diff --git a/.dockerignore b/.dockerignore index f6718b745c..12934f01a0 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,2 +1,7 @@ +.git/ .vagrant/ -obj/ +.vscode/ +/build/ +/obj/ +/tools/ +/downloads/ diff --git a/Dockerfile b/Dockerfile index 746733bbeb..96f5c6ce41 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,26 +1,14 @@ -FROM ubuntu:bionic +FROM ubuntu:focal -# Configuration -VOLUME /home/src/ -WORKDIR /home/src/ -ARG TOOLCHAIN_VERSION_SHORT -ENV TOOLCHAIN_VERSION_SHORT ${TOOLCHAIN_VERSION_SHORT:-"9-2019q4"} -ARG TOOLCHAIN_VERSION_LONG -ENV TOOLCHAIN_VERSION_LONG ${TOOLCHAIN_VERSION_LONG:-"9-2019-q4-major"} +ENV DEBIAN_FRONTEND noninteractive -# Essentials -RUN mkdir -p /home/src && \ - apt-get update && \ - apt-get install -y software-properties-common ruby make git gcc wget curl bzip2 - -# Toolchain -RUN wget -P /tmp "https://developer.arm.com/-/media/Files/downloads/gnu-rm/$TOOLCHAIN_VERSION_SHORT/gcc-arm-none-eabi-$TOOLCHAIN_VERSION_LONG-x86_64-linux.tar.bz2" -RUN mkdir -p /opt && \ - cd /opt && \ - tar xvjf "/tmp/gcc-arm-none-eabi-$TOOLCHAIN_VERSION_LONG-x86_64-linux.tar.bz2" -C /opt && \ - chmod -R -w "/opt/gcc-arm-none-eabi-$TOOLCHAIN_VERSION_LONG" - -ENV PATH="/opt/gcc-arm-none-eabi-$TOOLCHAIN_VERSION_LONG/bin:$PATH" +RUN apt-get update && apt-get install -y git cmake make ruby gcc RUN useradd inav + USER inav + +VOLUME /src + +WORKDIR /src/build +ENTRYPOINT ["/src/cmake/docker.sh"] diff --git a/build.sh b/build.sh index d514ddfbf2..59d9221b6e 100755 --- a/build.sh +++ b/build.sh @@ -1,12 +1,32 @@ -if [ -z "$1" ]; then - echo "Usage syntax: ./build.sh " +set -e + +if [[ $# == 0 ]]; then + echo -e "\ +Usage syntax: ./build.sh + +Notes: + * You can specify multiple targets. + * If no targets are specified, *all* of them will be built. + * To clean a target prefix it with \"clean_\". + * To clean all targets just use \"clean\"." exit 1 fi if [ -z "$(docker images -q inav-build)" ]; then echo -e "*** Building image\n" docker build -t inav-build . + echo -ne "\n" fi -echo -e "*** Building target $1\n" -docker run --rm -v "$(pwd)":/home/src/ inav-build make TARGET="$1" +if [ ! -d ./build ]; then + echo -e "*** Creating build directory\n" + mkdir ./build +fi + +echo -e "*** Building targets [$@]\n" +docker run --rm -it -v "$(pwd)":/src inav-build $@ + +if ls ./build/*.hex &> /dev/null; then + echo -e "\n*** Built targets in ./build:" + stat -c "%n (%.19y)" ./build/*.hex +fi diff --git a/cmake/docker.sh b/cmake/docker.sh new file mode 100755 index 0000000000..3c10ebc8e1 --- /dev/null +++ b/cmake/docker.sh @@ -0,0 +1,29 @@ +#!/bin/bash +set -e + +LAST_CMAKE_AT_REV_FILE="docker_cmake.rev" +CURR_REV="$(git rev-parse HEAD)" + +initialize_cmake() { + echo -e "*** CMake was not initialized yet, doing it now.\n" + cmake .. + echo "$CURR_REV" > "$LAST_CMAKE_AT_REV_FILE" +} + +# Check if CMake has never been initialized +if [ ! -f Makefile ]; then + initialize_cmake +fi + +# Check if CMake was initialized for a different Git revision (new targets may have been added) +if [ -f "$LAST_CMAKE_AT_REV_FILE" ]; then + LAST_CMAKE_AT_REV="$(cat $LAST_CMAKE_AT_REV_FILE)" + if [[ "$LAST_CMAKE_AT_REV" != "SKIP" ]] && [[ "$LAST_CMAKE_AT_REV" != "$CURR_REV" ]]; then + initialize_cmake + fi +else + initialize_cmake +fi + +# Let Make handle the arguments coming from the build script +make "$@" diff --git a/docs/Cli.md b/docs/Cli.md index 6489d967a7..3b059bb6b6 100644 --- a/docs/Cli.md +++ b/docs/Cli.md @@ -145,5 +145,4 @@ For targets that have a flash data chip, typically used for blackbox logs, the f | `flash_write
` | Writes `data` to `address` | ## CLI Variable Reference - See [Settings.md](Settings.md). diff --git a/docs/Controls.md b/docs/Controls.md index 7b3e870597..3757088db3 100644 --- a/docs/Controls.md +++ b/docs/Controls.md @@ -2,9 +2,9 @@ ## Arming -When armed, the aircraft is ready to fly and the motors will spin when throttle is applied. The motors will spin at a slow speed when armed (this feature may be disabled by setting MOTOR_STOP, but for safety reasons, that is not recommended). +When armed, the aircraft is ready to fly and the motors will spin when throttle is applied. With multirotors, the motors will spin at a slow speed when armed (this feature may be disabled by setting MOTOR_STOP, but for safety reasons, that is not recommended). -By default, arming and disarming is done using stick positions. (NOTE: this feature is disabled when using a switch to arm.) +Arming and disarming is done using a switch, set up on the modes page. (NOTE: Stick arming was removed in iNav 2.2) ## Stick Positions diff --git a/docs/Programming Framework.md b/docs/Programming Framework.md index 6c4e96f48d..2034bc0da1 100644 --- a/docs/Programming Framework.md +++ b/docs/Programming Framework.md @@ -116,6 +116,9 @@ IPF can be edited using INAV Configurator user interface, of via CLI | 28 | STABILIZED_YAW | Yaw PID controller output `[-500:500]` | | 29 | ACTIVE_WAYPOINT_INDEX | Indexed from `1`. To verify WP is in progress, use `IS_WP` | | 30 | ACTIVE_WAYPOINT_ACTION | See ACTIVE_WAYPOINT_ACTION paragraph | +| 31 | 3D HOME_DISTANCE | in `meters`, calculated from HOME_DISTANCE and ALTITUDE using Pythagorean theorem | +| 32 | CROSSFIRE LQ | Crossfire Link quality as returned by the CRSF protocol | +| 33 | CROSSFIRE SNR | Crossfire SNR as returned by the CRSF protocol | ##### ACTIVE_WAYPOINT_ACTION @@ -143,6 +146,8 @@ IPF can be edited using INAV Configurator user interface, of via CLI | 6 | ANGLE | | | 7 | HORIZON | | | 8 | AIR | | +| 9 | USER1 | | +| 10 | USER2 | | ### Flags diff --git a/docs/Rx.md b/docs/Rx.md index 569b9e3112..586e6ece42 100644 --- a/docs/Rx.md +++ b/docs/Rx.md @@ -33,6 +33,8 @@ http://www.frsky-rc.com/product/pro.php?pro_id=21 ### Spektrum +This section describes the legacy Spektrum satellite capability; the newer SRXL2 protocol is described [later in this document](#srxl2) . + 8 channels via serial currently supported. These receivers are reported working: @@ -47,10 +49,10 @@ As of iNav 1.6, a pseudo RSSI, based on satellite fade count is supported and re * Bind the satellite receiver using a physical RX; the bind function provided by the flight controller is not sufficient. * The CLI variable `rssi_channel` is set to channel 9: -```` +``` set rssi_channel = 9 -```` -This pseudo-RSSI should work on all makes of Spektrum satellite RX; it is tested as working on Lemon RX satellites http://www.lemon-rx.com/index.php?route=product/product&path=72&product_id=109 and http://www.lemon-rx.com/index.php?route=product/product&path=72&product_id=135 (recommended). +``` +This pseudo-RSSI should work on all makes of Spektrum satellite RX; it is tested as working on [Lemon RX satellites](http://www.lemon-rx.com/index.php?route=product/product&path=72&product_id=109 and http://www.lemon-rx.com/index.php?route=product/product&path=72&product_id=135) (recommended). ### S.BUS @@ -170,6 +172,46 @@ After flash "10ch Timer Mod i6 Updater", it is passible to get RSSI signal on se It is possible to use IBUS RX and IBUS telemetry on only one port of the hardware UART. More information in Telemetry.md.obj/inav_2.2.2_SPRACINGF3EVO.hex +### SRXL2 + +SRXL2 is a newer Spektrum protocol that provides a bidirectional link between the FC and the receiver, allowing the user to get FC telemetry data and basic settings on Spektrum Gen 2 airware TX. SRXL2 is supported in inav 2.6 and later. It offers improved performance and features compared to earlier Spektrum RX. + +#### Wiring + +Signal pin on receiver (labeled "S") must be wired to a **UART TX** pin on the FC. Voltage can be 3.3V (4.0V for SPM4651T) to 8.4V. On some F4 FCs, the TX pin may have a signal inverter (such as for S.Port). Make sure this isn't the case for the pin you intend to use. + +#### Configuration + +Selection of SXRL2 is provided in the inav 2.6 and later configurators. It is necessary to complete the configuration via the CLI; the following settings are recommended: + +``` +feature TELEMETRY +feature -RSSI_ADC +map TAER +set receiver_type = SERIAL +set serialrx_provider = SRXL2 +set serialrx_inverted = OFF +set srxl2_unit_id = 1 +set srxl2_baud_fast = ON +set rssi_source = PROTOCOL +set rssi_channel = 0 +``` + +#### Notes: + +* RSSI_ADC is disabled, as this would override the value provided through SRXL2 +* `rssi_channel = 0` is required, unlike earlier Spektrum devices (e.g. SPM4649T). + +Setting these values differently may have an adverse effects on RSSI readings. + +#### CLI Bind Command + +This command will put the receiver into bind mode without the need to reboot the FC as it was required with the older `spektrum_sat_bind` command. + +``` +bind_rx +``` + ## MultiWii serial protocol (MSP) Allows you to use MSP commands as the RC input. Only 8 channel support to maintain compatibility with MSP. @@ -215,21 +257,20 @@ To setup spectrum in the GUI: 2. Move to the "Configuration" page and in the upper lefthand corner choose Serial RX as the receiver type. 3. Below that choose the type of serial receiver that you are using. Save and reboot. -Using CLI: -For Serial RX enable `RX_SERIAL` and set the `serialrx_provider` CLI setting as follows. +#### Using CLI: -| Serial RX Provider | Value | -| ------------------ | ----- | -| SPEKTRUM1024 | 0 | -| SPEKTRUM2048 | 1 | -| SBUS | 2 | -| SUMD | 3 | -| SUMH | 4 | -| XBUS_MODE_B | 5 | -| XBUS_MODE_B_RJ01 | 6 | -| SERIALRX_IBUS | 7 | -| SERIALRX_JETIEXBUS | 8 | -| SERIALRX_CRSF | 9 | +For Serial RX set the `receiver_type` and `serialrx_provider` setting as appropriate for your RX. + +``` +# get rec +receiver_type = SERIAL +Allowed values: NONE, PPM, SERIAL, MSP, SPI, UIB + +# get serialrx +serialrx_provider = SBUS +Allowed values: SPEK1024, SPEK2048, SBUS, SUMD, SUMH, XB-B, XB-B-RJ01, IBUS, JETIEXBUS, CRSF, FPORT, SBUS_FAST, FPORT2, SRXL2 + +``` ### PPM/PWM input filtering. diff --git a/docs/Settings.md b/docs/Settings.md index 3f5a76e9cd..d82e08a80f 100644 --- a/docs/Settings.md +++ b/docs/Settings.md @@ -264,6 +264,7 @@ | nav_fw_launch_min_time | 0 | Allow launch mode to execute at least this time (ms) and ignore stick movements [0-60000]. | | nav_fw_launch_motor_delay | 500 | Delay between detected launch and launch sequence start and throttling up (ms) | | nav_fw_launch_spinup_time | 100 | Time to bring power from minimum throttle to nav_fw_launch_thr - to avoid big stress on ESC and large torque from propeller | +| nav_fw_launch_end_time | 3000 | Time for the transition of throttle and pitch angle, between the launch state and the subsequent flight mode [ms] | | nav_fw_launch_thr | 1700 | Launch throttle - throttle to be set during launch sequence (pwm units) | | nav_fw_launch_timeout | 5000 | Maximum time for launch sequence to be executed. After this time LAUNCH mode will be turned off and regular flight mode will take over (ms) | | nav_fw_launch_velocity | 300 | Forward velocity threshold for swing-launch detection [cm/s] | @@ -271,6 +272,8 @@ | nav_fw_max_thr | 1700 | Maximum throttle for flying wing in GPS assisted modes | | nav_fw_min_thr | 1200 | Minimum throttle for flying wing in GPS assisted modes | | nav_fw_pitch2thr | 10 | Amount of throttle applied related to pitch attitude in GPS assisted modes. Throttle = nav_fw_cruise_throttle - (nav_fw_pitch2thr * pitch_angle). (notice that pitch_angle is in degrees and is negative when climbing and positive when diving, and throttle value is constrained between nav_fw_min_thr and nav_fw_max_thr) | +| nav_fw_pitch2thr_smoothing | 0 | How smoothly the autopilot makes pitch to throttle correction inside a deadband defined by nav_fw_pitch2thr_threshold | +| nav_fw_pitch2thr_threshold | 0 | Threshold from average pitch where momentary pitch_to_throttle correction kicks in. [decidegrees] | | nav_fw_pos_hdg_d | 0 | D gain of heading trajectory PID controller. (Fixedwing, rovers, boats) | | nav_fw_pos_hdg_i | 0 | I gain of heading trajectory PID controller. (Fixedwing, rovers, boats) | | nav_fw_pos_hdg_p | 60 | P gain of heading PID controller. (Fixedwing, rovers, boats) | @@ -485,4 +488,4 @@ | yaw_lpf_hz | 30 | Yaw low pass filter cutoff frequency. Should be disabled (set to `0`) on small multirotors (7 inches and below) | | yaw_rate | 20 | Defines rotation rate on YAW axis that UAV will try to archive on max. stick deflection. Rates are defined in tens of degrees (deca-degrees) per second [rate = dps/10]. That means, rate 20 represents 200dps rotation speed. Default 20 (200dps) is more less equivalent of old Cleanflight/Baseflight rate 0. Max. 180 (1800dps) is what gyro can measure. | -> Note: this table is autogenerated. Do not edit it manually. \ No newline at end of file +> Note: this table is autogenerated. Do not edit it manually. diff --git a/docs/USB Flashing.md b/docs/USB Flashing.md index ec0897961d..850ede2b8d 100644 --- a/docs/USB Flashing.md +++ b/docs/USB Flashing.md @@ -12,6 +12,10 @@ This assigns the device to the plugdev group(a standard group in Ubuntu). To che ``` sudo usermod -a -G plugdev ``` +On Arch and its derivatives the group would be uucp and the command: +``` +sudo usermod -a -G uucp +``` ## Platform Specific: Windows Chrome can have problems accessing USB devices on Windows. A driver should be automatically installed by Windows for the ST Device in DFU Mode but this doesn't always allow access for Chrome. The solution is to replace the ST driver with a libusb driver. The easiest way to do that is to download [Zadig](http://zadig.akeo.ie/). diff --git a/docs/development/Building in Docker.md b/docs/development/Building in Docker.md index 8fc0b3f704..7e370cf91c 100755 --- a/docs/development/Building in Docker.md +++ b/docs/development/Building in Docker.md @@ -28,7 +28,7 @@ You'll have to manually execute the same steps that the build script does: 1. `docker build -t inav-build .` + This step is only needed the first time. -2. `docker run --rm -v :/home/src/ inav-build make TARGET=` +2. `docker run --rm -it -v :/src inav-build ` + Where `` must be replaced with the absolute path of where you cloned this repo (see above), and `` with the name of the target that you want to build. Refer to the [Linux](#Linux) instructions or the [build script](/build.sh) for more details. \ No newline at end of file diff --git a/docs/development/Building in Linux.md b/docs/development/Building in Linux.md index 7ae6082f5a..0c3a1aa83a 100644 --- a/docs/development/Building in Linux.md +++ b/docs/development/Building in Linux.md @@ -24,32 +24,31 @@ In addition to a cross-compiler, it is necessary to install some other tools: * `cmake` : generate the build environment * `make` : run the firmware compilation * `ruby` : build some generated source files from JSON definitions +* `gcc` : native compiler used to generate settings and run tests Note that inav requires `cmake` version 3.13 or later; any distro that provides `cmake` 3.13 will also provide adequate versions of the other tools. Note also that Ubuntu 18.04 LTS does NOT provide a modern enough `cmake`; it is recommended that you upgrade to Ubuntu 20.04 LTS which does. -If you wish to run the units tests, it is necessary to install a host C/C++ compiler (`gcc` or `clang`). This guide does not cover building and running the units tests. - ### Ubuntu / Debian ``` # make sure the system is updated first sudo apt update && sudo apt upgrade -sudo apt install git make ruby cmake +sudo apt install git make ruby cmake gcc ``` ### Fedora ``` # make sure the system is updated first sudo dnf -y update -sudo dnf install git make ruby cmake +sudo dnf install git make ruby cmake gcc ``` ### Arch ``` # make sure the system is updated first sudo pacman -Syu -sudo pacman -S git make ruby cmake +sudo pacman -S git make ruby cmake gcc ``` Once these prerequisites are installed, we can clone the repository to provide a local instance of the inav source code. diff --git a/docs/development/Building in Windows 10 with Linux Subsystem.md b/docs/development/Building in Windows 10 with Linux Subsystem.md index 52dd61527e..2b8439c543 100644 --- a/docs/development/Building in Windows 10 with Linux Subsystem.md +++ b/docs/development/Building in Windows 10 with Linux Subsystem.md @@ -41,6 +41,18 @@ Mount MS windows C drive and clone iNav You are ready! You now have a folder called inav in the root of C drive that you can edit in windows +### If you get a cloning error + +On some installations, you may see the following error: +``` +Cloning into 'inav'... +error: chmod on /mnt/c/inav/.git/config.lock failed: Operation not permitted +fatal: could not set 'core.filemode' to 'false' +``` + +You can fix this with by remounting the drive using the following commands +1. `sudo umount /mnt/c` +2. `sudo mount -t drvfs C: /mnt/c -o metadata` ## Building (example): @@ -84,7 +96,9 @@ make[1]: *** [CMakeFiles/Makefile2:33290: src/main/target/MATEKF722SE/CMakeFiles make: *** [Makefile:13703: MATEKF722SE] Error 2 ``` -This error can be triggered by a Windows PATHs included in the Linux Subsystem. The solution is to: +This error can be triggered by a Windows PATHs included in the Linux Subsystem. The solution is: + +#### For WSL V1 - Flags set as 7 by default 1. Open Windows RegEdit tool 1. Find `HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Lxss\{GUID}\Flags` @@ -92,4 +106,29 @@ This error can be triggered by a Windows PATHs included in the Linux Subsystem. 1. Restart WSL and Windows preferably 1. `cd build` 1. `cmake ..` -1. `make {TARGET}` should be working again \ No newline at end of file +1. `make {TARGET}` should be working again + +#### For WSL V2 - Flags set as 0x0000000f (15) by default +1. Open Windows RegEdit tool +1. Find `HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Lxss\{GUID}\Flags` +1. Change `Flags` from `f` to `d`, it is stored as Base Hexadecimal +1. Restart WSL and Windows preferably +1. `cd build` +1. `cmake ..` +1. `make {TARGET}` should be working again + +#### Or, for either version +1. In the Linux Subsystem, `cd /etc/` +2. Create a new file with `sudo nano wsl.conf` +3. Enter the following in to the new file: +``` +[Interop] +appendWindowsPath=false +``` +4. Save the file by holding `Ctrl` and pressing `o` +5. Press `Enter` to confirm the wsl.conf filename. +6. Hit `Ctrl`+`x` to exit nano +7. Restart WSL and Windows preferably +8. `cd build` +9. `cmake ..` +9. `make {TARGET}` should be working again diff --git a/docs/development/IDE - Visual Studio Code with Windows 10.md b/docs/development/IDE - Visual Studio Code with Windows 10.md index 7dff2d7cf7..6095fec4e3 100644 --- a/docs/development/IDE - Visual Studio Code with Windows 10.md +++ b/docs/development/IDE - Visual Studio Code with Windows 10.md @@ -104,13 +104,13 @@ Edit `./.vscode/tasks.json` to enable Building with `Ctrl + Shift + B` keyboard } , { - "label": "CMAKE Update", + "label": "Install/Update CMAKE", "type": "shell", - "command": "cmake ..", + "command": "mkdir -p build && cd build && cmake ..", "group": "build", "problemMatcher": [], "options": { - "cwd": "${workspaceFolder}/build" + "cwd": "${workspaceFolder}" } } ] diff --git a/lib/main/MAVLink/common/common.h b/lib/main/MAVLink/common/common.h index 4f417caf97..1014966516 100755 --- a/lib/main/MAVLink/common/common.h +++ b/lib/main/MAVLink/common/common.h @@ -11,7 +11,7 @@ #endif #undef MAVLINK_THIS_XML_IDX -#define MAVLINK_THIS_XML_IDX 1 +#define MAVLINK_THIS_XML_IDX 0 #ifdef __cplusplus extern "C" { @@ -20,11 +20,11 @@ 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, 37, 4, 0, 0, 27, 25, 0, 0, 0, 0, 0, 72, 26, 181, 225, 42, 6, 4, 0, 11, 18, 0, 0, 37, 20, 35, 33, 3, 0, 0, 0, 22, 39, 37, 53, 51, 53, 51, 0, 28, 56, 42, 33, 81, 0, 0, 0, 0, 0, 0, 26, 32, 32, 20, 32, 62, 44, 64, 84, 9, 254, 16, 12, 36, 44, 64, 22, 6, 14, 12, 97, 2, 2, 113, 35, 6, 79, 35, 35, 22, 13, 255, 14, 18, 43, 8, 22, 14, 36, 43, 41, 32, 243, 14, 93, 0, 100, 36, 60, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 40, 63, 182, 40, 0, 0, 0, 0, 0, 0, 32, 52, 53, 6, 2, 38, 19, 254, 36, 30, 18, 18, 51, 9, 0} +#define MAVLINK_MESSAGE_LENGTHS {9, 31, 12, 0, 14, 28, 3, 32, 36, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 24, 20, 2, 25, 23, 30, 101, 22, 26, 16, 14, 28, 32, 28, 28, 22, 22, 21, 6, 6, 37, 4, 4, 2, 2, 4, 2, 2, 3, 13, 12, 37, 4, 7, 0, 27, 25, 0, 0, 0, 0, 0, 72, 26, 181, 225, 42, 6, 4, 0, 11, 18, 0, 0, 37, 20, 35, 33, 3, 0, 0, 4, 22, 39, 37, 53, 51, 53, 51, 0, 28, 56, 42, 33, 81, 0, 0, 0, 0, 0, 0, 26, 32, 32, 20, 32, 62, 44, 64, 84, 9, 254, 16, 12, 36, 44, 64, 22, 6, 14, 12, 97, 2, 2, 113, 35, 6, 79, 35, 35, 22, 13, 255, 14, 18, 43, 8, 22, 14, 36, 43, 41, 32, 243, 14, 93, 0, 100, 36, 60, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 40, 63, 182, 40, 42, 0, 0, 0, 0, 0, 32, 52, 53, 6, 2, 38, 19, 254, 36, 30, 18, 18, 51, 9, 0} #endif #ifndef MAVLINK_MESSAGE_CRCS -#define MAVLINK_MESSAGE_CRCS {50, 124, 137, 0, 237, 217, 104, 119, 0, 0, 0, 89, 0, 0, 0, 0, 0, 0, 0, 0, 214, 159, 220, 168, 24, 23, 170, 144, 67, 115, 39, 246, 185, 104, 237, 244, 222, 212, 9, 254, 230, 28, 28, 132, 221, 232, 11, 153, 41, 39, 78, 196, 0, 0, 15, 3, 0, 0, 0, 0, 0, 167, 183, 119, 191, 118, 148, 21, 0, 243, 124, 0, 0, 38, 20, 158, 152, 143, 0, 0, 0, 106, 49, 22, 143, 140, 5, 150, 0, 231, 183, 63, 54, 47, 0, 0, 0, 0, 0, 0, 175, 102, 158, 208, 56, 93, 138, 108, 32, 185, 84, 34, 174, 124, 237, 4, 76, 128, 56, 116, 134, 237, 203, 250, 87, 203, 220, 25, 226, 46, 29, 223, 85, 6, 229, 203, 1, 195, 109, 168, 181, 47, 72, 131, 127, 0, 103, 154, 178, 200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 163, 105, 151, 35, 150, 0, 0, 0, 0, 0, 0, 90, 104, 85, 95, 130, 184, 81, 8, 204, 49, 170, 44, 83, 46, 0} +#define MAVLINK_MESSAGE_CRCS {50, 124, 137, 0, 237, 217, 104, 119, 117, 0, 0, 89, 0, 0, 0, 0, 0, 0, 0, 137, 214, 159, 220, 168, 24, 23, 170, 144, 67, 115, 39, 246, 185, 104, 237, 244, 222, 212, 9, 254, 230, 28, 28, 132, 221, 232, 11, 153, 41, 39, 78, 196, 132, 0, 15, 3, 0, 0, 0, 0, 0, 167, 183, 119, 191, 118, 148, 21, 0, 243, 124, 0, 0, 38, 20, 158, 152, 143, 0, 0, 14, 106, 49, 22, 143, 140, 5, 150, 0, 231, 183, 63, 54, 47, 0, 0, 0, 0, 0, 0, 175, 102, 158, 208, 56, 93, 138, 108, 32, 185, 84, 34, 174, 124, 237, 4, 76, 128, 56, 116, 134, 237, 203, 250, 87, 203, 220, 25, 226, 46, 29, 223, 85, 6, 229, 203, 1, 195, 109, 168, 181, 47, 72, 131, 127, 0, 103, 154, 178, 200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 189, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 163, 105, 151, 35, 150, 179, 0, 0, 0, 0, 0, 90, 104, 85, 95, 130, 184, 81, 8, 204, 49, 170, 44, 83, 46, 0} #endif #include "../protocol.h" @@ -42,7 +42,7 @@ typedef enum MAV_AUTOPILOT MAV_AUTOPILOT_GENERIC=0, /* Generic autopilot, full support for everything | */ MAV_AUTOPILOT_RESERVED=1, /* Reserved for future use. | */ MAV_AUTOPILOT_SLUGS=2, /* SLUGS autopilot, http://slugsuav.soe.ucsc.edu | */ - MAV_AUTOPILOT_ARDUPILOTMEGA=3, /* ArduPilotMega / ArduCopter, http://diydrones.com | */ + MAV_AUTOPILOT_ARDUPILOTMEGA=3, /* ArduPilot - Plane/Copter/Rover/Sub/Tracker, https://ardupilot.org | */ 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 | */ @@ -51,22 +51,24 @@ typedef enum MAV_AUTOPILOT MAV_AUTOPILOT_PPZ=9, /* PPZ UAV - http://nongnu.org/paparazzi | */ MAV_AUTOPILOT_UDB=10, /* UAV Dev Board | */ MAV_AUTOPILOT_FP=11, /* FlexiPilot | */ - MAV_AUTOPILOT_PX4=12, /* PX4 Autopilot - http://pixhawk.ethz.ch/px4/ | */ + MAV_AUTOPILOT_PX4=12, /* PX4 Autopilot - http://px4.io/ | */ MAV_AUTOPILOT_SMACCMPILOT=13, /* SMACCMPilot - http://smaccmpilot.org | */ MAV_AUTOPILOT_AUTOQUAD=14, /* AutoQuad -- http://autoquad.org | */ MAV_AUTOPILOT_ARMAZILA=15, /* Armazila -- http://armazila.com | */ MAV_AUTOPILOT_AEROB=16, /* Aerob -- http://aerob.ru | */ MAV_AUTOPILOT_ASLUAV=17, /* ASLUAV autopilot -- http://www.asl.ethz.ch | */ - MAV_AUTOPILOT_ENUM_END=18, /* | */ + MAV_AUTOPILOT_SMARTAP=18, /* SmartAP Autopilot - http://sky-drones.com | */ + MAV_AUTOPILOT_AIRRAILS=19, /* AirRails - http://uaventure.com | */ + MAV_AUTOPILOT_ENUM_END=20, /* | */ } MAV_AUTOPILOT; #endif -/** @brief */ +/** @brief MAVLINK component type reported in HEARTBEAT message. Flight controllers must report the type of the vehicle on which they are mounted (e.g. MAV_TYPE_OCTOROTOR). All other components must report a value appropriate for their type (e.g. a camera must use MAV_TYPE_CAMERA). */ #ifndef HAVE_ENUM_MAV_TYPE #define HAVE_ENUM_MAV_TYPE typedef enum MAV_TYPE { - MAV_TYPE_GENERIC=0, /* Generic micro air vehicle. | */ + 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 | */ @@ -92,9 +94,16 @@ typedef enum MAV_TYPE MAV_TYPE_VTOL_RESERVED3=23, /* VTOL reserved 3 | */ MAV_TYPE_VTOL_RESERVED4=24, /* VTOL reserved 4 | */ MAV_TYPE_VTOL_RESERVED5=25, /* VTOL reserved 5 | */ - MAV_TYPE_GIMBAL=26, /* Onboard gimbal | */ - MAV_TYPE_ADSB=27, /* Onboard ADSB peripheral | */ - MAV_TYPE_ENUM_END=28, /* | */ + MAV_TYPE_GIMBAL=26, /* Gimbal | */ + MAV_TYPE_ADSB=27, /* ADSB system | */ + MAV_TYPE_PARAFOIL=28, /* Steerable, nonrigid airfoil | */ + MAV_TYPE_DODECAROTOR=29, /* Dodecarotor | */ + MAV_TYPE_CAMERA=30, /* Camera | */ + MAV_TYPE_CHARGING_STATION=31, /* Charging station | */ + MAV_TYPE_FLARM=32, /* FLARM collision avoidance system | */ + MAV_TYPE_SERVO=33, /* Servo | */ + MAV_TYPE_ODID=34, /* Open Drone ID. See https://mavlink.io/en/services/opendroneid.html. | */ + MAV_TYPE_ENUM_END=35, /* | */ } MAV_TYPE; #endif @@ -112,6 +121,29 @@ typedef enum FIRMWARE_VERSION_TYPE } FIRMWARE_VERSION_TYPE; #endif +/** @brief Flags to report failure cases over the high latency telemtry. */ +#ifndef HAVE_ENUM_HL_FAILURE_FLAG +#define HAVE_ENUM_HL_FAILURE_FLAG +typedef enum HL_FAILURE_FLAG +{ + HL_FAILURE_FLAG_GPS=1, /* GPS failure. | */ + HL_FAILURE_FLAG_DIFFERENTIAL_PRESSURE=2, /* Differential pressure sensor failure. | */ + HL_FAILURE_FLAG_ABSOLUTE_PRESSURE=4, /* Absolute pressure sensor failure. | */ + HL_FAILURE_FLAG_3D_ACCEL=8, /* Accelerometer sensor failure. | */ + HL_FAILURE_FLAG_3D_GYRO=16, /* Gyroscope sensor failure. | */ + HL_FAILURE_FLAG_3D_MAG=32, /* Magnetometer sensor failure. | */ + HL_FAILURE_FLAG_TERRAIN=64, /* Terrain subsystem failure. | */ + HL_FAILURE_FLAG_BATTERY=128, /* Battery failure/critical low battery. | */ + HL_FAILURE_FLAG_RC_RECEIVER=256, /* RC receiver failure/no rc connection. | */ + HL_FAILURE_FLAG_OFFBOARD_LINK=512, /* Offboard link failure. | */ + HL_FAILURE_FLAG_ENGINE=1024, /* Engine failure. | */ + HL_FAILURE_FLAG_GEOFENCE=2048, /* Geofence violation. | */ + HL_FAILURE_FLAG_ESTIMATOR=4096, /* Estimator failure, for example measurement rejection or large variances. | */ + HL_FAILURE_FLAG_MISSION=8192, /* Mission failure. | */ + HL_FAILURE_FLAG_ENUM_END=8193, /* | */ +} HL_FAILURE_FLAG; +#endif + /** @brief These flags encode the MAV mode. */ #ifndef HAVE_ENUM_MAV_MODE_FLAG #define HAVE_ENUM_MAV_MODE_FLAG @@ -120,7 +152,7 @@ typedef enum MAV_MODE_FLAG MAV_MODE_FLAG_CUSTOM_MODE_ENABLED=1, /* 0b00000001 Reserved for future use. | */ MAV_MODE_FLAG_TEST_ENABLED=2, /* 0b00000010 system has a test mode enabled. This flag is intended for temporary system tests and should not be used for stable implementations. | */ MAV_MODE_FLAG_AUTO_ENABLED=4, /* 0b00000100 autonomous mode enabled, system finds its own goal positions. Guided flag can be set or not, depends on the actual implementation. | */ - MAV_MODE_FLAG_GUIDED_ENABLED=8, /* 0b00001000 guided mode enabled, system flies MISSIONs / mission items. | */ + MAV_MODE_FLAG_GUIDED_ENABLED=8, /* 0b00001000 guided mode enabled, system flies waypoints / 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. | */ @@ -136,7 +168,7 @@ typedef enum MAV_MODE_FLAG_DECODE_POSITION { MAV_MODE_FLAG_DECODE_POSITION_CUSTOM_MODE=1, /* Eighth bit: 00000001 | */ MAV_MODE_FLAG_DECODE_POSITION_TEST=2, /* Seventh bit: 00000010 | */ - MAV_MODE_FLAG_DECODE_POSITION_AUTO=4, /* Sixt bit: 00000100 | */ + MAV_MODE_FLAG_DECODE_POSITION_AUTO=4, /* Sixth 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 | */ @@ -146,7 +178,7 @@ typedef enum MAV_MODE_FLAG_DECODE_POSITION } MAV_MODE_FLAG_DECODE_POSITION; #endif -/** @brief Override command, pauses current mission execution and moves immediately to a position */ +/** @brief Actions that may be specified in MAV_CMD_OVERRIDE_GOTO to override mission execution. */ #ifndef HAVE_ENUM_MAV_GOTO #define HAVE_ENUM_MAV_GOTO typedef enum MAV_GOTO @@ -170,12 +202,12 @@ typedef enum MAV_MODE 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_AUTO_DISARMED=92, /* System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints) | */ 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_AUTO_ARMED=220, /* System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints) | */ MAV_MODE_ENUM_END=221, /* | */ } MAV_MODE; #endif @@ -193,47 +225,145 @@ typedef enum MAV_STATE MAV_STATE_CRITICAL=5, /* System is in a non-normal flight mode. It can however still navigate. | */ MAV_STATE_EMERGENCY=6, /* System is in a non-normal flight mode. It lost control over parts or over the whole airframe. It is in mayday and going down. | */ MAV_STATE_POWEROFF=7, /* System just initialized its power-down sequence, will shut down now. | */ - MAV_STATE_ENUM_END=8, /* | */ + MAV_STATE_FLIGHT_TERMINATION=8, /* System is terminating itself. | */ + MAV_STATE_ENUM_END=9, /* | */ } MAV_STATE; #endif -/** @brief */ +/** @brief Component ids (values) for the different types and instances of onboard hardware/software that might make up a MAVLink system (autopilot, cameras, servos, GPS systems, avoidance systems etc.). + Components must use the appropriate ID in their source address when sending messages. Components can also use IDs to determine if they are the intended recipient of an incoming message. The MAV_COMP_ID_ALL value is used to indicate messages that must be processed by all components. + When creating new entries, components that can have multiple instances (e.g. cameras, servos etc.) should be allocated sequential values. An appropriate number of values should be left free after these components to allow the number of instances to be expanded. */ #ifndef HAVE_ENUM_MAV_COMPONENT #define HAVE_ENUM_MAV_COMPONENT typedef enum MAV_COMPONENT { - MAV_COMP_ID_ALL=0, /* | */ - MAV_COMP_ID_CAMERA=100, /* | */ - MAV_COMP_ID_SERVO1=140, /* | */ - MAV_COMP_ID_SERVO2=141, /* | */ - MAV_COMP_ID_SERVO3=142, /* | */ - MAV_COMP_ID_SERVO4=143, /* | */ - MAV_COMP_ID_SERVO5=144, /* | */ - MAV_COMP_ID_SERVO6=145, /* | */ - MAV_COMP_ID_SERVO7=146, /* | */ - MAV_COMP_ID_SERVO8=147, /* | */ - MAV_COMP_ID_SERVO9=148, /* | */ - MAV_COMP_ID_SERVO10=149, /* | */ - MAV_COMP_ID_SERVO11=150, /* | */ - MAV_COMP_ID_SERVO12=151, /* | */ - MAV_COMP_ID_SERVO13=152, /* | */ - MAV_COMP_ID_SERVO14=153, /* | */ - MAV_COMP_ID_GIMBAL=154, /* | */ - MAV_COMP_ID_LOG=155, /* | */ - MAV_COMP_ID_ADSB=156, /* | */ - MAV_COMP_ID_OSD=157, /* On Screen Display (OSD) devices for video links | */ - MAV_COMP_ID_PERIPHERAL=158, /* Generic autopilot peripheral component ID. Meant for devices that do not implement the parameter sub-protocol | */ - MAV_COMP_ID_QX1_GIMBAL=159, /* | */ - 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_COMP_ID_ALL=0, /* Target id (target_component) used to broadcast messages to all components of the receiving system. Components should attempt to process messages with this component ID and forward to components on any other interfaces. Note: This is not a valid *source* component id for a message. | */ + MAV_COMP_ID_AUTOPILOT1=1, /* System flight controller component ("autopilot"). Only one autopilot is expected in a particular system. | */ + MAV_COMP_ID_USER1=25, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER2=26, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER3=27, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER4=28, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER5=29, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER6=30, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER7=31, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER8=32, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER9=33, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER10=34, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER11=35, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER12=36, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER13=37, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER14=38, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER15=39, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER16=40, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER17=41, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER18=42, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER19=43, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER20=44, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER21=45, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER22=46, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER23=47, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER24=48, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER25=49, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER26=50, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER27=51, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER28=52, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER29=53, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER30=54, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER31=55, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER32=56, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER33=57, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER34=58, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER35=59, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER36=60, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER37=61, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER38=62, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER39=63, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER40=64, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER41=65, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER42=66, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER43=67, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_TELEMETRY_RADIO=68, /* Telemetry radio (e.g. SiK radio, or other component that emits RADIO_STATUS messages). | */ + MAV_COMP_ID_USER45=69, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER46=70, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER47=71, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER48=72, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER49=73, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER50=74, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER51=75, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER52=76, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER53=77, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER54=78, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER55=79, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER56=80, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER57=81, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER58=82, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER59=83, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER60=84, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER61=85, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER62=86, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER63=87, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER64=88, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER65=89, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER66=90, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER67=91, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER68=92, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER69=93, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER70=94, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER71=95, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER72=96, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER73=97, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER74=98, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_USER75=99, /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + MAV_COMP_ID_CAMERA=100, /* Camera #1. | */ + MAV_COMP_ID_CAMERA2=101, /* Camera #2. | */ + MAV_COMP_ID_CAMERA3=102, /* Camera #3. | */ + MAV_COMP_ID_CAMERA4=103, /* Camera #4. | */ + MAV_COMP_ID_CAMERA5=104, /* Camera #5. | */ + MAV_COMP_ID_CAMERA6=105, /* Camera #6. | */ + MAV_COMP_ID_SERVO1=140, /* Servo #1. | */ + MAV_COMP_ID_SERVO2=141, /* Servo #2. | */ + MAV_COMP_ID_SERVO3=142, /* Servo #3. | */ + MAV_COMP_ID_SERVO4=143, /* Servo #4. | */ + MAV_COMP_ID_SERVO5=144, /* Servo #5. | */ + MAV_COMP_ID_SERVO6=145, /* Servo #6. | */ + MAV_COMP_ID_SERVO7=146, /* Servo #7. | */ + MAV_COMP_ID_SERVO8=147, /* Servo #8. | */ + MAV_COMP_ID_SERVO9=148, /* Servo #9. | */ + MAV_COMP_ID_SERVO10=149, /* Servo #10. | */ + MAV_COMP_ID_SERVO11=150, /* Servo #11. | */ + MAV_COMP_ID_SERVO12=151, /* Servo #12. | */ + MAV_COMP_ID_SERVO13=152, /* Servo #13. | */ + MAV_COMP_ID_SERVO14=153, /* Servo #14. | */ + MAV_COMP_ID_GIMBAL=154, /* Gimbal #1. | */ + MAV_COMP_ID_LOG=155, /* Logging component. | */ + MAV_COMP_ID_ADSB=156, /* Automatic Dependent Surveillance-Broadcast (ADS-B) component. | */ + MAV_COMP_ID_OSD=157, /* On Screen Display (OSD) devices for video links. | */ + MAV_COMP_ID_PERIPHERAL=158, /* Generic autopilot peripheral component ID. Meant for devices that do not implement the parameter microservice. | */ + MAV_COMP_ID_QX1_GIMBAL=159, /* Gimbal ID for QX1. | */ + MAV_COMP_ID_FLARM=160, /* FLARM collision alert component. | */ + MAV_COMP_ID_GIMBAL2=171, /* Gimbal #2. | */ + MAV_COMP_ID_GIMBAL3=172, /* Gimbal #3. | */ + MAV_COMP_ID_GIMBAL4=173, /* Gimbal #4 | */ + MAV_COMP_ID_GIMBAL5=174, /* Gimbal #5. | */ + MAV_COMP_ID_GIMBAL6=175, /* Gimbal #6. | */ + MAV_COMP_ID_MISSIONPLANNER=190, /* Component that can generate/supply a mission flight plan (e.g. GCS or developer API). | */ + MAV_COMP_ID_ONBOARD_COMPUTER=191, /* Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on. | */ + MAV_COMP_ID_PATHPLANNER=195, /* Component that finds an optimal path between points based on a certain constraint (e.g. minimum snap, shortest path, cost, etc.). | */ + MAV_COMP_ID_OBSTACLE_AVOIDANCE=196, /* Component that plans a collision free path between two points. | */ + MAV_COMP_ID_VISUAL_INERTIAL_ODOMETRY=197, /* Component that provides position estimates using VIO techniques. | */ + MAV_COMP_ID_PAIRING_MANAGER=198, /* Component that manages pairing of vehicle and GCS. | */ + MAV_COMP_ID_IMU=200, /* Inertial Measurement Unit (IMU) #1. | */ + MAV_COMP_ID_IMU_2=201, /* Inertial Measurement Unit (IMU) #2. | */ + MAV_COMP_ID_IMU_3=202, /* Inertial Measurement Unit (IMU) #3. | */ + MAV_COMP_ID_GPS=220, /* GPS #1. | */ + MAV_COMP_ID_GPS2=221, /* GPS #2. | */ + MAV_COMP_ID_ODID_TXRX_1=236, /* Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet). | */ + MAV_COMP_ID_ODID_TXRX_2=237, /* Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet). | */ + MAV_COMP_ID_ODID_TXRX_3=238, /* Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet). | */ + MAV_COMP_ID_UDP_BRIDGE=240, /* Component to bridge MAVLink to UDP (i.e. from a UART). | */ + MAV_COMP_ID_UART_BRIDGE=241, /* Component to bridge to UART (i.e. from UDP). | */ + MAV_COMP_ID_TUNNEL_NODE=242, /* Component handling TUNNEL messages (e.g. vendor specific GUI of a component). | */ + MAV_COMP_ID_SYSTEM_CONTROL=250, /* Component for handling system messages (e.g. to ARM, takeoff, etc.). | */ MAV_COMPONENT_ENUM_END=251, /* | */ } MAV_COMPONENT; #endif @@ -268,7 +398,12 @@ typedef enum MAV_SYS_STATUS_SENSOR MAV_SYS_STATUS_TERRAIN=4194304, /* 0x400000 Terrain subsystem health | */ MAV_SYS_STATUS_REVERSE_MOTOR=8388608, /* 0x800000 Motors are reversed | */ MAV_SYS_STATUS_LOGGING=16777216, /* 0x1000000 Logging | */ - MAV_SYS_STATUS_SENSOR_ENUM_END=16777217, /* | */ + MAV_SYS_STATUS_SENSOR_BATTERY=33554432, /* 0x2000000 Battery | */ + MAV_SYS_STATUS_SENSOR_PROXIMITY=67108864, /* 0x4000000 Proximity | */ + MAV_SYS_STATUS_SENSOR_SATCOM=134217728, /* 0x8000000 Satellite Communication | */ + MAV_SYS_STATUS_PREARM_CHECK=268435456, /* 0x10000000 pre-arm check status. Always healthy when armed | */ + MAV_SYS_STATUS_OBSTACLE_AVOIDANCE=536870912, /* 0x20000000 Avoidance/collision prevention | */ + MAV_SYS_STATUS_SENSOR_ENUM_END=536870913, /* | */ } MAV_SYS_STATUS_SENSOR; #endif @@ -277,19 +412,29 @@ typedef enum MAV_SYS_STATUS_SENSOR #define HAVE_ENUM_MAV_FRAME typedef enum MAV_FRAME { - MAV_FRAME_GLOBAL=0, /* Global coordinate frame, WGS84 coordinate system. First value / x: latitude, second value / y: longitude, third value / z: positive altitude over mean sea level (MSL) | */ - MAV_FRAME_LOCAL_NED=1, /* Local coordinate frame, Z-up (x: north, y: east, z: down). | */ + MAV_FRAME_GLOBAL=0, /* Global (WGS84) coordinate frame + MSL altitude. 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-down (x: North, y: East, z: Down). | */ MAV_FRAME_MISSION=2, /* NOT a coordinate frame, indicates a mission command. | */ - MAV_FRAME_GLOBAL_RELATIVE_ALT=3, /* Global coordinate frame, WGS84 coordinate system, relative altitude over ground with respect to the home position. First value / x: latitude, second value / y: longitude, third value / z: positive altitude with 0 being at the altitude of the home location. | */ - MAV_FRAME_LOCAL_ENU=4, /* Local coordinate frame, Z-down (x: east, y: north, z: up) | */ - MAV_FRAME_GLOBAL_INT=5, /* Global coordinate frame, WGS84 coordinate system. First value / x: latitude in degrees*1.0e-7, second value / y: longitude in degrees*1.0e-7, third value / z: positive altitude over mean sea level (MSL) | */ - MAV_FRAME_GLOBAL_RELATIVE_ALT_INT=6, /* Global coordinate frame, WGS84 coordinate system, relative altitude over ground with respect to the home position. First value / x: latitude in degrees*10e-7, second value / y: longitude in degrees*10e-7, third value / z: positive altitude with 0 being at the altitude of the home location. | */ + MAV_FRAME_GLOBAL_RELATIVE_ALT=3, /* Global (WGS84) coordinate frame + altitude relative 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-up (x: East, y: North, z: Up). | */ + MAV_FRAME_GLOBAL_INT=5, /* Global (WGS84) coordinate frame (scaled) + MSL altitude. First value / x: latitude in degrees*1.0e-7, second value / y: longitude in degrees*1.0e-7, third value / z: positive altitude over mean sea level (MSL). | */ + MAV_FRAME_GLOBAL_RELATIVE_ALT_INT=6, /* Global (WGS84) coordinate frame (scaled) + altitude relative to the home position. First value / x: latitude in degrees*10e-7, second value / y: longitude in degrees*10e-7, third value / z: positive altitude with 0 being at the altitude of the home location. | */ MAV_FRAME_LOCAL_OFFSET_NED=7, /* Offset to the current local frame. Anything expressed in this frame should be added to the current local frame position. | */ MAV_FRAME_BODY_NED=8, /* Setpoint in body NED frame. This makes sense if all position control is externalized - e.g. useful to command 2 m/s^2 acceleration to the right. | */ MAV_FRAME_BODY_OFFSET_NED=9, /* Offset in body NED frame. This makes sense if adding setpoints to the current flight path, to avoid an obstacle - e.g. useful to command 2 m/s^2 acceleration to the east. | */ - MAV_FRAME_GLOBAL_TERRAIN_ALT=10, /* Global coordinate frame with above terrain level altitude. WGS84 coordinate system, relative altitude over terrain with respect to the waypoint coordinate. First value / x: latitude in degrees, second value / y: longitude in degrees, third value / z: positive altitude in meters with 0 being at ground level in terrain model. | */ - MAV_FRAME_GLOBAL_TERRAIN_ALT_INT=11, /* Global coordinate frame with above terrain level altitude. WGS84 coordinate system, relative altitude over terrain with respect to the waypoint coordinate. First value / x: latitude in degrees*10e-7, second value / y: longitude in degrees*10e-7, third value / z: positive altitude in meters with 0 being at ground level in terrain model. | */ - MAV_FRAME_ENUM_END=12, /* | */ + MAV_FRAME_GLOBAL_TERRAIN_ALT=10, /* Global (WGS84) coordinate frame with AGL altitude (at the waypoint coordinate). First value / x: latitude in degrees, second value / y: longitude in degrees, third value / z: positive altitude in meters with 0 being at ground level in terrain model. | */ + MAV_FRAME_GLOBAL_TERRAIN_ALT_INT=11, /* Global (WGS84) coordinate frame (scaled) with AGL altitude (at the waypoint coordinate). First value / x: latitude in degrees*10e-7, second value / y: longitude in degrees*10e-7, third value / z: positive altitude in meters with 0 being at ground level in terrain model. | */ + MAV_FRAME_BODY_FRD=12, /* Body fixed frame of reference, Z-down (x: Forward, y: Right, z: Down). | */ + MAV_FRAME_RESERVED_13=13, /* MAV_FRAME_BODY_FLU - Body fixed frame of reference, Z-up (x: Forward, y: Left, z: Up). | */ + MAV_FRAME_RESERVED_14=14, /* MAV_FRAME_MOCAP_NED - Odometry local coordinate frame of data given by a motion capture system, Z-down (x: North, y: East, z: Down). | */ + MAV_FRAME_RESERVED_15=15, /* MAV_FRAME_MOCAP_ENU - Odometry local coordinate frame of data given by a motion capture system, Z-up (x: East, y: North, z: Up). | */ + MAV_FRAME_RESERVED_16=16, /* MAV_FRAME_VISION_NED - Odometry local coordinate frame of data given by a vision estimation system, Z-down (x: North, y: East, z: Down). | */ + MAV_FRAME_RESERVED_17=17, /* MAV_FRAME_VISION_ENU - Odometry local coordinate frame of data given by a vision estimation system, Z-up (x: East, y: North, z: Up). | */ + MAV_FRAME_RESERVED_18=18, /* MAV_FRAME_ESTIM_NED - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-down (x: North, y: East, z: Down). | */ + MAV_FRAME_RESERVED_19=19, /* MAV_FRAME_ESTIM_ENU - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-up (x: East, y: North, z: Up). | */ + MAV_FRAME_LOCAL_FRD=20, /* Forward, Right, Down coordinate frame. This is a local frame with Z-down and arbitrary F/R alignment (i.e. not aligned with NED/earth frame). | */ + MAV_FRAME_LOCAL_FLU=21, /* Forward, Left, Up coordinate frame. This is a local frame with Z-up and arbitrary F/L alignment (i.e. not aligned with ENU/earth frame). | */ + MAV_FRAME_ENUM_END=22, /* | */ } MAV_FRAME; #endif @@ -335,7 +480,19 @@ typedef enum FENCE_BREACH } FENCE_BREACH; #endif -/** @brief Enumeration of possible mount operation modes */ +/** @brief Actions being taken to mitigate/prevent fence breach */ +#ifndef HAVE_ENUM_FENCE_MITIGATE +#define HAVE_ENUM_FENCE_MITIGATE +typedef enum FENCE_MITIGATE +{ + FENCE_MITIGATE_UNKNOWN=0, /* Unknown | */ + FENCE_MITIGATE_NONE=1, /* No actions being taken | */ + FENCE_MITIGATE_VEL_LIMIT=2, /* Velocity limiting active to prevent breach | */ + FENCE_MITIGATE_ENUM_END=3, /* | */ +} FENCE_MITIGATE; +#endif + +/** @brief Enumeration of possible mount operation modes. This message is used by obsolete/deprecated gimbal messages. */ #ifndef HAVE_ENUM_MAV_MOUNT_MODE #define HAVE_ENUM_MAV_MOUNT_MODE typedef enum MAV_MOUNT_MODE @@ -345,131 +502,439 @@ typedef enum MAV_MOUNT_MODE MAV_MOUNT_MODE_MAVLINK_TARGETING=2, /* Load neutral position and start MAVLink Roll,Pitch,Yaw control with stabilization | */ MAV_MOUNT_MODE_RC_TARGETING=3, /* Load neutral position and start RC Roll,Pitch,Yaw control with stabilization | */ MAV_MOUNT_MODE_GPS_POINT=4, /* Load neutral position and start to point to Lat,Lon,Alt | */ - MAV_MOUNT_MODE_ENUM_END=5, /* | */ + MAV_MOUNT_MODE_SYSID_TARGET=5, /* Gimbal tracks system with specified system ID | */ + MAV_MOUNT_MODE_ENUM_END=6, /* | */ } MAV_MOUNT_MODE; #endif -/** @brief Commands to be executed by the MAV. They can be executed on user request, or as part of a mission script. If the action is used in a mission, the parameter mapping to the waypoint/mission message is as follows: Param 1, Param 2, Param 3, Param 4, X: Param 5, Y:Param 6, Z:Param 7. This command list is similar what ARINC 424 is for commercial aircraft: A data format how to interpret waypoint/mission data. */ +/** @brief Gimbal device (low level) capability flags (bitmap) */ +#ifndef HAVE_ENUM_GIMBAL_DEVICE_CAP_FLAGS +#define HAVE_ENUM_GIMBAL_DEVICE_CAP_FLAGS +typedef enum GIMBAL_DEVICE_CAP_FLAGS +{ + GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT=1, /* Gimbal device supports a retracted position | */ + GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL=2, /* Gimbal device supports a horizontal, forward looking position, stabilized | */ + GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS=4, /* Gimbal device supports rotating around roll axis. | */ + GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW=8, /* Gimbal device supports to follow a roll angle relative to the vehicle | */ + GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK=16, /* Gimbal device supports locking to an roll angle (generally that's the default with roll stabilized) | */ + GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS=32, /* Gimbal device supports rotating around pitch axis. | */ + GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW=64, /* Gimbal device supports to follow a pitch angle relative to the vehicle | */ + GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK=128, /* Gimbal device supports locking to an pitch angle (generally that's the default with pitch stabilized) | */ + GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS=256, /* Gimbal device supports rotating around yaw axis. | */ + GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW=512, /* Gimbal device supports to follow a yaw angle relative to the vehicle (generally that's the default) | */ + GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK=1024, /* Gimbal device supports locking to an absolute heading (often this is an option available) | */ + GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW=2048, /* Gimbal device supports yawing/panning infinetely (e.g. using slip disk). | */ + GIMBAL_DEVICE_CAP_FLAGS_ENUM_END=2049, /* | */ +} GIMBAL_DEVICE_CAP_FLAGS; +#endif + +/** @brief Gimbal manager high level capability flags (bitmap). The first 16 bits are identical to the GIMBAL_DEVICE_CAP_FLAGS which are identical with GIMBAL_DEVICE_FLAGS. However, the gimbal manager does not need to copy the flags from the gimbal but can also enhance the capabilities and thus add flags. */ +#ifndef HAVE_ENUM_GIMBAL_MANAGER_CAP_FLAGS +#define HAVE_ENUM_GIMBAL_MANAGER_CAP_FLAGS +typedef enum GIMBAL_MANAGER_CAP_FLAGS +{ + GIMBAL_MANAGER_CAP_FLAGS_HAS_RETRACT=1, /* Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT. | */ + GIMBAL_MANAGER_CAP_FLAGS_HAS_NEUTRAL=2, /* Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL. | */ + GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_AXIS=4, /* Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS. | */ + GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_FOLLOW=8, /* Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW. | */ + GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_LOCK=16, /* Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK. | */ + GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_AXIS=32, /* Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS. | */ + GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_FOLLOW=64, /* Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW. | */ + GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_LOCK=128, /* Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK. | */ + GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_AXIS=256, /* Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS. | */ + GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_FOLLOW=512, /* Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW. | */ + GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_LOCK=1024, /* Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK. | */ + GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_INFINITE_YAW=2048, /* Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW. | */ + GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_LOCAL=65536, /* Gimbal manager supports to point to a local position. | */ + GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_GLOBAL=131072, /* Gimbal manager supports to point to a global latitude, longitude, altitude position. | */ + GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_FOCAL_LENGTH_SCALE=1048576, /* Gimbal manager supports pitching and yawing at an angular velocity scaled by focal length (the more zoomed in, the slower the movement). | */ + GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_NUDGING=2097152, /* Gimbal manager supports nudging when pointing to a location or tracking. | */ + GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_OVERRIDE=4194304, /* Gimbal manager supports overriding when pointing to a location or tracking. | */ + GIMBAL_MANAGER_CAP_FLAGS_ENUM_END=4194305, /* | */ +} GIMBAL_MANAGER_CAP_FLAGS; +#endif + +/** @brief Flags for gimbal device (lower level) operation. */ +#ifndef HAVE_ENUM_GIMBAL_DEVICE_FLAGS +#define HAVE_ENUM_GIMBAL_DEVICE_FLAGS +typedef enum GIMBAL_DEVICE_FLAGS +{ + GIMBAL_DEVICE_FLAGS_RETRACT=1, /* Set to retracted safe position (no stabilization), takes presedence over all other flags. | */ + GIMBAL_DEVICE_FLAGS_NEUTRAL=2, /* Set to neutral position (horizontal, forward looking, with stabiliziation), takes presedence over all other flags except RETRACT. | */ + GIMBAL_DEVICE_FLAGS_ROLL_LOCK=4, /* Lock roll angle to absolute angle relative to horizon (not relative to drone). This is generally the default with a stabilizing gimbal. | */ + GIMBAL_DEVICE_FLAGS_PITCH_LOCK=8, /* Lock pitch angle to absolute angle relative to horizon (not relative to drone). This is generally the default. | */ + GIMBAL_DEVICE_FLAGS_YAW_LOCK=16, /* Lock yaw angle to absolute angle relative to North (not relative to drone). If this flag is set, the quaternion is in the Earth frame with the x-axis pointing North (yaw absolute). If this flag is not set, the quaternion frame is in the Earth frame rotated so that the x-axis is pointing forward (yaw relative to vehicle). | */ + GIMBAL_DEVICE_FLAGS_ENUM_END=17, /* | */ +} GIMBAL_DEVICE_FLAGS; +#endif + +/** @brief Flags for high level gimbal manager operation The first 16 bytes are identical to the GIMBAL_DEVICE_FLAGS. */ +#ifndef HAVE_ENUM_GIMBAL_MANAGER_FLAGS +#define HAVE_ENUM_GIMBAL_MANAGER_FLAGS +typedef enum GIMBAL_MANAGER_FLAGS +{ + GIMBAL_MANAGER_FLAGS_RETRACT=1, /* Based on GIMBAL_DEVICE_FLAGS_RETRACT | */ + GIMBAL_MANAGER_FLAGS_NEUTRAL=2, /* Based on GIMBAL_DEVICE_FLAGS_NEUTRAL | */ + GIMBAL_MANAGER_FLAGS_ROLL_LOCK=4, /* Based on GIMBAL_DEVICE_FLAGS_ROLL_LOCK | */ + GIMBAL_MANAGER_FLAGS_PITCH_LOCK=8, /* Based on GIMBAL_DEVICE_FLAGS_PITCH_LOCK | */ + GIMBAL_MANAGER_FLAGS_YAW_LOCK=16, /* Based on GIMBAL_DEVICE_FLAGS_YAW_LOCK | */ + GIMBAL_MANAGER_FLAGS_ANGULAR_VELOCITY_RELATIVE_TO_FOCAL_LENGTH=1048576, /* Scale angular velocity relative to focal length. This means the gimbal moves slower if it is zoomed in. | */ + GIMBAL_MANAGER_FLAGS_NUDGE=2097152, /* Interpret attitude control on top of pointing to a location or tracking. If this flag is set, the quaternion is relative to the existing tracking angle. | */ + GIMBAL_MANAGER_FLAGS_OVERRIDE=4194304, /* Completely override pointing to a location or tracking. If this flag is set, the quaternion is (as usual) according to GIMBAL_MANAGER_FLAGS_YAW_LOCK. | */ + GIMBAL_MANAGER_FLAGS_NONE=8388608, /* This flag can be set to give up control previously set using MAV_CMD_DO_GIMBAL_MANAGER_ATTITUDE. This flag must not be combined with other flags. | */ + GIMBAL_MANAGER_FLAGS_ENUM_END=8388609, /* | */ +} GIMBAL_MANAGER_FLAGS; +#endif + +/** @brief Gimbal device (low level) error flags (bitmap, 0 means no error) */ +#ifndef HAVE_ENUM_GIMBAL_DEVICE_ERROR_FLAGS +#define HAVE_ENUM_GIMBAL_DEVICE_ERROR_FLAGS +typedef enum GIMBAL_DEVICE_ERROR_FLAGS +{ + GIMBAL_DEVICE_ERROR_FLAGS_AT_ROLL_LIMIT=1, /* Gimbal device is limited by hardware roll limit. | */ + GIMBAL_DEVICE_ERROR_FLAGS_AT_PITCH_LIMIT=2, /* Gimbal device is limited by hardware pitch limit. | */ + GIMBAL_DEVICE_ERROR_FLAGS_AT_YAW_LIMIT=4, /* Gimbal device is limited by hardware yaw limit. | */ + GIMBAL_DEVICE_ERROR_FLAGS_ENCODER_ERROR=8, /* There is an error with the gimbal encoders. | */ + GIMBAL_DEVICE_ERROR_FLAGS_POWER_ERROR=16, /* There is an error with the gimbal power source. | */ + GIMBAL_DEVICE_ERROR_FLAGS_MOTOR_ERROR=32, /* There is an error with the gimbal motor's. | */ + GIMBAL_DEVICE_ERROR_FLAGS_SOFTWARE_ERROR=64, /* There is an error with the gimbal's software. | */ + GIMBAL_DEVICE_ERROR_FLAGS_COMMS_ERROR=128, /* There is an error with the gimbal's communication. | */ + GIMBAL_DEVICE_ERROR_FLAGS_CALIBRATION_RUNNING=256, /* Gimbal is currently calibrating. | */ + GIMBAL_DEVICE_ERROR_FLAGS_ENUM_END=257, /* | */ +} GIMBAL_DEVICE_ERROR_FLAGS; +#endif + +/** @brief Generalized UAVCAN node health */ +#ifndef HAVE_ENUM_UAVCAN_NODE_HEALTH +#define HAVE_ENUM_UAVCAN_NODE_HEALTH +typedef enum UAVCAN_NODE_HEALTH +{ + UAVCAN_NODE_HEALTH_OK=0, /* The node is functioning properly. | */ + UAVCAN_NODE_HEALTH_WARNING=1, /* A critical parameter went out of range or the node has encountered a minor failure. | */ + UAVCAN_NODE_HEALTH_ERROR=2, /* The node has encountered a major failure. | */ + UAVCAN_NODE_HEALTH_CRITICAL=3, /* The node has suffered a fatal malfunction. | */ + UAVCAN_NODE_HEALTH_ENUM_END=4, /* | */ +} UAVCAN_NODE_HEALTH; +#endif + +/** @brief Generalized UAVCAN node mode */ +#ifndef HAVE_ENUM_UAVCAN_NODE_MODE +#define HAVE_ENUM_UAVCAN_NODE_MODE +typedef enum UAVCAN_NODE_MODE +{ + UAVCAN_NODE_MODE_OPERATIONAL=0, /* The node is performing its primary functions. | */ + UAVCAN_NODE_MODE_INITIALIZATION=1, /* The node is initializing; this mode is entered immediately after startup. | */ + UAVCAN_NODE_MODE_MAINTENANCE=2, /* The node is under maintenance. | */ + UAVCAN_NODE_MODE_SOFTWARE_UPDATE=3, /* The node is in the process of updating its software. | */ + UAVCAN_NODE_MODE_OFFLINE=7, /* The node is no longer available online. | */ + UAVCAN_NODE_MODE_ENUM_END=8, /* | */ +} UAVCAN_NODE_MODE; +#endif + +/** @brief Indicates the ESC connection type. */ +#ifndef HAVE_ENUM_ESC_CONNECTION_TYPE +#define HAVE_ENUM_ESC_CONNECTION_TYPE +typedef enum ESC_CONNECTION_TYPE +{ + ESC_CONNECTION_TYPE_PPM=0, /* Traditional PPM ESC. | */ + ESC_CONNECTION_TYPE_SERIAL=1, /* Serial Bus connected ESC. | */ + ESC_CONNECTION_TYPE_ONESHOT=2, /* One Shot PPM ESC. | */ + ESC_CONNECTION_TYPE_I2C=3, /* I2C ESC. | */ + ESC_CONNECTION_TYPE_CAN=4, /* CAN-Bus ESC. | */ + ESC_CONNECTION_TYPE_DSHOT=5, /* DShot ESC. | */ + ESC_CONNECTION_TYPE_ENUM_END=6, /* | */ +} ESC_CONNECTION_TYPE; +#endif + +/** @brief Flags to report ESC failures. */ +#ifndef HAVE_ENUM_ESC_FAILURE_FLAGS +#define HAVE_ENUM_ESC_FAILURE_FLAGS +typedef enum ESC_FAILURE_FLAGS +{ + ESC_FAILURE_NONE=0, /* No ESC failure. | */ + ESC_FAILURE_OVER_CURRENT=1, /* Over current failure. | */ + ESC_FAILURE_OVER_VOLTAGE=2, /* Over voltage failure. | */ + ESC_FAILURE_OVER_TEMPERATURE=4, /* Over temperature failure. | */ + ESC_FAILURE_OVER_RPM=8, /* Over RPM failure. | */ + ESC_FAILURE_INCONSISTENT_CMD=16, /* Inconsistent command failure i.e. out of bounds. | */ + ESC_FAILURE_MOTOR_STUCK=32, /* Motor stuck failure. | */ + ESC_FAILURE_GENERIC=64, /* Generic ESC failure. | */ + ESC_FAILURE_FLAGS_ENUM_END=65, /* | */ +} ESC_FAILURE_FLAGS; +#endif + +/** @brief Flags to indicate the status of camera storage. */ +#ifndef HAVE_ENUM_STORAGE_STATUS +#define HAVE_ENUM_STORAGE_STATUS +typedef enum STORAGE_STATUS +{ + STORAGE_STATUS_EMPTY=0, /* Storage is missing (no microSD card loaded for example.) | */ + STORAGE_STATUS_UNFORMATTED=1, /* Storage present but unformatted. | */ + STORAGE_STATUS_READY=2, /* Storage present and ready. | */ + STORAGE_STATUS_NOT_SUPPORTED=3, /* Camera does not supply storage status information. Capacity information in STORAGE_INFORMATION fields will be ignored. | */ + STORAGE_STATUS_ENUM_END=4, /* | */ +} STORAGE_STATUS; +#endif + +/** @brief Yaw behaviour during orbit flight. */ +#ifndef HAVE_ENUM_ORBIT_YAW_BEHAVIOUR +#define HAVE_ENUM_ORBIT_YAW_BEHAVIOUR +typedef enum ORBIT_YAW_BEHAVIOUR +{ + ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER=0, /* Vehicle front points to the center (default). | */ + ORBIT_YAW_BEHAVIOUR_HOLD_INITIAL_HEADING=1, /* Vehicle front holds heading when message received. | */ + ORBIT_YAW_BEHAVIOUR_UNCONTROLLED=2, /* Yaw uncontrolled. | */ + ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TANGENT_TO_CIRCLE=3, /* Vehicle front follows flight path (tangential to circle). | */ + ORBIT_YAW_BEHAVIOUR_RC_CONTROLLED=4, /* Yaw controlled by RC input. | */ + ORBIT_YAW_BEHAVIOUR_ENUM_END=5, /* | */ +} ORBIT_YAW_BEHAVIOUR; +#endif + +/** @brief Possible responses from a WIFI_CONFIG_AP message. */ +#ifndef HAVE_ENUM_WIFI_CONFIG_AP_RESPONSE +#define HAVE_ENUM_WIFI_CONFIG_AP_RESPONSE +typedef enum WIFI_CONFIG_AP_RESPONSE +{ + WIFI_CONFIG_AP_RESPONSE_UNDEFINED=0, /* Undefined response. Likely an indicative of a system that doesn't support this request. | */ + WIFI_CONFIG_AP_RESPONSE_ACCEPTED=1, /* Changes accepted. | */ + WIFI_CONFIG_AP_RESPONSE_REJECTED=2, /* Changes rejected. | */ + WIFI_CONFIG_AP_RESPONSE_MODE_ERROR=3, /* Invalid Mode. | */ + WIFI_CONFIG_AP_RESPONSE_SSID_ERROR=4, /* Invalid SSID. | */ + WIFI_CONFIG_AP_RESPONSE_PASSWORD_ERROR=5, /* Invalid Password. | */ + WIFI_CONFIG_AP_RESPONSE_ENUM_END=6, /* | */ +} WIFI_CONFIG_AP_RESPONSE; +#endif + +/** @brief Possible responses from a CELLULAR_CONFIG message. */ +#ifndef HAVE_ENUM_CELLULAR_CONFIG_RESPONSE +#define HAVE_ENUM_CELLULAR_CONFIG_RESPONSE +typedef enum CELLULAR_CONFIG_RESPONSE +{ + CELLULAR_CONFIG_RESPONSE_ACCEPTED=0, /* Changes accepted. | */ + CELLULAR_CONFIG_RESPONSE_APN_ERROR=1, /* Invalid APN. | */ + CELLULAR_CONFIG_RESPONSE_PIN_ERROR=2, /* Invalid PIN. | */ + CELLULAR_CONFIG_RESPONSE_REJECTED=3, /* Changes rejected. | */ + CELLULAR_CONFIG_BLOCKED_PUK_REQUIRED=4, /* PUK is required to unblock SIM card. | */ + CELLULAR_CONFIG_RESPONSE_ENUM_END=5, /* | */ +} CELLULAR_CONFIG_RESPONSE; +#endif + +/** @brief WiFi Mode. */ +#ifndef HAVE_ENUM_WIFI_CONFIG_AP_MODE +#define HAVE_ENUM_WIFI_CONFIG_AP_MODE +typedef enum WIFI_CONFIG_AP_MODE +{ + WIFI_CONFIG_AP_MODE_UNDEFINED=0, /* WiFi mode is undefined. | */ + WIFI_CONFIG_AP_MODE_AP=1, /* WiFi configured as an access point. | */ + WIFI_CONFIG_AP_MODE_STATION=2, /* WiFi configured as a station connected to an existing local WiFi network. | */ + WIFI_CONFIG_AP_MODE_DISABLED=3, /* WiFi disabled. | */ + WIFI_CONFIG_AP_MODE_ENUM_END=4, /* | */ +} WIFI_CONFIG_AP_MODE; +#endif + +/** @brief Possible values for COMPONENT_INFORMATION.comp_metadata_type. */ +#ifndef HAVE_ENUM_COMP_METADATA_TYPE +#define HAVE_ENUM_COMP_METADATA_TYPE +typedef enum COMP_METADATA_TYPE +{ + COMP_METADATA_TYPE_VERSION=0, /* Version information which also includes information on other optional supported COMP_METADATA_TYPE's. Must be supported. Only downloadable from vehicle. | */ + COMP_METADATA_TYPE_PARAMETER=1, /* Parameter meta data. | */ + COMP_METADATA_TYPE_ENUM_END=2, /* | */ +} COMP_METADATA_TYPE; +#endif + +/** @brief Possible responses from a PARAM_START_TRANSACTION and PARAM_COMMIT_TRANSACTION messages. */ +#ifndef HAVE_ENUM_PARAM_TRANSACTION_RESPONSE +#define HAVE_ENUM_PARAM_TRANSACTION_RESPONSE +typedef enum PARAM_TRANSACTION_RESPONSE +{ + PARAM_TRANSACTION_RESPONSE_ACCEPTED=0, /* Transaction accepted. | */ + PARAM_TRANSACTION_RESPONSE_FAILED=1, /* Transaction failed. | */ + PARAM_TRANSACTION_RESPONSE_UNSUPPORTED=2, /* Transaction unsupported. | */ + PARAM_TRANSACTION_RESPONSE_INPROGRESS=3, /* Transaction in progress. | */ + PARAM_TRANSACTION_RESPONSE_ENUM_END=4, /* | */ +} PARAM_TRANSACTION_RESPONSE; +#endif + +/** @brief Possible transport layers to set and get parameters via mavlink during a parameter transaction. */ +#ifndef HAVE_ENUM_PARAM_TRANSACTION_TRANSPORT +#define HAVE_ENUM_PARAM_TRANSACTION_TRANSPORT +typedef enum PARAM_TRANSACTION_TRANSPORT +{ + PARAM_TRANSACTION_TRANSPORT_PARAM=0, /* Transaction over param transport. | */ + PARAM_TRANSACTION_TRANSPORT_PARAM_EXT=1, /* Transaction over param_ext transport. | */ + PARAM_TRANSACTION_TRANSPORT_ENUM_END=2, /* | */ +} PARAM_TRANSACTION_TRANSPORT; +#endif + +/** @brief Possible parameter transaction action during a commit. */ +#ifndef HAVE_ENUM_PARAM_TRANSACTION_ACTION +#define HAVE_ENUM_PARAM_TRANSACTION_ACTION +typedef enum PARAM_TRANSACTION_ACTION +{ + PARAM_TRANSACTION_ACTION_COMMIT=0, /* Commit the current parameter transaction. | */ + PARAM_TRANSACTION_ACTION_CANCEL=1, /* Cancel the current parameter transaction. | */ + PARAM_TRANSACTION_ACTION_ENUM_END=2, /* | */ +} PARAM_TRANSACTION_ACTION; +#endif + +/** @brief Commands to be executed by the MAV. They can be executed on user request, or as part of a mission script. If the action is used in a mission, the parameter mapping to the waypoint/mission message is as follows: Param 1, Param 2, Param 3, Param 4, X: Param 5, Y:Param 6, Z:Param 7. This command list is similar what ARINC 424 is for commercial aircraft: A data format how to interpret waypoint/mission data. NaN and INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current yaw or latitude rather than a specific value). See https://mavlink.io/en/guide/xml_schema.html#MAV_CMD for information about the structure of the MAV_CMD entries */ #ifndef HAVE_ENUM_MAV_CMD #define HAVE_ENUM_MAV_CMD typedef enum MAV_CMD { - MAV_CMD_NAV_WAYPOINT=16, /* Navigate to MISSION. |Hold time in decimal seconds. (ignored by fixed wing, time to stay at MISSION for rotary wing)| Acceptance radius in meters (if the sphere with this radius is hit, the MISSION counts as reached)| 0 to pass through the WP, if > 0 radius in meters to pass by WP. Positive value for clockwise orbit, negative value for counter-clockwise orbit. Allows trajectory control.| Desired yaw angle at MISSION (rotary wing)| Latitude| Longitude| Altitude| */ - MAV_CMD_NAV_LOITER_UNLIM=17, /* Loiter around this MISSION an unlimited amount of time |Empty| Empty| Radius around MISSION, in meters. If positive loiter clockwise, else counter-clockwise| Desired yaw angle.| Latitude| Longitude| Altitude| */ - MAV_CMD_NAV_LOITER_TURNS=18, /* Loiter around this MISSION for X turns |Turns| Empty| Radius around MISSION, in meters. If positive loiter clockwise, else counter-clockwise| Forward moving aircraft this sets exit xtrack location: 0 for center of loiter wp, 1 for exit location. Else, this is desired yaw angle| Latitude| Longitude| Altitude| */ - MAV_CMD_NAV_LOITER_TIME=19, /* Loiter around this MISSION for X seconds |Seconds (decimal)| Empty| Radius around MISSION, in meters. If positive loiter clockwise, else counter-clockwise| Forward moving aircraft this sets exit xtrack location: 0 for center of loiter wp, 1 for exit location. Else, this is desired yaw angle| Latitude| Longitude| Altitude| */ + MAV_CMD_NAV_WAYPOINT=16, /* Navigate to waypoint. |Hold time. (ignored by fixed wing, time to stay at waypoint for rotary wing)| Acceptance radius (if the sphere with this radius is hit, the waypoint counts as reached)| 0 to pass through the WP, if > 0 radius 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). NaN to use the current system yaw heading mode (e.g. yaw towards next waypoint, yaw to home, etc.).| Latitude| Longitude| Altitude| */ + MAV_CMD_NAV_LOITER_UNLIM=17, /* Loiter around this waypoint an unlimited amount of time |Empty| Empty| Loiter radius around waypoint for forward-only moving vehicles (not multicopters). If positive loiter clockwise, else counter-clockwise| Desired yaw angle. NaN to use the current system yaw heading mode (e.g. yaw towards next waypoint, yaw to home, etc.).| Latitude| Longitude| Altitude| */ + MAV_CMD_NAV_LOITER_TURNS=18, /* Loiter around this waypoint for X turns |Number of turns.| Leave loiter circle only once heading towards the next waypoint (0 = False)| Loiter radius around waypoint for forward-only moving vehicles (not multicopters). If positive loiter clockwise, else counter-clockwise| Loiter circle exit location and/or path to next waypoint ("xtrack") for forward-only moving vehicles (not multicopters). 0 for the vehicle to converge towards the center xtrack when it leaves the loiter (the line between the centers of the current and next waypoint), 1 to converge to the direct line between the location that the vehicle exits the loiter radius and the next waypoint. Otherwise the angle (in degrees) between the tangent of the loiter circle and the center xtrack at which the vehicle must leave the loiter (and converge to the center xtrack). NaN to use the current system default xtrack behaviour.| Latitude| Longitude| Altitude| */ + MAV_CMD_NAV_LOITER_TIME=19, /* Loiter at the specified latitude, longitude and altitude for a certain amount of time. Multicopter vehicles stop at the point (within a vehicle-specific acceptance radius). Forward-only moving vehicles (e.g. fixed-wing) circle the point with the specified radius/direction. If the Heading Required parameter (2) is non-zero forward moving aircraft will only leave the loiter circle once heading towards the next waypoint. |Loiter time (only starts once Lat, Lon and Alt is reached).| Leave loiter circle only once heading towards the next waypoint (0 = False)| Loiter radius around waypoint for forward-only moving vehicles (not multicopters). If positive loiter clockwise, else counter-clockwise.| Loiter circle exit location and/or path to next waypoint ("xtrack") for forward-only moving vehicles (not multicopters). 0 for the vehicle to converge towards the center xtrack when it leaves the loiter (the line between the centers of the current and next waypoint), 1 to converge to the direct line between the location that the vehicle exits the loiter radius and the next waypoint. Otherwise the angle (in degrees) between the tangent of the loiter circle and the center xtrack at which the vehicle must leave the loiter (and converge to the center xtrack). NaN to use the current system default xtrack behaviour.| Latitude| Longitude| Altitude| */ MAV_CMD_NAV_RETURN_TO_LAUNCH=20, /* Return to launch location |Empty| Empty| Empty| Empty| Empty| Empty| Empty| */ - MAV_CMD_NAV_LAND=21, /* Land at location |Abort Alt| Empty| Empty| Desired yaw angle| Latitude| Longitude| Altitude| */ - MAV_CMD_NAV_TAKEOFF=22, /* Takeoff from ground / hand |Minimum pitch (if airspeed sensor present), desired pitch without sensor| Empty| Empty| Yaw angle (if magnetometer present), ignored without magnetometer| Latitude| Longitude| Altitude| */ - MAV_CMD_NAV_LAND_LOCAL=23, /* Land at local position (local frame only) |Landing target number (if available)| Maximum accepted offset from desired landing position [m] - computed magnitude from spherical coordinates: d = sqrt(x^2 + y^2 + z^2), which gives the maximum accepted distance between the desired landing position and the position where the vehicle is about to land| Landing descend rate [ms^-1]| Desired yaw angle [rad]| Y-axis position [m]| X-axis position [m]| Z-axis / ground level position [m]| */ - MAV_CMD_NAV_TAKEOFF_LOCAL=24, /* Takeoff from local position (local frame only) |Minimum pitch (if airspeed sensor present), desired pitch without sensor [rad]| Empty| Takeoff ascend rate [ms^-1]| Yaw angle [rad] (if magnetometer or another yaw estimation source present), ignored without one of these| Y-axis position [m]| X-axis position [m]| Z-axis position [m]| */ - MAV_CMD_NAV_FOLLOW=25, /* Vehicle following, i.e. this waypoint represents the position of a moving vehicle |Following logic to use (e.g. loitering or sinusoidal following) - depends on specific autopilot implementation| Ground speed of vehicle to be followed| Radius around MISSION, in meters. If positive loiter clockwise, else counter-clockwise| Desired yaw angle.| Latitude| Longitude| Altitude| */ - MAV_CMD_NAV_CONTINUE_AND_CHANGE_ALT=30, /* Continue on the current course and climb/descend to specified altitude. When the altitude is reached continue to the next command (i.e., don't proceed to the next command until the desired altitude is reached. |Climb or Descend (0 = Neutral, command completes when within 5m of this command's altitude, 1 = Climbing, command completes when at or above this command's altitude, 2 = Descending, command completes when at or below this command's altitude. | Empty| Empty| Empty| Empty| Empty| Desired altitude in meters| */ - MAV_CMD_NAV_LOITER_TO_ALT=31, /* Begin loiter at the specified Latitude and Longitude. If Lat=Lon=0, then loiter at the current position. Don't consider the navigation command complete (don't leave loiter) until the altitude has been reached. Additionally, if the Heading Required parameter is non-zero the aircraft will not leave the loiter until heading toward the next waypoint. |Heading Required (0 = False)| Radius in meters. If positive loiter clockwise, negative counter-clockwise, 0 means no change to standard loiter.| Empty| Forward moving aircraft this sets exit xtrack location: 0 for center of loiter wp, 1 for exit location| Latitude| Longitude| Altitude| */ - MAV_CMD_DO_FOLLOW=32, /* Being following a target |System ID (the system ID of the FOLLOW_TARGET beacon). Send 0 to disable follow-me and return to the default position hold mode| RESERVED| RESERVED| altitude flag: 0: Keep current altitude, 1: keep altitude difference to target, 2: go to a fixed altitude above home| altitude| RESERVED| TTL in seconds in which the MAV should go to the default position hold mode after a message rx timeout| */ - MAV_CMD_DO_FOLLOW_REPOSITION=33, /* Reposition the MAV after a follow target command has been sent |Camera q1 (where 0 is on the ray from the camera to the tracking device)| Camera q2| Camera q3| Camera q4| altitude offset from target (m)| X offset from target (m)| Y offset from target (m)| */ - MAV_CMD_NAV_ROI=80, /* Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicles control system to control the vehicle attitude and the attitude of various sensors such as cameras. |Region of intereset mode. (see MAV_ROI enum)| MISSION index/ target ID. (see MAV_ROI enum)| ROI index (allows a vehicle to manage multiple ROI's)| Empty| x the location of the fixed ROI (see MAV_FRAME)| y| z| */ - MAV_CMD_NAV_PATHPLANNING=81, /* Control autonomous path planning on the MAV. |0: Disable local obstacle avoidance / local path planning (without resetting map), 1: Enable local path planning, 2: Enable and reset local path planning| 0: Disable full path planning (without resetting map), 1: Enable, 2: Enable and reset map/occupancy grid, 3: Enable and reset planned route, but not occupancy grid| Empty| Yaw angle at goal, in compass degrees, [0..360]| Latitude/X of goal| Longitude/Y of goal| Altitude/Z of goal| */ - MAV_CMD_NAV_SPLINE_WAYPOINT=82, /* Navigate to MISSION using a spline path. |Hold time in decimal seconds. (ignored by fixed wing, time to stay at MISSION for rotary wing)| Empty| Empty| Empty| Latitude/X of goal| Longitude/Y of goal| Altitude/Z of goal| */ - MAV_CMD_NAV_VTOL_TAKEOFF=84, /* Takeoff from ground using VTOL mode |Empty| Empty| Empty| Yaw angle in degrees| Latitude| Longitude| Altitude| */ - MAV_CMD_NAV_VTOL_LAND=85, /* Land using VTOL mode |Empty| Empty| Empty| Yaw angle in degrees| Latitude| Longitude| Altitude| */ + MAV_CMD_NAV_LAND=21, /* Land at location. |Minimum target altitude if landing is aborted (0 = undefined/use system default).| Precision land mode.| Empty| Desired yaw angle. NaN to use the current system yaw heading mode (e.g. yaw towards next waypoint, yaw to home, etc.).| Latitude.| Longitude.| Landing altitude (ground level in current frame).| */ + MAV_CMD_NAV_TAKEOFF=22, /* Takeoff from ground / hand. Vehicles that support multiple takeoff modes (e.g. VTOL quadplane) should take off using the currently configured mode. |Minimum pitch (if airspeed sensor present), desired pitch without sensor| Empty| Empty| Yaw angle (if magnetometer present), ignored without magnetometer. NaN to use the current system yaw heading mode (e.g. yaw towards next waypoint, yaw to home, etc.).| Latitude| Longitude| Altitude| */ + MAV_CMD_NAV_LAND_LOCAL=23, /* Land at local position (local frame only) |Landing target number (if available)| Maximum accepted offset from desired landing position - computed magnitude from spherical coordinates: d = sqrt(x^2 + y^2 + z^2), which gives the maximum accepted distance between the desired landing position and the position where the vehicle is about to land| Landing descend rate| Desired yaw angle| Y-axis position| X-axis position| Z-axis / ground level position| */ + MAV_CMD_NAV_TAKEOFF_LOCAL=24, /* Takeoff from local position (local frame only) |Minimum pitch (if airspeed sensor present), desired pitch without sensor| Empty| Takeoff ascend rate| Yaw angle (if magnetometer or another yaw estimation source present), ignored without one of these| Y-axis position| X-axis position| Z-axis position| */ + MAV_CMD_NAV_FOLLOW=25, /* Vehicle following, i.e. this waypoint represents the position of a moving vehicle |Following logic to use (e.g. loitering or sinusoidal following) - depends on specific autopilot implementation| Ground speed of vehicle to be followed| Radius around waypoint. If positive loiter clockwise, else counter-clockwise| Desired yaw angle.| Latitude| Longitude| Altitude| */ + MAV_CMD_NAV_CONTINUE_AND_CHANGE_ALT=30, /* Continue on the current course and climb/descend to specified altitude. When the altitude is reached continue to the next command (i.e., don't proceed to the next command until the desired altitude is reached. |Climb or Descend (0 = Neutral, command completes when within 5m of this command's altitude, 1 = Climbing, command completes when at or above this command's altitude, 2 = Descending, command completes when at or below this command's altitude.| Empty| Empty| Empty| Empty| Empty| Desired altitude| */ + MAV_CMD_NAV_LOITER_TO_ALT=31, /* Begin loiter at the specified Latitude and Longitude. If Lat=Lon=0, then loiter at the current position. Don't consider the navigation command complete (don't leave loiter) until the altitude has been reached. Additionally, if the Heading Required parameter is non-zero the aircraft will not leave the loiter until heading toward the next waypoint. |Leave loiter circle only once heading towards the next waypoint (0 = False)| Loiter radius around waypoint for forward-only moving vehicles (not multicopters). If positive loiter clockwise, negative counter-clockwise, 0 means no change to standard loiter.| Empty| Loiter circle exit location and/or path to next waypoint ("xtrack") for forward-only moving vehicles (not multicopters). 0 for the vehicle to converge towards the center xtrack when it leaves the loiter (the line between the centers of the current and next waypoint), 1 to converge to the direct line between the location that the vehicle exits the loiter radius and the next waypoint. Otherwise the angle (in degrees) between the tangent of the loiter circle and the center xtrack at which the vehicle must leave the loiter (and converge to the center xtrack). NaN to use the current system default xtrack behaviour.| Latitude| Longitude| Altitude| */ + MAV_CMD_DO_FOLLOW=32, /* Begin following a target |System ID (of the FOLLOW_TARGET beacon). Send 0 to disable follow-me and return to the default position hold mode.| Reserved| Reserved| Altitude mode: 0: Keep current altitude, 1: keep altitude difference to target, 2: go to a fixed altitude above home.| Altitude above home. (used if mode=2)| Reserved| Time to land in which the MAV should go to the default position hold mode after a message RX timeout.| */ + MAV_CMD_DO_FOLLOW_REPOSITION=33, /* Reposition the MAV after a follow target command has been sent |Camera q1 (where 0 is on the ray from the camera to the tracking device)| Camera q2| Camera q3| Camera q4| altitude offset from target| X offset from target| Y offset from target| */ + MAV_CMD_DO_ORBIT=34, /* Start orbiting on the circumference of a circle defined by the parameters. Setting any value NaN results in using defaults. |Radius of the circle. positive: Orbit clockwise. negative: Orbit counter-clockwise.| Tangential Velocity. NaN: Vehicle configuration default.| Yaw behavior of the vehicle.| Reserved (e.g. for dynamic center beacon options)| Center point latitude (if no MAV_FRAME specified) / X coordinate according to MAV_FRAME. NaN: Use current vehicle position or current center if already orbiting.| Center point longitude (if no MAV_FRAME specified) / Y coordinate according to MAV_FRAME. NaN: Use current vehicle position or current center if already orbiting.| Center point altitude (MSL) (if no MAV_FRAME specified) / Z coordinate according to MAV_FRAME. NaN: Use current vehicle position or current center if already orbiting.| */ + 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 vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. |Region of interest mode.| 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| Latitude/X of goal| Longitude/Y of goal| Altitude/Z of goal| */ + MAV_CMD_NAV_SPLINE_WAYPOINT=82, /* Navigate to waypoint using a spline path. |Hold time. (ignored by fixed wing, time to stay at waypoint for rotary wing)| Empty| Empty| Empty| Latitude/X of goal| Longitude/Y of goal| Altitude/Z of goal| */ + MAV_CMD_NAV_VTOL_TAKEOFF=84, /* Takeoff from ground using VTOL mode, and transition to forward flight with specified heading. The command should be ignored by vehicles that dont support both VTOL and fixed-wing flight (multicopters, boats,etc.). |Empty| Front transition heading.| Empty| Yaw angle. NaN to use the current system yaw heading mode (e.g. yaw towards next waypoint, yaw to home, etc.).| Latitude| Longitude| Altitude| */ + MAV_CMD_NAV_VTOL_LAND=85, /* Land using VTOL mode |Empty| Empty| Approach altitude (with the same reference as the Altitude field). NaN if unspecified.| Yaw angle. NaN to use the current system yaw heading mode (e.g. yaw towards next waypoint, yaw to home, etc.).| Latitude| Longitude| Altitude (ground level)| */ MAV_CMD_NAV_GUIDED_ENABLE=92, /* hand control over to an external controller |On / Off (> 0.5f on)| Empty| Empty| Empty| Empty| Empty| Empty| */ - MAV_CMD_NAV_DELAY=93, /* Delay the next navigation command a number of seconds or until a specified time |Delay in seconds (decimal, -1 to enable time-of-day fields)| hour (24h format, UTC, -1 to ignore)| minute (24h format, UTC, -1 to ignore)| second (24h format, UTC)| Empty| Empty| Empty| */ + MAV_CMD_NAV_DELAY=93, /* Delay the next navigation command a number of seconds or until a specified time |Delay (-1 to enable time-of-day fields)| hour (24h format, UTC, -1 to ignore)| minute (24h format, UTC, -1 to ignore)| second (24h format, UTC)| Empty| Empty| Empty| */ + MAV_CMD_NAV_PAYLOAD_PLACE=94, /* Descend and place payload. Vehicle moves to specified location, descends until it detects a hanging payload has reached the ground, and then releases the payload. If ground is not detected before the reaching the maximum descent value (param1), the command will complete without releasing the payload. |Maximum distance to descend.| Empty| Empty| Empty| Latitude| Longitude| Altitude| */ 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_DELAY=112, /* Delay mission state machine. |Delay| Empty| Empty| Empty| Empty| Empty| Empty| */ + MAV_CMD_CONDITION_CHANGE_ALT=113, /* Ascend/descend to target altitude at specified rate. Delay mission state machine until desired altitude reached. |Descent / Ascend rate.| Empty| Empty| Empty| Empty| Empty| Target Altitude| */ + MAV_CMD_CONDITION_DISTANCE=114, /* Delay mission state machine until within desired distance of next NAV point. |Distance.| Empty| Empty| Empty| Empty| Empty| Empty| */ + MAV_CMD_CONDITION_YAW=115, /* Reach a certain target angle. |target angle, 0 is north| angular speed| direction: -1: counter clockwise, 1: clockwise| 0: absolute angle, 1: relative offset| Empty| Empty| Empty| */ MAV_CMD_CONDITION_LAST=159, /* NOP - This command is only used to mark the upper limit of the CONDITION commands in the enumeration |Empty| Empty| Empty| Empty| Empty| Empty| Empty| */ - MAV_CMD_DO_SET_MODE=176, /* Set system mode. |Mode, as defined by ENUM MAV_MODE| Custom mode - this is system specific, please refer to the individual autopilot specifications for details.| Custom sub mode - this is system specific, please refer to the individual autopilot specifications for details.| Empty| Empty| Empty| Empty| */ + MAV_CMD_DO_SET_MODE=176, /* Set system mode. |Mode| Custom mode - this is system specific, please refer to the individual autopilot specifications for details.| Custom sub mode - this is system specific, please refer to the individual autopilot specifications for details.| Empty| Empty| Empty| Empty| */ MAV_CMD_DO_JUMP=177, /* Jump to the desired command in the mission list. Repeat this action only the specified number of times |Sequence number| Repeat count| Empty| Empty| Empty| Empty| Empty| */ - MAV_CMD_DO_CHANGE_SPEED=178, /* Change speed and/or throttle set points. |Speed type (0=Airspeed, 1=Ground Speed)| Speed (m/s, -1 indicates no change)| Throttle ( Percent, -1 indicates no change)| absolute or relative [0,1]| Empty| Empty| Empty| */ - MAV_CMD_DO_SET_HOME=179, /* Changes the home location either to the current location or a specified location. |Use current (1=use current location, 0=use specified location)| Empty| Empty| Empty| Latitude| Longitude| Altitude| */ + MAV_CMD_DO_CHANGE_SPEED=178, /* Change speed and/or throttle set points. |Speed type (0=Airspeed, 1=Ground Speed, 2=Climb Speed, 3=Descent Speed)| Speed (-1 indicates no change)| Throttle (-1 indicates no change)| 0: absolute, 1: relative| 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| Yaw angle. NaN to use default heading| 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_SET_RELAY=181, /* Set a relay to a condition. |Relay instance 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 cycles with a desired period. |Relay instance number.| Cycle count.| Cycle time.| Empty| Empty| Empty| Empty| */ + MAV_CMD_DO_SET_SERVO=183, /* Set a servo to a desired PWM value. |Servo instance number.| Pulse Width Modulation.| 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 instance number.| Pulse Width Modulation.| Cycle count.| Cycle time.| Empty| Empty| Empty| */ MAV_CMD_DO_FLIGHTTERMINATION=185, /* Terminate flight immediately |Flight termination activated if > 0.5| Empty| Empty| Empty| Empty| Empty| Empty| */ - MAV_CMD_DO_CHANGE_ALTITUDE=186, /* Change altitude set point. |Altitude in meters| Mav frame of new altitude (see MAV_FRAME)| Empty| Empty| Empty| Empty| Empty| */ - MAV_CMD_DO_LAND_START=189, /* Mission command to perform a landing. This is used as a marker in a mission to tell the autopilot where a sequence of mission items that represents a landing starts. It may also be sent via a COMMAND_LONG to trigger a landing, in which case the nearest (geographically) landing sequence in the mission will be used. The Latitude/Longitude is optional, and may be set to 0/0 if not needed. If specified then it will be used to help find the closest landing sequence. |Empty| Empty| Empty| Empty| Latitude| Longitude| Empty| */ - MAV_CMD_DO_RALLY_LAND=190, /* Mission command to perform a landing from a rally point. |Break altitude (meters)| Landing speed (m/s)| Empty| Empty| Empty| Empty| Empty| */ - MAV_CMD_DO_GO_AROUND=191, /* Mission command to safely abort an autonmous landing. |Altitude (meters)| Empty| Empty| Empty| Empty| Empty| Empty| */ - MAV_CMD_DO_REPOSITION=192, /* Reposition the vehicle to a specific WGS84 global position. |Ground speed, less than 0 (-1) for default| Bitmask of option flags, see the MAV_DO_REPOSITION_FLAGS enum.| Reserved| Yaw heading, NaN for unchanged. For planes indicates loiter direction (0: clockwise, 1: counter clockwise)| Latitude (deg * 1E7)| Longitude (deg * 1E7)| Altitude (meters)| */ + MAV_CMD_DO_CHANGE_ALTITUDE=186, /* Change altitude set point. |Altitude| Frame of new altitude.| Empty| Empty| Empty| Empty| Empty| */ + MAV_CMD_DO_SET_ACTUATOR=187, /* Sets actuators (e.g. servos) to a desired value. The actuator numbers are mapped to specific outputs (e.g. on any MAIN or AUX PWM or UAVCAN) using a flight-stack specific mechanism (i.e. a parameter). |Actuator 1 value, scaled from [-1 to 1]. NaN to ignore.| Actuator 2 value, scaled from [-1 to 1]. NaN to ignore.| Actuator 3 value, scaled from [-1 to 1]. NaN to ignore.| Actuator 4 value, scaled from [-1 to 1]. NaN to ignore.| Actuator 5 value, scaled from [-1 to 1]. NaN to ignore.| Actuator 6 value, scaled from [-1 to 1]. NaN to ignore.| Index of actuator set (i.e if set to 1, Actuator 1 becomes Actuator 7)| */ + MAV_CMD_DO_LAND_START=189, /* Mission command to perform a landing. This is used as a marker in a mission to tell the autopilot where a sequence of mission items that represents a landing starts. It may also be sent via a COMMAND_LONG to trigger a landing, in which case the nearest (geographically) landing sequence in the mission will be used. The Latitude/Longitude is optional, and may be set to 0 if not needed. If specified then it will be used to help find the closest landing sequence. |Empty| Empty| Empty| Empty| Latitude| Longitude| Empty| */ + MAV_CMD_DO_RALLY_LAND=190, /* Mission command to perform a landing from a rally point. |Break altitude| Landing speed| Empty| Empty| Empty| Empty| Empty| */ + MAV_CMD_DO_GO_AROUND=191, /* Mission command to safely abort an autonomous landing. |Altitude| Empty| Empty| Empty| Empty| Empty| Empty| */ + MAV_CMD_DO_REPOSITION=192, /* Reposition the vehicle to a specific WGS84 global position. |Ground speed, less than 0 (-1) for default| Bitmask of option flags.| Reserved| Yaw heading. NaN to use the current system yaw heading mode (e.g. yaw towards next waypoint, yaw to home, etc.). For planes indicates loiter direction (0: clockwise, 1: counter clockwise)| Latitude| Longitude| Altitude| */ MAV_CMD_DO_PAUSE_CONTINUE=193, /* If in a GPS controlled position mode, hold the current position or continue. |0: Pause current mission or reposition command, hold current position. 1: Continue mission. A VTOL capable vehicle should enter hover mode (multicopter and VTOL planes). A plane should loiter with the default loiter radius.| Reserved| Reserved| Reserved| Reserved| Reserved| Reserved| */ MAV_CMD_DO_SET_REVERSE=194, /* Set moving direction to forward or reverse. |Direction (0=Forward, 1=Reverse)| Empty| Empty| Empty| 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_SET_ROI=201, /* Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicles control system to control the vehicle attitude and the attitude of various sensors such as cameras. |Region of intereset mode. (see MAV_ROI enum)| MISSION index/ target ID. (see MAV_ROI enum)| ROI index (allows a vehicle to manage multiple ROI's)| Empty| x the location of the fixed ROI (see MAV_FRAME)| y| z| */ - MAV_CMD_DO_DIGICAM_CONFIGURE=202, /* Mission command to configure an on-board camera controller system. |Modes: P, TV, AV, M, Etc| Shutter speed: Divisor number for one second| Aperture: F stop number| ISO number e.g. 80, 100, 200, Etc| Exposure type enumerator| Command Identity| Main engine cut-off time before camera trigger in seconds/10 (0 means no cut-off)| */ - MAV_CMD_DO_DIGICAM_CONTROL=203, /* Mission command to control an on-board camera controller system. |Session control e.g. show/hide lens| Zoom's absolute position| Zooming step value to offset zoom from the current position| Focus Locking, Unlocking or Re-locking| Shooting Command| Command Identity| Empty| */ - MAV_CMD_DO_MOUNT_CONFIGURE=204, /* Mission command to configure a camera or antenna mount |Mount operation mode (see MAV_MOUNT_MODE enum)| stabilize roll? (1 = yes, 0 = no)| stabilize pitch? (1 = yes, 0 = no)| stabilize yaw? (1 = yes, 0 = no)| Empty| Empty| Empty| */ - MAV_CMD_DO_MOUNT_CONTROL=205, /* Mission command to control a camera or antenna mount |pitch (WIP: DEPRECATED: or lat in degrees) depending on mount mode.| roll (WIP: DEPRECATED: or lon in degrees) depending on mount mode.| yaw (WIP: DEPRECATED: or alt in meters) depending on mount mode.| WIP: alt in meters depending on mount mode.| WIP: latitude in degrees * 1E7, set if appropriate mount mode.| WIP: longitude in degrees * 1E7, set if appropriate mount mode.| MAV_MOUNT_MODE enum value| */ - MAV_CMD_DO_SET_CAM_TRIGG_DIST=206, /* Mission command to set CAM_TRIGG_DIST for this flight |Camera trigger distance (meters)| Empty| Empty| Empty| Empty| Empty| Empty| */ + MAV_CMD_DO_SET_ROI_LOCATION=195, /* Sets the region of interest (ROI) to a location. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal is not to react to this message. |Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. (Send command multiple times for more than one but not all gimbals.)| Empty| Empty| Empty| Latitude of ROI location| Longitude of ROI location| Altitude of ROI location| */ + MAV_CMD_DO_SET_ROI_WPNEXT_OFFSET=196, /* Sets the region of interest (ROI) to be toward next waypoint, with optional pitch/roll/yaw offset. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message. |Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. (Send command multiple times for more than one but not all gimbals.)| Empty| Empty| Empty| Pitch offset from next waypoint, positive tilting up| roll offset from next waypoint, positive banking to the right| yaw offset from next waypoint, positive panning to the right| */ + MAV_CMD_DO_SET_ROI_NONE=197, /* Cancels any previous ROI command returning the vehicle/sensors to default flight characteristics. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message. After this command the gimbal manager should go back to manual input if available, and otherwise assume a neutral position. |Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. (Send command multiple times for more than one but not all gimbals.)| Empty| Empty| Empty| Empty| Empty| Empty| */ + MAV_CMD_DO_SET_ROI_SYSID=198, /* Mount tracks system with specified system ID. Determination of target vehicle position may be done with GLOBAL_POSITION_INT or any other means. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message. |System ID| Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. (Send command multiple times for more than one but not all gimbals.)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + 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| 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 vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. |Region of interest mode.| Waypoint index/ target ID (depends on param 1).| Region of interest index. (allows a vehicle to manage multiple ROI's)| Empty| MAV_ROI_WPNEXT: pitch offset from next waypoint, MAV_ROI_LOCATION: latitude| MAV_ROI_WPNEXT: roll offset from next waypoint, MAV_ROI_LOCATION: longitude| MAV_ROI_WPNEXT: yaw offset from next waypoint, MAV_ROI_LOCATION: altitude| */ + MAV_CMD_DO_DIGICAM_CONFIGURE=202, /* Configure digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see https://mavlink.io/en/services/camera_def.html ). |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. (0 means no cut-off)| */ + MAV_CMD_DO_DIGICAM_CONTROL=203, /* Control digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see https://mavlink.io/en/services/camera_def.html ). |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| Test shot identifier. If set to 1, image will only be captured, but not counted towards internal frame count.| */ + MAV_CMD_DO_MOUNT_CONFIGURE=204, /* Mission command to configure a camera or antenna mount |Mount operation mode| stabilize roll? (1 = yes, 0 = no)| stabilize pitch? (1 = yes, 0 = no)| stabilize yaw? (1 = yes, 0 = no)| roll input (0 = angle body frame, 1 = angular rate, 2 = angle absolute frame)| pitch input (0 = angle body frame, 1 = angular rate, 2 = angle absolute frame)| yaw input (0 = angle body frame, 1 = angular rate, 2 = angle absolute frame)| */ + MAV_CMD_DO_MOUNT_CONTROL=205, /* Mission command to control a camera or antenna mount |pitch depending on mount mode (degrees or degrees/second depending on pitch input).| roll depending on mount mode (degrees or degrees/second depending on roll input).| yaw depending on mount mode (degrees or degrees/second depending on yaw input).| altitude depending on mount mode.| latitude, set if appropriate mount mode.| longitude, set if appropriate mount mode.| Mount mode.| */ + MAV_CMD_DO_SET_CAM_TRIGG_DIST=206, /* Mission command to set camera trigger distance for this flight. The camera is triggered each time this distance is exceeded. This command can also be used to set the shutter integration time for the camera. |Camera trigger distance. 0 to stop triggering.| Camera shutter integration time. -1 or 0 to ignore| Trigger camera once immediately. (0 = no trigger, 1 = trigger)| Empty| Empty| Empty| Empty| */ MAV_CMD_DO_FENCE_ENABLE=207, /* Mission command to enable the geofence |enable? (0=disable, 1=enable, 2=disable_floor_only)| Empty| Empty| Empty| Empty| Empty| Empty| */ - MAV_CMD_DO_PARACHUTE=208, /* Mission command to trigger a parachute |action (0=disable, 1=enable, 2=release, for some systems see PARACHUTE_ACTION enum, not in general message set.)| Empty| Empty| Empty| Empty| Empty| Empty| */ - MAV_CMD_DO_MOTOR_TEST=209, /* Mission command to perform motor test |motor sequence number (a number from 1 to max number of motors on the vehicle)| throttle type (0=throttle percentage, 1=PWM, 2=pilot throttle channel pass-through. See MOTOR_TEST_THROTTLE_TYPE enum)| throttle| timeout (in seconds)| Empty| Empty| Empty| */ - MAV_CMD_DO_INVERTED_FLIGHT=210, /* Change to/from inverted flight |inverted (0=normal, 1=inverted)| Empty| Empty| Empty| Empty| Empty| Empty| */ - MAV_CMD_NAV_SET_YAW_SPEED=213, /* Sets a desired vehicle turn angle and speed change |yaw angle to adjust steering by in centidegress| speed - normalized to 0 .. 1| Empty| Empty| Empty| Empty| Empty| */ - MAV_CMD_DO_MOUNT_CONTROL_QUAT=220, /* Mission command to control a camera or antenna mount, using a quaternion as reference. |q1 - quaternion param #1, w (1 in null-rotation)| q2 - quaternion param #2, x (0 in null-rotation)| q3 - quaternion param #3, y (0 in null-rotation)| q4 - quaternion param #4, z (0 in null-rotation)| Empty| Empty| Empty| */ + MAV_CMD_DO_PARACHUTE=208, /* Mission item/command to release a parachute or enable/disable auto release. |Action| Empty| Empty| Empty| Empty| Empty| Empty| */ + MAV_CMD_DO_MOTOR_TEST=209, /* Mission command to perform motor test. |Motor instance number. (from 1 to max number of motors on the vehicle)| Throttle type.| Throttle.| Timeout.| Motor count. (number of motors to test to test in sequence, waiting for the timeout above between them; 0=1 motor, 1=1 motor, 2=2 motors...)| Motor test order.| Empty| */ + MAV_CMD_DO_INVERTED_FLIGHT=210, /* Change to/from inverted flight. |Inverted flight. (0=normal, 1=inverted)| Empty| Empty| Empty| Empty| Empty| Empty| */ + MAV_CMD_NAV_SET_YAW_SPEED=213, /* Sets a desired vehicle turn angle and speed change. |Yaw angle to adjust steering by.| Speed.| Final angle. (0=absolute, 1=relative)| Empty| Empty| Empty| Empty| */ + MAV_CMD_DO_SET_CAM_TRIGG_INTERVAL=214, /* Mission command to set camera trigger interval for this flight. If triggering is enabled, the camera is triggered each time this interval expires. This command can also be used to set the shutter integration time for the camera. |Camera trigger cycle time. -1 or 0 to ignore.| Camera shutter integration time. Should be less than trigger cycle time. -1 or 0 to ignore.| Empty| Empty| Empty| Empty| Empty| */ + MAV_CMD_DO_MOUNT_CONTROL_QUAT=220, /* Mission command to control a camera or antenna mount, using a quaternion as reference. |quaternion param q1, w (1 in null-rotation)| quaternion param q2, x (0 in null-rotation)| quaternion param q3, y (0 in null-rotation)| quaternion param q4, z (0 in null-rotation)| Empty| Empty| Empty| */ MAV_CMD_DO_GUIDED_MASTER=221, /* set id of master controller |System ID| Component ID| Empty| Empty| Empty| Empty| Empty| */ - MAV_CMD_DO_GUIDED_LIMITS=222, /* set limits for external control |timeout - maximum time (in seconds) that external controller will be allowed to control vehicle. 0 means no timeout| absolute altitude min (in meters, AMSL) - if vehicle moves below this alt, the command will be aborted and the mission will continue. 0 means no lower altitude limit| absolute altitude max (in meters)- if vehicle moves above this alt, the command will be aborted and the mission will continue. 0 means no upper altitude limit| horizontal move limit (in meters, AMSL) - if vehicle moves more than this distance from it's location at the moment the command was executed, the command will be aborted and the mission will continue. 0 means no horizontal altitude limit| Empty| Empty| Empty| */ - MAV_CMD_DO_ENGINE_CONTROL=223, /* Control vehicle engine. This is interpreted by the vehicles engine controller to change the target engine state. It is intended for vehicles with internal combustion engines |0: Stop engine, 1:Start Engine| 0: Warm start, 1:Cold start. Controls use of choke where applicable| Height delay (meters). This is for commanding engine start only after the vehicle has gained the specified height. Used in VTOL vehicles during takeoff to start engine after the aircraft is off the ground. Zero for no delay.| Empty| Empty| Empty| Empty| Empty| */ + MAV_CMD_DO_GUIDED_LIMITS=222, /* Set limits for external control |Timeout - maximum time that external controller will be allowed to control vehicle. 0 means no timeout.| Altitude (MSL) min - if vehicle moves below this alt, the command will be aborted and the mission will continue. 0 means no lower altitude limit.| Altitude (MSL) max - if vehicle moves above this alt, the command will be aborted and the mission will continue. 0 means no upper altitude limit.| Horizontal move limit - if vehicle moves more than this distance from its location at the moment the command was executed, the command will be aborted and the mission will continue. 0 means no horizontal move limit.| Empty| Empty| Empty| */ + MAV_CMD_DO_ENGINE_CONTROL=223, /* Control vehicle engine. This is interpreted by the vehicles engine controller to change the target engine state. It is intended for vehicles with internal combustion engines |0: Stop engine, 1:Start Engine| 0: Warm start, 1:Cold start. Controls use of choke where applicable| Height delay. This is for commanding engine start only after the vehicle has gained the specified height. Used in VTOL vehicles during takeoff to start engine after the aircraft is off the ground. Zero for no delay.| Empty| Empty| Empty| Empty| */ + MAV_CMD_DO_SET_MISSION_CURRENT=224, /* 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). |Mission sequence value to set| Empty| Empty| Empty| 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. Except for Temperature Calibration, only one sensor should be set in a single message and all others should be zero. |1: gyro calibration, 3: gyro temperature calibration| 1: magnetometer calibration| 1: ground pressure calibration| 1: radio RC calibration, 2: RC trim calibration| 1: accelerometer calibration, 2: board level calibration, 3: accelerometer temperature calibration| 1: APM: compass/motor interference calibration / PX4: airspeed calibration| 1: ESC calibration, 3: barometer temperature calibration| */ + MAV_CMD_PREFLIGHT_CALIBRATION=241, /* Trigger calibration. This command will be only accepted if in pre-flight mode. Except for Temperature Calibration, only one sensor should be set in a single message and all others should be zero. |1: gyro calibration, 3: gyro temperature calibration| 1: magnetometer calibration| 1: ground pressure calibration| 1: radio RC calibration, 2: RC trim calibration| 1: accelerometer calibration, 2: board level calibration, 3: accelerometer temperature calibration, 4: simple accelerometer calibration| 1: APM: compass/motor interference calibration (PX4: airspeed calibration, deprecated), 2: airspeed calibration| 1: ESC calibration, 3: barometer temperature calibration| */ MAV_CMD_PREFLIGHT_SET_SENSOR_OFFSETS=242, /* Set sensor offsets. This command will be only accepted if in pre-flight mode. |Sensor to adjust the offsets for: 0: gyros, 1: accelerometer, 2: magnetometer, 3: barometer, 4: optical flow, 5: second magnetometer, 6: third magnetometer| X axis offset (or generic dimension 1), in the sensor's raw units| Y axis offset (or generic dimension 2), in the sensor's raw units| Z axis offset (or generic dimension 3), in the sensor's raw units| Generic dimension 4, in the sensor's raw units| Generic dimension 5, in the sensor's raw units| Generic dimension 6, in the sensor's raw units| */ MAV_CMD_PREFLIGHT_UAVCAN=243, /* Trigger UAVCAN config. This command will be only accepted if in pre-flight mode. |1: Trigger actuator ID assignment and direction mapping.| Reserved| Reserved| Reserved| Reserved| Reserved| Reserved| */ - MAV_CMD_PREFLIGHT_STORAGE=245, /* Request storage of different parameter values and logs. This command will be only accepted if in pre-flight mode. |Parameter storage: 0: READ FROM FLASH/EEPROM, 1: WRITE CURRENT TO FLASH/EEPROM, 2: Reset to defaults| Mission storage: 0: READ FROM FLASH/EEPROM, 1: WRITE CURRENT TO FLASH/EEPROM, 2: Reset to defaults| Onboard logging: 0: Ignore, 1: Start default rate logging, -1: Stop logging, > 1: start logging with rate of param 3 in Hz (e.g. set to 1000 for 1000 Hz logging)| Reserved| Empty| Empty| Empty| */ - MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN=246, /* Request the reboot or shutdown of system components. |0: Do nothing for autopilot, 1: Reboot autopilot, 2: Shutdown autopilot, 3: Reboot autopilot and keep it in the bootloader until upgraded.| 0: Do nothing for onboard computer, 1: Reboot onboard computer, 2: Shutdown onboard computer, 3: Reboot onboard computer and keep it in the bootloader until upgraded.| WIP: 0: Do nothing for camera, 1: Reboot onboard camera, 2: Shutdown onboard camera, 3: Reboot onboard camera and keep it in the bootloader until upgraded| WIP: 0: Do nothing for mount (e.g. gimbal), 1: Reboot mount, 2: Shutdown mount, 3: Reboot mount and keep it in the bootloader until upgraded| Reserved, send 0| Reserved, send 0| WIP: ID (e.g. camera ID -1 for all IDs)| */ - 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_PREFLIGHT_STORAGE=245, /* Request storage of different parameter values and logs. This command will be only accepted if in pre-flight mode. |Parameter storage: 0: READ FROM FLASH/EEPROM, 1: WRITE CURRENT TO FLASH/EEPROM, 2: Reset to defaults| Mission storage: 0: READ FROM FLASH/EEPROM, 1: WRITE CURRENT TO FLASH/EEPROM, 2: Reset to defaults| Onboard logging: 0: Ignore, 1: Start default rate logging, -1: Stop logging, > 1: logging rate (e.g. set to 1000 for 1000 Hz logging)| Reserved| Empty| Empty| Empty| */ + MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN=246, /* Request the reboot or shutdown of system components. |0: Do nothing for autopilot, 1: Reboot autopilot, 2: Shutdown autopilot, 3: Reboot autopilot and keep it in the bootloader until upgraded.| 0: Do nothing for onboard computer, 1: Reboot onboard computer, 2: Shutdown onboard computer, 3: Reboot onboard computer and keep it in the bootloader until upgraded.| WIP: 0: Do nothing for camera, 1: Reboot onboard camera, 2: Shutdown onboard camera, 3: Reboot onboard camera and keep it in the bootloader until upgraded| WIP: 0: Do nothing for mount (e.g. gimbal), 1: Reboot mount, 2: Shutdown mount, 3: Reboot mount and keep it in the bootloader until upgraded| Reserved (set to 0)| Reserved (set to 0)| WIP: ID (e.g. camera ID -1 for all IDs)| */ + MAV_CMD_DO_UPGRADE=247, /* Request a target system to start an upgrade of one (or all) of its components. For example, the command might be sent to a companion computer to cause it to upgrade a connected flight controller. The system doing the upgrade will report progress using the normal command protocol sequence for a long running operation. Command protocol information: https://mavlink.io/en/services/command.html. |Component id of the component to be upgraded. If set to 0, all components should be upgraded.| 0: Do not reboot component after the action is executed, 1: Reboot component after the action is executed.| Reserved| Reserved| Reserved| Reserved| WIP: upgrade progress report rate (can be used for more granular control).| */ + MAV_CMD_OVERRIDE_GOTO=252, /* Override current mission with command to pause mission, pause mission and move to position, continue/resume mission. When param 1 indicates that the mission is paused (MAV_GOTO_DO_HOLD), param 2 defines whether it holds in place or moves to another position. |MAV_GOTO_DO_HOLD: pause mission and either hold or move to specified position (depending on param2), MAV_GOTO_DO_CONTINUE: resume mission.| MAV_GOTO_HOLD_AT_CURRENT_POSITION: hold at current position, MAV_GOTO_HOLD_AT_SPECIFIED_POSITION: hold at specified position.| Coordinate frame of hold point.| Desired yaw angle.| 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)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + MAV_CMD_COMPONENT_ARM_DISARM=400, /* Arms / Disarms a component |0: disarm, 1: arm| 0: arm-disarm unless prevented by safety checks (i.e. when landed), 21196: force arming/disarming (e.g. allow arming to override preflight checks and disarming in flight)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + MAV_CMD_ILLUMINATOR_ON_OFF=405, /* Turns illuminators ON/OFF. An illuminator is a light source that is used for lighting up dark areas external to the sytstem: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light). |0: Illuminators OFF, 1: Illuminators ON| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ MAV_CMD_GET_HOME_POSITION=410, /* Request the home position from the vehicle. |Reserved| Reserved| Reserved| Reserved| Reserved| Reserved| Reserved| */ - MAV_CMD_START_RX_PAIR=500, /* Starts receiver pairing |0:Spektrum| 0:Spektrum DSM2, 1:Spektrum DSMX| */ - MAV_CMD_GET_MESSAGE_INTERVAL=510, /* Request the interval between messages for a particular MAVLink message ID |The MAVLink message ID| */ - MAV_CMD_SET_MESSAGE_INTERVAL=511, /* Request the interval between messages for a particular MAVLink message ID. This interface replaces REQUEST_DATA_STREAM |The MAVLink message ID| The interval between two messages, in microseconds. Set to -1 to disable and 0 to request default rate.| */ - MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES=520, /* Request autopilot capabilities |1: Request autopilot version| Reserved (all remaining params)| */ - MAV_CMD_REQUEST_CAMERA_INFORMATION=521, /* WIP: Request camera information (CAMERA_INFORMATION) |1: Request camera capabilities| Camera ID| Reserved (all remaining params)| */ - MAV_CMD_REQUEST_CAMERA_SETTINGS=522, /* WIP: Request camera settings (CAMERA_SETTINGS) |1: Request camera settings| Camera ID| Reserved (all remaining params)| */ - MAV_CMD_SET_CAMERA_SETTINGS_1=523, /* WIP: Set the camera settings part 1 (CAMERA_SETTINGS) |Camera ID| Aperture (1/value)| Aperture locked (0: auto, 1: locked)| Shutter speed in s| Shutter speed locked (0: auto, 1: locked)| ISO sensitivity| ISO sensitivity locked (0: auto, 1: locked)| */ - MAV_CMD_SET_CAMERA_SETTINGS_2=524, /* WIP: Set the camera settings part 2 (CAMERA_SETTINGS) |Camera ID| White balance locked (0: auto, 1: locked)| White balance (color temperature in K)| Reserved for camera mode ID| Reserved for color mode ID| Reserved for image format ID| Reserved| */ - MAV_CMD_REQUEST_STORAGE_INFORMATION=525, /* WIP: Request storage information (STORAGE_INFORMATION) |1: Request storage information| Storage ID| Reserved (all remaining params)| */ - MAV_CMD_STORAGE_FORMAT=526, /* WIP: Format a storage medium |1: Format storage| Storage ID| Reserved (all remaining params)| */ - MAV_CMD_REQUEST_CAMERA_CAPTURE_STATUS=527, /* WIP: Request camera capture status (CAMERA_CAPTURE_STATUS) |1: Request camera capture status| Camera ID| Reserved (all remaining params)| */ - MAV_CMD_REQUEST_FLIGHT_INFORMATION=528, /* WIP: Request flight information (FLIGHT_INFORMATION) |1: Request flight information| Reserved (all remaining params)| */ - MAV_CMD_IMAGE_START_CAPTURE=2000, /* Start image capture sequence. Sends CAMERA_IMAGE_CAPTURED after each capture. |Duration between two consecutive pictures (in seconds)| Number of images to capture total - 0 for unlimited capture| Resolution in megapixels (0.3 for 640x480, 1.3 for 1280x720, etc), set to 0 if param 4/5 are used, set to -1 for highest resolution possible.| WIP: Resolution horizontal in pixels| WIP: Resolution horizontal in pixels| WIP: Camera ID| */ - MAV_CMD_IMAGE_STOP_CAPTURE=2001, /* Stop image capture sequence |Camera ID| Reserved| */ - MAV_CMD_DO_TRIGGER_CONTROL=2003, /* Enable or disable on-board camera triggering system. |Trigger enable/disable (0 for disable, 1 for start)| Shutter integration time (in ms)| Reserved| */ - MAV_CMD_VIDEO_START_CAPTURE=2500, /* Starts video capture (recording) |Camera ID (0 for all cameras), 1 for first, 2 for second, etc.| Frames per second, set to -1 for highest framerate possible.| Resolution in megapixels (0.3 for 640x480, 1.3 for 1280x720, etc), set to 0 if param 4/5 are used, set to -1 for highest resolution possible.| WIP: Resolution horizontal in pixels| WIP: Resolution horizontal in pixels| WIP: Frequency CAMERA_CAPTURE_STATUS messages should be sent while recording (0 for no messages, otherwise time in Hz)| */ - MAV_CMD_VIDEO_STOP_CAPTURE=2501, /* Stop the current video capture (recording) |WIP: Camera ID| Reserved| */ + MAV_CMD_INJECT_FAILURE=420, /* Inject artificial failure for testing purposes. Note that autopilots should implement an additional protection before accepting this command such as a specific param setting. |The unit which is affected by the failure.| The type how the failure manifests itself.| Instance affected by failure (0 to signal all).| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + MAV_CMD_START_RX_PAIR=500, /* Starts receiver pairing. |0:Spektrum.| RC type.| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + MAV_CMD_GET_MESSAGE_INTERVAL=510, /* Request the interval between messages for a particular MAVLink message ID. The receiver should ACK the command and then emit its response in a MESSAGE_INTERVAL message. |The MAVLink message ID| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + MAV_CMD_SET_MESSAGE_INTERVAL=511, /* Set the interval between messages for a particular MAVLink message ID. This interface replaces REQUEST_DATA_STREAM. |The MAVLink message ID| The interval between two messages. Set to -1 to disable and 0 to request default rate.| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Target address of message stream (if message has target address fields). 0: Flight-stack default (recommended), 1: address of requestor, 2: broadcast.| */ + MAV_CMD_REQUEST_MESSAGE=512, /* Request the target system(s) emit a single instance of a specified message (i.e. a "one-shot" version of MAV_CMD_SET_MESSAGE_INTERVAL). |The MAVLink message ID of the requested message.| Use for index ID, if required. Otherwise, the use of this parameter (if any) must be defined in the requested message. By default assumed not used (0).| The use of this parameter (if any), must be defined in the requested message. By default assumed not used (0).| The use of this parameter (if any), must be defined in the requested message. By default assumed not used (0).| The use of this parameter (if any), must be defined in the requested message. By default assumed not used (0).| The use of this parameter (if any), must be defined in the requested message. By default assumed not used (0).| Target address for requested message (if message has target address fields). 0: Flight-stack default, 1: address of requestor, 2: broadcast.| */ + MAV_CMD_REQUEST_PROTOCOL_VERSION=519, /* Request MAVLink protocol version compatibility. All receivers should ACK the command and then emit their capabilities in an PROTOCOL_VERSION message |1: Request supported protocol versions by all nodes on the network| Reserved (all remaining params)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES=520, /* Request autopilot capabilities. The receiver should ACK the command and then emit its capabilities in an AUTOPILOT_VERSION message |1: Request autopilot version| Reserved (all remaining params)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + MAV_CMD_REQUEST_CAMERA_INFORMATION=521, /* Request camera information (CAMERA_INFORMATION). |0: No action 1: Request camera capabilities| Reserved (all remaining params)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + MAV_CMD_REQUEST_CAMERA_SETTINGS=522, /* Request camera settings (CAMERA_SETTINGS). |0: No Action 1: Request camera settings| Reserved (all remaining params)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + MAV_CMD_REQUEST_STORAGE_INFORMATION=525, /* Request storage information (STORAGE_INFORMATION). Use the command's target_component to target a specific component's storage. |Storage ID (0 for all, 1 for first, 2 for second, etc.)| 0: No Action 1: Request storage information| Reserved (all remaining params)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + MAV_CMD_STORAGE_FORMAT=526, /* Format a storage medium. Once format is complete, a STORAGE_INFORMATION message is sent. Use the command's target_component to target a specific component's storage. |Storage ID (1 for first, 2 for second, etc.)| Format storage (and reset image log). 0: No action 1: Format storage| Reset Image Log (without formatting storage medium). This will reset CAMERA_CAPTURE_STATUS.image_count and CAMERA_IMAGE_CAPTURED.image_index. 0: No action 1: Reset Image Log| Reserved (all remaining params)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + MAV_CMD_REQUEST_CAMERA_CAPTURE_STATUS=527, /* Request camera capture status (CAMERA_CAPTURE_STATUS) |0: No Action 1: Request camera capture status| Reserved (all remaining params)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + MAV_CMD_REQUEST_FLIGHT_INFORMATION=528, /* Request flight information (FLIGHT_INFORMATION) |1: Request flight information| Reserved (all remaining params)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + MAV_CMD_RESET_CAMERA_SETTINGS=529, /* Reset all camera settings to Factory Default |0: No Action 1: Reset all settings| Reserved (all remaining params)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + MAV_CMD_SET_CAMERA_MODE=530, /* Set camera running mode. Use NaN for reserved values. GCS will send a MAV_CMD_REQUEST_VIDEO_STREAM_STATUS command after a mode change if the camera supports video streaming. |Reserved (Set to 0)| Camera mode| Reserved (default:NaN)| Reserved (default:NaN)| Reserved (default:0)| Reserved (default:0)| Reserved (default:NaN)| */ + MAV_CMD_SET_CAMERA_ZOOM=531, /* Set camera zoom. Camera must respond with a CAMERA_SETTINGS message (on success). |Zoom type| Zoom value. The range of valid values depend on the zoom type.| Reserved (default:NaN)| Reserved (default:NaN)| Reserved (default:0)| Reserved (default:0)| Reserved (default:NaN)| */ + MAV_CMD_SET_CAMERA_FOCUS=532, /* Set camera focus. Camera must respond with a CAMERA_SETTINGS message (on success). |Focus type| Focus value| Reserved (default:NaN)| Reserved (default:NaN)| Reserved (default:0)| Reserved (default:0)| Reserved (default:NaN)| */ + MAV_CMD_JUMP_TAG=600, /* Tagged jump target. Can be jumped to with MAV_CMD_DO_JUMP_TAG. |Tag.| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + MAV_CMD_DO_JUMP_TAG=601, /* Jump to the matching tag in the mission list. Repeat this action for the specified number of times. A mission should contain a single matching tag for each jump. If this is not the case then a jump to a missing tag should complete the mission, and a jump where there are multiple matching tags should always select the one with the lowest mission sequence number. |Target tag to jump to.| Repeat count.| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + MAV_CMD_DO_GIMBAL_MANAGER_TILTPAN=1000, /* High level setpoint to be sent to a gimbal manager to set a gimbal attitude. It is possible to set combinations of the values below. E.g. an angle as well as a desired angular rate can be used to get to this angle at a certain angular rate, or an angular rate only will result in continuous turning. NaN is to be used to signal unset. Note: a gimbal is never to react to this command but only the gimbal manager. |Tilt/pitch rate (positive to tilt up).| Pan/yaw rate (positive to pan to the right).| Tilt/pitch angle (positive to tilt up, relative to vehicle for PAN mode, relative to world horizon for HOLD mode).| Pan/yaw angle (positive to pan to the right, relative to vehicle for PAN mode, absolute to North for HOLD mode).| Gimbal manager flags to use.| Reserved (default:0)| Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. (Send command multiple times for more than one but not all gimbals.)| */ + MAV_CMD_IMAGE_START_CAPTURE=2000, /* Start image capture sequence. Sends CAMERA_IMAGE_CAPTURED after each capture. Use NaN for reserved values. |Reserved (Set to 0)| Desired elapsed time between two consecutive pictures (in seconds). Minimum values depend on hardware (typically greater than 2 seconds).| Total number of images to capture. 0 to capture forever/until MAV_CMD_IMAGE_STOP_CAPTURE.| Capture sequence number starting from 1. This is only valid for single-capture (param3 == 1). Increment the capture ID for each capture command to prevent double captures when a command is re-transmitted. Use 0 to ignore it.| Reserved (all remaining params)| Reserved (default:0)| Reserved (default:0)| */ + MAV_CMD_IMAGE_STOP_CAPTURE=2001, /* Stop image capture sequence Use NaN for reserved values. |Reserved (Set to 0)| Reserved (default:NaN)| Reserved (default:NaN)| Reserved (default:NaN)| Reserved (default:0)| Reserved (default:0)| Reserved (default:NaN)| */ + MAV_CMD_REQUEST_CAMERA_IMAGE_CAPTURE=2002, /* Re-request a CAMERA_IMAGE_CAPTURED message. |Sequence number for missing CAMERA_IMAGE_CAPTURED message| Reserved (default:NaN)| Reserved (default:NaN)| Reserved (default:NaN)| Reserved (default:0)| Reserved (default:0)| Reserved (default:NaN)| */ + MAV_CMD_DO_TRIGGER_CONTROL=2003, /* Enable or disable on-board camera triggering system. |Trigger enable/disable (0 for disable, 1 for start), -1 to ignore| 1 to reset the trigger sequence, -1 or 0 to ignore| 1 to pause triggering, but without switching the camera off or retracting it. -1 to ignore| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + MAV_CMD_CAMERA_TRACK_POINT=2004, /* If the camera supports point visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_POINT is set), this command allows to initiate the tracking. |Point to track x value (normalized 0..1, 0 is left, 1 is right).| Point to track y value (normalized 0..1, 0 is top, 1 is bottom).| Point radius (normalized 0..1, 0 is image left, 1 is image right).| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + MAV_CMD_CAMERA_TRACK_RECTANGLE=2005, /* If the camera supports rectangle visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE is set), this command allows to initiate the tracking. |Top left corner of rectangle x value (normalized 0..1, 0 is left, 1 is right).| Top left corner of rectangle y value (normalized 0..1, 0 is top, 1 is bottom).| Bottom right corner of rectangle x value (normalized 0..1, 0 is left, 1 is right).| Bottom right corner of rectangle y value (normalized 0..1, 0 is top, 1 is bottom).| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + MAV_CMD_CAMERA_STOP_TRACKING=2010, /* Stops ongoing tracking. |Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + MAV_CMD_VIDEO_START_CAPTURE=2500, /* Starts video capture (recording). |Video Stream ID (0 for all streams)| Frequency CAMERA_CAPTURE_STATUS messages should be sent while recording (0 for no messages, otherwise frequency)| Reserved (default:NaN)| Reserved (default:NaN)| Reserved (default:NaN)| Reserved (default:NaN)| Reserved (default:NaN)| */ + MAV_CMD_VIDEO_STOP_CAPTURE=2501, /* Stop the current video capture (recording). |Video Stream ID (0 for all streams)| Reserved (default:NaN)| Reserved (default:NaN)| Reserved (default:NaN)| Reserved (default:NaN)| Reserved (default:NaN)| Reserved (default:NaN)| */ + MAV_CMD_VIDEO_START_STREAMING=2502, /* Start video streaming |Video Stream ID (0 for all streams, 1 for first, 2 for second, etc.)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + MAV_CMD_VIDEO_STOP_STREAMING=2503, /* Stop the given video stream |Video Stream ID (0 for all streams, 1 for first, 2 for second, etc.)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + MAV_CMD_REQUEST_VIDEO_STREAM_INFORMATION=2504, /* Request video stream information (VIDEO_STREAM_INFORMATION) |Video Stream ID (0 for all streams, 1 for first, 2 for second, etc.)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + MAV_CMD_REQUEST_VIDEO_STREAM_STATUS=2505, /* Request video stream status (VIDEO_STREAM_STATUS) |Video Stream ID (0 for all streams, 1 for first, 2 for second, etc.)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ MAV_CMD_LOGGING_START=2510, /* Request to start streaming logging data over MAVLink (see also LOGGING_DATA message) |Format: 0: ULog| Reserved (set to 0)| Reserved (set to 0)| Reserved (set to 0)| Reserved (set to 0)| Reserved (set to 0)| Reserved (set to 0)| */ MAV_CMD_LOGGING_STOP=2511, /* Request to stop streaming log data over MAVLink |Reserved (set to 0)| Reserved (set to 0)| Reserved (set to 0)| Reserved (set to 0)| Reserved (set to 0)| Reserved (set to 0)| Reserved (set to 0)| */ - MAV_CMD_AIRFRAME_CONFIGURATION=2520, /* |Landing gear ID (default: 0, -1 for all)| Landing gear position (Down: 0, Up: 1, NAN for no change)| Reserved, set to NAN| Reserved, set to NAN| Reserved, set to NAN| Reserved, set to NAN| Reserved, set to NAN| */ - MAV_CMD_PANORAMA_CREATE=2800, /* Create a panorama at the current position |Viewing angle horizontal of the panorama (in degrees, +- 0.5 the total angle)| Viewing angle vertical of panorama (in degrees)| Speed of the horizontal rotation (in degrees per second)| Speed of the vertical rotation (in degrees per second)| */ - MAV_CMD_DO_VTOL_TRANSITION=3000, /* Request VTOL transition |The target VTOL state, as defined by ENUM MAV_VTOL_STATE. Only MAV_VTOL_STATE_MC and MAV_VTOL_STATE_FW can be used.| */ - MAV_CMD_SET_GUIDED_SUBMODE_STANDARD=4000, /* This command sets the submode to standard guided when vehicle is in guided mode. The vehicle holds position and altitude and the user can input the desired velocites along all three axes. - | */ + MAV_CMD_AIRFRAME_CONFIGURATION=2520, /* |Landing gear ID (default: 0, -1 for all)| Landing gear position (Down: 0, Up: 1, NaN for no change)| Reserved (default:NaN)| Reserved (default:NaN)| Reserved (default:NaN)| Reserved (default:NaN)| Reserved (default:NaN)| */ + MAV_CMD_CONTROL_HIGH_LATENCY=2600, /* Request to start/stop transmitting over the high latency telemetry |Control transmission over high latency telemetry (0: stop, 1: start)| Empty| Empty| Empty| Empty| Empty| Empty| */ + MAV_CMD_PANORAMA_CREATE=2800, /* Create a panorama at the current position |Viewing angle horizontal of the panorama (+- 0.5 the total angle)| Viewing angle vertical of panorama.| Speed of the horizontal rotation.| Speed of the vertical rotation.| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + MAV_CMD_DO_VTOL_TRANSITION=3000, /* Request VTOL transition |The target VTOL state. Only MAV_VTOL_STATE_MC and MAV_VTOL_STATE_FW can be used.| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + MAV_CMD_ARM_AUTHORIZATION_REQUEST=3001, /* Request authorization to arm the vehicle to a external entity, the arm authorizer is responsible to request all data that is needs from the vehicle before authorize or deny the request. If approved the progress of command_ack message should be set with period of time that this authorization is valid in seconds or in case it was denied it should be set with one of the reasons in ARM_AUTH_DENIED_REASON. + |Vehicle system id, this way ground station can request arm authorization on behalf of any vehicle| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + MAV_CMD_SET_GUIDED_SUBMODE_STANDARD=4000, /* This command sets the submode to standard guided when vehicle is in guided mode. The vehicle holds position and altitude and the user can input the desired velocities along all three axes. + |Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ MAV_CMD_SET_GUIDED_SUBMODE_CIRCLE=4001, /* This command sets submode circle when vehicle is in guided mode. Vehicle flies along a circle facing the center of the circle. The user can input the velocity along the circle and change the radius. If no input is given the vehicle will hold position. - |Radius of desired circle in CIRCLE_MODE| User defined| User defined| User defined| Unscaled target latitude of center of circle in CIRCLE_MODE| Unscaled target longitude of center of circle in CIRCLE_MODE| */ + |Radius of desired circle in CIRCLE_MODE| User defined| User defined| User defined| Target latitude of center of circle in CIRCLE_MODE| Target longitude of center of circle in CIRCLE_MODE| Reserved (default:0)| */ + MAV_CMD_CONDITION_GATE=4501, /* Delay mission state machine until gate has been reached. |Geometry: 0: orthogonal to path between previous and next waypoint.| Altitude: 0: ignore altitude| Empty| Empty| Latitude| Longitude| Altitude| */ MAV_CMD_NAV_FENCE_RETURN_POINT=5000, /* Fence return point. There can only be one fence return point. |Reserved| Reserved| Reserved| Reserved| Latitude| Longitude| Altitude| */ - MAV_CMD_NAV_FENCE_POLYGON_VERTEX_INCLUSION=5001, /* Fence vertex for an inclusion polygon. The vehicle must stay within this area. Minimum of 3 vertices required. + MAV_CMD_NAV_FENCE_POLYGON_VERTEX_INCLUSION=5001, /* Fence vertex for an inclusion polygon (the polygon must not be self-intersecting). The vehicle must stay within this area. Minimum of 3 vertices required. |Polygon vertex count| Reserved| Reserved| Reserved| Latitude| Longitude| Reserved| */ - MAV_CMD_NAV_FENCE_POLYGON_VERTEX_EXCLUSION=5002, /* Fence vertex for an exclusion polygon. The vehicle must stay outside this area. Minimum of 3 vertices required. + MAV_CMD_NAV_FENCE_POLYGON_VERTEX_EXCLUSION=5002, /* Fence vertex for an exclusion polygon (the polygon must not be self-intersecting). The vehicle must stay outside this area. Minimum of 3 vertices required. |Polygon vertex count| Reserved| Reserved| Reserved| Latitude| Longitude| Reserved| */ + MAV_CMD_NAV_FENCE_CIRCLE_INCLUSION=5003, /* Circular fence area. The vehicle must stay inside this area. + |Radius.| Reserved| Reserved| Reserved| Latitude| Longitude| Reserved| */ + MAV_CMD_NAV_FENCE_CIRCLE_EXCLUSION=5004, /* Circular fence area. The vehicle must stay outside this area. + |Radius.| Reserved| Reserved| Reserved| Latitude| Longitude| Reserved| */ MAV_CMD_NAV_RALLY_POINT=5100, /* Rally point. You can have multiple rally points defined. |Reserved| Reserved| Reserved| Reserved| Latitude| Longitude| Altitude| */ - MAV_CMD_PAYLOAD_PREPARE_DEPLOY=30001, /* Deploy payload on a Lat / Lon / Alt position. This includes the navigation to reach the required release position and velocity. |Operation mode. 0: prepare single payload deploy (overwriting previous requests), but do not execute it. 1: execute payload deploy immediately (rejecting further deploy commands during execution, but allowing abort). 2: add payload deploy to existing deployment list.| Desired approach vector in degrees compass heading (0..360). A negative value indicates the system can define the approach vector at will.| Desired ground speed at release time. This can be overriden by the airframe in case it needs to meet minimum airspeed. A negative value indicates the system can define the ground speed at will.| Minimum altitude clearance to the release position in meters. A negative value indicates the system can define the clearance at will.| Latitude unscaled for MISSION_ITEM or in 1e7 degrees for MISSION_ITEM_INT| Longitude unscaled for MISSION_ITEM or in 1e7 degrees for MISSION_ITEM_INT| Altitude, in meters AMSL| */ - MAV_CMD_PAYLOAD_CONTROL_DEPLOY=30002, /* Control the payload deployment. |Operation mode. 0: Abort deployment, continue normal mission. 1: switch to payload deploment mode. 100: delete first payload deployment request. 101: delete all payload deployment requests.| Reserved| Reserved| Reserved| Reserved| Reserved| Reserved| */ - MAV_CMD_WAYPOINT_USER_1=31000, /* User defined waypoint item. Ground Station will show the Vehicle as flying through this item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude, in meters AMSL| */ - MAV_CMD_WAYPOINT_USER_2=31001, /* User defined waypoint item. Ground Station will show the Vehicle as flying through this item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude, in meters AMSL| */ - MAV_CMD_WAYPOINT_USER_3=31002, /* User defined waypoint item. Ground Station will show the Vehicle as flying through this item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude, in meters AMSL| */ - MAV_CMD_WAYPOINT_USER_4=31003, /* User defined waypoint item. Ground Station will show the Vehicle as flying through this item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude, in meters AMSL| */ - MAV_CMD_WAYPOINT_USER_5=31004, /* User defined waypoint item. Ground Station will show the Vehicle as flying through this item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude, in meters AMSL| */ - MAV_CMD_SPATIAL_USER_1=31005, /* User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude, in meters AMSL| */ - MAV_CMD_SPATIAL_USER_2=31006, /* User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude, in meters AMSL| */ - MAV_CMD_SPATIAL_USER_3=31007, /* User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude, in meters AMSL| */ - MAV_CMD_SPATIAL_USER_4=31008, /* User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude, in meters AMSL| */ - MAV_CMD_SPATIAL_USER_5=31009, /* User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude, in meters AMSL| */ + MAV_CMD_UAVCAN_GET_NODE_INFO=5200, /* Commands the vehicle to respond with a sequence of messages UAVCAN_NODE_INFO, one message per every UAVCAN node that is online. Note that some of the response messages can be lost, which the receiver can detect easily by checking whether every received UAVCAN_NODE_STATUS has a matching message UAVCAN_NODE_INFO received earlier; if not, this command should be sent again in order to request re-transmission of the node information messages. |Reserved (set to 0)| Reserved (set to 0)| Reserved (set to 0)| Reserved (set to 0)| Reserved (set to 0)| Reserved (set to 0)| Reserved (set to 0)| */ + MAV_CMD_PAYLOAD_PREPARE_DEPLOY=30001, /* Deploy payload on a Lat / Lon / Alt position. This includes the navigation to reach the required release position and velocity. |Operation mode. 0: prepare single payload deploy (overwriting previous requests), but do not execute it. 1: execute payload deploy immediately (rejecting further deploy commands during execution, but allowing abort). 2: add payload deploy to existing deployment list.| Desired approach vector in compass heading. A negative value indicates the system can define the approach vector at will.| Desired ground speed at release time. This can be overridden by the airframe in case it needs to meet minimum airspeed. A negative value indicates the system can define the ground speed at will.| Minimum altitude clearance to the release position. A negative value indicates the system can define the clearance at will.| Latitude. Note, if used in MISSION_ITEM (deprecated) the units are degrees (unscaled)| Longitude. Note, if used in MISSION_ITEM (deprecated) the units are degrees (unscaled)| Altitude (MSL)| */ + MAV_CMD_PAYLOAD_CONTROL_DEPLOY=30002, /* Control the payload deployment. |Operation mode. 0: Abort deployment, continue normal mission. 1: switch to payload deployment mode. 100: delete first payload deployment request. 101: delete all payload deployment requests.| Reserved| Reserved| Reserved| Reserved| Reserved| Reserved| */ + MAV_CMD_WAYPOINT_USER_1=31000, /* User defined waypoint item. Ground Station will show the Vehicle as flying through this item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude (MSL)| */ + MAV_CMD_WAYPOINT_USER_2=31001, /* User defined waypoint item. Ground Station will show the Vehicle as flying through this item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude (MSL)| */ + MAV_CMD_WAYPOINT_USER_3=31002, /* User defined waypoint item. Ground Station will show the Vehicle as flying through this item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude (MSL)| */ + MAV_CMD_WAYPOINT_USER_4=31003, /* User defined waypoint item. Ground Station will show the Vehicle as flying through this item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude (MSL)| */ + MAV_CMD_WAYPOINT_USER_5=31004, /* User defined waypoint item. Ground Station will show the Vehicle as flying through this item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude (MSL)| */ + MAV_CMD_SPATIAL_USER_1=31005, /* User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude (MSL)| */ + MAV_CMD_SPATIAL_USER_2=31006, /* User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude (MSL)| */ + MAV_CMD_SPATIAL_USER_3=31007, /* User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude (MSL)| */ + MAV_CMD_SPATIAL_USER_4=31008, /* User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude (MSL)| */ + MAV_CMD_SPATIAL_USER_5=31009, /* User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude (MSL)| */ MAV_CMD_USER_1=31010, /* User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item. |User defined| User defined| User defined| User defined| User defined| User defined| User defined| */ MAV_CMD_USER_2=31011, /* User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item. |User defined| User defined| User defined| User defined| User defined| User defined| User defined| */ MAV_CMD_USER_3=31012, /* User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item. |User defined| User defined| User defined| User defined| User defined| User defined| User defined| */ @@ -479,7 +944,7 @@ typedef enum MAV_CMD } MAV_CMD; #endif -/** @brief THIS INTERFACE IS DEPRECATED AS OF JULY 2015. Please use MESSAGE_INTERVAL instead. A data stream is not a fixed set of messages, but rather a +/** @brief 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 @@ -499,7 +964,7 @@ typedef enum MAV_DATA_STREAM } MAV_DATA_STREAM; #endif -/** @brief The ROI (region of interest) for the vehicle. This can be +/** @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 @@ -507,8 +972,8 @@ typedef enum MAV_DATA_STREAM typedef enum MAV_ROI { MAV_ROI_NONE=0, /* No region of interest. | */ - MAV_ROI_WPNEXT=1, /* Point toward next MISSION. | */ - MAV_ROI_WPINDEX=2, /* Point toward given MISSION. | */ + MAV_ROI_WPNEXT=1, /* Point toward next waypoint, with optional pitch/roll/yaw offset. | */ + 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, /* | */ @@ -520,15 +985,15 @@ typedef enum MAV_ROI #define HAVE_ENUM_MAV_CMD_ACK typedef enum MAV_CMD_ACK { - MAV_CMD_ACK_OK=1, /* Command / mission item is ok. | */ - MAV_CMD_ACK_ERR_FAIL=2, /* Generic error message if none of the other reasons fails or if no detailed error reporting is implemented. | */ - MAV_CMD_ACK_ERR_ACCESS_DENIED=3, /* The system is refusing to accept this command from this source / communication partner. | */ - MAV_CMD_ACK_ERR_NOT_SUPPORTED=4, /* Command or mission item is not supported, other commands would be accepted. | */ - MAV_CMD_ACK_ERR_COORDINATE_FRAME_NOT_SUPPORTED=5, /* The coordinate frame of this command / mission item is not supported. | */ - MAV_CMD_ACK_ERR_COORDINATES_OUT_OF_RANGE=6, /* The coordinate frame of this command is ok, but he coordinate values exceed the safety limits of this system. This is a generic error, please use the more specific error messages below if possible. | */ - MAV_CMD_ACK_ERR_X_LAT_OUT_OF_RANGE=7, /* The X or latitude value is out of range. | */ - MAV_CMD_ACK_ERR_Y_LON_OUT_OF_RANGE=8, /* The Y or longitude value is out of range. | */ - MAV_CMD_ACK_ERR_Z_ALT_OUT_OF_RANGE=9, /* The Z or altitude value is out of range. | */ + MAV_CMD_ACK_OK=1, /* Command / mission item is ok. |Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + MAV_CMD_ACK_ERR_FAIL=2, /* Generic error message if none of the other reasons fails or if no detailed error reporting is implemented. |Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + MAV_CMD_ACK_ERR_ACCESS_DENIED=3, /* The system is refusing to accept this command from this source / communication partner. |Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + MAV_CMD_ACK_ERR_NOT_SUPPORTED=4, /* Command or mission item is not supported, other commands would be accepted. |Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + MAV_CMD_ACK_ERR_COORDINATE_FRAME_NOT_SUPPORTED=5, /* The coordinate frame of this command / mission item is not supported. |Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + 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. |Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + MAV_CMD_ACK_ERR_X_LAT_OUT_OF_RANGE=7, /* The X or latitude value is out of range. |Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + MAV_CMD_ACK_ERR_Y_LON_OUT_OF_RANGE=8, /* The Y or longitude value is out of range. |Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + MAV_CMD_ACK_ERR_Z_ALT_OUT_OF_RANGE=9, /* The Z or altitude value is out of range. |Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ MAV_CMD_ACK_ENUM_END=10, /* | */ } MAV_CMD_ACK; #endif @@ -552,41 +1017,64 @@ typedef enum MAV_PARAM_TYPE } MAV_PARAM_TYPE; #endif -/** @brief result from a mavlink command */ +/** @brief Specifies the datatype of a MAVLink extended parameter. */ +#ifndef HAVE_ENUM_MAV_PARAM_EXT_TYPE +#define HAVE_ENUM_MAV_PARAM_EXT_TYPE +typedef enum MAV_PARAM_EXT_TYPE +{ + MAV_PARAM_EXT_TYPE_UINT8=1, /* 8-bit unsigned integer | */ + MAV_PARAM_EXT_TYPE_INT8=2, /* 8-bit signed integer | */ + MAV_PARAM_EXT_TYPE_UINT16=3, /* 16-bit unsigned integer | */ + MAV_PARAM_EXT_TYPE_INT16=4, /* 16-bit signed integer | */ + MAV_PARAM_EXT_TYPE_UINT32=5, /* 32-bit unsigned integer | */ + MAV_PARAM_EXT_TYPE_INT32=6, /* 32-bit signed integer | */ + MAV_PARAM_EXT_TYPE_UINT64=7, /* 64-bit unsigned integer | */ + MAV_PARAM_EXT_TYPE_INT64=8, /* 64-bit signed integer | */ + MAV_PARAM_EXT_TYPE_REAL32=9, /* 32-bit floating-point | */ + MAV_PARAM_EXT_TYPE_REAL64=10, /* 64-bit floating-point | */ + MAV_PARAM_EXT_TYPE_CUSTOM=11, /* Custom Type | */ + MAV_PARAM_EXT_TYPE_ENUM_END=12, /* | */ +} MAV_PARAM_EXT_TYPE; +#endif + +/** @brief Result from a MAVLink command (MAV_CMD) */ #ifndef HAVE_ENUM_MAV_RESULT #define HAVE_ENUM_MAV_RESULT typedef enum MAV_RESULT { - MAV_RESULT_ACCEPTED=0, /* Command ACCEPTED and EXECUTED | */ - MAV_RESULT_TEMPORARILY_REJECTED=1, /* Command TEMPORARY REJECTED/DENIED | */ - MAV_RESULT_DENIED=2, /* Command PERMANENTLY DENIED | */ - MAV_RESULT_UNSUPPORTED=3, /* Command UNKNOWN/UNSUPPORTED | */ - MAV_RESULT_FAILED=4, /* Command executed, but failed | */ - MAV_RESULT_ENUM_END=5, /* | */ + MAV_RESULT_ACCEPTED=0, /* Command is valid (is supported and has valid parameters), and was executed. | */ + MAV_RESULT_TEMPORARILY_REJECTED=1, /* Command is valid, but cannot be executed at this time. This is used to indicate a problem that should be fixed just by waiting (e.g. a state machine is busy, can't arm because have not got GPS lock, etc.). Retrying later should work. | */ + MAV_RESULT_DENIED=2, /* Command is invalid (is supported but has invalid parameters). Retrying same command and parameters will not work. | */ + MAV_RESULT_UNSUPPORTED=3, /* Command is not supported (unknown). | */ + MAV_RESULT_FAILED=4, /* Command is valid, but execution has failed. This is used to indicate any non-temporary or unexpected problem, i.e. any problem that must be fixed before the command can succeed/be retried. For example, attempting to write a file when out of memory, attempting to arm when sensors are not calibrated, etc. | */ + MAV_RESULT_IN_PROGRESS=5, /* Command is valid and is being executed. This will be followed by further progress updates, i.e. the component may send further COMMAND_ACK messages with result MAV_RESULT_IN_PROGRESS (at a rate decided by the implementation), and must terminate by sending a COMMAND_ACK message with final result of the operation. The COMMAND_ACK.progress field can be used to indicate the progress of the operation. | */ + MAV_RESULT_CANCELLED=6, /* Command has been cancelled (as a result of receiving a COMMAND_CANCEL message). | */ + MAV_RESULT_ENUM_END=7, /* | */ } MAV_RESULT; #endif -/** @brief result in a mavlink mission ack */ +/** @brief Result of mission operation (in a MISSION_ACK message). */ #ifndef HAVE_ENUM_MAV_MISSION_RESULT #define HAVE_ENUM_MAV_MISSION_RESULT typedef enum MAV_MISSION_RESULT { MAV_MISSION_ACCEPTED=0, /* mission accepted OK | */ - MAV_MISSION_ERROR=1, /* generic error / not accepting mission commands at all right now | */ - MAV_MISSION_UNSUPPORTED_FRAME=2, /* coordinate frame is not supported | */ - MAV_MISSION_UNSUPPORTED=3, /* command is not supported | */ - MAV_MISSION_NO_SPACE=4, /* mission item exceeds storage space | */ - MAV_MISSION_INVALID=5, /* one of the parameters has an invalid value | */ - MAV_MISSION_INVALID_PARAM1=6, /* param1 has an invalid value | */ - MAV_MISSION_INVALID_PARAM2=7, /* param2 has an invalid value | */ - MAV_MISSION_INVALID_PARAM3=8, /* param3 has an invalid value | */ - MAV_MISSION_INVALID_PARAM4=9, /* param4 has an invalid value | */ - MAV_MISSION_INVALID_PARAM5_X=10, /* x/param5 has an invalid value | */ - MAV_MISSION_INVALID_PARAM6_Y=11, /* y/param6 has an invalid value | */ - MAV_MISSION_INVALID_PARAM7=12, /* param7 has an invalid value | */ - MAV_MISSION_INVALID_SEQUENCE=13, /* received waypoint out of sequence | */ - MAV_MISSION_DENIED=14, /* not accepting any mission commands from this communication partner | */ - MAV_MISSION_RESULT_ENUM_END=15, /* | */ + MAV_MISSION_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 items exceed 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, /* z / param7 has an invalid value. | */ + MAV_MISSION_INVALID_SEQUENCE=13, /* Mission item received out of sequence | */ + MAV_MISSION_DENIED=14, /* Not accepting any mission commands from this communication partner. | */ + MAV_MISSION_OPERATION_CANCELLED=15, /* Current mission operation cancelled (e.g. mission upload, mission download). | */ + MAV_MISSION_RESULT_ENUM_END=16, /* | */ } MAV_MISSION_RESULT; #endif @@ -600,7 +1088,7 @@ typedef enum MAV_SEVERITY 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_NOTICE=5, /* An unusual event has occurred, 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, /* | */ @@ -632,7 +1120,17 @@ typedef enum SERIAL_CONTROL_DEV SERIAL_CONTROL_DEV_GPS1=2, /* First GPS port | */ SERIAL_CONTROL_DEV_GPS2=3, /* Second GPS port | */ SERIAL_CONTROL_DEV_SHELL=10, /* system shell | */ - SERIAL_CONTROL_DEV_ENUM_END=11, /* | */ + SERIAL_CONTROL_SERIAL0=100, /* SERIAL0 | */ + SERIAL_CONTROL_SERIAL1=101, /* SERIAL1 | */ + SERIAL_CONTROL_SERIAL2=102, /* SERIAL2 | */ + SERIAL_CONTROL_SERIAL3=103, /* SERIAL3 | */ + SERIAL_CONTROL_SERIAL4=104, /* SERIAL4 | */ + SERIAL_CONTROL_SERIAL5=105, /* SERIAL5 | */ + SERIAL_CONTROL_SERIAL6=106, /* SERIAL6 | */ + SERIAL_CONTROL_SERIAL7=107, /* SERIAL7 | */ + SERIAL_CONTROL_SERIAL8=108, /* SERIAL8 | */ + SERIAL_CONTROL_SERIAL9=109, /* SERIAL9 | */ + SERIAL_CONTROL_DEV_ENUM_END=110, /* | */ } SERIAL_CONTROL_DEV; #endif @@ -658,7 +1156,9 @@ typedef enum MAV_DISTANCE_SENSOR MAV_DISTANCE_SENSOR_LASER=0, /* Laser rangefinder, e.g. LightWare SF02/F or PulsedLight units | */ MAV_DISTANCE_SENSOR_ULTRASOUND=1, /* Ultrasound rangefinder, e.g. MaxBotix units | */ MAV_DISTANCE_SENSOR_INFRARED=2, /* Infrared rangefinder, e.g. Sharp units | */ - MAV_DISTANCE_SENSOR_ENUM_END=3, /* | */ + MAV_DISTANCE_SENSOR_RADAR=3, /* Radar type, e.g. uLanding units | */ + MAV_DISTANCE_SENSOR_UNKNOWN=4, /* Broken or unknown type, e.g. analog units | */ + MAV_DISTANCE_SENSOR_ENUM_END=5, /* | */ } MAV_DISTANCE_SENSOR; #endif @@ -705,8 +1205,12 @@ typedef enum MAV_SENSOR_ORIENTATION MAV_SENSOR_ROTATION_ROLL_270_PITCH_270=35, /* Roll: 270, Pitch: 270, Yaw: 0 | */ MAV_SENSOR_ROTATION_ROLL_90_PITCH_180_YAW_90=36, /* Roll: 90, Pitch: 180, Yaw: 90 | */ MAV_SENSOR_ROTATION_ROLL_90_YAW_270=37, /* Roll: 90, Pitch: 0, Yaw: 270 | */ - MAV_SENSOR_ROTATION_ROLL_315_PITCH_315_YAW_315=38, /* Roll: 315, Pitch: 315, Yaw: 315 | */ - MAV_SENSOR_ORIENTATION_ENUM_END=39, /* | */ + MAV_SENSOR_ROTATION_ROLL_90_PITCH_68_YAW_293=38, /* Roll: 90, Pitch: 68, Yaw: 293 | */ + MAV_SENSOR_ROTATION_PITCH_315=39, /* Pitch: 315 | */ + MAV_SENSOR_ROTATION_ROLL_90_PITCH_315=40, /* Roll: 90, Pitch: 315 | */ + MAV_SENSOR_ROTATION_ROLL_270_YAW_180=41, /* Roll: 270, Yaw: 180 | */ + MAV_SENSOR_ROTATION_CUSTOM=100, /* Custom orientation | */ + MAV_SENSOR_ORIENTATION_ENUM_END=101, /* | */ } MAV_SENSOR_ORIENTATION; #endif @@ -717,7 +1221,7 @@ typedef enum MAV_PROTOCOL_CAPABILITY { MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT=1, /* Autopilot supports MISSION float message type. | */ MAV_PROTOCOL_CAPABILITY_PARAM_FLOAT=2, /* Autopilot supports the new param float message type. | */ - MAV_PROTOCOL_CAPABILITY_MISSION_INT=4, /* Autopilot supports MISSION_INT scaled integer message type. | */ + MAV_PROTOCOL_CAPABILITY_MISSION_INT=4, /* Autopilot supports MISSION_ITEM_INT scaled integer message type. | */ MAV_PROTOCOL_CAPABILITY_COMMAND_INT=8, /* Autopilot supports COMMAND_INT scaled integer message type. | */ MAV_PROTOCOL_CAPABILITY_PARAM_UNION=16, /* Autopilot supports the new param union message type. | */ MAV_PROTOCOL_CAPABILITY_FTP=32, /* Autopilot supports the new FILE_TRANSFER_PROTOCOL message type. | */ @@ -728,10 +1232,11 @@ typedef enum MAV_PROTOCOL_CAPABILITY MAV_PROTOCOL_CAPABILITY_SET_ACTUATOR_TARGET=1024, /* Autopilot supports direct actuator control. | */ MAV_PROTOCOL_CAPABILITY_FLIGHT_TERMINATION=2048, /* Autopilot supports the flight termination command. | */ MAV_PROTOCOL_CAPABILITY_COMPASS_CALIBRATION=4096, /* Autopilot supports onboard compass calibration. | */ - MAV_PROTOCOL_CAPABILITY_MAVLINK2=8192, /* Autopilot supports mavlink version 2. | */ + MAV_PROTOCOL_CAPABILITY_MAVLINK2=8192, /* Autopilot supports MAVLink version 2. | */ MAV_PROTOCOL_CAPABILITY_MISSION_FENCE=16384, /* Autopilot supports mission fence protocol. | */ MAV_PROTOCOL_CAPABILITY_MISSION_RALLY=32768, /* Autopilot supports mission rally point protocol. | */ - MAV_PROTOCOL_CAPABILITY_ENUM_END=32769, /* | */ + MAV_PROTOCOL_CAPABILITY_FLIGHT_INFORMATION=65536, /* Autopilot supports the flight information protocol. | */ + MAV_PROTOCOL_CAPABILITY_ENUM_END=65537, /* | */ } MAV_PROTOCOL_CAPABILITY; #endif @@ -741,8 +1246,8 @@ typedef enum MAV_PROTOCOL_CAPABILITY typedef enum MAV_MISSION_TYPE { MAV_MISSION_TYPE_MISSION=0, /* Items are mission commands for main mission. | */ - MAV_MISSION_TYPE_FENCE=1, /* Specifies GeoFence area(s). Items are MAV_CMD_FENCE_ GeoFence items. | */ - MAV_MISSION_TYPE_RALLY=2, /* Specifies the rally points for the vehicle. Rally points are alternative RTL points. Items are MAV_CMD_RALLY_POINT rally point items. | */ + MAV_MISSION_TYPE_FENCE=1, /* Specifies GeoFence area(s). Items are MAV_CMD_NAV_FENCE_ GeoFence items. | */ + MAV_MISSION_TYPE_RALLY=2, /* Specifies the rally points for the vehicle. Rally points are alternative RTL points. Items are MAV_CMD_NAV_RALLY_POINT rally point items. | */ MAV_MISSION_TYPE_ALL=255, /* Only used in MISSION_CLEAR_ALL to clear all mission types. | */ MAV_MISSION_TYPE_ENUM_END=256, /* | */ } MAV_MISSION_TYPE; @@ -753,12 +1258,16 @@ typedef enum MAV_MISSION_TYPE #define HAVE_ENUM_MAV_ESTIMATOR_TYPE typedef enum MAV_ESTIMATOR_TYPE { + MAV_ESTIMATOR_TYPE_UNKNOWN=0, /* Unknown type of the estimator. | */ MAV_ESTIMATOR_TYPE_NAIVE=1, /* This is a naive estimator without any real covariance feedback. | */ MAV_ESTIMATOR_TYPE_VISION=2, /* Computer vision based estimate. Might be up to scale. | */ MAV_ESTIMATOR_TYPE_VIO=3, /* Visual-inertial estimate. | */ MAV_ESTIMATOR_TYPE_GPS=4, /* Plain GPS estimate. | */ MAV_ESTIMATOR_TYPE_GPS_INS=5, /* Estimator integrating GPS and inertial sensing. | */ - MAV_ESTIMATOR_TYPE_ENUM_END=6, /* | */ + MAV_ESTIMATOR_TYPE_MOCAP=6, /* Estimate from external motion capturing system. | */ + MAV_ESTIMATOR_TYPE_LIDAR=7, /* Estimator based on lidar sensor input. | */ + MAV_ESTIMATOR_TYPE_AUTOPILOT=8, /* Estimator on autopilot. | */ + MAV_ESTIMATOR_TYPE_ENUM_END=9, /* | */ } MAV_ESTIMATOR_TYPE; #endif @@ -790,6 +1299,70 @@ typedef enum MAV_BATTERY_FUNCTION } MAV_BATTERY_FUNCTION; #endif +/** @brief Enumeration for battery charge states. */ +#ifndef HAVE_ENUM_MAV_BATTERY_CHARGE_STATE +#define HAVE_ENUM_MAV_BATTERY_CHARGE_STATE +typedef enum MAV_BATTERY_CHARGE_STATE +{ + MAV_BATTERY_CHARGE_STATE_UNDEFINED=0, /* Low battery state is not provided | */ + MAV_BATTERY_CHARGE_STATE_OK=1, /* Battery is not in low state. Normal operation. | */ + MAV_BATTERY_CHARGE_STATE_LOW=2, /* Battery state is low, warn and monitor close. | */ + MAV_BATTERY_CHARGE_STATE_CRITICAL=3, /* Battery state is critical, return or abort immediately. | */ + MAV_BATTERY_CHARGE_STATE_EMERGENCY=4, /* Battery state is too low for ordinary abort sequence. Perform fastest possible emergency stop to prevent damage. | */ + MAV_BATTERY_CHARGE_STATE_FAILED=5, /* Battery failed, damage unavoidable. | */ + MAV_BATTERY_CHARGE_STATE_UNHEALTHY=6, /* Battery is diagnosed to be defective or an error occurred, usage is discouraged / prohibited. | */ + MAV_BATTERY_CHARGE_STATE_CHARGING=7, /* Battery is charging. | */ + MAV_BATTERY_CHARGE_STATE_ENUM_END=8, /* | */ +} MAV_BATTERY_CHARGE_STATE; +#endif + +/** @brief Smart battery supply status/fault flags (bitmask) for health indication. */ +#ifndef HAVE_ENUM_MAV_SMART_BATTERY_FAULT +#define HAVE_ENUM_MAV_SMART_BATTERY_FAULT +typedef enum MAV_SMART_BATTERY_FAULT +{ + MAV_SMART_BATTERY_FAULT_DEEP_DISCHARGE=1, /* Battery has deep discharged. | */ + MAV_SMART_BATTERY_FAULT_SPIKES=2, /* Voltage spikes. | */ + MAV_SMART_BATTERY_FAULT_SINGLE_CELL_FAIL=4, /* Single cell has failed. | */ + MAV_SMART_BATTERY_FAULT_OVER_CURRENT=8, /* Over-current fault. | */ + MAV_SMART_BATTERY_FAULT_OVER_TEMPERATURE=16, /* Over-temperature fault. | */ + MAV_SMART_BATTERY_FAULT_UNDER_TEMPERATURE=32, /* Under-temperature fault. | */ + MAV_SMART_BATTERY_FAULT_ENUM_END=33, /* | */ +} MAV_SMART_BATTERY_FAULT; +#endif + +/** @brief Flags to report status/failure cases for a power generator (used in GENERATOR_STATUS). Note that FAULTS are conditions that cause the generator to fail. Warnings are conditions that require attention before the next use (they indicate the system is not operating properly). */ +#ifndef HAVE_ENUM_MAV_GENERATOR_STATUS_FLAG +#define HAVE_ENUM_MAV_GENERATOR_STATUS_FLAG +typedef enum MAV_GENERATOR_STATUS_FLAG +{ + MAV_GENERATOR_STATUS_FLAG_OFF=1, /* Generator is off. | */ + MAV_GENERATOR_STATUS_FLAG_READY=2, /* Generator is ready to start generating power. | */ + MAV_GENERATOR_STATUS_FLAG_GENERATING=4, /* Generator is generating power. | */ + MAV_GENERATOR_STATUS_FLAG_CHARGING=8, /* Generator is charging the batteries (generating enough power to charge and provide the load). | */ + MAV_GENERATOR_STATUS_FLAG_REDUCED_POWER=16, /* Generator is operating at a reduced maximum power. | */ + MAV_GENERATOR_STATUS_FLAG_MAXPOWER=32, /* Generator is providing the maximum output. | */ + MAV_GENERATOR_STATUS_FLAG_OVERTEMP_WARNING=64, /* Generator is near the maximum operating temperature, cooling is insufficient. | */ + MAV_GENERATOR_STATUS_FLAG_OVERTEMP_FAULT=128, /* Generator hit the maximum operating temperature and shutdown. | */ + MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_WARNING=256, /* Power electronics are near the maximum operating temperature, cooling is insufficient. | */ + MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_FAULT=512, /* Power electronics hit the maximum operating temperature and shutdown. | */ + MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_FAULT=1024, /* Power electronics experienced a fault and shutdown. | */ + MAV_GENERATOR_STATUS_FLAG_POWERSOURCE_FAULT=2048, /* The power source supplying the generator failed e.g. mechanical generator stopped, tether is no longer providing power, solar cell is in shade, hydrogen reaction no longer happening. | */ + MAV_GENERATOR_STATUS_FLAG_COMMUNICATION_WARNING=4096, /* Generator controller having communication problems. | */ + MAV_GENERATOR_STATUS_FLAG_COOLING_WARNING=8192, /* Power electronic or generator cooling system error. | */ + MAV_GENERATOR_STATUS_FLAG_POWER_RAIL_FAULT=16384, /* Generator controller power rail experienced a fault. | */ + MAV_GENERATOR_STATUS_FLAG_OVERCURRENT_FAULT=32768, /* Generator controller exceeded the overcurrent threshold and shutdown to prevent damage. | */ + MAV_GENERATOR_STATUS_FLAG_BATTERY_OVERCHARGE_CURRENT_FAULT=65536, /* Generator controller detected a high current going into the batteries and shutdown to prevent battery damage. | */ + MAV_GENERATOR_STATUS_FLAG_OVERVOLTAGE_FAULT=131072, /* Generator controller exceeded it's overvoltage threshold and shutdown to prevent it exceeding the voltage rating. | */ + MAV_GENERATOR_STATUS_FLAG_BATTERY_UNDERVOLT_FAULT=262144, /* Batteries are under voltage (generator will not start). | */ + MAV_GENERATOR_STATUS_FLAG_START_INHIBITED=524288, /* Generator start is inhibited by e.g. a safety switch. | */ + MAV_GENERATOR_STATUS_FLAG_MAINTENANCE_REQUIRED=1048576, /* Generator requires maintenance. | */ + MAV_GENERATOR_STATUS_FLAG_WARMING_UP=2097152, /* Generator is not ready to generate yet. | */ + MAV_GENERATOR_STATUS_FLAG_IDLE=4194304, /* Generator is idle. | */ + MAV_GENERATOR_STATUS_FLAG_ENUM_END=4194305, /* | */ +} MAV_GENERATOR_STATUS_FLAG; +#endif + /** @brief Enumeration of VTOL states */ #ifndef HAVE_ENUM_MAV_VTOL_STATE #define HAVE_ENUM_MAV_VTOL_STATE @@ -812,7 +1385,9 @@ typedef enum MAV_LANDED_STATE MAV_LANDED_STATE_UNDEFINED=0, /* MAV landed state is unknown | */ MAV_LANDED_STATE_ON_GROUND=1, /* MAV is landed (on ground) | */ MAV_LANDED_STATE_IN_AIR=2, /* MAV is in air | */ - MAV_LANDED_STATE_ENUM_END=3, /* | */ + MAV_LANDED_STATE_TAKEOFF=3, /* MAV currently taking off | */ + MAV_LANDED_STATE_LANDING=4, /* MAV currently landing | */ + MAV_LANDED_STATE_ENUM_END=5, /* | */ } MAV_LANDED_STATE; #endif @@ -868,11 +1443,14 @@ typedef enum ADSB_FLAGS ADSB_FLAGS_VALID_CALLSIGN=16, /* | */ ADSB_FLAGS_VALID_SQUAWK=32, /* | */ ADSB_FLAGS_SIMULATED=64, /* | */ - ADSB_FLAGS_ENUM_END=65, /* | */ + ADSB_FLAGS_VERTICAL_VELOCITY_VALID=128, /* | */ + ADSB_FLAGS_BARO_VALID=256, /* | */ + ADSB_FLAGS_SOURCE_UAT=32768, /* | */ + ADSB_FLAGS_ENUM_END=32769, /* | */ } ADSB_FLAGS; #endif -/** @brief Bitmask of options for the MAV_CMD_DO_REPOSITION */ +/** @brief Bitmap of options for the MAV_CMD_DO_REPOSITION */ #ifndef HAVE_ENUM_MAV_DO_REPOSITION_FLAGS #define HAVE_ENUM_MAV_DO_REPOSITION_FLAGS typedef enum MAV_DO_REPOSITION_FLAGS @@ -882,7 +1460,7 @@ typedef enum MAV_DO_REPOSITION_FLAGS } MAV_DO_REPOSITION_FLAGS; #endif -/** @brief Flags in EKF_STATUS message */ +/** @brief Flags in ESTIMATOR_STATUS message */ #ifndef HAVE_ENUM_ESTIMATOR_STATUS_FLAGS #define HAVE_ENUM_ESTIMATOR_STATUS_FLAGS typedef enum ESTIMATOR_STATUS_FLAGS @@ -898,10 +1476,23 @@ typedef enum ESTIMATOR_STATUS_FLAGS ESTIMATOR_PRED_POS_HORIZ_REL=256, /* True if the EKF has sufficient data to enter a mode that will provide a (relative) position estimate | */ ESTIMATOR_PRED_POS_HORIZ_ABS=512, /* True if the EKF has sufficient data to enter a mode that will provide a (absolute) position estimate | */ ESTIMATOR_GPS_GLITCH=1024, /* True if the EKF has detected a GPS glitch | */ - ESTIMATOR_STATUS_FLAGS_ENUM_END=1025, /* | */ + ESTIMATOR_ACCEL_ERROR=2048, /* True if the EKF has detected bad accelerometer data | */ + ESTIMATOR_STATUS_FLAGS_ENUM_END=2049, /* | */ } ESTIMATOR_STATUS_FLAGS; #endif +/** @brief */ +#ifndef HAVE_ENUM_MOTOR_TEST_ORDER +#define HAVE_ENUM_MOTOR_TEST_ORDER +typedef enum MOTOR_TEST_ORDER +{ + MOTOR_TEST_ORDER_DEFAULT=0, /* default autopilot motor test method | */ + MOTOR_TEST_ORDER_SEQUENCE=1, /* motor numbers are specified as their index in a predefined vehicle-specific sequence | */ + MOTOR_TEST_ORDER_BOARD=2, /* motor numbers are specified as the output as labeled on the board | */ + MOTOR_TEST_ORDER_ENUM_END=3, /* | */ +} MOTOR_TEST_ORDER; +#endif + /** @brief */ #ifndef HAVE_ENUM_MOTOR_TEST_THROTTLE_TYPE #define HAVE_ENUM_MOTOR_TEST_THROTTLE_TYPE @@ -910,7 +1501,8 @@ typedef enum MOTOR_TEST_THROTTLE_TYPE MOTOR_TEST_THROTTLE_PERCENT=0, /* throttle as a percentage from 0 ~ 100 | */ MOTOR_TEST_THROTTLE_PWM=1, /* throttle as an absolute PWM value (normally in range of 1000~2000) | */ MOTOR_TEST_THROTTLE_PILOT=2, /* throttle pass-through from pilot's transmitter | */ - MOTOR_TEST_THROTTLE_TYPE_ENUM_END=3, /* | */ + MOTOR_TEST_COMPASS_CAL=3, /* per-motor compass calibration test | */ + MOTOR_TEST_THROTTLE_TYPE_ENUM_END=4, /* | */ } MOTOR_TEST_THROTTLE_TYPE; #endif @@ -954,7 +1546,7 @@ typedef enum MAV_COLLISION_THREAT_LEVEL { MAV_COLLISION_THREAT_LEVEL_NONE=0, /* Not a threat | */ MAV_COLLISION_THREAT_LEVEL_LOW=1, /* Craft is mildly concerned about this threat | */ - MAV_COLLISION_THREAT_LEVEL_HIGH=2, /* Craft is panicing, and may take actions to avoid threat | */ + MAV_COLLISION_THREAT_LEVEL_HIGH=2, /* Craft is panicking, and may take actions to avoid threat | */ MAV_COLLISION_THREAT_LEVEL_ENUM_END=3, /* | */ } MAV_COLLISION_THREAT_LEVEL; #endif @@ -983,10 +1575,811 @@ typedef enum GPS_FIX_TYPE GPS_FIX_TYPE_RTK_FLOAT=5, /* RTK float, 3D position | */ GPS_FIX_TYPE_RTK_FIXED=6, /* RTK Fixed, 3D position | */ GPS_FIX_TYPE_STATIC=7, /* Static fixed, typically used for base stations | */ - GPS_FIX_TYPE_ENUM_END=8, /* | */ + GPS_FIX_TYPE_PPP=8, /* PPP, 3D position. | */ + GPS_FIX_TYPE_ENUM_END=9, /* | */ } GPS_FIX_TYPE; #endif +/** @brief RTK GPS baseline coordinate system, used for RTK corrections */ +#ifndef HAVE_ENUM_RTK_BASELINE_COORDINATE_SYSTEM +#define HAVE_ENUM_RTK_BASELINE_COORDINATE_SYSTEM +typedef enum RTK_BASELINE_COORDINATE_SYSTEM +{ + RTK_BASELINE_COORDINATE_SYSTEM_ECEF=0, /* Earth-centered, Earth-fixed | */ + RTK_BASELINE_COORDINATE_SYSTEM_NED=1, /* RTK basestation centered, north, east, down | */ + RTK_BASELINE_COORDINATE_SYSTEM_ENUM_END=2, /* | */ +} RTK_BASELINE_COORDINATE_SYSTEM; +#endif + +/** @brief Type of landing target */ +#ifndef HAVE_ENUM_LANDING_TARGET_TYPE +#define HAVE_ENUM_LANDING_TARGET_TYPE +typedef enum LANDING_TARGET_TYPE +{ + LANDING_TARGET_TYPE_LIGHT_BEACON=0, /* Landing target signaled by light beacon (ex: IR-LOCK) | */ + LANDING_TARGET_TYPE_RADIO_BEACON=1, /* Landing target signaled by radio beacon (ex: ILS, NDB) | */ + LANDING_TARGET_TYPE_VISION_FIDUCIAL=2, /* Landing target represented by a fiducial marker (ex: ARTag) | */ + LANDING_TARGET_TYPE_VISION_OTHER=3, /* Landing target represented by a pre-defined visual shape/feature (ex: X-marker, H-marker, square) | */ + LANDING_TARGET_TYPE_ENUM_END=4, /* | */ +} LANDING_TARGET_TYPE; +#endif + +/** @brief Direction of VTOL transition */ +#ifndef HAVE_ENUM_VTOL_TRANSITION_HEADING +#define HAVE_ENUM_VTOL_TRANSITION_HEADING +typedef enum VTOL_TRANSITION_HEADING +{ + VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT=0, /* Respect the heading configuration of the vehicle. | */ + VTOL_TRANSITION_HEADING_NEXT_WAYPOINT=1, /* Use the heading pointing towards the next waypoint. | */ + VTOL_TRANSITION_HEADING_TAKEOFF=2, /* Use the heading on takeoff (while sitting on the ground). | */ + VTOL_TRANSITION_HEADING_SPECIFIED=3, /* Use the specified heading in parameter 4. | */ + VTOL_TRANSITION_HEADING_ANY=4, /* Use the current heading when reaching takeoff altitude (potentially facing the wind when weather-vaning is active). | */ + VTOL_TRANSITION_HEADING_ENUM_END=5, /* | */ +} VTOL_TRANSITION_HEADING; +#endif + +/** @brief Camera capability flags (Bitmap) */ +#ifndef HAVE_ENUM_CAMERA_CAP_FLAGS +#define HAVE_ENUM_CAMERA_CAP_FLAGS +typedef enum CAMERA_CAP_FLAGS +{ + CAMERA_CAP_FLAGS_CAPTURE_VIDEO=1, /* Camera is able to record video | */ + CAMERA_CAP_FLAGS_CAPTURE_IMAGE=2, /* Camera is able to capture images | */ + CAMERA_CAP_FLAGS_HAS_MODES=4, /* Camera has separate Video and Image/Photo modes (MAV_CMD_SET_CAMERA_MODE) | */ + CAMERA_CAP_FLAGS_CAN_CAPTURE_IMAGE_IN_VIDEO_MODE=8, /* Camera can capture images while in video mode | */ + CAMERA_CAP_FLAGS_CAN_CAPTURE_VIDEO_IN_IMAGE_MODE=16, /* Camera can capture videos while in Photo/Image mode | */ + CAMERA_CAP_FLAGS_HAS_IMAGE_SURVEY_MODE=32, /* Camera has image survey mode (MAV_CMD_SET_CAMERA_MODE) | */ + CAMERA_CAP_FLAGS_HAS_BASIC_ZOOM=64, /* Camera has basic zoom control (MAV_CMD_SET_CAMERA_ZOOM) | */ + CAMERA_CAP_FLAGS_HAS_BASIC_FOCUS=128, /* Camera has basic focus control (MAV_CMD_SET_CAMERA_FOCUS) | */ + CAMERA_CAP_FLAGS_HAS_VIDEO_STREAM=256, /* Camera has video streaming capabilities (request VIDEO_STREAM_INFORMATION with MAV_CMD_REQUEST_MESSAGE for video streaming info) | */ + CAMERA_CAP_FLAGS_HAS_TRACKING_POINT=512, /* Camera supports tracking of a point on the camera view. | */ + CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE=1024, /* Camera supports tracking of a selection rectangle on the camera view. | */ + CAMERA_CAP_FLAGS_HAS_TRACKING_GEO_STATUS=2048, /* Camera supports tracking geo status (CAMERA_TRACKING_GEO_STATUS). | */ + CAMERA_CAP_FLAGS_ENUM_END=2049, /* | */ +} CAMERA_CAP_FLAGS; +#endif + +/** @brief Stream status flags (Bitmap) */ +#ifndef HAVE_ENUM_VIDEO_STREAM_STATUS_FLAGS +#define HAVE_ENUM_VIDEO_STREAM_STATUS_FLAGS +typedef enum VIDEO_STREAM_STATUS_FLAGS +{ + VIDEO_STREAM_STATUS_FLAGS_RUNNING=1, /* Stream is active (running) | */ + VIDEO_STREAM_STATUS_FLAGS_THERMAL=2, /* Stream is thermal imaging | */ + VIDEO_STREAM_STATUS_FLAGS_ENUM_END=3, /* | */ +} VIDEO_STREAM_STATUS_FLAGS; +#endif + +/** @brief Video stream types */ +#ifndef HAVE_ENUM_VIDEO_STREAM_TYPE +#define HAVE_ENUM_VIDEO_STREAM_TYPE +typedef enum VIDEO_STREAM_TYPE +{ + VIDEO_STREAM_TYPE_RTSP=0, /* Stream is RTSP | */ + VIDEO_STREAM_TYPE_RTPUDP=1, /* Stream is RTP UDP (URI gives the port number) | */ + VIDEO_STREAM_TYPE_TCP_MPEG=2, /* Stream is MPEG on TCP | */ + VIDEO_STREAM_TYPE_MPEG_TS_H264=3, /* Stream is h.264 on MPEG TS (URI gives the port number) | */ + VIDEO_STREAM_TYPE_ENUM_END=4, /* | */ +} VIDEO_STREAM_TYPE; +#endif + +/** @brief Camera tracking status flags */ +#ifndef HAVE_ENUM_CAMERA_TRACKING_STATUS_FLAGS +#define HAVE_ENUM_CAMERA_TRACKING_STATUS_FLAGS +typedef enum CAMERA_TRACKING_STATUS_FLAGS +{ + CAMERA_TRACKING_STATUS_FLAGS_IDLE=0, /* Camera is not tracking | */ + CAMERA_TRACKING_STATUS_FLAGS_ACTIVE=1, /* Camera is tracking | */ + CAMERA_TRACKING_STATUS_FLAGS_ERROR=2, /* Camera tracking in error state | */ + CAMERA_TRACKING_STATUS_FLAGS_ENUM_END=3, /* | */ +} CAMERA_TRACKING_STATUS_FLAGS; +#endif + +/** @brief Camera tracking modes */ +#ifndef HAVE_ENUM_CAMERA_TRACKING_MODE +#define HAVE_ENUM_CAMERA_TRACKING_MODE +typedef enum CAMERA_TRACKING_MODE +{ + CAMERA_TRACKING_NONE=0, /* Not tracking | */ + CAMERA_TRACKING_POINT=1, /* Target is a point | */ + CAMERA_TRACKING_RECTANGLE=2, /* Target is a rectangle | */ + CAMERA_TRACKING_MODE_ENUM_END=3, /* | */ +} CAMERA_TRACKING_MODE; +#endif + +/** @brief Camera tracking target data (shows where tracked target is within image) */ +#ifndef HAVE_ENUM_CAMERA_TRACKING_TARGET_DATA +#define HAVE_ENUM_CAMERA_TRACKING_TARGET_DATA +typedef enum CAMERA_TRACKING_TARGET_DATA +{ + CAMERA_TRACKING_TARGET_NONE=0, /* No target data | */ + CAMERA_TRACKING_TARGET_EMBEDDED=1, /* Target data embedded in image data (proprietary) | */ + CAMERA_TRACKING_TARGET_RENDERED=2, /* Target data rendered in image | */ + CAMERA_TRACKING_TARGET_IN_STATUS=4, /* Target data within status message (Point or Rectangle) | */ + CAMERA_TRACKING_TARGET_DATA_ENUM_END=5, /* | */ +} CAMERA_TRACKING_TARGET_DATA; +#endif + +/** @brief Zoom types for MAV_CMD_SET_CAMERA_ZOOM */ +#ifndef HAVE_ENUM_CAMERA_ZOOM_TYPE +#define HAVE_ENUM_CAMERA_ZOOM_TYPE +typedef enum CAMERA_ZOOM_TYPE +{ + ZOOM_TYPE_STEP=0, /* Zoom one step increment (-1 for wide, 1 for tele) | */ + ZOOM_TYPE_CONTINUOUS=1, /* Continuous zoom up/down until stopped (-1 for wide, 1 for tele, 0 to stop zooming) | */ + ZOOM_TYPE_RANGE=2, /* Zoom value as proportion of full camera range (a value between 0.0 and 100.0) | */ + ZOOM_TYPE_FOCAL_LENGTH=3, /* Zoom value/variable focal length in milimetres. Note that there is no message to get the valid zoom range of the camera, so this can type can only be used for cameras where the zoom range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera) | */ + CAMERA_ZOOM_TYPE_ENUM_END=4, /* | */ +} CAMERA_ZOOM_TYPE; +#endif + +/** @brief Focus types for MAV_CMD_SET_CAMERA_FOCUS */ +#ifndef HAVE_ENUM_SET_FOCUS_TYPE +#define HAVE_ENUM_SET_FOCUS_TYPE +typedef enum SET_FOCUS_TYPE +{ + FOCUS_TYPE_STEP=0, /* Focus one step increment (-1 for focusing in, 1 for focusing out towards infinity). | */ + FOCUS_TYPE_CONTINUOUS=1, /* Continuous focus up/down until stopped (-1 for focusing in, 1 for focusing out towards infinity, 0 to stop focusing) | */ + FOCUS_TYPE_RANGE=2, /* Focus value as proportion of full camera focus range (a value between 0.0 and 100.0) | */ + FOCUS_TYPE_METERS=3, /* Focus value in metres. Note that there is no message to get the valid focus range of the camera, so this can type can only be used for cameras where the range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera). | */ + SET_FOCUS_TYPE_ENUM_END=4, /* | */ +} SET_FOCUS_TYPE; +#endif + +/** @brief Result from PARAM_EXT_SET message (or a PARAM_SET within a transaction). */ +#ifndef HAVE_ENUM_PARAM_ACK +#define HAVE_ENUM_PARAM_ACK +typedef enum PARAM_ACK +{ + PARAM_ACK_ACCEPTED=0, /* Parameter value ACCEPTED and SET | */ + PARAM_ACK_VALUE_UNSUPPORTED=1, /* Parameter value UNKNOWN/UNSUPPORTED | */ + PARAM_ACK_FAILED=2, /* Parameter failed to set | */ + PARAM_ACK_IN_PROGRESS=3, /* Parameter value received but not yet set/accepted. A subsequent PARAM_ACK_TRANSACTION or PARAM_EXT_ACK with the final result will follow once operation is completed. This is returned immediately for parameters that take longer to set, indicating taht the the parameter was recieved and does not need to be resent. | */ + PARAM_ACK_ENUM_END=4, /* | */ +} PARAM_ACK; +#endif + +/** @brief Camera Modes. */ +#ifndef HAVE_ENUM_CAMERA_MODE +#define HAVE_ENUM_CAMERA_MODE +typedef enum CAMERA_MODE +{ + CAMERA_MODE_IMAGE=0, /* Camera is in image/photo capture mode. | */ + CAMERA_MODE_VIDEO=1, /* Camera is in video capture mode. | */ + CAMERA_MODE_IMAGE_SURVEY=2, /* Camera is in image survey capture mode. It allows for camera controller to do specific settings for surveys. | */ + CAMERA_MODE_ENUM_END=3, /* | */ +} CAMERA_MODE; +#endif + +/** @brief */ +#ifndef HAVE_ENUM_MAV_ARM_AUTH_DENIED_REASON +#define HAVE_ENUM_MAV_ARM_AUTH_DENIED_REASON +typedef enum MAV_ARM_AUTH_DENIED_REASON +{ + MAV_ARM_AUTH_DENIED_REASON_GENERIC=0, /* Not a specific reason | */ + MAV_ARM_AUTH_DENIED_REASON_NONE=1, /* Authorizer will send the error as string to GCS | */ + MAV_ARM_AUTH_DENIED_REASON_INVALID_WAYPOINT=2, /* At least one waypoint have a invalid value | */ + MAV_ARM_AUTH_DENIED_REASON_TIMEOUT=3, /* Timeout in the authorizer process(in case it depends on network) | */ + MAV_ARM_AUTH_DENIED_REASON_AIRSPACE_IN_USE=4, /* Airspace of the mission in use by another vehicle, second result parameter can have the waypoint id that caused it to be denied. | */ + MAV_ARM_AUTH_DENIED_REASON_BAD_WEATHER=5, /* Weather is not good to fly | */ + MAV_ARM_AUTH_DENIED_REASON_ENUM_END=6, /* | */ +} MAV_ARM_AUTH_DENIED_REASON; +#endif + +/** @brief RC type */ +#ifndef HAVE_ENUM_RC_TYPE +#define HAVE_ENUM_RC_TYPE +typedef enum RC_TYPE +{ + RC_TYPE_SPEKTRUM_DSM2=0, /* Spektrum DSM2 | */ + RC_TYPE_SPEKTRUM_DSMX=1, /* Spektrum DSMX | */ + RC_TYPE_ENUM_END=2, /* | */ +} RC_TYPE; +#endif + +/** @brief Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 9 is set the floats afx afy afz should be interpreted as force instead of acceleration. */ +#ifndef HAVE_ENUM_POSITION_TARGET_TYPEMASK +#define HAVE_ENUM_POSITION_TARGET_TYPEMASK +typedef enum POSITION_TARGET_TYPEMASK +{ + POSITION_TARGET_TYPEMASK_X_IGNORE=1, /* Ignore position x | */ + POSITION_TARGET_TYPEMASK_Y_IGNORE=2, /* Ignore position y | */ + POSITION_TARGET_TYPEMASK_Z_IGNORE=4, /* Ignore position z | */ + POSITION_TARGET_TYPEMASK_VX_IGNORE=8, /* Ignore velocity x | */ + POSITION_TARGET_TYPEMASK_VY_IGNORE=16, /* Ignore velocity y | */ + POSITION_TARGET_TYPEMASK_VZ_IGNORE=32, /* Ignore velocity z | */ + POSITION_TARGET_TYPEMASK_AX_IGNORE=64, /* Ignore acceleration x | */ + POSITION_TARGET_TYPEMASK_AY_IGNORE=128, /* Ignore acceleration y | */ + POSITION_TARGET_TYPEMASK_AZ_IGNORE=256, /* Ignore acceleration z | */ + POSITION_TARGET_TYPEMASK_FORCE_SET=512, /* Use force instead of acceleration | */ + POSITION_TARGET_TYPEMASK_YAW_IGNORE=1024, /* Ignore yaw | */ + POSITION_TARGET_TYPEMASK_YAW_RATE_IGNORE=2048, /* Ignore yaw rate | */ + POSITION_TARGET_TYPEMASK_ENUM_END=2049, /* | */ +} POSITION_TARGET_TYPEMASK; +#endif + +/** @brief Airborne status of UAS. */ +#ifndef HAVE_ENUM_UTM_FLIGHT_STATE +#define HAVE_ENUM_UTM_FLIGHT_STATE +typedef enum UTM_FLIGHT_STATE +{ + UTM_FLIGHT_STATE_UNKNOWN=1, /* The flight state can't be determined. | */ + UTM_FLIGHT_STATE_GROUND=2, /* UAS on ground. | */ + UTM_FLIGHT_STATE_AIRBORNE=3, /* UAS airborne. | */ + UTM_FLIGHT_STATE_EMERGENCY=16, /* UAS is in an emergency flight state. | */ + UTM_FLIGHT_STATE_NOCTRL=32, /* UAS has no active controls. | */ + UTM_FLIGHT_STATE_ENUM_END=33, /* | */ +} UTM_FLIGHT_STATE; +#endif + +/** @brief Flags for the global position report. */ +#ifndef HAVE_ENUM_UTM_DATA_AVAIL_FLAGS +#define HAVE_ENUM_UTM_DATA_AVAIL_FLAGS +typedef enum UTM_DATA_AVAIL_FLAGS +{ + UTM_DATA_AVAIL_FLAGS_TIME_VALID=1, /* The field time contains valid data. | */ + UTM_DATA_AVAIL_FLAGS_UAS_ID_AVAILABLE=2, /* The field uas_id contains valid data. | */ + UTM_DATA_AVAIL_FLAGS_POSITION_AVAILABLE=4, /* The fields lat, lon and h_acc contain valid data. | */ + UTM_DATA_AVAIL_FLAGS_ALTITUDE_AVAILABLE=8, /* The fields alt and v_acc contain valid data. | */ + UTM_DATA_AVAIL_FLAGS_RELATIVE_ALTITUDE_AVAILABLE=16, /* The field relative_alt contains valid data. | */ + UTM_DATA_AVAIL_FLAGS_HORIZONTAL_VELO_AVAILABLE=32, /* The fields vx and vy contain valid data. | */ + UTM_DATA_AVAIL_FLAGS_VERTICAL_VELO_AVAILABLE=64, /* The field vz contains valid data. | */ + UTM_DATA_AVAIL_FLAGS_NEXT_WAYPOINT_AVAILABLE=128, /* The fields next_lat, next_lon and next_alt contain valid data. | */ + UTM_DATA_AVAIL_FLAGS_ENUM_END=129, /* | */ +} UTM_DATA_AVAIL_FLAGS; +#endif + +/** @brief Cellular network radio type */ +#ifndef HAVE_ENUM_CELLULAR_NETWORK_RADIO_TYPE +#define HAVE_ENUM_CELLULAR_NETWORK_RADIO_TYPE +typedef enum CELLULAR_NETWORK_RADIO_TYPE +{ + CELLULAR_NETWORK_RADIO_TYPE_NONE=0, /* | */ + CELLULAR_NETWORK_RADIO_TYPE_GSM=1, /* | */ + CELLULAR_NETWORK_RADIO_TYPE_CDMA=2, /* | */ + CELLULAR_NETWORK_RADIO_TYPE_WCDMA=3, /* | */ + CELLULAR_NETWORK_RADIO_TYPE_LTE=4, /* | */ + CELLULAR_NETWORK_RADIO_TYPE_ENUM_END=5, /* | */ +} CELLULAR_NETWORK_RADIO_TYPE; +#endif + +/** @brief These flags encode the cellular network status */ +#ifndef HAVE_ENUM_CELLULAR_STATUS_FLAG +#define HAVE_ENUM_CELLULAR_STATUS_FLAG +typedef enum CELLULAR_STATUS_FLAG +{ + CELLULAR_STATUS_FLAG_UNKNOWN=0, /* State unknown or not reportable. | */ + CELLULAR_STATUS_FLAG_FAILED=1, /* Modem is unusable | */ + CELLULAR_STATUS_FLAG_INITIALIZING=2, /* Modem is being initialized | */ + CELLULAR_STATUS_FLAG_LOCKED=3, /* Modem is locked | */ + CELLULAR_STATUS_FLAG_DISABLED=4, /* Modem is not enabled and is powered down | */ + CELLULAR_STATUS_FLAG_DISABLING=5, /* Modem is currently transitioning to the CELLULAR_STATUS_FLAG_DISABLED state | */ + CELLULAR_STATUS_FLAG_ENABLING=6, /* Modem is currently transitioning to the CELLULAR_STATUS_FLAG_ENABLED state | */ + CELLULAR_STATUS_FLAG_ENABLED=7, /* Modem is enabled and powered on but not registered with a network provider and not available for data connections | */ + CELLULAR_STATUS_FLAG_SEARCHING=8, /* Modem is searching for a network provider to register | */ + CELLULAR_STATUS_FLAG_REGISTERED=9, /* Modem is registered with a network provider, and data connections and messaging may be available for use | */ + CELLULAR_STATUS_FLAG_DISCONNECTING=10, /* Modem is disconnecting and deactivating the last active packet data bearer. This state will not be entered if more than one packet data bearer is active and one of the active bearers is deactivated | */ + CELLULAR_STATUS_FLAG_CONNECTING=11, /* Modem is activating and connecting the first packet data bearer. Subsequent bearer activations when another bearer is already active do not cause this state to be entered | */ + CELLULAR_STATUS_FLAG_CONNECTED=12, /* One or more packet data bearers is active and connected | */ + CELLULAR_STATUS_FLAG_ENUM_END=13, /* | */ +} CELLULAR_STATUS_FLAG; +#endif + +/** @brief These flags are used to diagnose the failure state of CELLULAR_STATUS */ +#ifndef HAVE_ENUM_CELLULAR_NETWORK_FAILED_REASON +#define HAVE_ENUM_CELLULAR_NETWORK_FAILED_REASON +typedef enum CELLULAR_NETWORK_FAILED_REASON +{ + CELLULAR_NETWORK_FAILED_REASON_NONE=0, /* No error | */ + CELLULAR_NETWORK_FAILED_REASON_UNKNOWN=1, /* Error state is unknown | */ + CELLULAR_NETWORK_FAILED_REASON_SIM_MISSING=2, /* SIM is required for the modem but missing | */ + CELLULAR_NETWORK_FAILED_REASON_SIM_ERROR=3, /* SIM is available, but not usuable for connection | */ + CELLULAR_NETWORK_FAILED_REASON_ENUM_END=4, /* | */ +} CELLULAR_NETWORK_FAILED_REASON; +#endif + +/** @brief Precision land modes (used in MAV_CMD_NAV_LAND). */ +#ifndef HAVE_ENUM_PRECISION_LAND_MODE +#define HAVE_ENUM_PRECISION_LAND_MODE +typedef enum PRECISION_LAND_MODE +{ + PRECISION_LAND_MODE_DISABLED=0, /* Normal (non-precision) landing. | */ + PRECISION_LAND_MODE_OPPORTUNISTIC=1, /* Use precision landing if beacon detected when land command accepted, otherwise land normally. | */ + PRECISION_LAND_MODE_REQUIRED=2, /* Use precision landing, searching for beacon if not found when land command accepted (land normally if beacon cannot be found). | */ + PRECISION_LAND_MODE_ENUM_END=3, /* | */ +} PRECISION_LAND_MODE; +#endif + +/** @brief Parachute actions. Trigger release and enable/disable auto-release. */ +#ifndef HAVE_ENUM_PARACHUTE_ACTION +#define HAVE_ENUM_PARACHUTE_ACTION +typedef enum PARACHUTE_ACTION +{ + PARACHUTE_DISABLE=0, /* Disable auto-release of parachute (i.e. release triggered by crash detectors). | */ + PARACHUTE_ENABLE=1, /* Enable auto-release of parachute. | */ + PARACHUTE_RELEASE=2, /* Release parachute and kill motors. | */ + PARACHUTE_ACTION_ENUM_END=3, /* | */ +} PARACHUTE_ACTION; +#endif + +/** @brief */ +#ifndef HAVE_ENUM_MAV_TUNNEL_PAYLOAD_TYPE +#define HAVE_ENUM_MAV_TUNNEL_PAYLOAD_TYPE +typedef enum MAV_TUNNEL_PAYLOAD_TYPE +{ + MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN=0, /* Encoding of payload unknown. | */ + MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED0=200, /* Registered for STorM32 gimbal controller. | */ + MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED1=201, /* Registered for STorM32 gimbal controller. | */ + MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED2=202, /* Registered for STorM32 gimbal controller. | */ + MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED3=203, /* Registered for STorM32 gimbal controller. | */ + MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED4=204, /* Registered for STorM32 gimbal controller. | */ + MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED5=205, /* Registered for STorM32 gimbal controller. | */ + MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED6=206, /* Registered for STorM32 gimbal controller. | */ + MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED7=207, /* Registered for STorM32 gimbal controller. | */ + MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED8=208, /* Registered for STorM32 gimbal controller. | */ + MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED9=209, /* Registered for STorM32 gimbal controller. | */ + MAV_TUNNEL_PAYLOAD_TYPE_ENUM_END=210, /* | */ +} MAV_TUNNEL_PAYLOAD_TYPE; +#endif + +/** @brief */ +#ifndef HAVE_ENUM_MAV_ODID_ID_TYPE +#define HAVE_ENUM_MAV_ODID_ID_TYPE +typedef enum MAV_ODID_ID_TYPE +{ + MAV_ODID_ID_TYPE_NONE=0, /* No type defined. | */ + MAV_ODID_ID_TYPE_SERIAL_NUMBER=1, /* Manufacturer Serial Number (ANSI/CTA-2063 format). | */ + MAV_ODID_ID_TYPE_CAA_REGISTRATION_ID=2, /* CAA (Civil Aviation Authority) registered ID. Format: [ICAO Country Code].[CAA Assigned ID]. | */ + MAV_ODID_ID_TYPE_UTM_ASSIGNED_UUID=3, /* UTM (Unmanned Traffic Management) assigned UUID (RFC4122). | */ + MAV_ODID_ID_TYPE_ENUM_END=4, /* | */ +} MAV_ODID_ID_TYPE; +#endif + +/** @brief */ +#ifndef HAVE_ENUM_MAV_ODID_UA_TYPE +#define HAVE_ENUM_MAV_ODID_UA_TYPE +typedef enum MAV_ODID_UA_TYPE +{ + MAV_ODID_UA_TYPE_NONE=0, /* No UA (Unmanned Aircraft) type defined. | */ + MAV_ODID_UA_TYPE_AEROPLANE=1, /* Aeroplane/Airplane. Fixed wing. | */ + MAV_ODID_UA_TYPE_HELICOPTER_OR_MULTIROTOR=2, /* Helicopter or multirotor. | */ + MAV_ODID_UA_TYPE_GYROPLANE=3, /* Gyroplane. | */ + MAV_ODID_UA_TYPE_HYBRID_LIFT=4, /* VTOL (Vertical Take-Off and Landing). Fixed wing aircraft that can take off vertically. | */ + MAV_ODID_UA_TYPE_ORNITHOPTER=5, /* Ornithopter. | */ + MAV_ODID_UA_TYPE_GLIDER=6, /* Glider. | */ + MAV_ODID_UA_TYPE_KITE=7, /* Kite. | */ + MAV_ODID_UA_TYPE_FREE_BALLOON=8, /* Free Balloon. | */ + MAV_ODID_UA_TYPE_CAPTIVE_BALLOON=9, /* Captive Balloon. | */ + MAV_ODID_UA_TYPE_AIRSHIP=10, /* Airship. E.g. a blimp. | */ + MAV_ODID_UA_TYPE_FREE_FALL_PARACHUTE=11, /* Free Fall/Parachute (unpowered). | */ + MAV_ODID_UA_TYPE_ROCKET=12, /* Rocket. | */ + MAV_ODID_UA_TYPE_TETHERED_POWERED_AIRCRAFT=13, /* Tethered powered aircraft. | */ + MAV_ODID_UA_TYPE_GROUND_OBSTACLE=14, /* Ground Obstacle. | */ + MAV_ODID_UA_TYPE_OTHER=15, /* Other type of aircraft not listed earlier. | */ + MAV_ODID_UA_TYPE_ENUM_END=16, /* | */ +} MAV_ODID_UA_TYPE; +#endif + +/** @brief */ +#ifndef HAVE_ENUM_MAV_ODID_STATUS +#define HAVE_ENUM_MAV_ODID_STATUS +typedef enum MAV_ODID_STATUS +{ + MAV_ODID_STATUS_UNDECLARED=0, /* The status of the (UA) Unmanned Aircraft is undefined. | */ + MAV_ODID_STATUS_GROUND=1, /* The UA is on the ground. | */ + MAV_ODID_STATUS_AIRBORNE=2, /* The UA is in the air. | */ + MAV_ODID_STATUS_EMERGENCY=3, /* The UA is having an emergency. | */ + MAV_ODID_STATUS_ENUM_END=4, /* | */ +} MAV_ODID_STATUS; +#endif + +/** @brief */ +#ifndef HAVE_ENUM_MAV_ODID_HEIGHT_REF +#define HAVE_ENUM_MAV_ODID_HEIGHT_REF +typedef enum MAV_ODID_HEIGHT_REF +{ + MAV_ODID_HEIGHT_REF_OVER_TAKEOFF=0, /* The height field is relative to the take-off location. | */ + MAV_ODID_HEIGHT_REF_OVER_GROUND=1, /* The height field is relative to ground. | */ + MAV_ODID_HEIGHT_REF_ENUM_END=2, /* | */ +} MAV_ODID_HEIGHT_REF; +#endif + +/** @brief */ +#ifndef HAVE_ENUM_MAV_ODID_HOR_ACC +#define HAVE_ENUM_MAV_ODID_HOR_ACC +typedef enum MAV_ODID_HOR_ACC +{ + MAV_ODID_HOR_ACC_UNKNOWN=0, /* The horizontal accuracy is unknown. | */ + MAV_ODID_HOR_ACC_10NM=1, /* The horizontal accuracy is smaller than 10 Nautical Miles. 18.52 km. | */ + MAV_ODID_HOR_ACC_4NM=2, /* The horizontal accuracy is smaller than 4 Nautical Miles. 7.408 km. | */ + MAV_ODID_HOR_ACC_2NM=3, /* The horizontal accuracy is smaller than 2 Nautical Miles. 3.704 km. | */ + MAV_ODID_HOR_ACC_1NM=4, /* The horizontal accuracy is smaller than 1 Nautical Miles. 1.852 km. | */ + MAV_ODID_HOR_ACC_0_5NM=5, /* The horizontal accuracy is smaller than 0.5 Nautical Miles. 926 m. | */ + MAV_ODID_HOR_ACC_0_3NM=6, /* The horizontal accuracy is smaller than 0.3 Nautical Miles. 555.6 m. | */ + MAV_ODID_HOR_ACC_0_1NM=7, /* The horizontal accuracy is smaller than 0.1 Nautical Miles. 185.2 m. | */ + MAV_ODID_HOR_ACC_0_05NM=8, /* The horizontal accuracy is smaller than 0.05 Nautical Miles. 92.6 m. | */ + MAV_ODID_HOR_ACC_30_METER=9, /* The horizontal accuracy is smaller than 30 meter. | */ + MAV_ODID_HOR_ACC_10_METER=10, /* The horizontal accuracy is smaller than 10 meter. | */ + MAV_ODID_HOR_ACC_3_METER=11, /* The horizontal accuracy is smaller than 3 meter. | */ + MAV_ODID_HOR_ACC_1_METER=12, /* The horizontal accuracy is smaller than 1 meter. | */ + MAV_ODID_HOR_ACC_ENUM_END=13, /* | */ +} MAV_ODID_HOR_ACC; +#endif + +/** @brief */ +#ifndef HAVE_ENUM_MAV_ODID_VER_ACC +#define HAVE_ENUM_MAV_ODID_VER_ACC +typedef enum MAV_ODID_VER_ACC +{ + MAV_ODID_VER_ACC_UNKNOWN=0, /* The vertical accuracy is unknown. | */ + MAV_ODID_VER_ACC_150_METER=1, /* The vertical accuracy is smaller than 150 meter. | */ + MAV_ODID_VER_ACC_45_METER=2, /* The vertical accuracy is smaller than 45 meter. | */ + MAV_ODID_VER_ACC_25_METER=3, /* The vertical accuracy is smaller than 25 meter. | */ + MAV_ODID_VER_ACC_10_METER=4, /* The vertical accuracy is smaller than 10 meter. | */ + MAV_ODID_VER_ACC_3_METER=5, /* The vertical accuracy is smaller than 3 meter. | */ + MAV_ODID_VER_ACC_1_METER=6, /* The vertical accuracy is smaller than 1 meter. | */ + MAV_ODID_VER_ACC_ENUM_END=7, /* | */ +} MAV_ODID_VER_ACC; +#endif + +/** @brief */ +#ifndef HAVE_ENUM_MAV_ODID_SPEED_ACC +#define HAVE_ENUM_MAV_ODID_SPEED_ACC +typedef enum MAV_ODID_SPEED_ACC +{ + MAV_ODID_SPEED_ACC_UNKNOWN=0, /* The speed accuracy is unknown. | */ + MAV_ODID_SPEED_ACC_10_METERS_PER_SECOND=1, /* The speed accuracy is smaller than 10 meters per second. | */ + MAV_ODID_SPEED_ACC_3_METERS_PER_SECOND=2, /* The speed accuracy is smaller than 3 meters per second. | */ + MAV_ODID_SPEED_ACC_1_METERS_PER_SECOND=3, /* The speed accuracy is smaller than 1 meters per second. | */ + MAV_ODID_SPEED_ACC_0_3_METERS_PER_SECOND=4, /* The speed accuracy is smaller than 0.3 meters per second. | */ + MAV_ODID_SPEED_ACC_ENUM_END=5, /* | */ +} MAV_ODID_SPEED_ACC; +#endif + +/** @brief */ +#ifndef HAVE_ENUM_MAV_ODID_TIME_ACC +#define HAVE_ENUM_MAV_ODID_TIME_ACC +typedef enum MAV_ODID_TIME_ACC +{ + MAV_ODID_TIME_ACC_UNKNOWN=0, /* The timestamp accuracy is unknown. | */ + MAV_ODID_TIME_ACC_0_1_SECOND=1, /* The timestamp accuracy is smaller than or equal to 0.1 second. | */ + MAV_ODID_TIME_ACC_0_2_SECOND=2, /* The timestamp accuracy is smaller than or equal to 0.2 second. | */ + MAV_ODID_TIME_ACC_0_3_SECOND=3, /* The timestamp accuracy is smaller than or equal to 0.3 second. | */ + MAV_ODID_TIME_ACC_0_4_SECOND=4, /* The timestamp accuracy is smaller than or equal to 0.4 second. | */ + MAV_ODID_TIME_ACC_0_5_SECOND=5, /* The timestamp accuracy is smaller than or equal to 0.5 second. | */ + MAV_ODID_TIME_ACC_0_6_SECOND=6, /* The timestamp accuracy is smaller than or equal to 0.6 second. | */ + MAV_ODID_TIME_ACC_0_7_SECOND=7, /* The timestamp accuracy is smaller than or equal to 0.7 second. | */ + MAV_ODID_TIME_ACC_0_8_SECOND=8, /* The timestamp accuracy is smaller than or equal to 0.8 second. | */ + MAV_ODID_TIME_ACC_0_9_SECOND=9, /* The timestamp accuracy is smaller than or equal to 0.9 second. | */ + MAV_ODID_TIME_ACC_1_0_SECOND=10, /* The timestamp accuracy is smaller than or equal to 1.0 second. | */ + MAV_ODID_TIME_ACC_1_1_SECOND=11, /* The timestamp accuracy is smaller than or equal to 1.1 second. | */ + MAV_ODID_TIME_ACC_1_2_SECOND=12, /* The timestamp accuracy is smaller than or equal to 1.2 second. | */ + MAV_ODID_TIME_ACC_1_3_SECOND=13, /* The timestamp accuracy is smaller than or equal to 1.3 second. | */ + MAV_ODID_TIME_ACC_1_4_SECOND=14, /* The timestamp accuracy is smaller than or equal to 1.4 second. | */ + MAV_ODID_TIME_ACC_1_5_SECOND=15, /* The timestamp accuracy is smaller than or equal to 1.5 second. | */ + MAV_ODID_TIME_ACC_ENUM_END=16, /* | */ +} MAV_ODID_TIME_ACC; +#endif + +/** @brief */ +#ifndef HAVE_ENUM_MAV_ODID_AUTH_TYPE +#define HAVE_ENUM_MAV_ODID_AUTH_TYPE +typedef enum MAV_ODID_AUTH_TYPE +{ + MAV_ODID_AUTH_TYPE_NONE=0, /* No authentication type is specified. | */ + MAV_ODID_AUTH_TYPE_UAS_ID_SIGNATURE=1, /* Signature for the UAS (Unmanned Aircraft System) ID. | */ + MAV_ODID_AUTH_TYPE_OPERATOR_ID_SIGNATURE=2, /* Signature for the Operator ID. | */ + MAV_ODID_AUTH_TYPE_MESSAGE_SET_SIGNATURE=3, /* Signature for the entire message set. | */ + MAV_ODID_AUTH_TYPE_NETWORK_REMOTE_ID=4, /* Authentication is provided by Network Remote ID. | */ + MAV_ODID_AUTH_TYPE_ENUM_END=5, /* | */ +} MAV_ODID_AUTH_TYPE; +#endif + +/** @brief */ +#ifndef HAVE_ENUM_MAV_ODID_DESC_TYPE +#define HAVE_ENUM_MAV_ODID_DESC_TYPE +typedef enum MAV_ODID_DESC_TYPE +{ + MAV_ODID_DESC_TYPE_TEXT=0, /* Free-form text description of the purpose of the flight. | */ + MAV_ODID_DESC_TYPE_ENUM_END=1, /* | */ +} MAV_ODID_DESC_TYPE; +#endif + +/** @brief */ +#ifndef HAVE_ENUM_MAV_ODID_OPERATOR_LOCATION_TYPE +#define HAVE_ENUM_MAV_ODID_OPERATOR_LOCATION_TYPE +typedef enum MAV_ODID_OPERATOR_LOCATION_TYPE +{ + MAV_ODID_OPERATOR_LOCATION_TYPE_TAKEOFF=0, /* The location of the operator is the same as the take-off location. | */ + MAV_ODID_OPERATOR_LOCATION_TYPE_LIVE_GNSS=1, /* The location of the operator is based on live GNSS data. | */ + MAV_ODID_OPERATOR_LOCATION_TYPE_FIXED=2, /* The location of the operator is a fixed location. | */ + MAV_ODID_OPERATOR_LOCATION_TYPE_ENUM_END=3, /* | */ +} MAV_ODID_OPERATOR_LOCATION_TYPE; +#endif + +/** @brief */ +#ifndef HAVE_ENUM_MAV_ODID_CLASSIFICATION_TYPE +#define HAVE_ENUM_MAV_ODID_CLASSIFICATION_TYPE +typedef enum MAV_ODID_CLASSIFICATION_TYPE +{ + MAV_ODID_CLASSIFICATION_TYPE_UNDECLARED=0, /* The classification type for the UA is undeclared. | */ + MAV_ODID_CLASSIFICATION_TYPE_EU=1, /* The classification type for the UA follows EU (European Union) specifications. | */ + MAV_ODID_CLASSIFICATION_TYPE_ENUM_END=2, /* | */ +} MAV_ODID_CLASSIFICATION_TYPE; +#endif + +/** @brief */ +#ifndef HAVE_ENUM_MAV_ODID_CATEGORY_EU +#define HAVE_ENUM_MAV_ODID_CATEGORY_EU +typedef enum MAV_ODID_CATEGORY_EU +{ + MAV_ODID_CATEGORY_EU_UNDECLARED=0, /* The category for the UA, according to the EU specification, is undeclared. | */ + MAV_ODID_CATEGORY_EU_OPEN=1, /* The category for the UA, according to the EU specification, is the Open category. | */ + MAV_ODID_CATEGORY_EU_SPECIFIC=2, /* The category for the UA, according to the EU specification, is the Specific category. | */ + MAV_ODID_CATEGORY_EU_CERTIFIED=3, /* The category for the UA, according to the EU specification, is the Certified category. | */ + MAV_ODID_CATEGORY_EU_ENUM_END=4, /* | */ +} MAV_ODID_CATEGORY_EU; +#endif + +/** @brief */ +#ifndef HAVE_ENUM_MAV_ODID_CLASS_EU +#define HAVE_ENUM_MAV_ODID_CLASS_EU +typedef enum MAV_ODID_CLASS_EU +{ + MAV_ODID_CLASS_EU_UNDECLARED=0, /* The class for the UA, according to the EU specification, is undeclared. | */ + MAV_ODID_CLASS_EU_CLASS_0=1, /* The class for the UA, according to the EU specification, is Class 0. | */ + MAV_ODID_CLASS_EU_CLASS_1=2, /* The class for the UA, according to the EU specification, is Class 1. | */ + MAV_ODID_CLASS_EU_CLASS_2=3, /* The class for the UA, according to the EU specification, is Class 2. | */ + MAV_ODID_CLASS_EU_CLASS_3=4, /* The class for the UA, according to the EU specification, is Class 3. | */ + MAV_ODID_CLASS_EU_CLASS_4=5, /* The class for the UA, according to the EU specification, is Class 4. | */ + MAV_ODID_CLASS_EU_CLASS_5=6, /* The class for the UA, according to the EU specification, is Class 5. | */ + MAV_ODID_CLASS_EU_CLASS_6=7, /* The class for the UA, according to the EU specification, is Class 6. | */ + MAV_ODID_CLASS_EU_ENUM_END=8, /* | */ +} MAV_ODID_CLASS_EU; +#endif + +/** @brief */ +#ifndef HAVE_ENUM_MAV_ODID_OPERATOR_ID_TYPE +#define HAVE_ENUM_MAV_ODID_OPERATOR_ID_TYPE +typedef enum MAV_ODID_OPERATOR_ID_TYPE +{ + MAV_ODID_OPERATOR_ID_TYPE_CAA=0, /* CAA (Civil Aviation Authority) registered operator ID. | */ + MAV_ODID_OPERATOR_ID_TYPE_ENUM_END=1, /* | */ +} MAV_ODID_OPERATOR_ID_TYPE; +#endif + +/** @brief Tune formats (used for vehicle buzzer/tone generation). */ +#ifndef HAVE_ENUM_TUNE_FORMAT +#define HAVE_ENUM_TUNE_FORMAT +typedef enum TUNE_FORMAT +{ + TUNE_FORMAT_QBASIC1_1=1, /* Format is QBasic 1.1 Play: https://www.qbasic.net/en/reference/qb11/Statement/PLAY-006.htm. | */ + TUNE_FORMAT_MML_MODERN=2, /* Format is Modern Music Markup Language (MML): https://en.wikipedia.org/wiki/Music_Macro_Language#Modern_MML. | */ + TUNE_FORMAT_ENUM_END=3, /* | */ +} TUNE_FORMAT; +#endif + +/** @brief Component capability flags (Bitmap) */ +#ifndef HAVE_ENUM_COMPONENT_CAP_FLAGS +#define HAVE_ENUM_COMPONENT_CAP_FLAGS +typedef enum COMPONENT_CAP_FLAGS +{ + COMPONENT_CAP_FLAGS_PARAM=1, /* Component has parameters, and supports the parameter protocol (PARAM messages). | */ + COMPONENT_CAP_FLAGS_PARAM_EXT=2, /* Component has parameters, and supports the extended parameter protocol (PARAM_EXT messages). | */ + COMPONENT_CAP_FLAGS_ENUM_END=3, /* | */ +} COMPONENT_CAP_FLAGS; +#endif + +/** @brief Type of AIS vessel, enum duplicated from AIS standard, https://gpsd.gitlab.io/gpsd/AIVDM.html */ +#ifndef HAVE_ENUM_AIS_TYPE +#define HAVE_ENUM_AIS_TYPE +typedef enum AIS_TYPE +{ + AIS_TYPE_UNKNOWN=0, /* Not available (default). | */ + AIS_TYPE_RESERVED_1=1, /* | */ + AIS_TYPE_RESERVED_2=2, /* | */ + AIS_TYPE_RESERVED_3=3, /* | */ + AIS_TYPE_RESERVED_4=4, /* | */ + AIS_TYPE_RESERVED_5=5, /* | */ + AIS_TYPE_RESERVED_6=6, /* | */ + AIS_TYPE_RESERVED_7=7, /* | */ + AIS_TYPE_RESERVED_8=8, /* | */ + AIS_TYPE_RESERVED_9=9, /* | */ + AIS_TYPE_RESERVED_10=10, /* | */ + AIS_TYPE_RESERVED_11=11, /* | */ + AIS_TYPE_RESERVED_12=12, /* | */ + AIS_TYPE_RESERVED_13=13, /* | */ + AIS_TYPE_RESERVED_14=14, /* | */ + AIS_TYPE_RESERVED_15=15, /* | */ + AIS_TYPE_RESERVED_16=16, /* | */ + AIS_TYPE_RESERVED_17=17, /* | */ + AIS_TYPE_RESERVED_18=18, /* | */ + AIS_TYPE_RESERVED_19=19, /* | */ + AIS_TYPE_WIG=20, /* Wing In Ground effect. | */ + AIS_TYPE_WIG_HAZARDOUS_A=21, /* | */ + AIS_TYPE_WIG_HAZARDOUS_B=22, /* | */ + AIS_TYPE_WIG_HAZARDOUS_C=23, /* | */ + AIS_TYPE_WIG_HAZARDOUS_D=24, /* | */ + AIS_TYPE_WIG_RESERVED_1=25, /* | */ + AIS_TYPE_WIG_RESERVED_2=26, /* | */ + AIS_TYPE_WIG_RESERVED_3=27, /* | */ + AIS_TYPE_WIG_RESERVED_4=28, /* | */ + AIS_TYPE_WIG_RESERVED_5=29, /* | */ + AIS_TYPE_FISHING=30, /* | */ + AIS_TYPE_TOWING=31, /* | */ + AIS_TYPE_TOWING_LARGE=32, /* Towing: length exceeds 200m or breadth exceeds 25m. | */ + AIS_TYPE_DREDGING=33, /* Dredging or other underwater ops. | */ + AIS_TYPE_DIVING=34, /* | */ + AIS_TYPE_MILITARY=35, /* | */ + AIS_TYPE_SAILING=36, /* | */ + AIS_TYPE_PLEASURE=37, /* | */ + AIS_TYPE_RESERVED_20=38, /* | */ + AIS_TYPE_RESERVED_21=39, /* | */ + AIS_TYPE_HSC=40, /* High Speed Craft. | */ + AIS_TYPE_HSC_HAZARDOUS_A=41, /* | */ + AIS_TYPE_HSC_HAZARDOUS_B=42, /* | */ + AIS_TYPE_HSC_HAZARDOUS_C=43, /* | */ + AIS_TYPE_HSC_HAZARDOUS_D=44, /* | */ + AIS_TYPE_HSC_RESERVED_1=45, /* | */ + AIS_TYPE_HSC_RESERVED_2=46, /* | */ + AIS_TYPE_HSC_RESERVED_3=47, /* | */ + AIS_TYPE_HSC_RESERVED_4=48, /* | */ + AIS_TYPE_HSC_UNKNOWN=49, /* | */ + AIS_TYPE_PILOT=50, /* | */ + AIS_TYPE_SAR=51, /* Search And Rescue vessel. | */ + AIS_TYPE_TUG=52, /* | */ + AIS_TYPE_PORT_TENDER=53, /* | */ + AIS_TYPE_ANTI_POLLUTION=54, /* Anti-pollution equipment. | */ + AIS_TYPE_LAW_ENFORCEMENT=55, /* | */ + AIS_TYPE_SPARE_LOCAL_1=56, /* | */ + AIS_TYPE_SPARE_LOCAL_2=57, /* | */ + AIS_TYPE_MEDICAL_TRANSPORT=58, /* | */ + AIS_TYPE_NONECOMBATANT=59, /* Noncombatant ship according to RR Resolution No. 18. | */ + AIS_TYPE_PASSENGER=60, /* | */ + AIS_TYPE_PASSENGER_HAZARDOUS_A=61, /* | */ + AIS_TYPE_PASSENGER_HAZARDOUS_B=62, /* | */ + AIS_TYPE_AIS_TYPE_PASSENGER_HAZARDOUS_C=63, /* | */ + AIS_TYPE_PASSENGER_HAZARDOUS_D=64, /* | */ + AIS_TYPE_PASSENGER_RESERVED_1=65, /* | */ + AIS_TYPE_PASSENGER_RESERVED_2=66, /* | */ + AIS_TYPE_PASSENGER_RESERVED_3=67, /* | */ + AIS_TYPE_AIS_TYPE_PASSENGER_RESERVED_4=68, /* | */ + AIS_TYPE_PASSENGER_UNKNOWN=69, /* | */ + AIS_TYPE_CARGO=70, /* | */ + AIS_TYPE_CARGO_HAZARDOUS_A=71, /* | */ + AIS_TYPE_CARGO_HAZARDOUS_B=72, /* | */ + AIS_TYPE_CARGO_HAZARDOUS_C=73, /* | */ + AIS_TYPE_CARGO_HAZARDOUS_D=74, /* | */ + AIS_TYPE_CARGO_RESERVED_1=75, /* | */ + AIS_TYPE_CARGO_RESERVED_2=76, /* | */ + AIS_TYPE_CARGO_RESERVED_3=77, /* | */ + AIS_TYPE_CARGO_RESERVED_4=78, /* | */ + AIS_TYPE_CARGO_UNKNOWN=79, /* | */ + AIS_TYPE_TANKER=80, /* | */ + AIS_TYPE_TANKER_HAZARDOUS_A=81, /* | */ + AIS_TYPE_TANKER_HAZARDOUS_B=82, /* | */ + AIS_TYPE_TANKER_HAZARDOUS_C=83, /* | */ + AIS_TYPE_TANKER_HAZARDOUS_D=84, /* | */ + AIS_TYPE_TANKER_RESERVED_1=85, /* | */ + AIS_TYPE_TANKER_RESERVED_2=86, /* | */ + AIS_TYPE_TANKER_RESERVED_3=87, /* | */ + AIS_TYPE_TANKER_RESERVED_4=88, /* | */ + AIS_TYPE_TANKER_UNKNOWN=89, /* | */ + AIS_TYPE_OTHER=90, /* | */ + AIS_TYPE_OTHER_HAZARDOUS_A=91, /* | */ + AIS_TYPE_OTHER_HAZARDOUS_B=92, /* | */ + AIS_TYPE_OTHER_HAZARDOUS_C=93, /* | */ + AIS_TYPE_OTHER_HAZARDOUS_D=94, /* | */ + AIS_TYPE_OTHER_RESERVED_1=95, /* | */ + AIS_TYPE_OTHER_RESERVED_2=96, /* | */ + AIS_TYPE_OTHER_RESERVED_3=97, /* | */ + AIS_TYPE_OTHER_RESERVED_4=98, /* | */ + AIS_TYPE_OTHER_UNKNOWN=99, /* | */ + AIS_TYPE_ENUM_END=100, /* | */ +} AIS_TYPE; +#endif + +/** @brief Navigational status of AIS vessel, enum duplicated from AIS standard, https://gpsd.gitlab.io/gpsd/AIVDM.html */ +#ifndef HAVE_ENUM_AIS_NAV_STATUS +#define HAVE_ENUM_AIS_NAV_STATUS +typedef enum AIS_NAV_STATUS +{ + UNDER_WAY=0, /* Under way using engine. | */ + AIS_NAV_ANCHORED=1, /* | */ + AIS_NAV_UN_COMMANDED=2, /* | */ + AIS_NAV_RESTRICTED_MANOEUVERABILITY=3, /* | */ + AIS_NAV_DRAUGHT_CONSTRAINED=4, /* | */ + AIS_NAV_MOORED=5, /* | */ + AIS_NAV_AGROUND=6, /* | */ + AIS_NAV_FISHING=7, /* | */ + AIS_NAV_SAILING=8, /* | */ + AIS_NAV_RESERVED_HSC=9, /* | */ + AIS_NAV_RESERVED_WIG=10, /* | */ + AIS_NAV_RESERVED_1=11, /* | */ + AIS_NAV_RESERVED_2=12, /* | */ + AIS_NAV_RESERVED_3=13, /* | */ + AIS_NAV_AIS_SART=14, /* Search And Rescue Transponder. | */ + AIS_NAV_UNKNOWN=15, /* Not available (default). | */ + AIS_NAV_STATUS_ENUM_END=16, /* | */ +} AIS_NAV_STATUS; +#endif + +/** @brief These flags are used in the AIS_VESSEL.fields bitmask to indicate validity of data in the other message fields. When set, the data is valid. */ +#ifndef HAVE_ENUM_AIS_FLAGS +#define HAVE_ENUM_AIS_FLAGS +typedef enum AIS_FLAGS +{ + AIS_FLAGS_POSITION_ACCURACY=1, /* 1 = Position accuracy less than 10m, 0 = position accuracy greater than 10m. | */ + AIS_FLAGS_VALID_COG=2, /* | */ + AIS_FLAGS_VALID_VELOCITY=4, /* | */ + AIS_FLAGS_HIGH_VELOCITY=8, /* 1 = Velocity over 52.5765m/s (102.2 knots) | */ + AIS_FLAGS_VALID_TURN_RATE=16, /* | */ + AIS_FLAGS_TURN_RATE_SIGN_ONLY=32, /* Only the sign of the returned turn rate value is valid, either greater than 5deg/30s or less than -5deg/30s | */ + AIS_FLAGS_VALID_DIMENSIONS=64, /* | */ + AIS_FLAGS_LARGE_BOW_DIMENSION=128, /* Distance to bow is larger than 511m | */ + AIS_FLAGS_LARGE_STERN_DIMENSION=256, /* Distance to stern is larger than 511m | */ + AIS_FLAGS_LARGE_PORT_DIMENSION=512, /* Distance to port side is larger than 63m | */ + AIS_FLAGS_LARGE_STARBOARD_DIMENSION=1024, /* Distance to starboard side is larger than 63m | */ + AIS_FLAGS_VALID_CALLSIGN=2048, /* | */ + AIS_FLAGS_VALID_NAME=4096, /* | */ + AIS_FLAGS_ENUM_END=4097, /* | */ +} AIS_FLAGS; +#endif + +/** @brief List of possible units where failures can be injected. */ +#ifndef HAVE_ENUM_FAILURE_UNIT +#define HAVE_ENUM_FAILURE_UNIT +typedef enum FAILURE_UNIT +{ + FAILURE_UNIT_SENSOR_GYRO=0, /* | */ + FAILURE_UNIT_SENSOR_ACCEL=1, /* | */ + FAILURE_UNIT_SENSOR_MAG=2, /* | */ + FAILURE_UNIT_SENSOR_BARO=3, /* | */ + FAILURE_UNIT_SENSOR_GPS=4, /* | */ + FAILURE_UNIT_SENSOR_OPTICAL_FLOW=5, /* | */ + FAILURE_UNIT_SENSOR_VIO=6, /* | */ + FAILURE_UNIT_SENSOR_DISTANCE_SENSOR=7, /* | */ + FAILURE_UNIT_SENSOR_AIRSPEED=8, /* | */ + FAILURE_UNIT_SYSTEM_BATTERY=100, /* | */ + FAILURE_UNIT_SYSTEM_MOTOR=101, /* | */ + FAILURE_UNIT_SYSTEM_SERVO=102, /* | */ + FAILURE_UNIT_SYSTEM_AVOIDANCE=103, /* | */ + FAILURE_UNIT_SYSTEM_RC_SIGNAL=104, /* | */ + FAILURE_UNIT_SYSTEM_MAVLINK_SIGNAL=105, /* | */ + FAILURE_UNIT_ENUM_END=106, /* | */ +} FAILURE_UNIT; +#endif + +/** @brief List of possible failure type to inject. */ +#ifndef HAVE_ENUM_FAILURE_TYPE +#define HAVE_ENUM_FAILURE_TYPE +typedef enum FAILURE_TYPE +{ + FAILURE_TYPE_OK=0, /* No failure injected, used to reset a previous failure. | */ + FAILURE_TYPE_OFF=1, /* Sets unit off, so completely non-responsive. | */ + FAILURE_TYPE_STUCK=2, /* Unit is stuck e.g. keeps reporting the same value. | */ + FAILURE_TYPE_GARBAGE=3, /* Unit is reporting complete garbage. | */ + FAILURE_TYPE_WRONG=4, /* Unit is consistently wrong. | */ + FAILURE_TYPE_SLOW=5, /* Unit is slow, so e.g. reporting at slower than expected rate. | */ + FAILURE_TYPE_DELAYED=6, /* Data of unit is delayed in time. | */ + FAILURE_TYPE_INTERMITTENT=7, /* Unit is sometimes working, sometimes not. | */ + FAILURE_TYPE_ENUM_END=8, /* | */ +} FAILURE_TYPE; +#endif + +/** @brief Winch status flags used in WINCH_STATUS */ +#ifndef HAVE_ENUM_MAV_WINCH_STATUS_FLAG +#define HAVE_ENUM_MAV_WINCH_STATUS_FLAG +typedef enum MAV_WINCH_STATUS_FLAG +{ + MAV_WINCH_STATUS_HEALTHY=1, /* Winch is healthy | */ + MAV_WINCH_STATUS_FULLY_RETRACTED=2, /* Winch thread is fully retracted | */ + MAV_WINCH_STATUS_MOVING=4, /* Winch motor is moving | */ + MAV_WINCH_STATUS_CLUTCH_ENGAGED=8, /* Winch clutch is engaged allowing motor to move freely | */ + MAV_WINCH_STATUS_FLAG_ENUM_END=9, /* | */ +} MAV_WINCH_STATUS_FLAG; +#endif + // MAVLINK VERSION #ifndef MAVLINK_VERSION @@ -1006,7 +2399,9 @@ typedef enum GPS_FIX_TYPE #include "./mavlink_msg_change_operator_control.h" #include "./mavlink_msg_change_operator_control_ack.h" #include "./mavlink_msg_auth_key.h" +#include "./mavlink_msg_link_node_status.h" #include "./mavlink_msg_set_mode.h" +#include "./mavlink_msg_param_ack_transaction.h" #include "./mavlink_msg_param_request_read.h" #include "./mavlink_msg_param_request_list.h" #include "./mavlink_msg_param_value.h" @@ -1039,6 +2434,7 @@ typedef enum GPS_FIX_TYPE #include "./mavlink_msg_gps_global_origin.h" #include "./mavlink_msg_param_map_rc.h" #include "./mavlink_msg_mission_request_int.h" +#include "./mavlink_msg_mission_changed.h" #include "./mavlink_msg_safety_set_allowed_area.h" #include "./mavlink_msg_safety_allowed_area.h" #include "./mavlink_msg_attitude_quaternion_cov.h" @@ -1055,6 +2451,7 @@ typedef enum GPS_FIX_TYPE #include "./mavlink_msg_command_int.h" #include "./mavlink_msg_command_long.h" #include "./mavlink_msg_command_ack.h" +#include "./mavlink_msg_command_cancel.h" #include "./mavlink_msg_manual_setpoint.h" #include "./mavlink_msg_set_attitude_target.h" #include "./mavlink_msg_attitude_target.h" @@ -1116,11 +2513,13 @@ typedef enum GPS_FIX_TYPE #include "./mavlink_msg_battery_status.h" #include "./mavlink_msg_autopilot_version.h" #include "./mavlink_msg_landing_target.h" +#include "./mavlink_msg_fence_status.h" #include "./mavlink_msg_estimator_status.h" #include "./mavlink_msg_wind_cov.h" #include "./mavlink_msg_gps_input.h" #include "./mavlink_msg_gps_rtcm_data.h" #include "./mavlink_msg_high_latency.h" +#include "./mavlink_msg_high_latency2.h" #include "./mavlink_msg_vibration.h" #include "./mavlink_msg_home_position.h" #include "./mavlink_msg_set_home_position.h" @@ -1140,10 +2539,11 @@ typedef enum GPS_FIX_TYPE #undef MAVLINK_THIS_XML_IDX -#define MAVLINK_THIS_XML_IDX 1 +#define MAVLINK_THIS_XML_IDX 0 #if MAVLINK_THIS_XML_IDX == MAVLINK_PRIMARY_XML_IDX -# define MAVLINK_MESSAGE_INFO {MAVLINK_MESSAGE_INFO_HEARTBEAT, MAVLINK_MESSAGE_INFO_SYS_STATUS, MAVLINK_MESSAGE_INFO_SYSTEM_TIME, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_PING, MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL, MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL_ACK, MAVLINK_MESSAGE_INFO_AUTH_KEY, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_SET_MODE, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_PARAM_REQUEST_READ, MAVLINK_MESSAGE_INFO_PARAM_REQUEST_LIST, MAVLINK_MESSAGE_INFO_PARAM_VALUE, MAVLINK_MESSAGE_INFO_PARAM_SET, MAVLINK_MESSAGE_INFO_GPS_RAW_INT, MAVLINK_MESSAGE_INFO_GPS_STATUS, MAVLINK_MESSAGE_INFO_SCALED_IMU, MAVLINK_MESSAGE_INFO_RAW_IMU, MAVLINK_MESSAGE_INFO_RAW_PRESSURE, MAVLINK_MESSAGE_INFO_SCALED_PRESSURE, MAVLINK_MESSAGE_INFO_ATTITUDE, MAVLINK_MESSAGE_INFO_ATTITUDE_QUATERNION, MAVLINK_MESSAGE_INFO_LOCAL_POSITION_NED, MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_INT, MAVLINK_MESSAGE_INFO_RC_CHANNELS_SCALED, MAVLINK_MESSAGE_INFO_RC_CHANNELS_RAW, MAVLINK_MESSAGE_INFO_SERVO_OUTPUT_RAW, MAVLINK_MESSAGE_INFO_MISSION_REQUEST_PARTIAL_LIST, MAVLINK_MESSAGE_INFO_MISSION_WRITE_PARTIAL_LIST, MAVLINK_MESSAGE_INFO_MISSION_ITEM, MAVLINK_MESSAGE_INFO_MISSION_REQUEST, MAVLINK_MESSAGE_INFO_MISSION_SET_CURRENT, MAVLINK_MESSAGE_INFO_MISSION_CURRENT, MAVLINK_MESSAGE_INFO_MISSION_REQUEST_LIST, MAVLINK_MESSAGE_INFO_MISSION_COUNT, MAVLINK_MESSAGE_INFO_MISSION_CLEAR_ALL, MAVLINK_MESSAGE_INFO_MISSION_ITEM_REACHED, MAVLINK_MESSAGE_INFO_MISSION_ACK, MAVLINK_MESSAGE_INFO_SET_GPS_GLOBAL_ORIGIN, MAVLINK_MESSAGE_INFO_GPS_GLOBAL_ORIGIN, MAVLINK_MESSAGE_INFO_PARAM_MAP_RC, MAVLINK_MESSAGE_INFO_MISSION_REQUEST_INT, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_SAFETY_SET_ALLOWED_AREA, MAVLINK_MESSAGE_INFO_SAFETY_ALLOWED_AREA, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_ATTITUDE_QUATERNION_COV, MAVLINK_MESSAGE_INFO_NAV_CONTROLLER_OUTPUT, MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_INT_COV, MAVLINK_MESSAGE_INFO_LOCAL_POSITION_NED_COV, MAVLINK_MESSAGE_INFO_RC_CHANNELS, MAVLINK_MESSAGE_INFO_REQUEST_DATA_STREAM, MAVLINK_MESSAGE_INFO_DATA_STREAM, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_MANUAL_CONTROL, MAVLINK_MESSAGE_INFO_RC_CHANNELS_OVERRIDE, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_MISSION_ITEM_INT, MAVLINK_MESSAGE_INFO_VFR_HUD, MAVLINK_MESSAGE_INFO_COMMAND_INT, MAVLINK_MESSAGE_INFO_COMMAND_LONG, MAVLINK_MESSAGE_INFO_COMMAND_ACK, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_MANUAL_SETPOINT, MAVLINK_MESSAGE_INFO_SET_ATTITUDE_TARGET, MAVLINK_MESSAGE_INFO_ATTITUDE_TARGET, MAVLINK_MESSAGE_INFO_SET_POSITION_TARGET_LOCAL_NED, MAVLINK_MESSAGE_INFO_POSITION_TARGET_LOCAL_NED, MAVLINK_MESSAGE_INFO_SET_POSITION_TARGET_GLOBAL_INT, MAVLINK_MESSAGE_INFO_POSITION_TARGET_GLOBAL_INT, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET, MAVLINK_MESSAGE_INFO_HIL_STATE, MAVLINK_MESSAGE_INFO_HIL_CONTROLS, MAVLINK_MESSAGE_INFO_HIL_RC_INPUTS_RAW, MAVLINK_MESSAGE_INFO_HIL_ACTUATOR_CONTROLS, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_OPTICAL_FLOW, MAVLINK_MESSAGE_INFO_GLOBAL_VISION_POSITION_ESTIMATE, MAVLINK_MESSAGE_INFO_VISION_POSITION_ESTIMATE, MAVLINK_MESSAGE_INFO_VISION_SPEED_ESTIMATE, MAVLINK_MESSAGE_INFO_VICON_POSITION_ESTIMATE, MAVLINK_MESSAGE_INFO_HIGHRES_IMU, MAVLINK_MESSAGE_INFO_OPTICAL_FLOW_RAD, MAVLINK_MESSAGE_INFO_HIL_SENSOR, MAVLINK_MESSAGE_INFO_SIM_STATE, MAVLINK_MESSAGE_INFO_RADIO_STATUS, MAVLINK_MESSAGE_INFO_FILE_TRANSFER_PROTOCOL, MAVLINK_MESSAGE_INFO_TIMESYNC, MAVLINK_MESSAGE_INFO_CAMERA_TRIGGER, MAVLINK_MESSAGE_INFO_HIL_GPS, MAVLINK_MESSAGE_INFO_HIL_OPTICAL_FLOW, MAVLINK_MESSAGE_INFO_HIL_STATE_QUATERNION, MAVLINK_MESSAGE_INFO_SCALED_IMU2, MAVLINK_MESSAGE_INFO_LOG_REQUEST_LIST, MAVLINK_MESSAGE_INFO_LOG_ENTRY, MAVLINK_MESSAGE_INFO_LOG_REQUEST_DATA, MAVLINK_MESSAGE_INFO_LOG_DATA, MAVLINK_MESSAGE_INFO_LOG_ERASE, MAVLINK_MESSAGE_INFO_LOG_REQUEST_END, MAVLINK_MESSAGE_INFO_GPS_INJECT_DATA, MAVLINK_MESSAGE_INFO_GPS2_RAW, MAVLINK_MESSAGE_INFO_POWER_STATUS, MAVLINK_MESSAGE_INFO_SERIAL_CONTROL, MAVLINK_MESSAGE_INFO_GPS_RTK, MAVLINK_MESSAGE_INFO_GPS2_RTK, MAVLINK_MESSAGE_INFO_SCALED_IMU3, MAVLINK_MESSAGE_INFO_DATA_TRANSMISSION_HANDSHAKE, MAVLINK_MESSAGE_INFO_ENCAPSULATED_DATA, MAVLINK_MESSAGE_INFO_DISTANCE_SENSOR, MAVLINK_MESSAGE_INFO_TERRAIN_REQUEST, MAVLINK_MESSAGE_INFO_TERRAIN_DATA, MAVLINK_MESSAGE_INFO_TERRAIN_CHECK, MAVLINK_MESSAGE_INFO_TERRAIN_REPORT, MAVLINK_MESSAGE_INFO_SCALED_PRESSURE2, MAVLINK_MESSAGE_INFO_ATT_POS_MOCAP, MAVLINK_MESSAGE_INFO_SET_ACTUATOR_CONTROL_TARGET, MAVLINK_MESSAGE_INFO_ACTUATOR_CONTROL_TARGET, MAVLINK_MESSAGE_INFO_ALTITUDE, MAVLINK_MESSAGE_INFO_RESOURCE_REQUEST, MAVLINK_MESSAGE_INFO_SCALED_PRESSURE3, MAVLINK_MESSAGE_INFO_FOLLOW_TARGET, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_CONTROL_SYSTEM_STATE, MAVLINK_MESSAGE_INFO_BATTERY_STATUS, MAVLINK_MESSAGE_INFO_AUTOPILOT_VERSION, MAVLINK_MESSAGE_INFO_LANDING_TARGET, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_ESTIMATOR_STATUS, MAVLINK_MESSAGE_INFO_WIND_COV, MAVLINK_MESSAGE_INFO_GPS_INPUT, MAVLINK_MESSAGE_INFO_GPS_RTCM_DATA, MAVLINK_MESSAGE_INFO_HIGH_LATENCY, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_VIBRATION, MAVLINK_MESSAGE_INFO_HOME_POSITION, MAVLINK_MESSAGE_INFO_SET_HOME_POSITION, MAVLINK_MESSAGE_INFO_MESSAGE_INTERVAL, MAVLINK_MESSAGE_INFO_EXTENDED_SYS_STATE, MAVLINK_MESSAGE_INFO_ADSB_VEHICLE, MAVLINK_MESSAGE_INFO_COLLISION, MAVLINK_MESSAGE_INFO_V2_EXTENSION, MAVLINK_MESSAGE_INFO_MEMORY_VECT, MAVLINK_MESSAGE_INFO_DEBUG_VECT, MAVLINK_MESSAGE_INFO_NAMED_VALUE_FLOAT, MAVLINK_MESSAGE_INFO_NAMED_VALUE_INT, MAVLINK_MESSAGE_INFO_STATUSTEXT, MAVLINK_MESSAGE_INFO_DEBUG, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}} +# 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, MAVLINK_MESSAGE_INFO_LINK_NODE_STATUS, {"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}}}, MAVLINK_MESSAGE_INFO_PARAM_ACK_TRANSACTION, MAVLINK_MESSAGE_INFO_PARAM_REQUEST_READ, MAVLINK_MESSAGE_INFO_PARAM_REQUEST_LIST, MAVLINK_MESSAGE_INFO_PARAM_VALUE, MAVLINK_MESSAGE_INFO_PARAM_SET, MAVLINK_MESSAGE_INFO_GPS_RAW_INT, MAVLINK_MESSAGE_INFO_GPS_STATUS, MAVLINK_MESSAGE_INFO_SCALED_IMU, MAVLINK_MESSAGE_INFO_RAW_IMU, MAVLINK_MESSAGE_INFO_RAW_PRESSURE, MAVLINK_MESSAGE_INFO_SCALED_PRESSURE, MAVLINK_MESSAGE_INFO_ATTITUDE, MAVLINK_MESSAGE_INFO_ATTITUDE_QUATERNION, MAVLINK_MESSAGE_INFO_LOCAL_POSITION_NED, MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_INT, MAVLINK_MESSAGE_INFO_RC_CHANNELS_SCALED, MAVLINK_MESSAGE_INFO_RC_CHANNELS_RAW, MAVLINK_MESSAGE_INFO_SERVO_OUTPUT_RAW, MAVLINK_MESSAGE_INFO_MISSION_REQUEST_PARTIAL_LIST, MAVLINK_MESSAGE_INFO_MISSION_WRITE_PARTIAL_LIST, MAVLINK_MESSAGE_INFO_MISSION_ITEM, MAVLINK_MESSAGE_INFO_MISSION_REQUEST, MAVLINK_MESSAGE_INFO_MISSION_SET_CURRENT, MAVLINK_MESSAGE_INFO_MISSION_CURRENT, MAVLINK_MESSAGE_INFO_MISSION_REQUEST_LIST, MAVLINK_MESSAGE_INFO_MISSION_COUNT, MAVLINK_MESSAGE_INFO_MISSION_CLEAR_ALL, MAVLINK_MESSAGE_INFO_MISSION_ITEM_REACHED, MAVLINK_MESSAGE_INFO_MISSION_ACK, MAVLINK_MESSAGE_INFO_SET_GPS_GLOBAL_ORIGIN, MAVLINK_MESSAGE_INFO_GPS_GLOBAL_ORIGIN, MAVLINK_MESSAGE_INFO_PARAM_MAP_RC, MAVLINK_MESSAGE_INFO_MISSION_REQUEST_INT, MAVLINK_MESSAGE_INFO_MISSION_CHANGED, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_SAFETY_SET_ALLOWED_AREA, MAVLINK_MESSAGE_INFO_SAFETY_ALLOWED_AREA, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_ATTITUDE_QUATERNION_COV, MAVLINK_MESSAGE_INFO_NAV_CONTROLLER_OUTPUT, MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_INT_COV, MAVLINK_MESSAGE_INFO_LOCAL_POSITION_NED_COV, MAVLINK_MESSAGE_INFO_RC_CHANNELS, MAVLINK_MESSAGE_INFO_REQUEST_DATA_STREAM, MAVLINK_MESSAGE_INFO_DATA_STREAM, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_MANUAL_CONTROL, MAVLINK_MESSAGE_INFO_RC_CHANNELS_OVERRIDE, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_MISSION_ITEM_INT, MAVLINK_MESSAGE_INFO_VFR_HUD, MAVLINK_MESSAGE_INFO_COMMAND_INT, MAVLINK_MESSAGE_INFO_COMMAND_LONG, MAVLINK_MESSAGE_INFO_COMMAND_ACK, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_COMMAND_CANCEL, MAVLINK_MESSAGE_INFO_MANUAL_SETPOINT, MAVLINK_MESSAGE_INFO_SET_ATTITUDE_TARGET, MAVLINK_MESSAGE_INFO_ATTITUDE_TARGET, MAVLINK_MESSAGE_INFO_SET_POSITION_TARGET_LOCAL_NED, MAVLINK_MESSAGE_INFO_POSITION_TARGET_LOCAL_NED, MAVLINK_MESSAGE_INFO_SET_POSITION_TARGET_GLOBAL_INT, MAVLINK_MESSAGE_INFO_POSITION_TARGET_GLOBAL_INT, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET, MAVLINK_MESSAGE_INFO_HIL_STATE, MAVLINK_MESSAGE_INFO_HIL_CONTROLS, MAVLINK_MESSAGE_INFO_HIL_RC_INPUTS_RAW, MAVLINK_MESSAGE_INFO_HIL_ACTUATOR_CONTROLS, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_OPTICAL_FLOW, MAVLINK_MESSAGE_INFO_GLOBAL_VISION_POSITION_ESTIMATE, MAVLINK_MESSAGE_INFO_VISION_POSITION_ESTIMATE, MAVLINK_MESSAGE_INFO_VISION_SPEED_ESTIMATE, MAVLINK_MESSAGE_INFO_VICON_POSITION_ESTIMATE, MAVLINK_MESSAGE_INFO_HIGHRES_IMU, MAVLINK_MESSAGE_INFO_OPTICAL_FLOW_RAD, MAVLINK_MESSAGE_INFO_HIL_SENSOR, MAVLINK_MESSAGE_INFO_SIM_STATE, MAVLINK_MESSAGE_INFO_RADIO_STATUS, MAVLINK_MESSAGE_INFO_FILE_TRANSFER_PROTOCOL, MAVLINK_MESSAGE_INFO_TIMESYNC, MAVLINK_MESSAGE_INFO_CAMERA_TRIGGER, MAVLINK_MESSAGE_INFO_HIL_GPS, MAVLINK_MESSAGE_INFO_HIL_OPTICAL_FLOW, MAVLINK_MESSAGE_INFO_HIL_STATE_QUATERNION, MAVLINK_MESSAGE_INFO_SCALED_IMU2, MAVLINK_MESSAGE_INFO_LOG_REQUEST_LIST, MAVLINK_MESSAGE_INFO_LOG_ENTRY, MAVLINK_MESSAGE_INFO_LOG_REQUEST_DATA, MAVLINK_MESSAGE_INFO_LOG_DATA, MAVLINK_MESSAGE_INFO_LOG_ERASE, MAVLINK_MESSAGE_INFO_LOG_REQUEST_END, MAVLINK_MESSAGE_INFO_GPS_INJECT_DATA, MAVLINK_MESSAGE_INFO_GPS2_RAW, MAVLINK_MESSAGE_INFO_POWER_STATUS, MAVLINK_MESSAGE_INFO_SERIAL_CONTROL, MAVLINK_MESSAGE_INFO_GPS_RTK, MAVLINK_MESSAGE_INFO_GPS2_RTK, MAVLINK_MESSAGE_INFO_SCALED_IMU3, MAVLINK_MESSAGE_INFO_DATA_TRANSMISSION_HANDSHAKE, MAVLINK_MESSAGE_INFO_ENCAPSULATED_DATA, MAVLINK_MESSAGE_INFO_DISTANCE_SENSOR, MAVLINK_MESSAGE_INFO_TERRAIN_REQUEST, MAVLINK_MESSAGE_INFO_TERRAIN_DATA, MAVLINK_MESSAGE_INFO_TERRAIN_CHECK, MAVLINK_MESSAGE_INFO_TERRAIN_REPORT, MAVLINK_MESSAGE_INFO_SCALED_PRESSURE2, MAVLINK_MESSAGE_INFO_ATT_POS_MOCAP, MAVLINK_MESSAGE_INFO_SET_ACTUATOR_CONTROL_TARGET, MAVLINK_MESSAGE_INFO_ACTUATOR_CONTROL_TARGET, MAVLINK_MESSAGE_INFO_ALTITUDE, MAVLINK_MESSAGE_INFO_RESOURCE_REQUEST, MAVLINK_MESSAGE_INFO_SCALED_PRESSURE3, MAVLINK_MESSAGE_INFO_FOLLOW_TARGET, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_CONTROL_SYSTEM_STATE, MAVLINK_MESSAGE_INFO_BATTERY_STATUS, MAVLINK_MESSAGE_INFO_AUTOPILOT_VERSION, MAVLINK_MESSAGE_INFO_LANDING_TARGET, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_FENCE_STATUS, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_ESTIMATOR_STATUS, MAVLINK_MESSAGE_INFO_WIND_COV, MAVLINK_MESSAGE_INFO_GPS_INPUT, MAVLINK_MESSAGE_INFO_GPS_RTCM_DATA, MAVLINK_MESSAGE_INFO_HIGH_LATENCY, MAVLINK_MESSAGE_INFO_HIGH_LATENCY2, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_VIBRATION, MAVLINK_MESSAGE_INFO_HOME_POSITION, MAVLINK_MESSAGE_INFO_SET_HOME_POSITION, MAVLINK_MESSAGE_INFO_MESSAGE_INTERVAL, MAVLINK_MESSAGE_INFO_EXTENDED_SYS_STATE, MAVLINK_MESSAGE_INFO_ADSB_VEHICLE, MAVLINK_MESSAGE_INFO_COLLISION, MAVLINK_MESSAGE_INFO_V2_EXTENSION, MAVLINK_MESSAGE_INFO_MEMORY_VECT, MAVLINK_MESSAGE_INFO_DEBUG_VECT, MAVLINK_MESSAGE_INFO_NAMED_VALUE_FLOAT, MAVLINK_MESSAGE_INFO_NAMED_VALUE_INT, MAVLINK_MESSAGE_INFO_STATUSTEXT, MAVLINK_MESSAGE_INFO_DEBUG, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}} +# define MAVLINK_MESSAGE_NAMES {{ "ACTUATOR_CONTROL_TARGET", 140 }, { "ADSB_VEHICLE", 246 }, { "ALTITUDE", 141 }, { "ATTITUDE", 30 }, { "ATTITUDE_QUATERNION", 31 }, { "ATTITUDE_QUATERNION_COV", 61 }, { "ATTITUDE_TARGET", 83 }, { "ATT_POS_MOCAP", 138 }, { "AUTH_KEY", 7 }, { "AUTOPILOT_VERSION", 148 }, { "BATTERY_STATUS", 147 }, { "CAMERA_TRIGGER", 112 }, { "CHANGE_OPERATOR_CONTROL", 5 }, { "CHANGE_OPERATOR_CONTROL_ACK", 6 }, { "COLLISION", 247 }, { "COMMAND_ACK", 77 }, { "COMMAND_CANCEL", 80 }, { "COMMAND_INT", 75 }, { "COMMAND_LONG", 76 }, { "CONTROL_SYSTEM_STATE", 146 }, { "DATA_STREAM", 67 }, { "DATA_TRANSMISSION_HANDSHAKE", 130 }, { "DEBUG", 254 }, { "DEBUG_VECT", 250 }, { "DISTANCE_SENSOR", 132 }, { "ENCAPSULATED_DATA", 131 }, { "ESTIMATOR_STATUS", 230 }, { "EXTENDED_SYS_STATE", 245 }, { "FENCE_STATUS", 162 }, { "FILE_TRANSFER_PROTOCOL", 110 }, { "FOLLOW_TARGET", 144 }, { "GLOBAL_POSITION_INT", 33 }, { "GLOBAL_POSITION_INT_COV", 63 }, { "GLOBAL_VISION_POSITION_ESTIMATE", 101 }, { "GPS2_RAW", 124 }, { "GPS2_RTK", 128 }, { "GPS_GLOBAL_ORIGIN", 49 }, { "GPS_INJECT_DATA", 123 }, { "GPS_INPUT", 232 }, { "GPS_RAW_INT", 24 }, { "GPS_RTCM_DATA", 233 }, { "GPS_RTK", 127 }, { "GPS_STATUS", 25 }, { "HEARTBEAT", 0 }, { "HIGHRES_IMU", 105 }, { "HIGH_LATENCY", 234 }, { "HIGH_LATENCY2", 235 }, { "HIL_ACTUATOR_CONTROLS", 93 }, { "HIL_CONTROLS", 91 }, { "HIL_GPS", 113 }, { "HIL_OPTICAL_FLOW", 114 }, { "HIL_RC_INPUTS_RAW", 92 }, { "HIL_SENSOR", 107 }, { "HIL_STATE", 90 }, { "HIL_STATE_QUATERNION", 115 }, { "HOME_POSITION", 242 }, { "LANDING_TARGET", 149 }, { "LINK_NODE_STATUS", 8 }, { "LOCAL_POSITION_NED", 32 }, { "LOCAL_POSITION_NED_COV", 64 }, { "LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET", 89 }, { "LOG_DATA", 120 }, { "LOG_ENTRY", 118 }, { "LOG_ERASE", 121 }, { "LOG_REQUEST_DATA", 119 }, { "LOG_REQUEST_END", 122 }, { "LOG_REQUEST_LIST", 117 }, { "MANUAL_CONTROL", 69 }, { "MANUAL_SETPOINT", 81 }, { "MEMORY_VECT", 249 }, { "MESSAGE_INTERVAL", 244 }, { "MISSION_ACK", 47 }, { "MISSION_CHANGED", 52 }, { "MISSION_CLEAR_ALL", 45 }, { "MISSION_COUNT", 44 }, { "MISSION_CURRENT", 42 }, { "MISSION_ITEM", 39 }, { "MISSION_ITEM_INT", 73 }, { "MISSION_ITEM_REACHED", 46 }, { "MISSION_REQUEST", 40 }, { "MISSION_REQUEST_INT", 51 }, { "MISSION_REQUEST_LIST", 43 }, { "MISSION_REQUEST_PARTIAL_LIST", 37 }, { "MISSION_SET_CURRENT", 41 }, { "MISSION_WRITE_PARTIAL_LIST", 38 }, { "NAMED_VALUE_FLOAT", 251 }, { "NAMED_VALUE_INT", 252 }, { "NAV_CONTROLLER_OUTPUT", 62 }, { "OPTICAL_FLOW", 100 }, { "OPTICAL_FLOW_RAD", 106 }, { "PARAM_ACK_TRANSACTION", 19 }, { "PARAM_MAP_RC", 50 }, { "PARAM_REQUEST_LIST", 21 }, { "PARAM_REQUEST_READ", 20 }, { "PARAM_SET", 23 }, { "PARAM_VALUE", 22 }, { "PING", 4 }, { "POSITION_TARGET_GLOBAL_INT", 87 }, { "POSITION_TARGET_LOCAL_NED", 85 }, { "POWER_STATUS", 125 }, { "RADIO_STATUS", 109 }, { "RAW_IMU", 27 }, { "RAW_PRESSURE", 28 }, { "RC_CHANNELS", 65 }, { "RC_CHANNELS_OVERRIDE", 70 }, { "RC_CHANNELS_RAW", 35 }, { "RC_CHANNELS_SCALED", 34 }, { "REQUEST_DATA_STREAM", 66 }, { "RESOURCE_REQUEST", 142 }, { "SAFETY_ALLOWED_AREA", 55 }, { "SAFETY_SET_ALLOWED_AREA", 54 }, { "SCALED_IMU", 26 }, { "SCALED_IMU2", 116 }, { "SCALED_IMU3", 129 }, { "SCALED_PRESSURE", 29 }, { "SCALED_PRESSURE2", 137 }, { "SCALED_PRESSURE3", 143 }, { "SERIAL_CONTROL", 126 }, { "SERVO_OUTPUT_RAW", 36 }, { "SET_ACTUATOR_CONTROL_TARGET", 139 }, { "SET_ATTITUDE_TARGET", 82 }, { "SET_GPS_GLOBAL_ORIGIN", 48 }, { "SET_HOME_POSITION", 243 }, { "SET_MODE", 11 }, { "SET_POSITION_TARGET_GLOBAL_INT", 86 }, { "SET_POSITION_TARGET_LOCAL_NED", 84 }, { "SIM_STATE", 108 }, { "STATUSTEXT", 253 }, { "SYSTEM_TIME", 2 }, { "SYS_STATUS", 1 }, { "TERRAIN_CHECK", 135 }, { "TERRAIN_DATA", 134 }, { "TERRAIN_REPORT", 136 }, { "TERRAIN_REQUEST", 133 }, { "TIMESYNC", 111 }, { "V2_EXTENSION", 248 }, { "VFR_HUD", 74 }, { "VIBRATION", 241 }, { "VICON_POSITION_ESTIMATE", 104 }, { "VISION_POSITION_ESTIMATE", 102 }, { "VISION_SPEED_ESTIMATE", 103 }, { "WIND_COV", 231 }} # if MAVLINK_COMMAND_24BIT # include "../mavlink_get_info.h" # endif diff --git a/lib/main/MAVLink/common/mavlink.h b/lib/main/MAVLink/common/mavlink.h index 6644aa5c2f..35163d3459 100755 --- a/lib/main/MAVLink/common/mavlink.h +++ b/lib/main/MAVLink/common/mavlink.h @@ -6,7 +6,7 @@ #ifndef MAVLINK_H #define MAVLINK_H -#define MAVLINK_PRIMARY_XML_IDX 1 +#define MAVLINK_PRIMARY_XML_IDX 0 #ifndef MAVLINK_STX #define MAVLINK_STX 254 diff --git a/lib/main/MAVLink/common/mavlink_msg_actuator_control_target.h b/lib/main/MAVLink/common/mavlink_msg_actuator_control_target.h index 2d1ebc05a2..31e307cb5a 100755 --- a/lib/main/MAVLink/common/mavlink_msg_actuator_control_target.h +++ b/lib/main/MAVLink/common/mavlink_msg_actuator_control_target.h @@ -3,12 +3,12 @@ #define MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET 140 -MAVPACKED( + typedef struct __mavlink_actuator_control_target_t { - uint64_t time_usec; /*< Timestamp (micros since boot or Unix epoch)*/ - float controls[8]; /*< Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs.*/ - uint8_t group_mlx; /*< Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances.*/ -}) mavlink_actuator_control_target_t; + uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.*/ + float controls[8]; /*< Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs.*/ + uint8_t group_mlx; /*< Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances.*/ +} mavlink_actuator_control_target_t; #define MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN 41 #define MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_MIN_LEN 41 @@ -26,8 +26,8 @@ typedef struct __mavlink_actuator_control_target_t { "ACTUATOR_CONTROL_TARGET", \ 3, \ { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_actuator_control_target_t, time_usec) }, \ - { "controls", NULL, MAVLINK_TYPE_FLOAT, 8, 8, offsetof(mavlink_actuator_control_target_t, controls) }, \ { "group_mlx", NULL, MAVLINK_TYPE_UINT8_T, 0, 40, offsetof(mavlink_actuator_control_target_t, group_mlx) }, \ + { "controls", NULL, MAVLINK_TYPE_FLOAT, 8, 8, offsetof(mavlink_actuator_control_target_t, controls) }, \ } \ } #else @@ -35,8 +35,8 @@ typedef struct __mavlink_actuator_control_target_t { "ACTUATOR_CONTROL_TARGET", \ 3, \ { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_actuator_control_target_t, time_usec) }, \ - { "controls", NULL, MAVLINK_TYPE_FLOAT, 8, 8, offsetof(mavlink_actuator_control_target_t, controls) }, \ { "group_mlx", NULL, MAVLINK_TYPE_UINT8_T, 0, 40, offsetof(mavlink_actuator_control_target_t, group_mlx) }, \ + { "controls", NULL, MAVLINK_TYPE_FLOAT, 8, 8, offsetof(mavlink_actuator_control_target_t, controls) }, \ } \ } #endif @@ -47,9 +47,9 @@ typedef struct __mavlink_actuator_control_target_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param time_usec Timestamp (micros since boot or Unix epoch) - * @param group_mlx Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances. - * @param controls Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs. + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param group_mlx Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances. + * @param controls Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_actuator_control_target_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -79,9 +79,9 @@ static inline uint16_t mavlink_msg_actuator_control_target_pack(uint8_t system_i * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param time_usec Timestamp (micros since boot or Unix epoch) - * @param group_mlx Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances. - * @param controls Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs. + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param group_mlx Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances. + * @param controls Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_actuator_control_target_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -137,9 +137,9 @@ static inline uint16_t mavlink_msg_actuator_control_target_encode_chan(uint8_t s * @brief Send a actuator_control_target message * @param chan MAVLink channel to send the message * - * @param time_usec Timestamp (micros since boot or Unix epoch) - * @param group_mlx Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances. - * @param controls Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs. + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param group_mlx Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances. + * @param controls Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs. */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -208,7 +208,7 @@ static inline void mavlink_msg_actuator_control_target_send_buf(mavlink_message_ /** * @brief Get field time_usec from actuator_control_target message * - * @return Timestamp (micros since boot or Unix epoch) + * @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. */ static inline uint64_t mavlink_msg_actuator_control_target_get_time_usec(const mavlink_message_t* msg) { @@ -218,7 +218,7 @@ static inline uint64_t mavlink_msg_actuator_control_target_get_time_usec(const m /** * @brief Get field group_mlx from actuator_control_target message * - * @return Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances. + * @return Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances. */ static inline uint8_t mavlink_msg_actuator_control_target_get_group_mlx(const mavlink_message_t* msg) { @@ -228,7 +228,7 @@ static inline uint8_t mavlink_msg_actuator_control_target_get_group_mlx(const ma /** * @brief Get field controls from actuator_control_target message * - * @return Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs. + * @return Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs. */ static inline uint16_t mavlink_msg_actuator_control_target_get_controls(const mavlink_message_t* msg, float *controls) { diff --git a/lib/main/MAVLink/common/mavlink_msg_adsb_vehicle.h b/lib/main/MAVLink/common/mavlink_msg_adsb_vehicle.h index d395be5e9d..7296c22aa5 100755 --- a/lib/main/MAVLink/common/mavlink_msg_adsb_vehicle.h +++ b/lib/main/MAVLink/common/mavlink_msg_adsb_vehicle.h @@ -3,22 +3,22 @@ #define MAVLINK_MSG_ID_ADSB_VEHICLE 246 -MAVPACKED( + typedef struct __mavlink_adsb_vehicle_t { - uint32_t ICAO_address; /*< ICAO address*/ - int32_t lat; /*< Latitude, expressed as degrees * 1E7*/ - int32_t lon; /*< Longitude, expressed as degrees * 1E7*/ - int32_t altitude; /*< Altitude(ASL) in millimeters*/ - uint16_t heading; /*< Course over ground in centidegrees*/ - uint16_t hor_velocity; /*< The horizontal velocity in centimeters/second*/ - int16_t ver_velocity; /*< The vertical velocity in centimeters/second, positive is up*/ - uint16_t flags; /*< Flags to indicate various statuses including valid data fields*/ - uint16_t squawk; /*< Squawk code*/ - uint8_t altitude_type; /*< Type from ADSB_ALTITUDE_TYPE enum*/ - char callsign[9]; /*< The callsign, 8+null*/ - uint8_t emitter_type; /*< Type from ADSB_EMITTER_TYPE enum*/ - uint8_t tslc; /*< Time since last communication in seconds*/ -}) mavlink_adsb_vehicle_t; + uint32_t ICAO_address; /*< ICAO address*/ + int32_t lat; /*< [degE7] Latitude*/ + int32_t lon; /*< [degE7] Longitude*/ + int32_t altitude; /*< [mm] Altitude(ASL)*/ + uint16_t heading; /*< [cdeg] Course over ground*/ + uint16_t hor_velocity; /*< [cm/s] The horizontal velocity*/ + int16_t ver_velocity; /*< [cm/s] The vertical velocity. Positive is up*/ + uint16_t flags; /*< Bitmap to indicate various statuses including valid data fields*/ + uint16_t squawk; /*< Squawk code*/ + uint8_t altitude_type; /*< ADSB altitude type.*/ + char callsign[9]; /*< The callsign, 8+null*/ + uint8_t emitter_type; /*< ADSB emitter type.*/ + uint8_t tslc; /*< [s] Time since last communication in seconds*/ +} mavlink_adsb_vehicle_t; #define MAVLINK_MSG_ID_ADSB_VEHICLE_LEN 38 #define MAVLINK_MSG_ID_ADSB_VEHICLE_MIN_LEN 38 @@ -38,16 +38,16 @@ typedef struct __mavlink_adsb_vehicle_t { { { "ICAO_address", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_adsb_vehicle_t, ICAO_address) }, \ { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_adsb_vehicle_t, lat) }, \ { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_adsb_vehicle_t, lon) }, \ + { "altitude_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 26, offsetof(mavlink_adsb_vehicle_t, altitude_type) }, \ { "altitude", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_adsb_vehicle_t, altitude) }, \ { "heading", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_adsb_vehicle_t, heading) }, \ { "hor_velocity", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_adsb_vehicle_t, hor_velocity) }, \ { "ver_velocity", NULL, MAVLINK_TYPE_INT16_T, 0, 20, offsetof(mavlink_adsb_vehicle_t, ver_velocity) }, \ - { "flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 22, offsetof(mavlink_adsb_vehicle_t, flags) }, \ - { "squawk", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_adsb_vehicle_t, squawk) }, \ - { "altitude_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 26, offsetof(mavlink_adsb_vehicle_t, altitude_type) }, \ { "callsign", NULL, MAVLINK_TYPE_CHAR, 9, 27, offsetof(mavlink_adsb_vehicle_t, callsign) }, \ { "emitter_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_adsb_vehicle_t, emitter_type) }, \ { "tslc", NULL, MAVLINK_TYPE_UINT8_T, 0, 37, offsetof(mavlink_adsb_vehicle_t, tslc) }, \ + { "flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 22, offsetof(mavlink_adsb_vehicle_t, flags) }, \ + { "squawk", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_adsb_vehicle_t, squawk) }, \ } \ } #else @@ -57,16 +57,16 @@ typedef struct __mavlink_adsb_vehicle_t { { { "ICAO_address", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_adsb_vehicle_t, ICAO_address) }, \ { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_adsb_vehicle_t, lat) }, \ { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_adsb_vehicle_t, lon) }, \ + { "altitude_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 26, offsetof(mavlink_adsb_vehicle_t, altitude_type) }, \ { "altitude", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_adsb_vehicle_t, altitude) }, \ { "heading", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_adsb_vehicle_t, heading) }, \ { "hor_velocity", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_adsb_vehicle_t, hor_velocity) }, \ { "ver_velocity", NULL, MAVLINK_TYPE_INT16_T, 0, 20, offsetof(mavlink_adsb_vehicle_t, ver_velocity) }, \ - { "flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 22, offsetof(mavlink_adsb_vehicle_t, flags) }, \ - { "squawk", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_adsb_vehicle_t, squawk) }, \ - { "altitude_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 26, offsetof(mavlink_adsb_vehicle_t, altitude_type) }, \ { "callsign", NULL, MAVLINK_TYPE_CHAR, 9, 27, offsetof(mavlink_adsb_vehicle_t, callsign) }, \ { "emitter_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_adsb_vehicle_t, emitter_type) }, \ { "tslc", NULL, MAVLINK_TYPE_UINT8_T, 0, 37, offsetof(mavlink_adsb_vehicle_t, tslc) }, \ + { "flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 22, offsetof(mavlink_adsb_vehicle_t, flags) }, \ + { "squawk", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_adsb_vehicle_t, squawk) }, \ } \ } #endif @@ -77,19 +77,19 @@ typedef struct __mavlink_adsb_vehicle_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param ICAO_address ICAO address - * @param lat Latitude, expressed as degrees * 1E7 - * @param lon Longitude, expressed as degrees * 1E7 - * @param altitude_type Type from ADSB_ALTITUDE_TYPE enum - * @param altitude Altitude(ASL) in millimeters - * @param heading Course over ground in centidegrees - * @param hor_velocity The horizontal velocity in centimeters/second - * @param ver_velocity The vertical velocity in centimeters/second, positive is up - * @param callsign The callsign, 8+null - * @param emitter_type Type from ADSB_EMITTER_TYPE enum - * @param tslc Time since last communication in seconds - * @param flags Flags to indicate various statuses including valid data fields - * @param squawk Squawk code + * @param ICAO_address ICAO address + * @param lat [degE7] Latitude + * @param lon [degE7] Longitude + * @param altitude_type ADSB altitude type. + * @param altitude [mm] Altitude(ASL) + * @param heading [cdeg] Course over ground + * @param hor_velocity [cm/s] The horizontal velocity + * @param ver_velocity [cm/s] The vertical velocity. Positive is up + * @param callsign The callsign, 8+null + * @param emitter_type ADSB emitter type. + * @param tslc [s] Time since last communication in seconds + * @param flags Bitmap to indicate various statuses including valid data fields + * @param squawk Squawk code * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_adsb_vehicle_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -139,19 +139,19 @@ static inline uint16_t mavlink_msg_adsb_vehicle_pack(uint8_t system_id, uint8_t * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param ICAO_address ICAO address - * @param lat Latitude, expressed as degrees * 1E7 - * @param lon Longitude, expressed as degrees * 1E7 - * @param altitude_type Type from ADSB_ALTITUDE_TYPE enum - * @param altitude Altitude(ASL) in millimeters - * @param heading Course over ground in centidegrees - * @param hor_velocity The horizontal velocity in centimeters/second - * @param ver_velocity The vertical velocity in centimeters/second, positive is up - * @param callsign The callsign, 8+null - * @param emitter_type Type from ADSB_EMITTER_TYPE enum - * @param tslc Time since last communication in seconds - * @param flags Flags to indicate various statuses including valid data fields - * @param squawk Squawk code + * @param ICAO_address ICAO address + * @param lat [degE7] Latitude + * @param lon [degE7] Longitude + * @param altitude_type ADSB altitude type. + * @param altitude [mm] Altitude(ASL) + * @param heading [cdeg] Course over ground + * @param hor_velocity [cm/s] The horizontal velocity + * @param ver_velocity [cm/s] The vertical velocity. Positive is up + * @param callsign The callsign, 8+null + * @param emitter_type ADSB emitter type. + * @param tslc [s] Time since last communication in seconds + * @param flags Bitmap to indicate various statuses including valid data fields + * @param squawk Squawk code * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_adsb_vehicle_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -227,19 +227,19 @@ static inline uint16_t mavlink_msg_adsb_vehicle_encode_chan(uint8_t system_id, u * @brief Send a adsb_vehicle message * @param chan MAVLink channel to send the message * - * @param ICAO_address ICAO address - * @param lat Latitude, expressed as degrees * 1E7 - * @param lon Longitude, expressed as degrees * 1E7 - * @param altitude_type Type from ADSB_ALTITUDE_TYPE enum - * @param altitude Altitude(ASL) in millimeters - * @param heading Course over ground in centidegrees - * @param hor_velocity The horizontal velocity in centimeters/second - * @param ver_velocity The vertical velocity in centimeters/second, positive is up - * @param callsign The callsign, 8+null - * @param emitter_type Type from ADSB_EMITTER_TYPE enum - * @param tslc Time since last communication in seconds - * @param flags Flags to indicate various statuses including valid data fields - * @param squawk Squawk code + * @param ICAO_address ICAO address + * @param lat [degE7] Latitude + * @param lon [degE7] Longitude + * @param altitude_type ADSB altitude type. + * @param altitude [mm] Altitude(ASL) + * @param heading [cdeg] Course over ground + * @param hor_velocity [cm/s] The horizontal velocity + * @param ver_velocity [cm/s] The vertical velocity. Positive is up + * @param callsign The callsign, 8+null + * @param emitter_type ADSB emitter type. + * @param tslc [s] Time since last communication in seconds + * @param flags Bitmap to indicate various statuses including valid data fields + * @param squawk Squawk code */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -348,7 +348,7 @@ static inline void mavlink_msg_adsb_vehicle_send_buf(mavlink_message_t *msgbuf, /** * @brief Get field ICAO_address from adsb_vehicle message * - * @return ICAO address + * @return ICAO address */ static inline uint32_t mavlink_msg_adsb_vehicle_get_ICAO_address(const mavlink_message_t* msg) { @@ -358,7 +358,7 @@ static inline uint32_t mavlink_msg_adsb_vehicle_get_ICAO_address(const mavlink_m /** * @brief Get field lat from adsb_vehicle message * - * @return Latitude, expressed as degrees * 1E7 + * @return [degE7] Latitude */ static inline int32_t mavlink_msg_adsb_vehicle_get_lat(const mavlink_message_t* msg) { @@ -368,7 +368,7 @@ static inline int32_t mavlink_msg_adsb_vehicle_get_lat(const mavlink_message_t* /** * @brief Get field lon from adsb_vehicle message * - * @return Longitude, expressed as degrees * 1E7 + * @return [degE7] Longitude */ static inline int32_t mavlink_msg_adsb_vehicle_get_lon(const mavlink_message_t* msg) { @@ -378,7 +378,7 @@ static inline int32_t mavlink_msg_adsb_vehicle_get_lon(const mavlink_message_t* /** * @brief Get field altitude_type from adsb_vehicle message * - * @return Type from ADSB_ALTITUDE_TYPE enum + * @return ADSB altitude type. */ static inline uint8_t mavlink_msg_adsb_vehicle_get_altitude_type(const mavlink_message_t* msg) { @@ -388,7 +388,7 @@ static inline uint8_t mavlink_msg_adsb_vehicle_get_altitude_type(const mavlink_m /** * @brief Get field altitude from adsb_vehicle message * - * @return Altitude(ASL) in millimeters + * @return [mm] Altitude(ASL) */ static inline int32_t mavlink_msg_adsb_vehicle_get_altitude(const mavlink_message_t* msg) { @@ -398,7 +398,7 @@ static inline int32_t mavlink_msg_adsb_vehicle_get_altitude(const mavlink_messag /** * @brief Get field heading from adsb_vehicle message * - * @return Course over ground in centidegrees + * @return [cdeg] Course over ground */ static inline uint16_t mavlink_msg_adsb_vehicle_get_heading(const mavlink_message_t* msg) { @@ -408,7 +408,7 @@ static inline uint16_t mavlink_msg_adsb_vehicle_get_heading(const mavlink_messag /** * @brief Get field hor_velocity from adsb_vehicle message * - * @return The horizontal velocity in centimeters/second + * @return [cm/s] The horizontal velocity */ static inline uint16_t mavlink_msg_adsb_vehicle_get_hor_velocity(const mavlink_message_t* msg) { @@ -418,7 +418,7 @@ static inline uint16_t mavlink_msg_adsb_vehicle_get_hor_velocity(const mavlink_m /** * @brief Get field ver_velocity from adsb_vehicle message * - * @return The vertical velocity in centimeters/second, positive is up + * @return [cm/s] The vertical velocity. Positive is up */ static inline int16_t mavlink_msg_adsb_vehicle_get_ver_velocity(const mavlink_message_t* msg) { @@ -428,7 +428,7 @@ static inline int16_t mavlink_msg_adsb_vehicle_get_ver_velocity(const mavlink_me /** * @brief Get field callsign from adsb_vehicle message * - * @return The callsign, 8+null + * @return The callsign, 8+null */ static inline uint16_t mavlink_msg_adsb_vehicle_get_callsign(const mavlink_message_t* msg, char *callsign) { @@ -438,7 +438,7 @@ static inline uint16_t mavlink_msg_adsb_vehicle_get_callsign(const mavlink_messa /** * @brief Get field emitter_type from adsb_vehicle message * - * @return Type from ADSB_EMITTER_TYPE enum + * @return ADSB emitter type. */ static inline uint8_t mavlink_msg_adsb_vehicle_get_emitter_type(const mavlink_message_t* msg) { @@ -448,7 +448,7 @@ static inline uint8_t mavlink_msg_adsb_vehicle_get_emitter_type(const mavlink_me /** * @brief Get field tslc from adsb_vehicle message * - * @return Time since last communication in seconds + * @return [s] Time since last communication in seconds */ static inline uint8_t mavlink_msg_adsb_vehicle_get_tslc(const mavlink_message_t* msg) { @@ -458,7 +458,7 @@ static inline uint8_t mavlink_msg_adsb_vehicle_get_tslc(const mavlink_message_t* /** * @brief Get field flags from adsb_vehicle message * - * @return Flags to indicate various statuses including valid data fields + * @return Bitmap to indicate various statuses including valid data fields */ static inline uint16_t mavlink_msg_adsb_vehicle_get_flags(const mavlink_message_t* msg) { @@ -468,7 +468,7 @@ static inline uint16_t mavlink_msg_adsb_vehicle_get_flags(const mavlink_message_ /** * @brief Get field squawk from adsb_vehicle message * - * @return Squawk code + * @return Squawk code */ static inline uint16_t mavlink_msg_adsb_vehicle_get_squawk(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_altitude.h b/lib/main/MAVLink/common/mavlink_msg_altitude.h index d51a9e80c0..1424f0ab9d 100755 --- a/lib/main/MAVLink/common/mavlink_msg_altitude.h +++ b/lib/main/MAVLink/common/mavlink_msg_altitude.h @@ -3,16 +3,16 @@ #define MAVLINK_MSG_ID_ALTITUDE 141 -MAVPACKED( + typedef struct __mavlink_altitude_t { - uint64_t time_usec; /*< Timestamp (micros since boot or Unix epoch)*/ - float altitude_monotonic; /*< This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights.*/ - float altitude_amsl; /*< This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output AMSL by default and not the WGS84 altitude.*/ - float altitude_local; /*< This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive.*/ - float altitude_relative; /*< This is the altitude above the home position. It resets on each change of the current home position.*/ - float altitude_terrain; /*< This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown.*/ - float bottom_clearance; /*< This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available.*/ -}) mavlink_altitude_t; + uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.*/ + float altitude_monotonic; /*< [m] This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights.*/ + float altitude_amsl; /*< [m] This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output MSL by default and not the WGS84 altitude.*/ + float altitude_local; /*< [m] This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive.*/ + float altitude_relative; /*< [m] This is the altitude above the home position. It resets on each change of the current home position.*/ + float altitude_terrain; /*< [m] This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown.*/ + float bottom_clearance; /*< [m] This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available.*/ +} mavlink_altitude_t; #define MAVLINK_MSG_ID_ALTITUDE_LEN 32 #define MAVLINK_MSG_ID_ALTITUDE_MIN_LEN 32 @@ -59,13 +59,13 @@ typedef struct __mavlink_altitude_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param time_usec Timestamp (micros since boot or Unix epoch) - * @param altitude_monotonic This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights. - * @param altitude_amsl This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output AMSL by default and not the WGS84 altitude. - * @param altitude_local This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive. - * @param altitude_relative This is the altitude above the home position. It resets on each change of the current home position. - * @param altitude_terrain This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown. - * @param bottom_clearance This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available. + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param altitude_monotonic [m] This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights. + * @param altitude_amsl [m] This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output MSL by default and not the WGS84 altitude. + * @param altitude_local [m] This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive. + * @param altitude_relative [m] This is the altitude above the home position. It resets on each change of the current home position. + * @param altitude_terrain [m] This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown. + * @param bottom_clearance [m] This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_altitude_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -105,13 +105,13 @@ static inline uint16_t mavlink_msg_altitude_pack(uint8_t system_id, uint8_t comp * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param time_usec Timestamp (micros since boot or Unix epoch) - * @param altitude_monotonic This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights. - * @param altitude_amsl This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output AMSL by default and not the WGS84 altitude. - * @param altitude_local This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive. - * @param altitude_relative This is the altitude above the home position. It resets on each change of the current home position. - * @param altitude_terrain This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown. - * @param bottom_clearance This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available. + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param altitude_monotonic [m] This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights. + * @param altitude_amsl [m] This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output MSL by default and not the WGS84 altitude. + * @param altitude_local [m] This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive. + * @param altitude_relative [m] This is the altitude above the home position. It resets on each change of the current home position. + * @param altitude_terrain [m] This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown. + * @param bottom_clearance [m] This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_altitude_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -177,13 +177,13 @@ static inline uint16_t mavlink_msg_altitude_encode_chan(uint8_t system_id, uint8 * @brief Send a altitude message * @param chan MAVLink channel to send the message * - * @param time_usec Timestamp (micros since boot or Unix epoch) - * @param altitude_monotonic This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights. - * @param altitude_amsl This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output AMSL by default and not the WGS84 altitude. - * @param altitude_local This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive. - * @param altitude_relative This is the altitude above the home position. It resets on each change of the current home position. - * @param altitude_terrain This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown. - * @param bottom_clearance This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available. + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param altitude_monotonic [m] This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights. + * @param altitude_amsl [m] This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output MSL by default and not the WGS84 altitude. + * @param altitude_local [m] This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive. + * @param altitude_relative [m] This is the altitude above the home position. It resets on each change of the current home position. + * @param altitude_terrain [m] This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown. + * @param bottom_clearance [m] This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available. */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -272,7 +272,7 @@ static inline void mavlink_msg_altitude_send_buf(mavlink_message_t *msgbuf, mavl /** * @brief Get field time_usec from altitude message * - * @return Timestamp (micros since boot or Unix epoch) + * @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. */ static inline uint64_t mavlink_msg_altitude_get_time_usec(const mavlink_message_t* msg) { @@ -282,7 +282,7 @@ static inline uint64_t mavlink_msg_altitude_get_time_usec(const mavlink_message_ /** * @brief Get field altitude_monotonic from altitude message * - * @return This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights. + * @return [m] This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights. */ static inline float mavlink_msg_altitude_get_altitude_monotonic(const mavlink_message_t* msg) { @@ -292,7 +292,7 @@ static inline float mavlink_msg_altitude_get_altitude_monotonic(const mavlink_me /** * @brief Get field altitude_amsl from altitude message * - * @return This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output AMSL by default and not the WGS84 altitude. + * @return [m] This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output MSL by default and not the WGS84 altitude. */ static inline float mavlink_msg_altitude_get_altitude_amsl(const mavlink_message_t* msg) { @@ -302,7 +302,7 @@ static inline float mavlink_msg_altitude_get_altitude_amsl(const mavlink_message /** * @brief Get field altitude_local from altitude message * - * @return This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive. + * @return [m] This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive. */ static inline float mavlink_msg_altitude_get_altitude_local(const mavlink_message_t* msg) { @@ -312,7 +312,7 @@ static inline float mavlink_msg_altitude_get_altitude_local(const mavlink_messag /** * @brief Get field altitude_relative from altitude message * - * @return This is the altitude above the home position. It resets on each change of the current home position. + * @return [m] This is the altitude above the home position. It resets on each change of the current home position. */ static inline float mavlink_msg_altitude_get_altitude_relative(const mavlink_message_t* msg) { @@ -322,7 +322,7 @@ static inline float mavlink_msg_altitude_get_altitude_relative(const mavlink_mes /** * @brief Get field altitude_terrain from altitude message * - * @return This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown. + * @return [m] This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown. */ static inline float mavlink_msg_altitude_get_altitude_terrain(const mavlink_message_t* msg) { @@ -332,7 +332,7 @@ static inline float mavlink_msg_altitude_get_altitude_terrain(const mavlink_mess /** * @brief Get field bottom_clearance from altitude message * - * @return This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available. + * @return [m] This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available. */ static inline float mavlink_msg_altitude_get_bottom_clearance(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_att_pos_mocap.h b/lib/main/MAVLink/common/mavlink_msg_att_pos_mocap.h index 3c1a251a6e..dab6f557b6 100755 --- a/lib/main/MAVLink/common/mavlink_msg_att_pos_mocap.h +++ b/lib/main/MAVLink/common/mavlink_msg_att_pos_mocap.h @@ -3,14 +3,14 @@ #define MAVLINK_MSG_ID_ATT_POS_MOCAP 138 -MAVPACKED( + typedef struct __mavlink_att_pos_mocap_t { - uint64_t time_usec; /*< Timestamp (micros since boot or Unix epoch)*/ - float q[4]; /*< Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)*/ - float x; /*< X position in meters (NED)*/ - float y; /*< Y position in meters (NED)*/ - float z; /*< Z position in meters (NED)*/ -}) mavlink_att_pos_mocap_t; + uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.*/ + float q[4]; /*< Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)*/ + float x; /*< [m] X position (NED)*/ + float y; /*< [m] Y position (NED)*/ + float z; /*< [m] Z position (NED)*/ +} mavlink_att_pos_mocap_t; #define MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN 36 #define MAVLINK_MSG_ID_ATT_POS_MOCAP_MIN_LEN 36 @@ -53,11 +53,11 @@ typedef struct __mavlink_att_pos_mocap_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param time_usec Timestamp (micros since boot or Unix epoch) - * @param q Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) - * @param x X position in meters (NED) - * @param y Y position in meters (NED) - * @param z Z position in meters (NED) + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param q Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) + * @param x [m] X position (NED) + * @param y [m] Y position (NED) + * @param z [m] Z position (NED) * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_att_pos_mocap_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -91,11 +91,11 @@ static inline uint16_t mavlink_msg_att_pos_mocap_pack(uint8_t system_id, uint8_t * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param time_usec Timestamp (micros since boot or Unix epoch) - * @param q Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) - * @param x X position in meters (NED) - * @param y Y position in meters (NED) - * @param z Z position in meters (NED) + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param q Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) + * @param x [m] X position (NED) + * @param y [m] Y position (NED) + * @param z [m] Z position (NED) * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_att_pos_mocap_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -155,11 +155,11 @@ static inline uint16_t mavlink_msg_att_pos_mocap_encode_chan(uint8_t system_id, * @brief Send a att_pos_mocap message * @param chan MAVLink channel to send the message * - * @param time_usec Timestamp (micros since boot or Unix epoch) - * @param q Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) - * @param x X position in meters (NED) - * @param y Y position in meters (NED) - * @param z Z position in meters (NED) + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param q Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) + * @param x [m] X position (NED) + * @param y [m] Y position (NED) + * @param z [m] Z position (NED) */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -236,7 +236,7 @@ static inline void mavlink_msg_att_pos_mocap_send_buf(mavlink_message_t *msgbuf, /** * @brief Get field time_usec from att_pos_mocap message * - * @return Timestamp (micros since boot or Unix epoch) + * @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. */ static inline uint64_t mavlink_msg_att_pos_mocap_get_time_usec(const mavlink_message_t* msg) { @@ -246,7 +246,7 @@ static inline uint64_t mavlink_msg_att_pos_mocap_get_time_usec(const mavlink_mes /** * @brief Get field q from att_pos_mocap message * - * @return Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) + * @return Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) */ static inline uint16_t mavlink_msg_att_pos_mocap_get_q(const mavlink_message_t* msg, float *q) { @@ -256,7 +256,7 @@ static inline uint16_t mavlink_msg_att_pos_mocap_get_q(const mavlink_message_t* /** * @brief Get field x from att_pos_mocap message * - * @return X position in meters (NED) + * @return [m] X position (NED) */ static inline float mavlink_msg_att_pos_mocap_get_x(const mavlink_message_t* msg) { @@ -266,7 +266,7 @@ static inline float mavlink_msg_att_pos_mocap_get_x(const mavlink_message_t* msg /** * @brief Get field y from att_pos_mocap message * - * @return Y position in meters (NED) + * @return [m] Y position (NED) */ static inline float mavlink_msg_att_pos_mocap_get_y(const mavlink_message_t* msg) { @@ -276,7 +276,7 @@ static inline float mavlink_msg_att_pos_mocap_get_y(const mavlink_message_t* msg /** * @brief Get field z from att_pos_mocap message * - * @return Z position in meters (NED) + * @return [m] Z position (NED) */ static inline float mavlink_msg_att_pos_mocap_get_z(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_attitude.h b/lib/main/MAVLink/common/mavlink_msg_attitude.h index 21472fb2b0..6a8237c92c 100755 --- a/lib/main/MAVLink/common/mavlink_msg_attitude.h +++ b/lib/main/MAVLink/common/mavlink_msg_attitude.h @@ -3,16 +3,16 @@ #define MAVLINK_MSG_ID_ATTITUDE 30 -MAVPACKED( + typedef struct __mavlink_attitude_t { - uint32_t time_boot_ms; /*< Timestamp (milliseconds since system boot)*/ - float roll; /*< Roll angle (rad, -pi..+pi)*/ - float pitch; /*< Pitch angle (rad, -pi..+pi)*/ - float yaw; /*< Yaw angle (rad, -pi..+pi)*/ - float rollspeed; /*< Roll angular speed (rad/s)*/ - float pitchspeed; /*< Pitch angular speed (rad/s)*/ - float yawspeed; /*< Yaw angular speed (rad/s)*/ -}) mavlink_attitude_t; + uint32_t time_boot_ms; /*< [ms] Timestamp (time since system boot).*/ + float roll; /*< [rad] Roll angle (-pi..+pi)*/ + float pitch; /*< [rad] Pitch angle (-pi..+pi)*/ + float yaw; /*< [rad] Yaw angle (-pi..+pi)*/ + float rollspeed; /*< [rad/s] Roll angular speed*/ + float pitchspeed; /*< [rad/s] Pitch angular speed*/ + float yawspeed; /*< [rad/s] Yaw angular speed*/ +} mavlink_attitude_t; #define MAVLINK_MSG_ID_ATTITUDE_LEN 28 #define MAVLINK_MSG_ID_ATTITUDE_MIN_LEN 28 @@ -59,13 +59,13 @@ typedef struct __mavlink_attitude_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param time_boot_ms Timestamp (milliseconds since system boot) - * @param roll Roll angle (rad, -pi..+pi) - * @param pitch Pitch angle (rad, -pi..+pi) - * @param yaw Yaw angle (rad, -pi..+pi) - * @param rollspeed Roll angular speed (rad/s) - * @param pitchspeed Pitch angular speed (rad/s) - * @param yawspeed Yaw angular speed (rad/s) + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param roll [rad] Roll angle (-pi..+pi) + * @param pitch [rad] Pitch angle (-pi..+pi) + * @param yaw [rad] Yaw angle (-pi..+pi) + * @param rollspeed [rad/s] Roll angular speed + * @param pitchspeed [rad/s] Pitch angular speed + * @param yawspeed [rad/s] Yaw angular speed * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_attitude_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -105,13 +105,13 @@ static inline uint16_t mavlink_msg_attitude_pack(uint8_t system_id, uint8_t comp * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param time_boot_ms Timestamp (milliseconds since system boot) - * @param roll Roll angle (rad, -pi..+pi) - * @param pitch Pitch angle (rad, -pi..+pi) - * @param yaw Yaw angle (rad, -pi..+pi) - * @param rollspeed Roll angular speed (rad/s) - * @param pitchspeed Pitch angular speed (rad/s) - * @param yawspeed Yaw angular speed (rad/s) + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param roll [rad] Roll angle (-pi..+pi) + * @param pitch [rad] Pitch angle (-pi..+pi) + * @param yaw [rad] Yaw angle (-pi..+pi) + * @param rollspeed [rad/s] Roll angular speed + * @param pitchspeed [rad/s] Pitch angular speed + * @param yawspeed [rad/s] Yaw angular speed * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_attitude_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -177,13 +177,13 @@ static inline uint16_t mavlink_msg_attitude_encode_chan(uint8_t system_id, uint8 * @brief Send a attitude message * @param chan MAVLink channel to send the message * - * @param time_boot_ms Timestamp (milliseconds since system boot) - * @param roll Roll angle (rad, -pi..+pi) - * @param pitch Pitch angle (rad, -pi..+pi) - * @param yaw Yaw angle (rad, -pi..+pi) - * @param rollspeed Roll angular speed (rad/s) - * @param pitchspeed Pitch angular speed (rad/s) - * @param yawspeed Yaw angular speed (rad/s) + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param roll [rad] Roll angle (-pi..+pi) + * @param pitch [rad] Pitch angle (-pi..+pi) + * @param yaw [rad] Yaw angle (-pi..+pi) + * @param rollspeed [rad/s] Roll angular speed + * @param pitchspeed [rad/s] Pitch angular speed + * @param yawspeed [rad/s] Yaw angular speed */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -272,7 +272,7 @@ static inline void mavlink_msg_attitude_send_buf(mavlink_message_t *msgbuf, mavl /** * @brief Get field time_boot_ms from attitude message * - * @return Timestamp (milliseconds since system boot) + * @return [ms] Timestamp (time since system boot). */ static inline uint32_t mavlink_msg_attitude_get_time_boot_ms(const mavlink_message_t* msg) { @@ -282,7 +282,7 @@ static inline uint32_t mavlink_msg_attitude_get_time_boot_ms(const mavlink_messa /** * @brief Get field roll from attitude message * - * @return Roll angle (rad, -pi..+pi) + * @return [rad] Roll angle (-pi..+pi) */ static inline float mavlink_msg_attitude_get_roll(const mavlink_message_t* msg) { @@ -292,7 +292,7 @@ static inline float mavlink_msg_attitude_get_roll(const mavlink_message_t* msg) /** * @brief Get field pitch from attitude message * - * @return Pitch angle (rad, -pi..+pi) + * @return [rad] Pitch angle (-pi..+pi) */ static inline float mavlink_msg_attitude_get_pitch(const mavlink_message_t* msg) { @@ -302,7 +302,7 @@ static inline float mavlink_msg_attitude_get_pitch(const mavlink_message_t* msg) /** * @brief Get field yaw from attitude message * - * @return Yaw angle (rad, -pi..+pi) + * @return [rad] Yaw angle (-pi..+pi) */ static inline float mavlink_msg_attitude_get_yaw(const mavlink_message_t* msg) { @@ -312,7 +312,7 @@ static inline float mavlink_msg_attitude_get_yaw(const mavlink_message_t* msg) /** * @brief Get field rollspeed from attitude message * - * @return Roll angular speed (rad/s) + * @return [rad/s] Roll angular speed */ static inline float mavlink_msg_attitude_get_rollspeed(const mavlink_message_t* msg) { @@ -322,7 +322,7 @@ static inline float mavlink_msg_attitude_get_rollspeed(const mavlink_message_t* /** * @brief Get field pitchspeed from attitude message * - * @return Pitch angular speed (rad/s) + * @return [rad/s] Pitch angular speed */ static inline float mavlink_msg_attitude_get_pitchspeed(const mavlink_message_t* msg) { @@ -332,7 +332,7 @@ static inline float mavlink_msg_attitude_get_pitchspeed(const mavlink_message_t* /** * @brief Get field yawspeed from attitude message * - * @return Yaw angular speed (rad/s) + * @return [rad/s] Yaw angular speed */ static inline float mavlink_msg_attitude_get_yawspeed(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_attitude_quaternion.h b/lib/main/MAVLink/common/mavlink_msg_attitude_quaternion.h index df8e1e97a9..3ef53c4413 100755 --- a/lib/main/MAVLink/common/mavlink_msg_attitude_quaternion.h +++ b/lib/main/MAVLink/common/mavlink_msg_attitude_quaternion.h @@ -3,17 +3,17 @@ #define MAVLINK_MSG_ID_ATTITUDE_QUATERNION 31 -MAVPACKED( + typedef struct __mavlink_attitude_quaternion_t { - uint32_t time_boot_ms; /*< Timestamp (milliseconds since system boot)*/ - float q1; /*< Quaternion component 1, w (1 in null-rotation)*/ - float q2; /*< Quaternion component 2, x (0 in null-rotation)*/ - float q3; /*< Quaternion component 3, y (0 in null-rotation)*/ - float q4; /*< Quaternion component 4, z (0 in null-rotation)*/ - float rollspeed; /*< Roll angular speed (rad/s)*/ - float pitchspeed; /*< Pitch angular speed (rad/s)*/ - float yawspeed; /*< Yaw angular speed (rad/s)*/ -}) mavlink_attitude_quaternion_t; + uint32_t time_boot_ms; /*< [ms] Timestamp (time since system boot).*/ + float q1; /*< Quaternion component 1, w (1 in null-rotation)*/ + float q2; /*< Quaternion component 2, x (0 in null-rotation)*/ + float q3; /*< Quaternion component 3, y (0 in null-rotation)*/ + float q4; /*< Quaternion component 4, z (0 in null-rotation)*/ + float rollspeed; /*< [rad/s] Roll angular speed*/ + float pitchspeed; /*< [rad/s] Pitch angular speed*/ + float yawspeed; /*< [rad/s] Yaw angular speed*/ +} mavlink_attitude_quaternion_t; #define MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN 32 #define MAVLINK_MSG_ID_ATTITUDE_QUATERNION_MIN_LEN 32 @@ -62,14 +62,14 @@ typedef struct __mavlink_attitude_quaternion_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param time_boot_ms Timestamp (milliseconds since system boot) - * @param q1 Quaternion component 1, w (1 in null-rotation) - * @param q2 Quaternion component 2, x (0 in null-rotation) - * @param q3 Quaternion component 3, y (0 in null-rotation) - * @param q4 Quaternion component 4, z (0 in null-rotation) - * @param rollspeed Roll angular speed (rad/s) - * @param pitchspeed Pitch angular speed (rad/s) - * @param yawspeed Yaw angular speed (rad/s) + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param q1 Quaternion component 1, w (1 in null-rotation) + * @param q2 Quaternion component 2, x (0 in null-rotation) + * @param q3 Quaternion component 3, y (0 in null-rotation) + * @param q4 Quaternion component 4, z (0 in null-rotation) + * @param rollspeed [rad/s] Roll angular speed + * @param pitchspeed [rad/s] Pitch angular speed + * @param yawspeed [rad/s] Yaw angular speed * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_attitude_quaternion_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -111,14 +111,14 @@ static inline uint16_t mavlink_msg_attitude_quaternion_pack(uint8_t system_id, u * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param time_boot_ms Timestamp (milliseconds since system boot) - * @param q1 Quaternion component 1, w (1 in null-rotation) - * @param q2 Quaternion component 2, x (0 in null-rotation) - * @param q3 Quaternion component 3, y (0 in null-rotation) - * @param q4 Quaternion component 4, z (0 in null-rotation) - * @param rollspeed Roll angular speed (rad/s) - * @param pitchspeed Pitch angular speed (rad/s) - * @param yawspeed Yaw angular speed (rad/s) + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param q1 Quaternion component 1, w (1 in null-rotation) + * @param q2 Quaternion component 2, x (0 in null-rotation) + * @param q3 Quaternion component 3, y (0 in null-rotation) + * @param q4 Quaternion component 4, z (0 in null-rotation) + * @param rollspeed [rad/s] Roll angular speed + * @param pitchspeed [rad/s] Pitch angular speed + * @param yawspeed [rad/s] Yaw angular speed * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_attitude_quaternion_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -186,14 +186,14 @@ static inline uint16_t mavlink_msg_attitude_quaternion_encode_chan(uint8_t syste * @brief Send a attitude_quaternion message * @param chan MAVLink channel to send the message * - * @param time_boot_ms Timestamp (milliseconds since system boot) - * @param q1 Quaternion component 1, w (1 in null-rotation) - * @param q2 Quaternion component 2, x (0 in null-rotation) - * @param q3 Quaternion component 3, y (0 in null-rotation) - * @param q4 Quaternion component 4, z (0 in null-rotation) - * @param rollspeed Roll angular speed (rad/s) - * @param pitchspeed Pitch angular speed (rad/s) - * @param yawspeed Yaw angular speed (rad/s) + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param q1 Quaternion component 1, w (1 in null-rotation) + * @param q2 Quaternion component 2, x (0 in null-rotation) + * @param q3 Quaternion component 3, y (0 in null-rotation) + * @param q4 Quaternion component 4, z (0 in null-rotation) + * @param rollspeed [rad/s] Roll angular speed + * @param pitchspeed [rad/s] Pitch angular speed + * @param yawspeed [rad/s] Yaw angular speed */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -286,7 +286,7 @@ static inline void mavlink_msg_attitude_quaternion_send_buf(mavlink_message_t *m /** * @brief Get field time_boot_ms from attitude_quaternion message * - * @return Timestamp (milliseconds since system boot) + * @return [ms] Timestamp (time since system boot). */ static inline uint32_t mavlink_msg_attitude_quaternion_get_time_boot_ms(const mavlink_message_t* msg) { @@ -296,7 +296,7 @@ static inline uint32_t mavlink_msg_attitude_quaternion_get_time_boot_ms(const ma /** * @brief Get field q1 from attitude_quaternion message * - * @return Quaternion component 1, w (1 in null-rotation) + * @return Quaternion component 1, w (1 in null-rotation) */ static inline float mavlink_msg_attitude_quaternion_get_q1(const mavlink_message_t* msg) { @@ -306,7 +306,7 @@ static inline float mavlink_msg_attitude_quaternion_get_q1(const mavlink_message /** * @brief Get field q2 from attitude_quaternion message * - * @return Quaternion component 2, x (0 in null-rotation) + * @return Quaternion component 2, x (0 in null-rotation) */ static inline float mavlink_msg_attitude_quaternion_get_q2(const mavlink_message_t* msg) { @@ -316,7 +316,7 @@ static inline float mavlink_msg_attitude_quaternion_get_q2(const mavlink_message /** * @brief Get field q3 from attitude_quaternion message * - * @return Quaternion component 3, y (0 in null-rotation) + * @return Quaternion component 3, y (0 in null-rotation) */ static inline float mavlink_msg_attitude_quaternion_get_q3(const mavlink_message_t* msg) { @@ -326,7 +326,7 @@ static inline float mavlink_msg_attitude_quaternion_get_q3(const mavlink_message /** * @brief Get field q4 from attitude_quaternion message * - * @return Quaternion component 4, z (0 in null-rotation) + * @return Quaternion component 4, z (0 in null-rotation) */ static inline float mavlink_msg_attitude_quaternion_get_q4(const mavlink_message_t* msg) { @@ -336,7 +336,7 @@ static inline float mavlink_msg_attitude_quaternion_get_q4(const mavlink_message /** * @brief Get field rollspeed from attitude_quaternion message * - * @return Roll angular speed (rad/s) + * @return [rad/s] Roll angular speed */ static inline float mavlink_msg_attitude_quaternion_get_rollspeed(const mavlink_message_t* msg) { @@ -346,7 +346,7 @@ static inline float mavlink_msg_attitude_quaternion_get_rollspeed(const mavlink_ /** * @brief Get field pitchspeed from attitude_quaternion message * - * @return Pitch angular speed (rad/s) + * @return [rad/s] Pitch angular speed */ static inline float mavlink_msg_attitude_quaternion_get_pitchspeed(const mavlink_message_t* msg) { @@ -356,7 +356,7 @@ static inline float mavlink_msg_attitude_quaternion_get_pitchspeed(const mavlink /** * @brief Get field yawspeed from attitude_quaternion message * - * @return Yaw angular speed (rad/s) + * @return [rad/s] Yaw angular speed */ static inline float mavlink_msg_attitude_quaternion_get_yawspeed(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_attitude_quaternion_cov.h b/lib/main/MAVLink/common/mavlink_msg_attitude_quaternion_cov.h index adfcfa7905..bc2351aa3c 100755 --- a/lib/main/MAVLink/common/mavlink_msg_attitude_quaternion_cov.h +++ b/lib/main/MAVLink/common/mavlink_msg_attitude_quaternion_cov.h @@ -3,15 +3,15 @@ #define MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV 61 -MAVPACKED( + typedef struct __mavlink_attitude_quaternion_cov_t { - uint64_t time_usec; /*< Timestamp (microseconds since system boot or since UNIX epoch)*/ - float q[4]; /*< Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)*/ - float rollspeed; /*< Roll angular speed (rad/s)*/ - float pitchspeed; /*< Pitch angular speed (rad/s)*/ - float yawspeed; /*< Yaw angular speed (rad/s)*/ - float covariance[9]; /*< Attitude covariance*/ -}) mavlink_attitude_quaternion_cov_t; + uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.*/ + float q[4]; /*< Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)*/ + float rollspeed; /*< [rad/s] Roll angular speed*/ + float pitchspeed; /*< [rad/s] Pitch angular speed*/ + float yawspeed; /*< [rad/s] Yaw angular speed*/ + float covariance[9]; /*< Row-major representation of a 3x3 attitude covariance matrix (states: roll, pitch, yaw; first three entries are the first ROW, next three entries are the second row, etc.). If unknown, assign NaN value to first element in the array.*/ +} mavlink_attitude_quaternion_cov_t; #define MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN 72 #define MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_MIN_LEN 72 @@ -57,12 +57,12 @@ typedef struct __mavlink_attitude_quaternion_cov_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param time_usec Timestamp (microseconds since system boot or since UNIX epoch) - * @param q Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation) - * @param rollspeed Roll angular speed (rad/s) - * @param pitchspeed Pitch angular speed (rad/s) - * @param yawspeed Yaw angular speed (rad/s) - * @param covariance Attitude covariance + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param q Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation) + * @param rollspeed [rad/s] Roll angular speed + * @param pitchspeed [rad/s] Pitch angular speed + * @param yawspeed [rad/s] Yaw angular speed + * @param covariance Row-major representation of a 3x3 attitude covariance matrix (states: roll, pitch, yaw; first three entries are the first ROW, next three entries are the second row, etc.). If unknown, assign NaN value to first element in the array. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_attitude_quaternion_cov_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -98,12 +98,12 @@ static inline uint16_t mavlink_msg_attitude_quaternion_cov_pack(uint8_t system_i * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param time_usec Timestamp (microseconds since system boot or since UNIX epoch) - * @param q Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation) - * @param rollspeed Roll angular speed (rad/s) - * @param pitchspeed Pitch angular speed (rad/s) - * @param yawspeed Yaw angular speed (rad/s) - * @param covariance Attitude covariance + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param q Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation) + * @param rollspeed [rad/s] Roll angular speed + * @param pitchspeed [rad/s] Pitch angular speed + * @param yawspeed [rad/s] Yaw angular speed + * @param covariance Row-major representation of a 3x3 attitude covariance matrix (states: roll, pitch, yaw; first three entries are the first ROW, next three entries are the second row, etc.). If unknown, assign NaN value to first element in the array. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_attitude_quaternion_cov_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -165,12 +165,12 @@ static inline uint16_t mavlink_msg_attitude_quaternion_cov_encode_chan(uint8_t s * @brief Send a attitude_quaternion_cov message * @param chan MAVLink channel to send the message * - * @param time_usec Timestamp (microseconds since system boot or since UNIX epoch) - * @param q Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation) - * @param rollspeed Roll angular speed (rad/s) - * @param pitchspeed Pitch angular speed (rad/s) - * @param yawspeed Yaw angular speed (rad/s) - * @param covariance Attitude covariance + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param q Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation) + * @param rollspeed [rad/s] Roll angular speed + * @param pitchspeed [rad/s] Pitch angular speed + * @param yawspeed [rad/s] Yaw angular speed + * @param covariance Row-major representation of a 3x3 attitude covariance matrix (states: roll, pitch, yaw; first three entries are the first ROW, next three entries are the second row, etc.). If unknown, assign NaN value to first element in the array. */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -251,7 +251,7 @@ static inline void mavlink_msg_attitude_quaternion_cov_send_buf(mavlink_message_ /** * @brief Get field time_usec from attitude_quaternion_cov message * - * @return Timestamp (microseconds since system boot or since UNIX epoch) + * @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. */ static inline uint64_t mavlink_msg_attitude_quaternion_cov_get_time_usec(const mavlink_message_t* msg) { @@ -261,7 +261,7 @@ static inline uint64_t mavlink_msg_attitude_quaternion_cov_get_time_usec(const m /** * @brief Get field q from attitude_quaternion_cov message * - * @return Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation) + * @return Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation) */ static inline uint16_t mavlink_msg_attitude_quaternion_cov_get_q(const mavlink_message_t* msg, float *q) { @@ -271,7 +271,7 @@ static inline uint16_t mavlink_msg_attitude_quaternion_cov_get_q(const mavlink_m /** * @brief Get field rollspeed from attitude_quaternion_cov message * - * @return Roll angular speed (rad/s) + * @return [rad/s] Roll angular speed */ static inline float mavlink_msg_attitude_quaternion_cov_get_rollspeed(const mavlink_message_t* msg) { @@ -281,7 +281,7 @@ static inline float mavlink_msg_attitude_quaternion_cov_get_rollspeed(const mavl /** * @brief Get field pitchspeed from attitude_quaternion_cov message * - * @return Pitch angular speed (rad/s) + * @return [rad/s] Pitch angular speed */ static inline float mavlink_msg_attitude_quaternion_cov_get_pitchspeed(const mavlink_message_t* msg) { @@ -291,7 +291,7 @@ static inline float mavlink_msg_attitude_quaternion_cov_get_pitchspeed(const mav /** * @brief Get field yawspeed from attitude_quaternion_cov message * - * @return Yaw angular speed (rad/s) + * @return [rad/s] Yaw angular speed */ static inline float mavlink_msg_attitude_quaternion_cov_get_yawspeed(const mavlink_message_t* msg) { @@ -301,7 +301,7 @@ static inline float mavlink_msg_attitude_quaternion_cov_get_yawspeed(const mavli /** * @brief Get field covariance from attitude_quaternion_cov message * - * @return Attitude covariance + * @return Row-major representation of a 3x3 attitude covariance matrix (states: roll, pitch, yaw; first three entries are the first ROW, next three entries are the second row, etc.). If unknown, assign NaN value to first element in the array. */ static inline uint16_t mavlink_msg_attitude_quaternion_cov_get_covariance(const mavlink_message_t* msg, float *covariance) { diff --git a/lib/main/MAVLink/common/mavlink_msg_attitude_target.h b/lib/main/MAVLink/common/mavlink_msg_attitude_target.h index 74c98f0f6a..af578884f4 100755 --- a/lib/main/MAVLink/common/mavlink_msg_attitude_target.h +++ b/lib/main/MAVLink/common/mavlink_msg_attitude_target.h @@ -3,16 +3,16 @@ #define MAVLINK_MSG_ID_ATTITUDE_TARGET 83 -MAVPACKED( + typedef struct __mavlink_attitude_target_t { - uint32_t time_boot_ms; /*< Timestamp in milliseconds since system boot*/ - float q[4]; /*< Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)*/ - float body_roll_rate; /*< Body roll rate in radians per second*/ - float body_pitch_rate; /*< Body roll rate in radians per second*/ - float body_yaw_rate; /*< Body roll rate in radians per second*/ - float thrust; /*< Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)*/ - uint8_t type_mask; /*< Mappings: If any of these bits are set, the corresponding input should be ignored: bit 1: body roll rate, bit 2: body pitch rate, bit 3: body yaw rate. bit 4-bit 7: reserved, bit 8: attitude*/ -}) mavlink_attitude_target_t; + uint32_t time_boot_ms; /*< [ms] Timestamp (time since system boot).*/ + float q[4]; /*< Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)*/ + float body_roll_rate; /*< [rad/s] Body roll rate*/ + float body_pitch_rate; /*< [rad/s] Body pitch rate*/ + float body_yaw_rate; /*< [rad/s] Body yaw rate*/ + float thrust; /*< Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)*/ + uint8_t type_mask; /*< Mappings: If any of these bits are set, the corresponding input should be ignored: bit 1: body roll rate, bit 2: body pitch rate, bit 3: body yaw rate. bit 4-bit 7: reserved, bit 8: attitude*/ +} mavlink_attitude_target_t; #define MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN 37 #define MAVLINK_MSG_ID_ATTITUDE_TARGET_MIN_LEN 37 @@ -30,12 +30,12 @@ typedef struct __mavlink_attitude_target_t { "ATTITUDE_TARGET", \ 7, \ { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_attitude_target_t, time_boot_ms) }, \ + { "type_mask", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_attitude_target_t, type_mask) }, \ { "q", NULL, MAVLINK_TYPE_FLOAT, 4, 4, offsetof(mavlink_attitude_target_t, q) }, \ { "body_roll_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_attitude_target_t, body_roll_rate) }, \ { "body_pitch_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_attitude_target_t, body_pitch_rate) }, \ { "body_yaw_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_attitude_target_t, body_yaw_rate) }, \ { "thrust", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_attitude_target_t, thrust) }, \ - { "type_mask", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_attitude_target_t, type_mask) }, \ } \ } #else @@ -43,12 +43,12 @@ typedef struct __mavlink_attitude_target_t { "ATTITUDE_TARGET", \ 7, \ { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_attitude_target_t, time_boot_ms) }, \ + { "type_mask", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_attitude_target_t, type_mask) }, \ { "q", NULL, MAVLINK_TYPE_FLOAT, 4, 4, offsetof(mavlink_attitude_target_t, q) }, \ { "body_roll_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_attitude_target_t, body_roll_rate) }, \ { "body_pitch_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_attitude_target_t, body_pitch_rate) }, \ { "body_yaw_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_attitude_target_t, body_yaw_rate) }, \ { "thrust", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_attitude_target_t, thrust) }, \ - { "type_mask", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_attitude_target_t, type_mask) }, \ } \ } #endif @@ -59,13 +59,13 @@ typedef struct __mavlink_attitude_target_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param time_boot_ms Timestamp in milliseconds since system boot - * @param type_mask Mappings: If any of these bits are set, the corresponding input should be ignored: bit 1: body roll rate, bit 2: body pitch rate, bit 3: body yaw rate. bit 4-bit 7: reserved, bit 8: attitude - * @param q Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) - * @param body_roll_rate Body roll rate in radians per second - * @param body_pitch_rate Body roll rate in radians per second - * @param body_yaw_rate Body roll rate in radians per second - * @param thrust Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust) + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param type_mask Mappings: If any of these bits are set, the corresponding input should be ignored: bit 1: body roll rate, bit 2: body pitch rate, bit 3: body yaw rate. bit 4-bit 7: reserved, bit 8: attitude + * @param q Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) + * @param body_roll_rate [rad/s] Body roll rate + * @param body_pitch_rate [rad/s] Body pitch rate + * @param body_yaw_rate [rad/s] Body yaw rate + * @param thrust Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust) * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_attitude_target_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -103,13 +103,13 @@ static inline uint16_t mavlink_msg_attitude_target_pack(uint8_t system_id, uint8 * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param time_boot_ms Timestamp in milliseconds since system boot - * @param type_mask Mappings: If any of these bits are set, the corresponding input should be ignored: bit 1: body roll rate, bit 2: body pitch rate, bit 3: body yaw rate. bit 4-bit 7: reserved, bit 8: attitude - * @param q Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) - * @param body_roll_rate Body roll rate in radians per second - * @param body_pitch_rate Body roll rate in radians per second - * @param body_yaw_rate Body roll rate in radians per second - * @param thrust Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust) + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param type_mask Mappings: If any of these bits are set, the corresponding input should be ignored: bit 1: body roll rate, bit 2: body pitch rate, bit 3: body yaw rate. bit 4-bit 7: reserved, bit 8: attitude + * @param q Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) + * @param body_roll_rate [rad/s] Body roll rate + * @param body_pitch_rate [rad/s] Body pitch rate + * @param body_yaw_rate [rad/s] Body yaw rate + * @param thrust Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust) * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_attitude_target_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -173,13 +173,13 @@ static inline uint16_t mavlink_msg_attitude_target_encode_chan(uint8_t system_id * @brief Send a attitude_target message * @param chan MAVLink channel to send the message * - * @param time_boot_ms Timestamp in milliseconds since system boot - * @param type_mask Mappings: If any of these bits are set, the corresponding input should be ignored: bit 1: body roll rate, bit 2: body pitch rate, bit 3: body yaw rate. bit 4-bit 7: reserved, bit 8: attitude - * @param q Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) - * @param body_roll_rate Body roll rate in radians per second - * @param body_pitch_rate Body roll rate in radians per second - * @param body_yaw_rate Body roll rate in radians per second - * @param thrust Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust) + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param type_mask Mappings: If any of these bits are set, the corresponding input should be ignored: bit 1: body roll rate, bit 2: body pitch rate, bit 3: body yaw rate. bit 4-bit 7: reserved, bit 8: attitude + * @param q Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) + * @param body_roll_rate [rad/s] Body roll rate + * @param body_pitch_rate [rad/s] Body pitch rate + * @param body_yaw_rate [rad/s] Body yaw rate + * @param thrust Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust) */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -264,7 +264,7 @@ static inline void mavlink_msg_attitude_target_send_buf(mavlink_message_t *msgbu /** * @brief Get field time_boot_ms from attitude_target message * - * @return Timestamp in milliseconds since system boot + * @return [ms] Timestamp (time since system boot). */ static inline uint32_t mavlink_msg_attitude_target_get_time_boot_ms(const mavlink_message_t* msg) { @@ -274,7 +274,7 @@ static inline uint32_t mavlink_msg_attitude_target_get_time_boot_ms(const mavlin /** * @brief Get field type_mask from attitude_target message * - * @return Mappings: If any of these bits are set, the corresponding input should be ignored: bit 1: body roll rate, bit 2: body pitch rate, bit 3: body yaw rate. bit 4-bit 7: reserved, bit 8: attitude + * @return Mappings: If any of these bits are set, the corresponding input should be ignored: bit 1: body roll rate, bit 2: body pitch rate, bit 3: body yaw rate. bit 4-bit 7: reserved, bit 8: attitude */ static inline uint8_t mavlink_msg_attitude_target_get_type_mask(const mavlink_message_t* msg) { @@ -284,7 +284,7 @@ static inline uint8_t mavlink_msg_attitude_target_get_type_mask(const mavlink_me /** * @brief Get field q from attitude_target message * - * @return Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) + * @return Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) */ static inline uint16_t mavlink_msg_attitude_target_get_q(const mavlink_message_t* msg, float *q) { @@ -294,7 +294,7 @@ static inline uint16_t mavlink_msg_attitude_target_get_q(const mavlink_message_t /** * @brief Get field body_roll_rate from attitude_target message * - * @return Body roll rate in radians per second + * @return [rad/s] Body roll rate */ static inline float mavlink_msg_attitude_target_get_body_roll_rate(const mavlink_message_t* msg) { @@ -304,7 +304,7 @@ static inline float mavlink_msg_attitude_target_get_body_roll_rate(const mavlink /** * @brief Get field body_pitch_rate from attitude_target message * - * @return Body roll rate in radians per second + * @return [rad/s] Body pitch rate */ static inline float mavlink_msg_attitude_target_get_body_pitch_rate(const mavlink_message_t* msg) { @@ -314,7 +314,7 @@ static inline float mavlink_msg_attitude_target_get_body_pitch_rate(const mavlin /** * @brief Get field body_yaw_rate from attitude_target message * - * @return Body roll rate in radians per second + * @return [rad/s] Body yaw rate */ static inline float mavlink_msg_attitude_target_get_body_yaw_rate(const mavlink_message_t* msg) { @@ -324,7 +324,7 @@ static inline float mavlink_msg_attitude_target_get_body_yaw_rate(const mavlink_ /** * @brief Get field thrust from attitude_target message * - * @return Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust) + * @return Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust) */ static inline float mavlink_msg_attitude_target_get_thrust(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_auth_key.h b/lib/main/MAVLink/common/mavlink_msg_auth_key.h index 2754a2ad6b..57cd6916ab 100755 --- a/lib/main/MAVLink/common/mavlink_msg_auth_key.h +++ b/lib/main/MAVLink/common/mavlink_msg_auth_key.h @@ -3,10 +3,10 @@ #define MAVLINK_MSG_ID_AUTH_KEY 7 -MAVPACKED( + typedef struct __mavlink_auth_key_t { - char key[32]; /*< key*/ -}) mavlink_auth_key_t; + char key[32]; /*< key*/ +} mavlink_auth_key_t; #define MAVLINK_MSG_ID_AUTH_KEY_LEN 32 #define MAVLINK_MSG_ID_AUTH_KEY_MIN_LEN 32 @@ -41,7 +41,7 @@ typedef struct __mavlink_auth_key_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param key key + * @param key key * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_auth_key_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -69,7 +69,7 @@ static inline uint16_t mavlink_msg_auth_key_pack(uint8_t system_id, uint8_t comp * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param key key + * @param key key * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_auth_key_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -123,7 +123,7 @@ static inline uint16_t mavlink_msg_auth_key_encode_chan(uint8_t system_id, uint8 * @brief Send a auth_key message * @param chan MAVLink channel to send the message * - * @param key key + * @param key key */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -188,7 +188,7 @@ static inline void mavlink_msg_auth_key_send_buf(mavlink_message_t *msgbuf, mavl /** * @brief Get field key from auth_key message * - * @return key + * @return key */ static inline uint16_t mavlink_msg_auth_key_get_key(const mavlink_message_t* msg, char *key) { diff --git a/lib/main/MAVLink/common/mavlink_msg_autopilot_version.h b/lib/main/MAVLink/common/mavlink_msg_autopilot_version.h index 68f7d83b69..ae0324b75b 100755 --- a/lib/main/MAVLink/common/mavlink_msg_autopilot_version.h +++ b/lib/main/MAVLink/common/mavlink_msg_autopilot_version.h @@ -3,20 +3,20 @@ #define MAVLINK_MSG_ID_AUTOPILOT_VERSION 148 -MAVPACKED( + typedef struct __mavlink_autopilot_version_t { - uint64_t capabilities; /*< bitmask of capabilities (see MAV_PROTOCOL_CAPABILITY enum)*/ - uint64_t uid; /*< UID if provided by hardware*/ - uint32_t flight_sw_version; /*< Firmware version number*/ - uint32_t middleware_sw_version; /*< Middleware version number*/ - uint32_t os_sw_version; /*< Operating system version number*/ - uint32_t board_version; /*< HW / board version (last 8 bytes should be silicon ID, if any)*/ - uint16_t vendor_id; /*< ID of the board vendor*/ - uint16_t product_id; /*< ID of the product*/ - uint8_t flight_custom_version[8]; /*< Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.*/ - uint8_t middleware_custom_version[8]; /*< Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.*/ - uint8_t os_custom_version[8]; /*< Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.*/ -}) mavlink_autopilot_version_t; + uint64_t capabilities; /*< Bitmap of capabilities*/ + uint64_t uid; /*< UID if provided by hardware (see uid2)*/ + uint32_t flight_sw_version; /*< Firmware version number*/ + uint32_t middleware_sw_version; /*< Middleware version number*/ + uint32_t os_sw_version; /*< Operating system version number*/ + uint32_t board_version; /*< HW / board version (last 8 bytes should be silicon ID, if any)*/ + uint16_t vendor_id; /*< ID of the board vendor*/ + uint16_t product_id; /*< ID of the product*/ + uint8_t flight_custom_version[8]; /*< Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.*/ + uint8_t middleware_custom_version[8]; /*< Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.*/ + uint8_t os_custom_version[8]; /*< Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.*/ +} mavlink_autopilot_version_t; #define MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN 60 #define MAVLINK_MSG_ID_AUTOPILOT_VERSION_MIN_LEN 60 @@ -36,16 +36,16 @@ typedef struct __mavlink_autopilot_version_t { "AUTOPILOT_VERSION", \ 11, \ { { "capabilities", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_autopilot_version_t, capabilities) }, \ - { "uid", NULL, MAVLINK_TYPE_UINT64_T, 0, 8, offsetof(mavlink_autopilot_version_t, uid) }, \ { "flight_sw_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 16, offsetof(mavlink_autopilot_version_t, flight_sw_version) }, \ { "middleware_sw_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_autopilot_version_t, middleware_sw_version) }, \ { "os_sw_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 24, offsetof(mavlink_autopilot_version_t, os_sw_version) }, \ { "board_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 28, offsetof(mavlink_autopilot_version_t, board_version) }, \ - { "vendor_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 32, offsetof(mavlink_autopilot_version_t, vendor_id) }, \ - { "product_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 34, offsetof(mavlink_autopilot_version_t, product_id) }, \ { "flight_custom_version", NULL, MAVLINK_TYPE_UINT8_T, 8, 36, offsetof(mavlink_autopilot_version_t, flight_custom_version) }, \ { "middleware_custom_version", NULL, MAVLINK_TYPE_UINT8_T, 8, 44, offsetof(mavlink_autopilot_version_t, middleware_custom_version) }, \ { "os_custom_version", NULL, MAVLINK_TYPE_UINT8_T, 8, 52, offsetof(mavlink_autopilot_version_t, os_custom_version) }, \ + { "vendor_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 32, offsetof(mavlink_autopilot_version_t, vendor_id) }, \ + { "product_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 34, offsetof(mavlink_autopilot_version_t, product_id) }, \ + { "uid", NULL, MAVLINK_TYPE_UINT64_T, 0, 8, offsetof(mavlink_autopilot_version_t, uid) }, \ } \ } #else @@ -53,16 +53,16 @@ typedef struct __mavlink_autopilot_version_t { "AUTOPILOT_VERSION", \ 11, \ { { "capabilities", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_autopilot_version_t, capabilities) }, \ - { "uid", NULL, MAVLINK_TYPE_UINT64_T, 0, 8, offsetof(mavlink_autopilot_version_t, uid) }, \ { "flight_sw_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 16, offsetof(mavlink_autopilot_version_t, flight_sw_version) }, \ { "middleware_sw_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_autopilot_version_t, middleware_sw_version) }, \ { "os_sw_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 24, offsetof(mavlink_autopilot_version_t, os_sw_version) }, \ { "board_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 28, offsetof(mavlink_autopilot_version_t, board_version) }, \ - { "vendor_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 32, offsetof(mavlink_autopilot_version_t, vendor_id) }, \ - { "product_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 34, offsetof(mavlink_autopilot_version_t, product_id) }, \ { "flight_custom_version", NULL, MAVLINK_TYPE_UINT8_T, 8, 36, offsetof(mavlink_autopilot_version_t, flight_custom_version) }, \ { "middleware_custom_version", NULL, MAVLINK_TYPE_UINT8_T, 8, 44, offsetof(mavlink_autopilot_version_t, middleware_custom_version) }, \ { "os_custom_version", NULL, MAVLINK_TYPE_UINT8_T, 8, 52, offsetof(mavlink_autopilot_version_t, os_custom_version) }, \ + { "vendor_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 32, offsetof(mavlink_autopilot_version_t, vendor_id) }, \ + { "product_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 34, offsetof(mavlink_autopilot_version_t, product_id) }, \ + { "uid", NULL, MAVLINK_TYPE_UINT64_T, 0, 8, offsetof(mavlink_autopilot_version_t, uid) }, \ } \ } #endif @@ -73,17 +73,17 @@ typedef struct __mavlink_autopilot_version_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param capabilities bitmask of capabilities (see MAV_PROTOCOL_CAPABILITY enum) - * @param flight_sw_version Firmware version number - * @param middleware_sw_version Middleware version number - * @param os_sw_version Operating system version number - * @param board_version HW / board version (last 8 bytes should be silicon ID, if any) - * @param flight_custom_version Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases. - * @param middleware_custom_version Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases. - * @param os_custom_version Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases. - * @param vendor_id ID of the board vendor - * @param product_id ID of the product - * @param uid UID if provided by hardware + * @param capabilities Bitmap of capabilities + * @param flight_sw_version Firmware version number + * @param middleware_sw_version Middleware version number + * @param os_sw_version Operating system version number + * @param board_version HW / board version (last 8 bytes should be silicon ID, if any) + * @param flight_custom_version Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases. + * @param middleware_custom_version Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases. + * @param os_custom_version Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases. + * @param vendor_id ID of the board vendor + * @param product_id ID of the product + * @param uid UID if provided by hardware (see uid2) * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_autopilot_version_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -129,17 +129,17 @@ static inline uint16_t mavlink_msg_autopilot_version_pack(uint8_t system_id, uin * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param capabilities bitmask of capabilities (see MAV_PROTOCOL_CAPABILITY enum) - * @param flight_sw_version Firmware version number - * @param middleware_sw_version Middleware version number - * @param os_sw_version Operating system version number - * @param board_version HW / board version (last 8 bytes should be silicon ID, if any) - * @param flight_custom_version Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases. - * @param middleware_custom_version Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases. - * @param os_custom_version Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases. - * @param vendor_id ID of the board vendor - * @param product_id ID of the product - * @param uid UID if provided by hardware + * @param capabilities Bitmap of capabilities + * @param flight_sw_version Firmware version number + * @param middleware_sw_version Middleware version number + * @param os_sw_version Operating system version number + * @param board_version HW / board version (last 8 bytes should be silicon ID, if any) + * @param flight_custom_version Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases. + * @param middleware_custom_version Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases. + * @param os_custom_version Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases. + * @param vendor_id ID of the board vendor + * @param product_id ID of the product + * @param uid UID if provided by hardware (see uid2) * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_autopilot_version_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -211,17 +211,17 @@ static inline uint16_t mavlink_msg_autopilot_version_encode_chan(uint8_t system_ * @brief Send a autopilot_version message * @param chan MAVLink channel to send the message * - * @param capabilities bitmask of capabilities (see MAV_PROTOCOL_CAPABILITY enum) - * @param flight_sw_version Firmware version number - * @param middleware_sw_version Middleware version number - * @param os_sw_version Operating system version number - * @param board_version HW / board version (last 8 bytes should be silicon ID, if any) - * @param flight_custom_version Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases. - * @param middleware_custom_version Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases. - * @param os_custom_version Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases. - * @param vendor_id ID of the board vendor - * @param product_id ID of the product - * @param uid UID if provided by hardware + * @param capabilities Bitmap of capabilities + * @param flight_sw_version Firmware version number + * @param middleware_sw_version Middleware version number + * @param os_sw_version Operating system version number + * @param board_version HW / board version (last 8 bytes should be silicon ID, if any) + * @param flight_custom_version Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases. + * @param middleware_custom_version Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases. + * @param os_custom_version Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases. + * @param vendor_id ID of the board vendor + * @param product_id ID of the product + * @param uid UID if provided by hardware (see uid2) */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -322,7 +322,7 @@ static inline void mavlink_msg_autopilot_version_send_buf(mavlink_message_t *msg /** * @brief Get field capabilities from autopilot_version message * - * @return bitmask of capabilities (see MAV_PROTOCOL_CAPABILITY enum) + * @return Bitmap of capabilities */ static inline uint64_t mavlink_msg_autopilot_version_get_capabilities(const mavlink_message_t* msg) { @@ -332,7 +332,7 @@ static inline uint64_t mavlink_msg_autopilot_version_get_capabilities(const mavl /** * @brief Get field flight_sw_version from autopilot_version message * - * @return Firmware version number + * @return Firmware version number */ static inline uint32_t mavlink_msg_autopilot_version_get_flight_sw_version(const mavlink_message_t* msg) { @@ -342,7 +342,7 @@ static inline uint32_t mavlink_msg_autopilot_version_get_flight_sw_version(const /** * @brief Get field middleware_sw_version from autopilot_version message * - * @return Middleware version number + * @return Middleware version number */ static inline uint32_t mavlink_msg_autopilot_version_get_middleware_sw_version(const mavlink_message_t* msg) { @@ -352,7 +352,7 @@ static inline uint32_t mavlink_msg_autopilot_version_get_middleware_sw_version(c /** * @brief Get field os_sw_version from autopilot_version message * - * @return Operating system version number + * @return Operating system version number */ static inline uint32_t mavlink_msg_autopilot_version_get_os_sw_version(const mavlink_message_t* msg) { @@ -362,7 +362,7 @@ static inline uint32_t mavlink_msg_autopilot_version_get_os_sw_version(const mav /** * @brief Get field board_version from autopilot_version message * - * @return HW / board version (last 8 bytes should be silicon ID, if any) + * @return HW / board version (last 8 bytes should be silicon ID, if any) */ static inline uint32_t mavlink_msg_autopilot_version_get_board_version(const mavlink_message_t* msg) { @@ -372,7 +372,7 @@ static inline uint32_t mavlink_msg_autopilot_version_get_board_version(const mav /** * @brief Get field flight_custom_version from autopilot_version message * - * @return Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases. + * @return Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases. */ static inline uint16_t mavlink_msg_autopilot_version_get_flight_custom_version(const mavlink_message_t* msg, uint8_t *flight_custom_version) { @@ -382,7 +382,7 @@ static inline uint16_t mavlink_msg_autopilot_version_get_flight_custom_version(c /** * @brief Get field middleware_custom_version from autopilot_version message * - * @return Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases. + * @return Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases. */ static inline uint16_t mavlink_msg_autopilot_version_get_middleware_custom_version(const mavlink_message_t* msg, uint8_t *middleware_custom_version) { @@ -392,7 +392,7 @@ static inline uint16_t mavlink_msg_autopilot_version_get_middleware_custom_versi /** * @brief Get field os_custom_version from autopilot_version message * - * @return Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases. + * @return Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases. */ static inline uint16_t mavlink_msg_autopilot_version_get_os_custom_version(const mavlink_message_t* msg, uint8_t *os_custom_version) { @@ -402,7 +402,7 @@ static inline uint16_t mavlink_msg_autopilot_version_get_os_custom_version(const /** * @brief Get field vendor_id from autopilot_version message * - * @return ID of the board vendor + * @return ID of the board vendor */ static inline uint16_t mavlink_msg_autopilot_version_get_vendor_id(const mavlink_message_t* msg) { @@ -412,7 +412,7 @@ static inline uint16_t mavlink_msg_autopilot_version_get_vendor_id(const mavlink /** * @brief Get field product_id from autopilot_version message * - * @return ID of the product + * @return ID of the product */ static inline uint16_t mavlink_msg_autopilot_version_get_product_id(const mavlink_message_t* msg) { @@ -422,7 +422,7 @@ static inline uint16_t mavlink_msg_autopilot_version_get_product_id(const mavlin /** * @brief Get field uid from autopilot_version message * - * @return UID if provided by hardware + * @return UID if provided by hardware (see uid2) */ static inline uint64_t mavlink_msg_autopilot_version_get_uid(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_battery_status.h b/lib/main/MAVLink/common/mavlink_msg_battery_status.h index 240463aba8..9d5ac516b2 100755 --- a/lib/main/MAVLink/common/mavlink_msg_battery_status.h +++ b/lib/main/MAVLink/common/mavlink_msg_battery_status.h @@ -3,18 +3,18 @@ #define MAVLINK_MSG_ID_BATTERY_STATUS 147 -MAVPACKED( + typedef struct __mavlink_battery_status_t { - int32_t current_consumed; /*< Consumed charge, in milliampere hours (1 = 1 mAh), -1: autopilot does not provide mAh consumption estimate*/ - int32_t energy_consumed; /*< Consumed energy, in 100*Joules (intergrated U*I*dt) (1 = 100 Joule), -1: autopilot does not provide energy consumption estimate*/ - int16_t temperature; /*< Temperature of the battery in centi-degrees celsius. INT16_MAX for unknown temperature.*/ - uint16_t voltages[10]; /*< Battery voltage of cells, in millivolts (1 = 1 millivolt). Cells above the valid cell count for this battery should have the UINT16_MAX value.*/ - int16_t current_battery; /*< Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current*/ - uint8_t id; /*< Battery ID*/ - uint8_t battery_function; /*< Function of the battery*/ - uint8_t type; /*< Type (chemistry) of the battery*/ - int8_t battery_remaining; /*< Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot does not estimate the remaining battery*/ -}) mavlink_battery_status_t; + int32_t current_consumed; /*< [mAh] Consumed charge, -1: autopilot does not provide consumption estimate*/ + int32_t energy_consumed; /*< [hJ] Consumed energy, -1: autopilot does not provide energy consumption estimate*/ + int16_t temperature; /*< [cdegC] Temperature of the battery. INT16_MAX for unknown temperature.*/ + uint16_t voltages[10]; /*< [mV] Battery voltage of cells 1 to 10 (see voltages_ext for cells 11-14). Cells in this field above the valid cell count for this battery should have the UINT16_MAX value. If individual cell voltages are unknown or not measured for this battery, then the overall battery voltage should be filled in cell 0, with all others set to UINT16_MAX. If the voltage of the battery is greater than (UINT16_MAX - 1), then cell 0 should be set to (UINT16_MAX - 1), and cell 1 to the remaining voltage. This can be extended to multiple cells if the total voltage is greater than 2 * (UINT16_MAX - 1).*/ + int16_t current_battery; /*< [cA] Battery current, -1: autopilot does not measure the current*/ + uint8_t id; /*< Battery ID*/ + uint8_t battery_function; /*< Function of the battery*/ + uint8_t type; /*< Type (chemistry) of the battery*/ + int8_t battery_remaining; /*< [%] Remaining battery energy. Values: [0-100], -1: autopilot does not estimate the remaining battery.*/ +} mavlink_battery_status_t; #define MAVLINK_MSG_ID_BATTERY_STATUS_LEN 36 #define MAVLINK_MSG_ID_BATTERY_STATUS_MIN_LEN 36 @@ -31,14 +31,14 @@ typedef struct __mavlink_battery_status_t { 147, \ "BATTERY_STATUS", \ 9, \ - { { "current_consumed", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_battery_status_t, current_consumed) }, \ - { "energy_consumed", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_battery_status_t, energy_consumed) }, \ + { { "id", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_battery_status_t, id) }, \ + { "battery_function", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_battery_status_t, battery_function) }, \ + { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_battery_status_t, type) }, \ { "temperature", NULL, MAVLINK_TYPE_INT16_T, 0, 8, offsetof(mavlink_battery_status_t, temperature) }, \ { "voltages", NULL, MAVLINK_TYPE_UINT16_T, 10, 10, offsetof(mavlink_battery_status_t, voltages) }, \ { "current_battery", NULL, MAVLINK_TYPE_INT16_T, 0, 30, offsetof(mavlink_battery_status_t, current_battery) }, \ - { "id", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_battery_status_t, id) }, \ - { "battery_function", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_battery_status_t, battery_function) }, \ - { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_battery_status_t, type) }, \ + { "current_consumed", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_battery_status_t, current_consumed) }, \ + { "energy_consumed", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_battery_status_t, energy_consumed) }, \ { "battery_remaining", NULL, MAVLINK_TYPE_INT8_T, 0, 35, offsetof(mavlink_battery_status_t, battery_remaining) }, \ } \ } @@ -46,14 +46,14 @@ typedef struct __mavlink_battery_status_t { #define MAVLINK_MESSAGE_INFO_BATTERY_STATUS { \ "BATTERY_STATUS", \ 9, \ - { { "current_consumed", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_battery_status_t, current_consumed) }, \ - { "energy_consumed", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_battery_status_t, energy_consumed) }, \ + { { "id", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_battery_status_t, id) }, \ + { "battery_function", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_battery_status_t, battery_function) }, \ + { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_battery_status_t, type) }, \ { "temperature", NULL, MAVLINK_TYPE_INT16_T, 0, 8, offsetof(mavlink_battery_status_t, temperature) }, \ { "voltages", NULL, MAVLINK_TYPE_UINT16_T, 10, 10, offsetof(mavlink_battery_status_t, voltages) }, \ { "current_battery", NULL, MAVLINK_TYPE_INT16_T, 0, 30, offsetof(mavlink_battery_status_t, current_battery) }, \ - { "id", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_battery_status_t, id) }, \ - { "battery_function", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_battery_status_t, battery_function) }, \ - { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_battery_status_t, type) }, \ + { "current_consumed", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_battery_status_t, current_consumed) }, \ + { "energy_consumed", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_battery_status_t, energy_consumed) }, \ { "battery_remaining", NULL, MAVLINK_TYPE_INT8_T, 0, 35, offsetof(mavlink_battery_status_t, battery_remaining) }, \ } \ } @@ -65,15 +65,15 @@ typedef struct __mavlink_battery_status_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param id Battery ID - * @param battery_function Function of the battery - * @param type Type (chemistry) of the battery - * @param temperature Temperature of the battery in centi-degrees celsius. INT16_MAX for unknown temperature. - * @param voltages Battery voltage of cells, in millivolts (1 = 1 millivolt). Cells above the valid cell count for this battery should have the UINT16_MAX value. - * @param current_battery Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current - * @param current_consumed Consumed charge, in milliampere hours (1 = 1 mAh), -1: autopilot does not provide mAh consumption estimate - * @param energy_consumed Consumed energy, in 100*Joules (intergrated U*I*dt) (1 = 100 Joule), -1: autopilot does not provide energy consumption estimate - * @param battery_remaining Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot does not estimate the remaining battery + * @param id Battery ID + * @param battery_function Function of the battery + * @param type Type (chemistry) of the battery + * @param temperature [cdegC] Temperature of the battery. INT16_MAX for unknown temperature. + * @param voltages [mV] Battery voltage of cells 1 to 10 (see voltages_ext for cells 11-14). Cells in this field above the valid cell count for this battery should have the UINT16_MAX value. If individual cell voltages are unknown or not measured for this battery, then the overall battery voltage should be filled in cell 0, with all others set to UINT16_MAX. If the voltage of the battery is greater than (UINT16_MAX - 1), then cell 0 should be set to (UINT16_MAX - 1), and cell 1 to the remaining voltage. This can be extended to multiple cells if the total voltage is greater than 2 * (UINT16_MAX - 1). + * @param current_battery [cA] Battery current, -1: autopilot does not measure the current + * @param current_consumed [mAh] Consumed charge, -1: autopilot does not provide consumption estimate + * @param energy_consumed [hJ] Consumed energy, -1: autopilot does not provide energy consumption estimate + * @param battery_remaining [%] Remaining battery energy. Values: [0-100], -1: autopilot does not estimate the remaining battery. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_battery_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -115,15 +115,15 @@ static inline uint16_t mavlink_msg_battery_status_pack(uint8_t system_id, uint8_ * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param id Battery ID - * @param battery_function Function of the battery - * @param type Type (chemistry) of the battery - * @param temperature Temperature of the battery in centi-degrees celsius. INT16_MAX for unknown temperature. - * @param voltages Battery voltage of cells, in millivolts (1 = 1 millivolt). Cells above the valid cell count for this battery should have the UINT16_MAX value. - * @param current_battery Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current - * @param current_consumed Consumed charge, in milliampere hours (1 = 1 mAh), -1: autopilot does not provide mAh consumption estimate - * @param energy_consumed Consumed energy, in 100*Joules (intergrated U*I*dt) (1 = 100 Joule), -1: autopilot does not provide energy consumption estimate - * @param battery_remaining Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot does not estimate the remaining battery + * @param id Battery ID + * @param battery_function Function of the battery + * @param type Type (chemistry) of the battery + * @param temperature [cdegC] Temperature of the battery. INT16_MAX for unknown temperature. + * @param voltages [mV] Battery voltage of cells 1 to 10 (see voltages_ext for cells 11-14). Cells in this field above the valid cell count for this battery should have the UINT16_MAX value. If individual cell voltages are unknown or not measured for this battery, then the overall battery voltage should be filled in cell 0, with all others set to UINT16_MAX. If the voltage of the battery is greater than (UINT16_MAX - 1), then cell 0 should be set to (UINT16_MAX - 1), and cell 1 to the remaining voltage. This can be extended to multiple cells if the total voltage is greater than 2 * (UINT16_MAX - 1). + * @param current_battery [cA] Battery current, -1: autopilot does not measure the current + * @param current_consumed [mAh] Consumed charge, -1: autopilot does not provide consumption estimate + * @param energy_consumed [hJ] Consumed energy, -1: autopilot does not provide energy consumption estimate + * @param battery_remaining [%] Remaining battery energy. Values: [0-100], -1: autopilot does not estimate the remaining battery. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_battery_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -191,15 +191,15 @@ static inline uint16_t mavlink_msg_battery_status_encode_chan(uint8_t system_id, * @brief Send a battery_status message * @param chan MAVLink channel to send the message * - * @param id Battery ID - * @param battery_function Function of the battery - * @param type Type (chemistry) of the battery - * @param temperature Temperature of the battery in centi-degrees celsius. INT16_MAX for unknown temperature. - * @param voltages Battery voltage of cells, in millivolts (1 = 1 millivolt). Cells above the valid cell count for this battery should have the UINT16_MAX value. - * @param current_battery Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current - * @param current_consumed Consumed charge, in milliampere hours (1 = 1 mAh), -1: autopilot does not provide mAh consumption estimate - * @param energy_consumed Consumed energy, in 100*Joules (intergrated U*I*dt) (1 = 100 Joule), -1: autopilot does not provide energy consumption estimate - * @param battery_remaining Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot does not estimate the remaining battery + * @param id Battery ID + * @param battery_function Function of the battery + * @param type Type (chemistry) of the battery + * @param temperature [cdegC] Temperature of the battery. INT16_MAX for unknown temperature. + * @param voltages [mV] Battery voltage of cells 1 to 10 (see voltages_ext for cells 11-14). Cells in this field above the valid cell count for this battery should have the UINT16_MAX value. If individual cell voltages are unknown or not measured for this battery, then the overall battery voltage should be filled in cell 0, with all others set to UINT16_MAX. If the voltage of the battery is greater than (UINT16_MAX - 1), then cell 0 should be set to (UINT16_MAX - 1), and cell 1 to the remaining voltage. This can be extended to multiple cells if the total voltage is greater than 2 * (UINT16_MAX - 1). + * @param current_battery [cA] Battery current, -1: autopilot does not measure the current + * @param current_consumed [mAh] Consumed charge, -1: autopilot does not provide consumption estimate + * @param energy_consumed [hJ] Consumed energy, -1: autopilot does not provide energy consumption estimate + * @param battery_remaining [%] Remaining battery energy. Values: [0-100], -1: autopilot does not estimate the remaining battery. */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -292,7 +292,7 @@ static inline void mavlink_msg_battery_status_send_buf(mavlink_message_t *msgbuf /** * @brief Get field id from battery_status message * - * @return Battery ID + * @return Battery ID */ static inline uint8_t mavlink_msg_battery_status_get_id(const mavlink_message_t* msg) { @@ -302,7 +302,7 @@ static inline uint8_t mavlink_msg_battery_status_get_id(const mavlink_message_t* /** * @brief Get field battery_function from battery_status message * - * @return Function of the battery + * @return Function of the battery */ static inline uint8_t mavlink_msg_battery_status_get_battery_function(const mavlink_message_t* msg) { @@ -312,7 +312,7 @@ static inline uint8_t mavlink_msg_battery_status_get_battery_function(const mavl /** * @brief Get field type from battery_status message * - * @return Type (chemistry) of the battery + * @return Type (chemistry) of the battery */ static inline uint8_t mavlink_msg_battery_status_get_type(const mavlink_message_t* msg) { @@ -322,7 +322,7 @@ static inline uint8_t mavlink_msg_battery_status_get_type(const mavlink_message_ /** * @brief Get field temperature from battery_status message * - * @return Temperature of the battery in centi-degrees celsius. INT16_MAX for unknown temperature. + * @return [cdegC] Temperature of the battery. INT16_MAX for unknown temperature. */ static inline int16_t mavlink_msg_battery_status_get_temperature(const mavlink_message_t* msg) { @@ -332,7 +332,7 @@ static inline int16_t mavlink_msg_battery_status_get_temperature(const mavlink_m /** * @brief Get field voltages from battery_status message * - * @return Battery voltage of cells, in millivolts (1 = 1 millivolt). Cells above the valid cell count for this battery should have the UINT16_MAX value. + * @return [mV] Battery voltage of cells 1 to 10 (see voltages_ext for cells 11-14). Cells in this field above the valid cell count for this battery should have the UINT16_MAX value. If individual cell voltages are unknown or not measured for this battery, then the overall battery voltage should be filled in cell 0, with all others set to UINT16_MAX. If the voltage of the battery is greater than (UINT16_MAX - 1), then cell 0 should be set to (UINT16_MAX - 1), and cell 1 to the remaining voltage. This can be extended to multiple cells if the total voltage is greater than 2 * (UINT16_MAX - 1). */ static inline uint16_t mavlink_msg_battery_status_get_voltages(const mavlink_message_t* msg, uint16_t *voltages) { @@ -342,7 +342,7 @@ static inline uint16_t mavlink_msg_battery_status_get_voltages(const mavlink_mes /** * @brief Get field current_battery from battery_status message * - * @return Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current + * @return [cA] Battery current, -1: autopilot does not measure the current */ static inline int16_t mavlink_msg_battery_status_get_current_battery(const mavlink_message_t* msg) { @@ -352,7 +352,7 @@ static inline int16_t mavlink_msg_battery_status_get_current_battery(const mavli /** * @brief Get field current_consumed from battery_status message * - * @return Consumed charge, in milliampere hours (1 = 1 mAh), -1: autopilot does not provide mAh consumption estimate + * @return [mAh] Consumed charge, -1: autopilot does not provide consumption estimate */ static inline int32_t mavlink_msg_battery_status_get_current_consumed(const mavlink_message_t* msg) { @@ -362,7 +362,7 @@ static inline int32_t mavlink_msg_battery_status_get_current_consumed(const mavl /** * @brief Get field energy_consumed from battery_status message * - * @return Consumed energy, in 100*Joules (intergrated U*I*dt) (1 = 100 Joule), -1: autopilot does not provide energy consumption estimate + * @return [hJ] Consumed energy, -1: autopilot does not provide energy consumption estimate */ static inline int32_t mavlink_msg_battery_status_get_energy_consumed(const mavlink_message_t* msg) { @@ -372,7 +372,7 @@ static inline int32_t mavlink_msg_battery_status_get_energy_consumed(const mavli /** * @brief Get field battery_remaining from battery_status message * - * @return Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot does not estimate the remaining battery + * @return [%] Remaining battery energy. Values: [0-100], -1: autopilot does not estimate the remaining battery. */ static inline int8_t mavlink_msg_battery_status_get_battery_remaining(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_camera_trigger.h b/lib/main/MAVLink/common/mavlink_msg_camera_trigger.h index 71bb1c1c86..ee2ad8e9b0 100755 --- a/lib/main/MAVLink/common/mavlink_msg_camera_trigger.h +++ b/lib/main/MAVLink/common/mavlink_msg_camera_trigger.h @@ -3,11 +3,11 @@ #define MAVLINK_MSG_ID_CAMERA_TRIGGER 112 -MAVPACKED( + typedef struct __mavlink_camera_trigger_t { - uint64_t time_usec; /*< Timestamp for the image frame in microseconds*/ - uint32_t seq; /*< Image frame sequence*/ -}) mavlink_camera_trigger_t; + uint64_t time_usec; /*< [us] Timestamp for image frame (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.*/ + uint32_t seq; /*< Image frame sequence*/ +} mavlink_camera_trigger_t; #define MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN 12 #define MAVLINK_MSG_ID_CAMERA_TRIGGER_MIN_LEN 12 @@ -44,8 +44,8 @@ typedef struct __mavlink_camera_trigger_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param time_usec Timestamp for the image frame in microseconds - * @param seq Image frame sequence + * @param time_usec [us] Timestamp for image frame (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param seq Image frame sequence * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_camera_trigger_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -75,8 +75,8 @@ static inline uint16_t mavlink_msg_camera_trigger_pack(uint8_t system_id, uint8_ * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param time_usec Timestamp for the image frame in microseconds - * @param seq Image frame sequence + * @param time_usec [us] Timestamp for image frame (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param seq Image frame sequence * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_camera_trigger_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -132,8 +132,8 @@ static inline uint16_t mavlink_msg_camera_trigger_encode_chan(uint8_t system_id, * @brief Send a camera_trigger message * @param chan MAVLink channel to send the message * - * @param time_usec Timestamp for the image frame in microseconds - * @param seq Image frame sequence + * @param time_usec [us] Timestamp for image frame (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param seq Image frame sequence */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -202,7 +202,7 @@ static inline void mavlink_msg_camera_trigger_send_buf(mavlink_message_t *msgbuf /** * @brief Get field time_usec from camera_trigger message * - * @return Timestamp for the image frame in microseconds + * @return [us] Timestamp for image frame (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. */ static inline uint64_t mavlink_msg_camera_trigger_get_time_usec(const mavlink_message_t* msg) { @@ -212,7 +212,7 @@ static inline uint64_t mavlink_msg_camera_trigger_get_time_usec(const mavlink_me /** * @brief Get field seq from camera_trigger message * - * @return Image frame sequence + * @return Image frame sequence */ static inline uint32_t mavlink_msg_camera_trigger_get_seq(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_change_operator_control.h b/lib/main/MAVLink/common/mavlink_msg_change_operator_control.h index b6e76f7f7a..8fea8d7837 100755 --- a/lib/main/MAVLink/common/mavlink_msg_change_operator_control.h +++ b/lib/main/MAVLink/common/mavlink_msg_change_operator_control.h @@ -3,13 +3,13 @@ #define MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL 5 -MAVPACKED( + typedef struct __mavlink_change_operator_control_t { - uint8_t target_system; /*< System the GCS requests control for*/ - uint8_t control_request; /*< 0: request control of this MAV, 1: Release control of this MAV*/ - uint8_t version; /*< 0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch.*/ - char passkey[25]; /*< Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and "!?,.-"*/ -}) mavlink_change_operator_control_t; + uint8_t target_system; /*< System the GCS requests control for*/ + uint8_t control_request; /*< 0: request control of this MAV, 1: Release control of this MAV*/ + uint8_t version; /*< [rad] 0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch.*/ + char passkey[25]; /*< Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and "!?,.-"*/ +} mavlink_change_operator_control_t; #define MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN 28 #define MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_MIN_LEN 28 @@ -50,10 +50,10 @@ typedef struct __mavlink_change_operator_control_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param target_system System the GCS requests control for - * @param control_request 0: request control of this MAV, 1: Release control of this MAV - * @param version 0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch. - * @param passkey Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and "!?,.-" + * @param target_system System the GCS requests control for + * @param control_request 0: request control of this MAV, 1: Release control of this MAV + * @param version [rad] 0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch. + * @param passkey Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and "!?,.-" * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_change_operator_control_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -85,10 +85,10 @@ static inline uint16_t mavlink_msg_change_operator_control_pack(uint8_t system_i * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param target_system System the GCS requests control for - * @param control_request 0: request control of this MAV, 1: Release control of this MAV - * @param version 0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch. - * @param passkey Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and "!?,.-" + * @param target_system System the GCS requests control for + * @param control_request 0: request control of this MAV, 1: Release control of this MAV + * @param version [rad] 0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch. + * @param passkey Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and "!?,.-" * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_change_operator_control_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -146,10 +146,10 @@ static inline uint16_t mavlink_msg_change_operator_control_encode_chan(uint8_t s * @brief Send a change_operator_control message * @param chan MAVLink channel to send the message * - * @param target_system System the GCS requests control for - * @param control_request 0: request control of this MAV, 1: Release control of this MAV - * @param version 0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch. - * @param passkey Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and "!?,.-" + * @param target_system System the GCS requests control for + * @param control_request 0: request control of this MAV, 1: Release control of this MAV + * @param version [rad] 0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch. + * @param passkey Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and "!?,.-" */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -222,7 +222,7 @@ static inline void mavlink_msg_change_operator_control_send_buf(mavlink_message_ /** * @brief Get field target_system from change_operator_control message * - * @return System the GCS requests control for + * @return System the GCS requests control for */ static inline uint8_t mavlink_msg_change_operator_control_get_target_system(const mavlink_message_t* msg) { @@ -232,7 +232,7 @@ static inline uint8_t mavlink_msg_change_operator_control_get_target_system(cons /** * @brief Get field control_request from change_operator_control message * - * @return 0: request control of this MAV, 1: Release control of this MAV + * @return 0: request control of this MAV, 1: Release control of this MAV */ static inline uint8_t mavlink_msg_change_operator_control_get_control_request(const mavlink_message_t* msg) { @@ -242,7 +242,7 @@ static inline uint8_t mavlink_msg_change_operator_control_get_control_request(co /** * @brief Get field version from change_operator_control message * - * @return 0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch. + * @return [rad] 0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch. */ static inline uint8_t mavlink_msg_change_operator_control_get_version(const mavlink_message_t* msg) { @@ -252,7 +252,7 @@ static inline uint8_t mavlink_msg_change_operator_control_get_version(const mavl /** * @brief Get field passkey from change_operator_control message * - * @return Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and "!?,.-" + * @return Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and "!?,.-" */ static inline uint16_t mavlink_msg_change_operator_control_get_passkey(const mavlink_message_t* msg, char *passkey) { diff --git a/lib/main/MAVLink/common/mavlink_msg_change_operator_control_ack.h b/lib/main/MAVLink/common/mavlink_msg_change_operator_control_ack.h index 16bcec880b..d35d444ba3 100755 --- a/lib/main/MAVLink/common/mavlink_msg_change_operator_control_ack.h +++ b/lib/main/MAVLink/common/mavlink_msg_change_operator_control_ack.h @@ -3,12 +3,12 @@ #define MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK 6 -MAVPACKED( + typedef struct __mavlink_change_operator_control_ack_t { - uint8_t gcs_system_id; /*< ID of the GCS this message */ - uint8_t control_request; /*< 0: request control of this MAV, 1: Release control of this MAV*/ - uint8_t ack; /*< 0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control*/ -}) mavlink_change_operator_control_ack_t; + uint8_t gcs_system_id; /*< ID of the GCS this message */ + uint8_t control_request; /*< 0: request control of this MAV, 1: Release control of this MAV*/ + uint8_t ack; /*< 0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control*/ +} mavlink_change_operator_control_ack_t; #define MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN 3 #define MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_MIN_LEN 3 @@ -47,9 +47,9 @@ typedef struct __mavlink_change_operator_control_ack_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param gcs_system_id ID of the GCS this message - * @param control_request 0: request control of this MAV, 1: Release control of this MAV - * @param ack 0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control + * @param gcs_system_id ID of the GCS this message + * @param control_request 0: request control of this MAV, 1: Release control of this MAV + * @param ack 0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_change_operator_control_ack_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -81,9 +81,9 @@ static inline uint16_t mavlink_msg_change_operator_control_ack_pack(uint8_t syst * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param gcs_system_id ID of the GCS this message - * @param control_request 0: request control of this MAV, 1: Release control of this MAV - * @param ack 0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control + * @param gcs_system_id ID of the GCS this message + * @param control_request 0: request control of this MAV, 1: Release control of this MAV + * @param ack 0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_change_operator_control_ack_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -141,9 +141,9 @@ static inline uint16_t mavlink_msg_change_operator_control_ack_encode_chan(uint8 * @brief Send a change_operator_control_ack message * @param chan MAVLink channel to send the message * - * @param gcs_system_id ID of the GCS this message - * @param control_request 0: request control of this MAV, 1: Release control of this MAV - * @param ack 0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control + * @param gcs_system_id ID of the GCS this message + * @param control_request 0: request control of this MAV, 1: Release control of this MAV + * @param ack 0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -216,7 +216,7 @@ static inline void mavlink_msg_change_operator_control_ack_send_buf(mavlink_mess /** * @brief Get field gcs_system_id from change_operator_control_ack message * - * @return ID of the GCS this message + * @return ID of the GCS this message */ static inline uint8_t mavlink_msg_change_operator_control_ack_get_gcs_system_id(const mavlink_message_t* msg) { @@ -226,7 +226,7 @@ static inline uint8_t mavlink_msg_change_operator_control_ack_get_gcs_system_id( /** * @brief Get field control_request from change_operator_control_ack message * - * @return 0: request control of this MAV, 1: Release control of this MAV + * @return 0: request control of this MAV, 1: Release control of this MAV */ static inline uint8_t mavlink_msg_change_operator_control_ack_get_control_request(const mavlink_message_t* msg) { @@ -236,7 +236,7 @@ static inline uint8_t mavlink_msg_change_operator_control_ack_get_control_reques /** * @brief Get field ack from change_operator_control_ack message * - * @return 0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control + * @return 0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control */ static inline uint8_t mavlink_msg_change_operator_control_ack_get_ack(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_collision.h b/lib/main/MAVLink/common/mavlink_msg_collision.h index b888c20a24..b7d8a07f25 100755 --- a/lib/main/MAVLink/common/mavlink_msg_collision.h +++ b/lib/main/MAVLink/common/mavlink_msg_collision.h @@ -3,16 +3,16 @@ #define MAVLINK_MSG_ID_COLLISION 247 -MAVPACKED( + typedef struct __mavlink_collision_t { - uint32_t id; /*< Unique identifier, domain based on src field*/ - float time_to_minimum_delta; /*< Estimated time until collision occurs (seconds)*/ - float altitude_minimum_delta; /*< Closest vertical distance in meters between vehicle and object*/ - float horizontal_minimum_delta; /*< Closest horizontal distance in meteres between vehicle and object*/ - uint8_t src; /*< Collision data source*/ - uint8_t action; /*< Action that is being taken to avoid this collision*/ - uint8_t threat_level; /*< How concerned the aircraft is about this collision*/ -}) mavlink_collision_t; + uint32_t id; /*< Unique identifier, domain based on src field*/ + float time_to_minimum_delta; /*< [s] Estimated time until collision occurs*/ + float altitude_minimum_delta; /*< [m] Closest vertical distance between vehicle and object*/ + float horizontal_minimum_delta; /*< [m] Closest horizontal distance between vehicle and object*/ + uint8_t src; /*< Collision data source*/ + uint8_t action; /*< Action that is being taken to avoid this collision*/ + uint8_t threat_level; /*< How concerned the aircraft is about this collision*/ +} mavlink_collision_t; #define MAVLINK_MSG_ID_COLLISION_LEN 19 #define MAVLINK_MSG_ID_COLLISION_MIN_LEN 19 @@ -29,26 +29,26 @@ typedef struct __mavlink_collision_t { 247, \ "COLLISION", \ 7, \ - { { "id", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_collision_t, id) }, \ + { { "src", NULL, MAVLINK_TYPE_UINT8_T, 0, 16, offsetof(mavlink_collision_t, src) }, \ + { "id", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_collision_t, id) }, \ + { "action", NULL, MAVLINK_TYPE_UINT8_T, 0, 17, offsetof(mavlink_collision_t, action) }, \ + { "threat_level", NULL, MAVLINK_TYPE_UINT8_T, 0, 18, offsetof(mavlink_collision_t, threat_level) }, \ { "time_to_minimum_delta", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_collision_t, time_to_minimum_delta) }, \ { "altitude_minimum_delta", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_collision_t, altitude_minimum_delta) }, \ { "horizontal_minimum_delta", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_collision_t, horizontal_minimum_delta) }, \ - { "src", NULL, MAVLINK_TYPE_UINT8_T, 0, 16, offsetof(mavlink_collision_t, src) }, \ - { "action", NULL, MAVLINK_TYPE_UINT8_T, 0, 17, offsetof(mavlink_collision_t, action) }, \ - { "threat_level", NULL, MAVLINK_TYPE_UINT8_T, 0, 18, offsetof(mavlink_collision_t, threat_level) }, \ } \ } #else #define MAVLINK_MESSAGE_INFO_COLLISION { \ "COLLISION", \ 7, \ - { { "id", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_collision_t, id) }, \ + { { "src", NULL, MAVLINK_TYPE_UINT8_T, 0, 16, offsetof(mavlink_collision_t, src) }, \ + { "id", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_collision_t, id) }, \ + { "action", NULL, MAVLINK_TYPE_UINT8_T, 0, 17, offsetof(mavlink_collision_t, action) }, \ + { "threat_level", NULL, MAVLINK_TYPE_UINT8_T, 0, 18, offsetof(mavlink_collision_t, threat_level) }, \ { "time_to_minimum_delta", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_collision_t, time_to_minimum_delta) }, \ { "altitude_minimum_delta", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_collision_t, altitude_minimum_delta) }, \ { "horizontal_minimum_delta", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_collision_t, horizontal_minimum_delta) }, \ - { "src", NULL, MAVLINK_TYPE_UINT8_T, 0, 16, offsetof(mavlink_collision_t, src) }, \ - { "action", NULL, MAVLINK_TYPE_UINT8_T, 0, 17, offsetof(mavlink_collision_t, action) }, \ - { "threat_level", NULL, MAVLINK_TYPE_UINT8_T, 0, 18, offsetof(mavlink_collision_t, threat_level) }, \ } \ } #endif @@ -59,13 +59,13 @@ typedef struct __mavlink_collision_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param src Collision data source - * @param id Unique identifier, domain based on src field - * @param action Action that is being taken to avoid this collision - * @param threat_level How concerned the aircraft is about this collision - * @param time_to_minimum_delta Estimated time until collision occurs (seconds) - * @param altitude_minimum_delta Closest vertical distance in meters between vehicle and object - * @param horizontal_minimum_delta Closest horizontal distance in meteres between vehicle and object + * @param src Collision data source + * @param id Unique identifier, domain based on src field + * @param action Action that is being taken to avoid this collision + * @param threat_level How concerned the aircraft is about this collision + * @param time_to_minimum_delta [s] Estimated time until collision occurs + * @param altitude_minimum_delta [m] Closest vertical distance between vehicle and object + * @param horizontal_minimum_delta [m] Closest horizontal distance between vehicle and object * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_collision_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -105,13 +105,13 @@ static inline uint16_t mavlink_msg_collision_pack(uint8_t system_id, uint8_t com * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param src Collision data source - * @param id Unique identifier, domain based on src field - * @param action Action that is being taken to avoid this collision - * @param threat_level How concerned the aircraft is about this collision - * @param time_to_minimum_delta Estimated time until collision occurs (seconds) - * @param altitude_minimum_delta Closest vertical distance in meters between vehicle and object - * @param horizontal_minimum_delta Closest horizontal distance in meteres between vehicle and object + * @param src Collision data source + * @param id Unique identifier, domain based on src field + * @param action Action that is being taken to avoid this collision + * @param threat_level How concerned the aircraft is about this collision + * @param time_to_minimum_delta [s] Estimated time until collision occurs + * @param altitude_minimum_delta [m] Closest vertical distance between vehicle and object + * @param horizontal_minimum_delta [m] Closest horizontal distance between vehicle and object * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_collision_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -177,13 +177,13 @@ static inline uint16_t mavlink_msg_collision_encode_chan(uint8_t system_id, uint * @brief Send a collision message * @param chan MAVLink channel to send the message * - * @param src Collision data source - * @param id Unique identifier, domain based on src field - * @param action Action that is being taken to avoid this collision - * @param threat_level How concerned the aircraft is about this collision - * @param time_to_minimum_delta Estimated time until collision occurs (seconds) - * @param altitude_minimum_delta Closest vertical distance in meters between vehicle and object - * @param horizontal_minimum_delta Closest horizontal distance in meteres between vehicle and object + * @param src Collision data source + * @param id Unique identifier, domain based on src field + * @param action Action that is being taken to avoid this collision + * @param threat_level How concerned the aircraft is about this collision + * @param time_to_minimum_delta [s] Estimated time until collision occurs + * @param altitude_minimum_delta [m] Closest vertical distance between vehicle and object + * @param horizontal_minimum_delta [m] Closest horizontal distance between vehicle and object */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -272,7 +272,7 @@ static inline void mavlink_msg_collision_send_buf(mavlink_message_t *msgbuf, mav /** * @brief Get field src from collision message * - * @return Collision data source + * @return Collision data source */ static inline uint8_t mavlink_msg_collision_get_src(const mavlink_message_t* msg) { @@ -282,7 +282,7 @@ static inline uint8_t mavlink_msg_collision_get_src(const mavlink_message_t* msg /** * @brief Get field id from collision message * - * @return Unique identifier, domain based on src field + * @return Unique identifier, domain based on src field */ static inline uint32_t mavlink_msg_collision_get_id(const mavlink_message_t* msg) { @@ -292,7 +292,7 @@ static inline uint32_t mavlink_msg_collision_get_id(const mavlink_message_t* msg /** * @brief Get field action from collision message * - * @return Action that is being taken to avoid this collision + * @return Action that is being taken to avoid this collision */ static inline uint8_t mavlink_msg_collision_get_action(const mavlink_message_t* msg) { @@ -302,7 +302,7 @@ static inline uint8_t mavlink_msg_collision_get_action(const mavlink_message_t* /** * @brief Get field threat_level from collision message * - * @return How concerned the aircraft is about this collision + * @return How concerned the aircraft is about this collision */ static inline uint8_t mavlink_msg_collision_get_threat_level(const mavlink_message_t* msg) { @@ -312,7 +312,7 @@ static inline uint8_t mavlink_msg_collision_get_threat_level(const mavlink_messa /** * @brief Get field time_to_minimum_delta from collision message * - * @return Estimated time until collision occurs (seconds) + * @return [s] Estimated time until collision occurs */ static inline float mavlink_msg_collision_get_time_to_minimum_delta(const mavlink_message_t* msg) { @@ -322,7 +322,7 @@ static inline float mavlink_msg_collision_get_time_to_minimum_delta(const mavlin /** * @brief Get field altitude_minimum_delta from collision message * - * @return Closest vertical distance in meters between vehicle and object + * @return [m] Closest vertical distance between vehicle and object */ static inline float mavlink_msg_collision_get_altitude_minimum_delta(const mavlink_message_t* msg) { @@ -332,7 +332,7 @@ static inline float mavlink_msg_collision_get_altitude_minimum_delta(const mavli /** * @brief Get field horizontal_minimum_delta from collision message * - * @return Closest horizontal distance in meteres between vehicle and object + * @return [m] Closest horizontal distance between vehicle and object */ static inline float mavlink_msg_collision_get_horizontal_minimum_delta(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_command_ack.h b/lib/main/MAVLink/common/mavlink_msg_command_ack.h index 7ace685119..52991543c5 100755 --- a/lib/main/MAVLink/common/mavlink_msg_command_ack.h +++ b/lib/main/MAVLink/common/mavlink_msg_command_ack.h @@ -3,11 +3,11 @@ #define MAVLINK_MSG_ID_COMMAND_ACK 77 -MAVPACKED( + typedef struct __mavlink_command_ack_t { - uint16_t command; /*< Command ID, as defined by MAV_CMD enum.*/ - uint8_t result; /*< See MAV_RESULT enum*/ -}) mavlink_command_ack_t; + uint16_t command; /*< Command ID (of acknowledged command).*/ + uint8_t result; /*< Result of command.*/ +} mavlink_command_ack_t; #define MAVLINK_MSG_ID_COMMAND_ACK_LEN 3 #define MAVLINK_MSG_ID_COMMAND_ACK_MIN_LEN 3 @@ -44,8 +44,8 @@ typedef struct __mavlink_command_ack_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param command Command ID, as defined by MAV_CMD enum. - * @param result See MAV_RESULT enum + * @param command Command ID (of acknowledged command). + * @param result Result of command. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_command_ack_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -75,8 +75,8 @@ static inline uint16_t mavlink_msg_command_ack_pack(uint8_t system_id, uint8_t c * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param command Command ID, as defined by MAV_CMD enum. - * @param result See MAV_RESULT enum + * @param command Command ID (of acknowledged command). + * @param result Result of command. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_command_ack_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -132,8 +132,8 @@ static inline uint16_t mavlink_msg_command_ack_encode_chan(uint8_t system_id, ui * @brief Send a command_ack message * @param chan MAVLink channel to send the message * - * @param command Command ID, as defined by MAV_CMD enum. - * @param result See MAV_RESULT enum + * @param command Command ID (of acknowledged command). + * @param result Result of command. */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -202,7 +202,7 @@ static inline void mavlink_msg_command_ack_send_buf(mavlink_message_t *msgbuf, m /** * @brief Get field command from command_ack message * - * @return Command ID, as defined by MAV_CMD enum. + * @return Command ID (of acknowledged command). */ static inline uint16_t mavlink_msg_command_ack_get_command(const mavlink_message_t* msg) { @@ -212,7 +212,7 @@ static inline uint16_t mavlink_msg_command_ack_get_command(const mavlink_message /** * @brief Get field result from command_ack message * - * @return See MAV_RESULT enum + * @return Result of command. */ static inline uint8_t mavlink_msg_command_ack_get_result(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_command_cancel.h b/lib/main/MAVLink/common/mavlink_msg_command_cancel.h new file mode 100644 index 0000000000..0ad7dac584 --- /dev/null +++ b/lib/main/MAVLink/common/mavlink_msg_command_cancel.h @@ -0,0 +1,263 @@ +#pragma once +// MESSAGE COMMAND_CANCEL PACKING + +#define MAVLINK_MSG_ID_COMMAND_CANCEL 80 + + +typedef struct __mavlink_command_cancel_t { + uint16_t command; /*< Command ID (of command to cancel).*/ + uint8_t target_system; /*< System executing long running command. Should not be broadcast (0).*/ + uint8_t target_component; /*< Component executing long running command.*/ +} mavlink_command_cancel_t; + +#define MAVLINK_MSG_ID_COMMAND_CANCEL_LEN 4 +#define MAVLINK_MSG_ID_COMMAND_CANCEL_MIN_LEN 4 +#define MAVLINK_MSG_ID_80_LEN 4 +#define MAVLINK_MSG_ID_80_MIN_LEN 4 + +#define MAVLINK_MSG_ID_COMMAND_CANCEL_CRC 14 +#define MAVLINK_MSG_ID_80_CRC 14 + + + +#if MAVLINK_COMMAND_24BIT +#define MAVLINK_MESSAGE_INFO_COMMAND_CANCEL { \ + 80, \ + "COMMAND_CANCEL", \ + 3, \ + { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_command_cancel_t, target_system) }, \ + { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_command_cancel_t, target_component) }, \ + { "command", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_command_cancel_t, command) }, \ + } \ +} +#else +#define MAVLINK_MESSAGE_INFO_COMMAND_CANCEL { \ + "COMMAND_CANCEL", \ + 3, \ + { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_command_cancel_t, target_system) }, \ + { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_command_cancel_t, target_component) }, \ + { "command", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_command_cancel_t, command) }, \ + } \ +} +#endif + +/** + * @brief Pack a command_cancel 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 executing long running command. Should not be broadcast (0). + * @param target_component Component executing long running command. + * @param command Command ID (of command to cancel). + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_command_cancel_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, + uint8_t target_system, uint8_t target_component, uint16_t command) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[MAVLINK_MSG_ID_COMMAND_CANCEL_LEN]; + _mav_put_uint16_t(buf, 0, command); + _mav_put_uint8_t(buf, 2, target_system); + _mav_put_uint8_t(buf, 3, target_component); + + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_COMMAND_CANCEL_LEN); +#else + mavlink_command_cancel_t packet; + packet.command = command; + packet.target_system = target_system; + packet.target_component = target_component; + + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_COMMAND_CANCEL_LEN); +#endif + + msg->msgid = MAVLINK_MSG_ID_COMMAND_CANCEL; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_COMMAND_CANCEL_MIN_LEN, MAVLINK_MSG_ID_COMMAND_CANCEL_LEN, MAVLINK_MSG_ID_COMMAND_CANCEL_CRC); +} + +/** + * @brief Pack a command_cancel message on a channel + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param chan The MAVLink channel this message will be sent over + * @param msg The MAVLink message to compress the data into + * @param target_system System executing long running command. Should not be broadcast (0). + * @param target_component Component executing long running command. + * @param command Command ID (of command to cancel). + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_command_cancel_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, + mavlink_message_t* msg, + uint8_t target_system,uint8_t target_component,uint16_t command) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[MAVLINK_MSG_ID_COMMAND_CANCEL_LEN]; + _mav_put_uint16_t(buf, 0, command); + _mav_put_uint8_t(buf, 2, target_system); + _mav_put_uint8_t(buf, 3, target_component); + + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_COMMAND_CANCEL_LEN); +#else + mavlink_command_cancel_t packet; + packet.command = command; + packet.target_system = target_system; + packet.target_component = target_component; + + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_COMMAND_CANCEL_LEN); +#endif + + msg->msgid = MAVLINK_MSG_ID_COMMAND_CANCEL; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_COMMAND_CANCEL_MIN_LEN, MAVLINK_MSG_ID_COMMAND_CANCEL_LEN, MAVLINK_MSG_ID_COMMAND_CANCEL_CRC); +} + +/** + * @brief Encode a command_cancel struct + * + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param msg The MAVLink message to compress the data into + * @param command_cancel C-struct to read the message contents from + */ +static inline uint16_t mavlink_msg_command_cancel_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_command_cancel_t* command_cancel) +{ + return mavlink_msg_command_cancel_pack(system_id, component_id, msg, command_cancel->target_system, command_cancel->target_component, command_cancel->command); +} + +/** + * @brief Encode a command_cancel struct on a channel + * + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param chan The MAVLink channel this message will be sent over + * @param msg The MAVLink message to compress the data into + * @param command_cancel C-struct to read the message contents from + */ +static inline uint16_t mavlink_msg_command_cancel_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_command_cancel_t* command_cancel) +{ + return mavlink_msg_command_cancel_pack_chan(system_id, component_id, chan, msg, command_cancel->target_system, command_cancel->target_component, command_cancel->command); +} + +/** + * @brief Send a command_cancel message + * @param chan MAVLink channel to send the message + * + * @param target_system System executing long running command. Should not be broadcast (0). + * @param target_component Component executing long running command. + * @param command Command ID (of command to cancel). + */ +#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS + +static inline void mavlink_msg_command_cancel_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t command) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[MAVLINK_MSG_ID_COMMAND_CANCEL_LEN]; + _mav_put_uint16_t(buf, 0, command); + _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_COMMAND_CANCEL, buf, MAVLINK_MSG_ID_COMMAND_CANCEL_MIN_LEN, MAVLINK_MSG_ID_COMMAND_CANCEL_LEN, MAVLINK_MSG_ID_COMMAND_CANCEL_CRC); +#else + mavlink_command_cancel_t packet; + packet.command = command; + packet.target_system = target_system; + packet.target_component = target_component; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_CANCEL, (const char *)&packet, MAVLINK_MSG_ID_COMMAND_CANCEL_MIN_LEN, MAVLINK_MSG_ID_COMMAND_CANCEL_LEN, MAVLINK_MSG_ID_COMMAND_CANCEL_CRC); +#endif +} + +/** + * @brief Send a command_cancel message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_command_cancel_send_struct(mavlink_channel_t chan, const mavlink_command_cancel_t* command_cancel) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_command_cancel_send(chan, command_cancel->target_system, command_cancel->target_component, command_cancel->command); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_CANCEL, (const char *)command_cancel, MAVLINK_MSG_ID_COMMAND_CANCEL_MIN_LEN, MAVLINK_MSG_ID_COMMAND_CANCEL_LEN, MAVLINK_MSG_ID_COMMAND_CANCEL_CRC); +#endif +} + +#if MAVLINK_MSG_ID_COMMAND_CANCEL_LEN <= MAVLINK_MAX_PAYLOAD_LEN +/* + This varient of _send() can be used to save stack space by re-using + memory from the receive buffer. The caller provides a + mavlink_message_t which is the size of a full mavlink message. This + is usually the receive buffer for the channel, and allows a reply to an + incoming message with minimum stack space usage. + */ +static inline void mavlink_msg_command_cancel_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t command) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char *buf = (char *)msgbuf; + _mav_put_uint16_t(buf, 0, command); + _mav_put_uint8_t(buf, 2, target_system); + _mav_put_uint8_t(buf, 3, target_component); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_CANCEL, buf, MAVLINK_MSG_ID_COMMAND_CANCEL_MIN_LEN, MAVLINK_MSG_ID_COMMAND_CANCEL_LEN, MAVLINK_MSG_ID_COMMAND_CANCEL_CRC); +#else + mavlink_command_cancel_t *packet = (mavlink_command_cancel_t *)msgbuf; + packet->command = command; + packet->target_system = target_system; + packet->target_component = target_component; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_CANCEL, (const char *)packet, MAVLINK_MSG_ID_COMMAND_CANCEL_MIN_LEN, MAVLINK_MSG_ID_COMMAND_CANCEL_LEN, MAVLINK_MSG_ID_COMMAND_CANCEL_CRC); +#endif +} +#endif + +#endif + +// MESSAGE COMMAND_CANCEL UNPACKING + + +/** + * @brief Get field target_system from command_cancel message + * + * @return System executing long running command. Should not be broadcast (0). + */ +static inline uint8_t mavlink_msg_command_cancel_get_target_system(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint8_t(msg, 2); +} + +/** + * @brief Get field target_component from command_cancel message + * + * @return Component executing long running command. + */ +static inline uint8_t mavlink_msg_command_cancel_get_target_component(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint8_t(msg, 3); +} + +/** + * @brief Get field command from command_cancel message + * + * @return Command ID (of command to cancel). + */ +static inline uint16_t mavlink_msg_command_cancel_get_command(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint16_t(msg, 0); +} + +/** + * @brief Decode a command_cancel message into a struct + * + * @param msg The message to decode + * @param command_cancel C-struct to decode the message contents into + */ +static inline void mavlink_msg_command_cancel_decode(const mavlink_message_t* msg, mavlink_command_cancel_t* command_cancel) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + command_cancel->command = mavlink_msg_command_cancel_get_command(msg); + command_cancel->target_system = mavlink_msg_command_cancel_get_target_system(msg); + command_cancel->target_component = mavlink_msg_command_cancel_get_target_component(msg); +#else + uint8_t len = msg->len < MAVLINK_MSG_ID_COMMAND_CANCEL_LEN? msg->len : MAVLINK_MSG_ID_COMMAND_CANCEL_LEN; + memset(command_cancel, 0, MAVLINK_MSG_ID_COMMAND_CANCEL_LEN); + memcpy(command_cancel, _MAV_PAYLOAD(msg), len); +#endif +} diff --git a/lib/main/MAVLink/common/mavlink_msg_command_int.h b/lib/main/MAVLink/common/mavlink_msg_command_int.h index 763634642e..dcd298a1c9 100755 --- a/lib/main/MAVLink/common/mavlink_msg_command_int.h +++ b/lib/main/MAVLink/common/mavlink_msg_command_int.h @@ -3,22 +3,22 @@ #define MAVLINK_MSG_ID_COMMAND_INT 75 -MAVPACKED( + typedef struct __mavlink_command_int_t { - float param1; /*< PARAM1, see MAV_CMD enum*/ - float param2; /*< PARAM2, see MAV_CMD enum*/ - float param3; /*< PARAM3, see MAV_CMD enum*/ - float param4; /*< PARAM4, see MAV_CMD enum*/ - int32_t x; /*< PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7*/ - int32_t y; /*< PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7*/ - float z; /*< PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame.*/ - uint16_t command; /*< The scheduled action for the mission item. see MAV_CMD in common.xml MAVLink specs*/ - uint8_t target_system; /*< System ID*/ - uint8_t target_component; /*< Component ID*/ - uint8_t frame; /*< The coordinate system of the COMMAND. see MAV_FRAME in mavlink_types.h*/ - uint8_t current; /*< false:0, true:1*/ - uint8_t autocontinue; /*< autocontinue to next wp*/ -}) mavlink_command_int_t; + float param1; /*< PARAM1, see MAV_CMD enum*/ + float param2; /*< PARAM2, see MAV_CMD enum*/ + float param3; /*< PARAM3, see MAV_CMD enum*/ + float param4; /*< PARAM4, see MAV_CMD enum*/ + int32_t x; /*< PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7*/ + int32_t y; /*< PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7*/ + float z; /*< PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame).*/ + uint16_t command; /*< The scheduled action for the mission item.*/ + uint8_t target_system; /*< System ID*/ + uint8_t target_component; /*< Component ID*/ + uint8_t frame; /*< The coordinate system of the COMMAND.*/ + uint8_t current; /*< false:0, true:1*/ + uint8_t autocontinue; /*< autocontinue to next wp*/ +} mavlink_command_int_t; #define MAVLINK_MSG_ID_COMMAND_INT_LEN 35 #define MAVLINK_MSG_ID_COMMAND_INT_MIN_LEN 35 @@ -35,38 +35,38 @@ typedef struct __mavlink_command_int_t { 75, \ "COMMAND_INT", \ 13, \ - { { "param1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_command_int_t, param1) }, \ + { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_command_int_t, target_system) }, \ + { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_command_int_t, target_component) }, \ + { "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_command_int_t, frame) }, \ + { "command", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_command_int_t, command) }, \ + { "current", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_command_int_t, current) }, \ + { "autocontinue", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_command_int_t, autocontinue) }, \ + { "param1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_command_int_t, param1) }, \ { "param2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_command_int_t, param2) }, \ { "param3", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_command_int_t, param3) }, \ { "param4", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_command_int_t, param4) }, \ { "x", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_command_int_t, x) }, \ { "y", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_command_int_t, y) }, \ { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_command_int_t, z) }, \ - { "command", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_command_int_t, command) }, \ - { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_command_int_t, target_system) }, \ - { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_command_int_t, target_component) }, \ - { "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_command_int_t, frame) }, \ - { "current", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_command_int_t, current) }, \ - { "autocontinue", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_command_int_t, autocontinue) }, \ } \ } #else #define MAVLINK_MESSAGE_INFO_COMMAND_INT { \ "COMMAND_INT", \ 13, \ - { { "param1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_command_int_t, param1) }, \ + { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_command_int_t, target_system) }, \ + { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_command_int_t, target_component) }, \ + { "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_command_int_t, frame) }, \ + { "command", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_command_int_t, command) }, \ + { "current", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_command_int_t, current) }, \ + { "autocontinue", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_command_int_t, autocontinue) }, \ + { "param1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_command_int_t, param1) }, \ { "param2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_command_int_t, param2) }, \ { "param3", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_command_int_t, param3) }, \ { "param4", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_command_int_t, param4) }, \ { "x", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_command_int_t, x) }, \ { "y", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_command_int_t, y) }, \ { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_command_int_t, z) }, \ - { "command", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_command_int_t, command) }, \ - { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_command_int_t, target_system) }, \ - { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_command_int_t, target_component) }, \ - { "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_command_int_t, frame) }, \ - { "current", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_command_int_t, current) }, \ - { "autocontinue", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_command_int_t, autocontinue) }, \ } \ } #endif @@ -77,19 +77,19 @@ typedef struct __mavlink_command_int_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param target_system System ID - * @param target_component Component ID - * @param frame The coordinate system of the COMMAND. see MAV_FRAME in mavlink_types.h - * @param command The scheduled action for the mission item. see MAV_CMD in common.xml MAVLink specs - * @param current false:0, true:1 - * @param autocontinue autocontinue to next wp - * @param param1 PARAM1, see MAV_CMD enum - * @param param2 PARAM2, see MAV_CMD enum - * @param param3 PARAM3, see MAV_CMD enum - * @param param4 PARAM4, see MAV_CMD enum - * @param x PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7 - * @param y PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7 - * @param z PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame. + * @param target_system System ID + * @param target_component Component ID + * @param frame The coordinate system of the COMMAND. + * @param command The scheduled action for the mission item. + * @param current false:0, true:1 + * @param autocontinue autocontinue to next wp + * @param param1 PARAM1, see MAV_CMD enum + * @param param2 PARAM2, see MAV_CMD enum + * @param param3 PARAM3, see MAV_CMD enum + * @param param4 PARAM4, see MAV_CMD enum + * @param x PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7 + * @param y PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7 + * @param z PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame). * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_command_int_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -141,19 +141,19 @@ static inline uint16_t mavlink_msg_command_int_pack(uint8_t system_id, uint8_t c * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param target_system System ID - * @param target_component Component ID - * @param frame The coordinate system of the COMMAND. see MAV_FRAME in mavlink_types.h - * @param command The scheduled action for the mission item. see MAV_CMD in common.xml MAVLink specs - * @param current false:0, true:1 - * @param autocontinue autocontinue to next wp - * @param param1 PARAM1, see MAV_CMD enum - * @param param2 PARAM2, see MAV_CMD enum - * @param param3 PARAM3, see MAV_CMD enum - * @param param4 PARAM4, see MAV_CMD enum - * @param x PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7 - * @param y PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7 - * @param z PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame. + * @param target_system System ID + * @param target_component Component ID + * @param frame The coordinate system of the COMMAND. + * @param command The scheduled action for the mission item. + * @param current false:0, true:1 + * @param autocontinue autocontinue to next wp + * @param param1 PARAM1, see MAV_CMD enum + * @param param2 PARAM2, see MAV_CMD enum + * @param param3 PARAM3, see MAV_CMD enum + * @param param4 PARAM4, see MAV_CMD enum + * @param x PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7 + * @param y PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7 + * @param z PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame). * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_command_int_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -231,19 +231,19 @@ static inline uint16_t mavlink_msg_command_int_encode_chan(uint8_t system_id, ui * @brief Send a command_int message * @param chan MAVLink channel to send the message * - * @param target_system System ID - * @param target_component Component ID - * @param frame The coordinate system of the COMMAND. see MAV_FRAME in mavlink_types.h - * @param command The scheduled action for the mission item. see MAV_CMD in common.xml MAVLink specs - * @param current false:0, true:1 - * @param autocontinue autocontinue to next wp - * @param param1 PARAM1, see MAV_CMD enum - * @param param2 PARAM2, see MAV_CMD enum - * @param param3 PARAM3, see MAV_CMD enum - * @param param4 PARAM4, see MAV_CMD enum - * @param x PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7 - * @param y PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7 - * @param z PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame. + * @param target_system System ID + * @param target_component Component ID + * @param frame The coordinate system of the COMMAND. + * @param command The scheduled action for the mission item. + * @param current false:0, true:1 + * @param autocontinue autocontinue to next wp + * @param param1 PARAM1, see MAV_CMD enum + * @param param2 PARAM2, see MAV_CMD enum + * @param param3 PARAM3, see MAV_CMD enum + * @param param4 PARAM4, see MAV_CMD enum + * @param x PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7 + * @param y PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7 + * @param z PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame). */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -356,7 +356,7 @@ static inline void mavlink_msg_command_int_send_buf(mavlink_message_t *msgbuf, m /** * @brief Get field target_system from command_int message * - * @return System ID + * @return System ID */ static inline uint8_t mavlink_msg_command_int_get_target_system(const mavlink_message_t* msg) { @@ -366,7 +366,7 @@ static inline uint8_t mavlink_msg_command_int_get_target_system(const mavlink_me /** * @brief Get field target_component from command_int message * - * @return Component ID + * @return Component ID */ static inline uint8_t mavlink_msg_command_int_get_target_component(const mavlink_message_t* msg) { @@ -376,7 +376,7 @@ static inline uint8_t mavlink_msg_command_int_get_target_component(const mavlink /** * @brief Get field frame from command_int message * - * @return The coordinate system of the COMMAND. see MAV_FRAME in mavlink_types.h + * @return The coordinate system of the COMMAND. */ static inline uint8_t mavlink_msg_command_int_get_frame(const mavlink_message_t* msg) { @@ -386,7 +386,7 @@ static inline uint8_t mavlink_msg_command_int_get_frame(const mavlink_message_t* /** * @brief Get field command from command_int message * - * @return The scheduled action for the mission item. see MAV_CMD in common.xml MAVLink specs + * @return The scheduled action for the mission item. */ static inline uint16_t mavlink_msg_command_int_get_command(const mavlink_message_t* msg) { @@ -396,7 +396,7 @@ static inline uint16_t mavlink_msg_command_int_get_command(const mavlink_message /** * @brief Get field current from command_int message * - * @return false:0, true:1 + * @return false:0, true:1 */ static inline uint8_t mavlink_msg_command_int_get_current(const mavlink_message_t* msg) { @@ -406,7 +406,7 @@ static inline uint8_t mavlink_msg_command_int_get_current(const mavlink_message_ /** * @brief Get field autocontinue from command_int message * - * @return autocontinue to next wp + * @return autocontinue to next wp */ static inline uint8_t mavlink_msg_command_int_get_autocontinue(const mavlink_message_t* msg) { @@ -416,7 +416,7 @@ static inline uint8_t mavlink_msg_command_int_get_autocontinue(const mavlink_mes /** * @brief Get field param1 from command_int message * - * @return PARAM1, see MAV_CMD enum + * @return PARAM1, see MAV_CMD enum */ static inline float mavlink_msg_command_int_get_param1(const mavlink_message_t* msg) { @@ -426,7 +426,7 @@ static inline float mavlink_msg_command_int_get_param1(const mavlink_message_t* /** * @brief Get field param2 from command_int message * - * @return PARAM2, see MAV_CMD enum + * @return PARAM2, see MAV_CMD enum */ static inline float mavlink_msg_command_int_get_param2(const mavlink_message_t* msg) { @@ -436,7 +436,7 @@ static inline float mavlink_msg_command_int_get_param2(const mavlink_message_t* /** * @brief Get field param3 from command_int message * - * @return PARAM3, see MAV_CMD enum + * @return PARAM3, see MAV_CMD enum */ static inline float mavlink_msg_command_int_get_param3(const mavlink_message_t* msg) { @@ -446,7 +446,7 @@ static inline float mavlink_msg_command_int_get_param3(const mavlink_message_t* /** * @brief Get field param4 from command_int message * - * @return PARAM4, see MAV_CMD enum + * @return PARAM4, see MAV_CMD enum */ static inline float mavlink_msg_command_int_get_param4(const mavlink_message_t* msg) { @@ -456,7 +456,7 @@ static inline float mavlink_msg_command_int_get_param4(const mavlink_message_t* /** * @brief Get field x from command_int message * - * @return PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7 + * @return PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7 */ static inline int32_t mavlink_msg_command_int_get_x(const mavlink_message_t* msg) { @@ -466,7 +466,7 @@ static inline int32_t mavlink_msg_command_int_get_x(const mavlink_message_t* msg /** * @brief Get field y from command_int message * - * @return PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7 + * @return PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7 */ static inline int32_t mavlink_msg_command_int_get_y(const mavlink_message_t* msg) { @@ -476,7 +476,7 @@ static inline int32_t mavlink_msg_command_int_get_y(const mavlink_message_t* msg /** * @brief Get field z from command_int message * - * @return PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame. + * @return PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame). */ static inline float mavlink_msg_command_int_get_z(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_command_long.h b/lib/main/MAVLink/common/mavlink_msg_command_long.h index f7c62cb352..6a9a169875 100755 --- a/lib/main/MAVLink/common/mavlink_msg_command_long.h +++ b/lib/main/MAVLink/common/mavlink_msg_command_long.h @@ -3,20 +3,20 @@ #define MAVLINK_MSG_ID_COMMAND_LONG 76 -MAVPACKED( + typedef struct __mavlink_command_long_t { - float param1; /*< Parameter 1, as defined by MAV_CMD enum.*/ - float param2; /*< Parameter 2, as defined by MAV_CMD enum.*/ - float param3; /*< Parameter 3, as defined by MAV_CMD enum.*/ - float param4; /*< Parameter 4, as defined by MAV_CMD enum.*/ - float param5; /*< Parameter 5, as defined by MAV_CMD enum.*/ - float param6; /*< Parameter 6, as defined by MAV_CMD enum.*/ - float param7; /*< Parameter 7, as defined by MAV_CMD enum.*/ - uint16_t command; /*< Command ID, as defined by MAV_CMD enum.*/ - uint8_t target_system; /*< System which should execute the command*/ - uint8_t target_component; /*< Component which should execute the command, 0 for all components*/ - uint8_t confirmation; /*< 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)*/ -}) mavlink_command_long_t; + float param1; /*< Parameter 1 (for the specific command).*/ + float param2; /*< Parameter 2 (for the specific command).*/ + float param3; /*< Parameter 3 (for the specific command).*/ + float param4; /*< Parameter 4 (for the specific command).*/ + float param5; /*< Parameter 5 (for the specific command).*/ + float param6; /*< Parameter 6 (for the specific command).*/ + float param7; /*< Parameter 7 (for the specific command).*/ + uint16_t command; /*< Command ID (of command to send).*/ + uint8_t target_system; /*< System which should execute the command*/ + uint8_t target_component; /*< Component which should execute the command, 0 for all components*/ + uint8_t confirmation; /*< 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)*/ +} mavlink_command_long_t; #define MAVLINK_MSG_ID_COMMAND_LONG_LEN 33 #define MAVLINK_MSG_ID_COMMAND_LONG_MIN_LEN 33 @@ -33,34 +33,34 @@ typedef struct __mavlink_command_long_t { 76, \ "COMMAND_LONG", \ 11, \ - { { "param1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_command_long_t, param1) }, \ + { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_command_long_t, target_system) }, \ + { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_command_long_t, target_component) }, \ + { "command", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_command_long_t, command) }, \ + { "confirmation", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_command_long_t, confirmation) }, \ + { "param1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_command_long_t, param1) }, \ { "param2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_command_long_t, param2) }, \ { "param3", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_command_long_t, param3) }, \ { "param4", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_command_long_t, param4) }, \ { "param5", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_command_long_t, param5) }, \ { "param6", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_command_long_t, param6) }, \ { "param7", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_command_long_t, param7) }, \ - { "command", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_command_long_t, command) }, \ - { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_command_long_t, target_system) }, \ - { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_command_long_t, target_component) }, \ - { "confirmation", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_command_long_t, confirmation) }, \ } \ } #else #define MAVLINK_MESSAGE_INFO_COMMAND_LONG { \ "COMMAND_LONG", \ 11, \ - { { "param1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_command_long_t, param1) }, \ + { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_command_long_t, target_system) }, \ + { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_command_long_t, target_component) }, \ + { "command", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_command_long_t, command) }, \ + { "confirmation", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_command_long_t, confirmation) }, \ + { "param1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_command_long_t, param1) }, \ { "param2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_command_long_t, param2) }, \ { "param3", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_command_long_t, param3) }, \ { "param4", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_command_long_t, param4) }, \ { "param5", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_command_long_t, param5) }, \ { "param6", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_command_long_t, param6) }, \ { "param7", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_command_long_t, param7) }, \ - { "command", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_command_long_t, command) }, \ - { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_command_long_t, target_system) }, \ - { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_command_long_t, target_component) }, \ - { "confirmation", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_command_long_t, confirmation) }, \ } \ } #endif @@ -71,17 +71,17 @@ typedef struct __mavlink_command_long_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param target_system System which should execute the command - * @param target_component Component which should execute the command, 0 for all components - * @param command Command ID, as defined by MAV_CMD enum. - * @param confirmation 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command) - * @param param1 Parameter 1, as defined by MAV_CMD enum. - * @param param2 Parameter 2, as defined by MAV_CMD enum. - * @param param3 Parameter 3, as defined by MAV_CMD enum. - * @param param4 Parameter 4, as defined by MAV_CMD enum. - * @param param5 Parameter 5, as defined by MAV_CMD enum. - * @param param6 Parameter 6, as defined by MAV_CMD enum. - * @param param7 Parameter 7, as defined by MAV_CMD enum. + * @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 (of command to send). + * @param confirmation 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command) + * @param param1 Parameter 1 (for the specific command). + * @param param2 Parameter 2 (for the specific command). + * @param param3 Parameter 3 (for the specific command). + * @param param4 Parameter 4 (for the specific command). + * @param param5 Parameter 5 (for the specific command). + * @param param6 Parameter 6 (for the specific command). + * @param param7 Parameter 7 (for the specific command). * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_command_long_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -129,17 +129,17 @@ static inline uint16_t mavlink_msg_command_long_pack(uint8_t system_id, uint8_t * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param target_system System which should execute the command - * @param target_component Component which should execute the command, 0 for all components - * @param command Command ID, as defined by MAV_CMD enum. - * @param confirmation 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command) - * @param param1 Parameter 1, as defined by MAV_CMD enum. - * @param param2 Parameter 2, as defined by MAV_CMD enum. - * @param param3 Parameter 3, as defined by MAV_CMD enum. - * @param param4 Parameter 4, as defined by MAV_CMD enum. - * @param param5 Parameter 5, as defined by MAV_CMD enum. - * @param param6 Parameter 6, as defined by MAV_CMD enum. - * @param param7 Parameter 7, as defined by MAV_CMD enum. + * @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 (of command to send). + * @param confirmation 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command) + * @param param1 Parameter 1 (for the specific command). + * @param param2 Parameter 2 (for the specific command). + * @param param3 Parameter 3 (for the specific command). + * @param param4 Parameter 4 (for the specific command). + * @param param5 Parameter 5 (for the specific command). + * @param param6 Parameter 6 (for the specific command). + * @param param7 Parameter 7 (for the specific command). * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_command_long_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -213,17 +213,17 @@ static inline uint16_t mavlink_msg_command_long_encode_chan(uint8_t system_id, u * @brief Send a command_long message * @param chan MAVLink channel to send the message * - * @param target_system System which should execute the command - * @param target_component Component which should execute the command, 0 for all components - * @param command Command ID, as defined by MAV_CMD enum. - * @param confirmation 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command) - * @param param1 Parameter 1, as defined by MAV_CMD enum. - * @param param2 Parameter 2, as defined by MAV_CMD enum. - * @param param3 Parameter 3, as defined by MAV_CMD enum. - * @param param4 Parameter 4, as defined by MAV_CMD enum. - * @param param5 Parameter 5, as defined by MAV_CMD enum. - * @param param6 Parameter 6, as defined by MAV_CMD enum. - * @param param7 Parameter 7, as defined by MAV_CMD enum. + * @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 (of command to send). + * @param confirmation 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command) + * @param param1 Parameter 1 (for the specific command). + * @param param2 Parameter 2 (for the specific command). + * @param param3 Parameter 3 (for the specific command). + * @param param4 Parameter 4 (for the specific command). + * @param param5 Parameter 5 (for the specific command). + * @param param6 Parameter 6 (for the specific command). + * @param param7 Parameter 7 (for the specific command). */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -328,7 +328,7 @@ static inline void mavlink_msg_command_long_send_buf(mavlink_message_t *msgbuf, /** * @brief Get field target_system from command_long message * - * @return System which should execute the command + * @return System which should execute the command */ static inline uint8_t mavlink_msg_command_long_get_target_system(const mavlink_message_t* msg) { @@ -338,7 +338,7 @@ static inline uint8_t mavlink_msg_command_long_get_target_system(const mavlink_m /** * @brief Get field target_component from command_long message * - * @return Component which should execute the command, 0 for all components + * @return Component which should execute the command, 0 for all components */ static inline uint8_t mavlink_msg_command_long_get_target_component(const mavlink_message_t* msg) { @@ -348,7 +348,7 @@ static inline uint8_t mavlink_msg_command_long_get_target_component(const mavlin /** * @brief Get field command from command_long message * - * @return Command ID, as defined by MAV_CMD enum. + * @return Command ID (of command to send). */ static inline uint16_t mavlink_msg_command_long_get_command(const mavlink_message_t* msg) { @@ -358,7 +358,7 @@ static inline uint16_t mavlink_msg_command_long_get_command(const mavlink_messag /** * @brief Get field confirmation from command_long message * - * @return 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command) + * @return 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command) */ static inline uint8_t mavlink_msg_command_long_get_confirmation(const mavlink_message_t* msg) { @@ -368,7 +368,7 @@ static inline uint8_t mavlink_msg_command_long_get_confirmation(const mavlink_me /** * @brief Get field param1 from command_long message * - * @return Parameter 1, as defined by MAV_CMD enum. + * @return Parameter 1 (for the specific command). */ static inline float mavlink_msg_command_long_get_param1(const mavlink_message_t* msg) { @@ -378,7 +378,7 @@ static inline float mavlink_msg_command_long_get_param1(const mavlink_message_t* /** * @brief Get field param2 from command_long message * - * @return Parameter 2, as defined by MAV_CMD enum. + * @return Parameter 2 (for the specific command). */ static inline float mavlink_msg_command_long_get_param2(const mavlink_message_t* msg) { @@ -388,7 +388,7 @@ static inline float mavlink_msg_command_long_get_param2(const mavlink_message_t* /** * @brief Get field param3 from command_long message * - * @return Parameter 3, as defined by MAV_CMD enum. + * @return Parameter 3 (for the specific command). */ static inline float mavlink_msg_command_long_get_param3(const mavlink_message_t* msg) { @@ -398,7 +398,7 @@ static inline float mavlink_msg_command_long_get_param3(const mavlink_message_t* /** * @brief Get field param4 from command_long message * - * @return Parameter 4, as defined by MAV_CMD enum. + * @return Parameter 4 (for the specific command). */ static inline float mavlink_msg_command_long_get_param4(const mavlink_message_t* msg) { @@ -408,7 +408,7 @@ static inline float mavlink_msg_command_long_get_param4(const mavlink_message_t* /** * @brief Get field param5 from command_long message * - * @return Parameter 5, as defined by MAV_CMD enum. + * @return Parameter 5 (for the specific command). */ static inline float mavlink_msg_command_long_get_param5(const mavlink_message_t* msg) { @@ -418,7 +418,7 @@ static inline float mavlink_msg_command_long_get_param5(const mavlink_message_t* /** * @brief Get field param6 from command_long message * - * @return Parameter 6, as defined by MAV_CMD enum. + * @return Parameter 6 (for the specific command). */ static inline float mavlink_msg_command_long_get_param6(const mavlink_message_t* msg) { @@ -428,7 +428,7 @@ static inline float mavlink_msg_command_long_get_param6(const mavlink_message_t* /** * @brief Get field param7 from command_long message * - * @return Parameter 7, as defined by MAV_CMD enum. + * @return Parameter 7 (for the specific command). */ static inline float mavlink_msg_command_long_get_param7(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_control_system_state.h b/lib/main/MAVLink/common/mavlink_msg_control_system_state.h index 8914b6ae10..b4381cff4e 100755 --- a/lib/main/MAVLink/common/mavlink_msg_control_system_state.h +++ b/lib/main/MAVLink/common/mavlink_msg_control_system_state.h @@ -3,26 +3,26 @@ #define MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE 146 -MAVPACKED( + typedef struct __mavlink_control_system_state_t { - uint64_t time_usec; /*< Timestamp (micros since boot or Unix epoch)*/ - float x_acc; /*< X acceleration in body frame*/ - float y_acc; /*< Y acceleration in body frame*/ - float z_acc; /*< Z acceleration in body frame*/ - float x_vel; /*< X velocity in body frame*/ - float y_vel; /*< Y velocity in body frame*/ - float z_vel; /*< Z velocity in body frame*/ - float x_pos; /*< X position in local frame*/ - float y_pos; /*< Y position in local frame*/ - float z_pos; /*< Z position in local frame*/ - float airspeed; /*< Airspeed, set to -1 if unknown*/ - float vel_variance[3]; /*< Variance of body velocity estimate*/ - float pos_variance[3]; /*< Variance in local position*/ - float q[4]; /*< The attitude, represented as Quaternion*/ - float roll_rate; /*< Angular rate in roll axis*/ - float pitch_rate; /*< Angular rate in pitch axis*/ - float yaw_rate; /*< Angular rate in yaw axis*/ -}) mavlink_control_system_state_t; + uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.*/ + float x_acc; /*< [m/s/s] X acceleration in body frame*/ + float y_acc; /*< [m/s/s] Y acceleration in body frame*/ + float z_acc; /*< [m/s/s] Z acceleration in body frame*/ + float x_vel; /*< [m/s] X velocity in body frame*/ + float y_vel; /*< [m/s] Y velocity in body frame*/ + float z_vel; /*< [m/s] Z velocity in body frame*/ + float x_pos; /*< [m] X position in local frame*/ + float y_pos; /*< [m] Y position in local frame*/ + float z_pos; /*< [m] Z position in local frame*/ + float airspeed; /*< [m/s] Airspeed, set to -1 if unknown*/ + float vel_variance[3]; /*< Variance of body velocity estimate*/ + float pos_variance[3]; /*< Variance in local position*/ + float q[4]; /*< The attitude, represented as Quaternion*/ + float roll_rate; /*< [rad/s] Angular rate in roll axis*/ + float pitch_rate; /*< [rad/s] Angular rate in pitch axis*/ + float yaw_rate; /*< [rad/s] Angular rate in yaw axis*/ +} mavlink_control_system_state_t; #define MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN 100 #define MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_MIN_LEN 100 @@ -91,23 +91,23 @@ typedef struct __mavlink_control_system_state_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param time_usec Timestamp (micros since boot or Unix epoch) - * @param x_acc X acceleration in body frame - * @param y_acc Y acceleration in body frame - * @param z_acc Z acceleration in body frame - * @param x_vel X velocity in body frame - * @param y_vel Y velocity in body frame - * @param z_vel Z velocity in body frame - * @param x_pos X position in local frame - * @param y_pos Y position in local frame - * @param z_pos Z position in local frame - * @param airspeed Airspeed, set to -1 if unknown - * @param vel_variance Variance of body velocity estimate - * @param pos_variance Variance in local position - * @param q The attitude, represented as Quaternion - * @param roll_rate Angular rate in roll axis - * @param pitch_rate Angular rate in pitch axis - * @param yaw_rate Angular rate in yaw axis + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param x_acc [m/s/s] X acceleration in body frame + * @param y_acc [m/s/s] Y acceleration in body frame + * @param z_acc [m/s/s] Z acceleration in body frame + * @param x_vel [m/s] X velocity in body frame + * @param y_vel [m/s] Y velocity in body frame + * @param z_vel [m/s] Z velocity in body frame + * @param x_pos [m] X position in local frame + * @param y_pos [m] Y position in local frame + * @param z_pos [m] Z position in local frame + * @param airspeed [m/s] Airspeed, set to -1 if unknown + * @param vel_variance Variance of body velocity estimate + * @param pos_variance Variance in local position + * @param q The attitude, represented as Quaternion + * @param roll_rate [rad/s] Angular rate in roll axis + * @param pitch_rate [rad/s] Angular rate in pitch axis + * @param yaw_rate [rad/s] Angular rate in yaw axis * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_control_system_state_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -165,23 +165,23 @@ static inline uint16_t mavlink_msg_control_system_state_pack(uint8_t system_id, * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param time_usec Timestamp (micros since boot or Unix epoch) - * @param x_acc X acceleration in body frame - * @param y_acc Y acceleration in body frame - * @param z_acc Z acceleration in body frame - * @param x_vel X velocity in body frame - * @param y_vel Y velocity in body frame - * @param z_vel Z velocity in body frame - * @param x_pos X position in local frame - * @param y_pos Y position in local frame - * @param z_pos Z position in local frame - * @param airspeed Airspeed, set to -1 if unknown - * @param vel_variance Variance of body velocity estimate - * @param pos_variance Variance in local position - * @param q The attitude, represented as Quaternion - * @param roll_rate Angular rate in roll axis - * @param pitch_rate Angular rate in pitch axis - * @param yaw_rate Angular rate in yaw axis + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param x_acc [m/s/s] X acceleration in body frame + * @param y_acc [m/s/s] Y acceleration in body frame + * @param z_acc [m/s/s] Z acceleration in body frame + * @param x_vel [m/s] X velocity in body frame + * @param y_vel [m/s] Y velocity in body frame + * @param z_vel [m/s] Z velocity in body frame + * @param x_pos [m] X position in local frame + * @param y_pos [m] Y position in local frame + * @param z_pos [m] Z position in local frame + * @param airspeed [m/s] Airspeed, set to -1 if unknown + * @param vel_variance Variance of body velocity estimate + * @param pos_variance Variance in local position + * @param q The attitude, represented as Quaternion + * @param roll_rate [rad/s] Angular rate in roll axis + * @param pitch_rate [rad/s] Angular rate in pitch axis + * @param yaw_rate [rad/s] Angular rate in yaw axis * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_control_system_state_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -265,23 +265,23 @@ static inline uint16_t mavlink_msg_control_system_state_encode_chan(uint8_t syst * @brief Send a control_system_state message * @param chan MAVLink channel to send the message * - * @param time_usec Timestamp (micros since boot or Unix epoch) - * @param x_acc X acceleration in body frame - * @param y_acc Y acceleration in body frame - * @param z_acc Z acceleration in body frame - * @param x_vel X velocity in body frame - * @param y_vel Y velocity in body frame - * @param z_vel Z velocity in body frame - * @param x_pos X position in local frame - * @param y_pos Y position in local frame - * @param z_pos Z position in local frame - * @param airspeed Airspeed, set to -1 if unknown - * @param vel_variance Variance of body velocity estimate - * @param pos_variance Variance in local position - * @param q The attitude, represented as Quaternion - * @param roll_rate Angular rate in roll axis - * @param pitch_rate Angular rate in pitch axis - * @param yaw_rate Angular rate in yaw axis + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param x_acc [m/s/s] X acceleration in body frame + * @param y_acc [m/s/s] Y acceleration in body frame + * @param z_acc [m/s/s] Z acceleration in body frame + * @param x_vel [m/s] X velocity in body frame + * @param y_vel [m/s] Y velocity in body frame + * @param z_vel [m/s] Z velocity in body frame + * @param x_pos [m] X position in local frame + * @param y_pos [m] Y position in local frame + * @param z_pos [m] Z position in local frame + * @param airspeed [m/s] Airspeed, set to -1 if unknown + * @param vel_variance Variance of body velocity estimate + * @param pos_variance Variance in local position + * @param q The attitude, represented as Quaternion + * @param roll_rate [rad/s] Angular rate in roll axis + * @param pitch_rate [rad/s] Angular rate in pitch axis + * @param yaw_rate [rad/s] Angular rate in yaw axis */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -406,7 +406,7 @@ static inline void mavlink_msg_control_system_state_send_buf(mavlink_message_t * /** * @brief Get field time_usec from control_system_state message * - * @return Timestamp (micros since boot or Unix epoch) + * @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. */ static inline uint64_t mavlink_msg_control_system_state_get_time_usec(const mavlink_message_t* msg) { @@ -416,7 +416,7 @@ static inline uint64_t mavlink_msg_control_system_state_get_time_usec(const mavl /** * @brief Get field x_acc from control_system_state message * - * @return X acceleration in body frame + * @return [m/s/s] X acceleration in body frame */ static inline float mavlink_msg_control_system_state_get_x_acc(const mavlink_message_t* msg) { @@ -426,7 +426,7 @@ static inline float mavlink_msg_control_system_state_get_x_acc(const mavlink_mes /** * @brief Get field y_acc from control_system_state message * - * @return Y acceleration in body frame + * @return [m/s/s] Y acceleration in body frame */ static inline float mavlink_msg_control_system_state_get_y_acc(const mavlink_message_t* msg) { @@ -436,7 +436,7 @@ static inline float mavlink_msg_control_system_state_get_y_acc(const mavlink_mes /** * @brief Get field z_acc from control_system_state message * - * @return Z acceleration in body frame + * @return [m/s/s] Z acceleration in body frame */ static inline float mavlink_msg_control_system_state_get_z_acc(const mavlink_message_t* msg) { @@ -446,7 +446,7 @@ static inline float mavlink_msg_control_system_state_get_z_acc(const mavlink_mes /** * @brief Get field x_vel from control_system_state message * - * @return X velocity in body frame + * @return [m/s] X velocity in body frame */ static inline float mavlink_msg_control_system_state_get_x_vel(const mavlink_message_t* msg) { @@ -456,7 +456,7 @@ static inline float mavlink_msg_control_system_state_get_x_vel(const mavlink_mes /** * @brief Get field y_vel from control_system_state message * - * @return Y velocity in body frame + * @return [m/s] Y velocity in body frame */ static inline float mavlink_msg_control_system_state_get_y_vel(const mavlink_message_t* msg) { @@ -466,7 +466,7 @@ static inline float mavlink_msg_control_system_state_get_y_vel(const mavlink_mes /** * @brief Get field z_vel from control_system_state message * - * @return Z velocity in body frame + * @return [m/s] Z velocity in body frame */ static inline float mavlink_msg_control_system_state_get_z_vel(const mavlink_message_t* msg) { @@ -476,7 +476,7 @@ static inline float mavlink_msg_control_system_state_get_z_vel(const mavlink_mes /** * @brief Get field x_pos from control_system_state message * - * @return X position in local frame + * @return [m] X position in local frame */ static inline float mavlink_msg_control_system_state_get_x_pos(const mavlink_message_t* msg) { @@ -486,7 +486,7 @@ static inline float mavlink_msg_control_system_state_get_x_pos(const mavlink_mes /** * @brief Get field y_pos from control_system_state message * - * @return Y position in local frame + * @return [m] Y position in local frame */ static inline float mavlink_msg_control_system_state_get_y_pos(const mavlink_message_t* msg) { @@ -496,7 +496,7 @@ static inline float mavlink_msg_control_system_state_get_y_pos(const mavlink_mes /** * @brief Get field z_pos from control_system_state message * - * @return Z position in local frame + * @return [m] Z position in local frame */ static inline float mavlink_msg_control_system_state_get_z_pos(const mavlink_message_t* msg) { @@ -506,7 +506,7 @@ static inline float mavlink_msg_control_system_state_get_z_pos(const mavlink_mes /** * @brief Get field airspeed from control_system_state message * - * @return Airspeed, set to -1 if unknown + * @return [m/s] Airspeed, set to -1 if unknown */ static inline float mavlink_msg_control_system_state_get_airspeed(const mavlink_message_t* msg) { @@ -516,7 +516,7 @@ static inline float mavlink_msg_control_system_state_get_airspeed(const mavlink_ /** * @brief Get field vel_variance from control_system_state message * - * @return Variance of body velocity estimate + * @return Variance of body velocity estimate */ static inline uint16_t mavlink_msg_control_system_state_get_vel_variance(const mavlink_message_t* msg, float *vel_variance) { @@ -526,7 +526,7 @@ static inline uint16_t mavlink_msg_control_system_state_get_vel_variance(const m /** * @brief Get field pos_variance from control_system_state message * - * @return Variance in local position + * @return Variance in local position */ static inline uint16_t mavlink_msg_control_system_state_get_pos_variance(const mavlink_message_t* msg, float *pos_variance) { @@ -536,7 +536,7 @@ static inline uint16_t mavlink_msg_control_system_state_get_pos_variance(const m /** * @brief Get field q from control_system_state message * - * @return The attitude, represented as Quaternion + * @return The attitude, represented as Quaternion */ static inline uint16_t mavlink_msg_control_system_state_get_q(const mavlink_message_t* msg, float *q) { @@ -546,7 +546,7 @@ static inline uint16_t mavlink_msg_control_system_state_get_q(const mavlink_mess /** * @brief Get field roll_rate from control_system_state message * - * @return Angular rate in roll axis + * @return [rad/s] Angular rate in roll axis */ static inline float mavlink_msg_control_system_state_get_roll_rate(const mavlink_message_t* msg) { @@ -556,7 +556,7 @@ static inline float mavlink_msg_control_system_state_get_roll_rate(const mavlink /** * @brief Get field pitch_rate from control_system_state message * - * @return Angular rate in pitch axis + * @return [rad/s] Angular rate in pitch axis */ static inline float mavlink_msg_control_system_state_get_pitch_rate(const mavlink_message_t* msg) { @@ -566,7 +566,7 @@ static inline float mavlink_msg_control_system_state_get_pitch_rate(const mavlin /** * @brief Get field yaw_rate from control_system_state message * - * @return Angular rate in yaw axis + * @return [rad/s] Angular rate in yaw axis */ static inline float mavlink_msg_control_system_state_get_yaw_rate(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_data_stream.h b/lib/main/MAVLink/common/mavlink_msg_data_stream.h index cceca20fae..36b688cbee 100755 --- a/lib/main/MAVLink/common/mavlink_msg_data_stream.h +++ b/lib/main/MAVLink/common/mavlink_msg_data_stream.h @@ -3,12 +3,12 @@ #define MAVLINK_MSG_ID_DATA_STREAM 67 -MAVPACKED( + typedef struct __mavlink_data_stream_t { - uint16_t message_rate; /*< The message rate*/ - uint8_t stream_id; /*< The ID of the requested data stream*/ - uint8_t on_off; /*< 1 stream is enabled, 0 stream is stopped.*/ -}) mavlink_data_stream_t; + uint16_t message_rate; /*< [Hz] The message rate*/ + uint8_t stream_id; /*< The ID of the requested data stream*/ + uint8_t on_off; /*< 1 stream is enabled, 0 stream is stopped.*/ +} mavlink_data_stream_t; #define MAVLINK_MSG_ID_DATA_STREAM_LEN 4 #define MAVLINK_MSG_ID_DATA_STREAM_MIN_LEN 4 @@ -25,8 +25,8 @@ typedef struct __mavlink_data_stream_t { 67, \ "DATA_STREAM", \ 3, \ - { { "message_rate", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_data_stream_t, message_rate) }, \ - { "stream_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_data_stream_t, stream_id) }, \ + { { "stream_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_data_stream_t, stream_id) }, \ + { "message_rate", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_data_stream_t, message_rate) }, \ { "on_off", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_data_stream_t, on_off) }, \ } \ } @@ -34,8 +34,8 @@ typedef struct __mavlink_data_stream_t { #define MAVLINK_MESSAGE_INFO_DATA_STREAM { \ "DATA_STREAM", \ 3, \ - { { "message_rate", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_data_stream_t, message_rate) }, \ - { "stream_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_data_stream_t, stream_id) }, \ + { { "stream_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_data_stream_t, stream_id) }, \ + { "message_rate", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_data_stream_t, message_rate) }, \ { "on_off", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_data_stream_t, on_off) }, \ } \ } @@ -47,9 +47,9 @@ typedef struct __mavlink_data_stream_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param stream_id The ID of the requested data stream - * @param message_rate The message rate - * @param on_off 1 stream is enabled, 0 stream is stopped. + * @param stream_id The ID of the requested data stream + * @param message_rate [Hz] The message rate + * @param on_off 1 stream is enabled, 0 stream is stopped. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_data_stream_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -81,9 +81,9 @@ static inline uint16_t mavlink_msg_data_stream_pack(uint8_t system_id, uint8_t c * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param stream_id The ID of the requested data stream - * @param message_rate The message rate - * @param on_off 1 stream is enabled, 0 stream is stopped. + * @param stream_id The ID of the requested data stream + * @param message_rate [Hz] The message rate + * @param on_off 1 stream is enabled, 0 stream is stopped. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_data_stream_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -141,9 +141,9 @@ static inline uint16_t mavlink_msg_data_stream_encode_chan(uint8_t system_id, ui * @brief Send a data_stream message * @param chan MAVLink channel to send the message * - * @param stream_id The ID of the requested data stream - * @param message_rate The message rate - * @param on_off 1 stream is enabled, 0 stream is stopped. + * @param stream_id The ID of the requested data stream + * @param message_rate [Hz] The message rate + * @param on_off 1 stream is enabled, 0 stream is stopped. */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -216,7 +216,7 @@ static inline void mavlink_msg_data_stream_send_buf(mavlink_message_t *msgbuf, m /** * @brief Get field stream_id from data_stream message * - * @return The ID of the requested data stream + * @return The ID of the requested data stream */ static inline uint8_t mavlink_msg_data_stream_get_stream_id(const mavlink_message_t* msg) { @@ -226,7 +226,7 @@ static inline uint8_t mavlink_msg_data_stream_get_stream_id(const mavlink_messag /** * @brief Get field message_rate from data_stream message * - * @return The message rate + * @return [Hz] The message rate */ static inline uint16_t mavlink_msg_data_stream_get_message_rate(const mavlink_message_t* msg) { @@ -236,7 +236,7 @@ static inline uint16_t mavlink_msg_data_stream_get_message_rate(const mavlink_me /** * @brief Get field on_off from data_stream message * - * @return 1 stream is enabled, 0 stream is stopped. + * @return 1 stream is enabled, 0 stream is stopped. */ static inline uint8_t mavlink_msg_data_stream_get_on_off(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_data_transmission_handshake.h b/lib/main/MAVLink/common/mavlink_msg_data_transmission_handshake.h index f607e39768..45fe60680a 100755 --- a/lib/main/MAVLink/common/mavlink_msg_data_transmission_handshake.h +++ b/lib/main/MAVLink/common/mavlink_msg_data_transmission_handshake.h @@ -3,16 +3,16 @@ #define MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE 130 -MAVPACKED( + typedef struct __mavlink_data_transmission_handshake_t { - uint32_t size; /*< total data size in bytes (set on ACK only)*/ - uint16_t width; /*< Width of a matrix or image*/ - uint16_t height; /*< Height of a matrix or image*/ - uint16_t packets; /*< number of packets beeing sent (set on ACK only)*/ - uint8_t type; /*< type of requested/acknowledged data (as defined in ENUM DATA_TYPES in mavlink/include/mavlink_types.h)*/ - uint8_t payload; /*< payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only)*/ - uint8_t jpg_quality; /*< JPEG quality out of [1,100]*/ -}) mavlink_data_transmission_handshake_t; + uint32_t size; /*< [bytes] total data size (set on ACK only).*/ + uint16_t width; /*< Width of a matrix or image.*/ + uint16_t height; /*< Height of a matrix or image.*/ + uint16_t packets; /*< Number of packets being sent (set on ACK only).*/ + uint8_t type; /*< Type of requested/acknowledged data.*/ + uint8_t payload; /*< [bytes] Payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only).*/ + uint8_t jpg_quality; /*< [%] JPEG quality. Values: [1-100].*/ +} mavlink_data_transmission_handshake_t; #define MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN 13 #define MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_MIN_LEN 13 @@ -29,11 +29,11 @@ typedef struct __mavlink_data_transmission_handshake_t { 130, \ "DATA_TRANSMISSION_HANDSHAKE", \ 7, \ - { { "size", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_data_transmission_handshake_t, size) }, \ + { { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_data_transmission_handshake_t, type) }, \ + { "size", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_data_transmission_handshake_t, size) }, \ { "width", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_data_transmission_handshake_t, width) }, \ { "height", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_data_transmission_handshake_t, height) }, \ { "packets", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_data_transmission_handshake_t, packets) }, \ - { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_data_transmission_handshake_t, type) }, \ { "payload", NULL, MAVLINK_TYPE_UINT8_T, 0, 11, offsetof(mavlink_data_transmission_handshake_t, payload) }, \ { "jpg_quality", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_data_transmission_handshake_t, jpg_quality) }, \ } \ @@ -42,11 +42,11 @@ typedef struct __mavlink_data_transmission_handshake_t { #define MAVLINK_MESSAGE_INFO_DATA_TRANSMISSION_HANDSHAKE { \ "DATA_TRANSMISSION_HANDSHAKE", \ 7, \ - { { "size", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_data_transmission_handshake_t, size) }, \ + { { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_data_transmission_handshake_t, type) }, \ + { "size", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_data_transmission_handshake_t, size) }, \ { "width", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_data_transmission_handshake_t, width) }, \ { "height", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_data_transmission_handshake_t, height) }, \ { "packets", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_data_transmission_handshake_t, packets) }, \ - { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_data_transmission_handshake_t, type) }, \ { "payload", NULL, MAVLINK_TYPE_UINT8_T, 0, 11, offsetof(mavlink_data_transmission_handshake_t, payload) }, \ { "jpg_quality", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_data_transmission_handshake_t, jpg_quality) }, \ } \ @@ -59,13 +59,13 @@ typedef struct __mavlink_data_transmission_handshake_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param type type of requested/acknowledged data (as defined in ENUM DATA_TYPES in mavlink/include/mavlink_types.h) - * @param size total data size in bytes (set on ACK only) - * @param width Width of a matrix or image - * @param height Height of a matrix or image - * @param packets number of packets beeing sent (set on ACK only) - * @param payload payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only) - * @param jpg_quality JPEG quality out of [1,100] + * @param type Type of requested/acknowledged data. + * @param size [bytes] total data size (set on ACK only). + * @param width Width of a matrix or image. + * @param height Height of a matrix or image. + * @param packets Number of packets being sent (set on ACK only). + * @param payload [bytes] Payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only). + * @param jpg_quality [%] JPEG quality. Values: [1-100]. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_data_transmission_handshake_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -105,13 +105,13 @@ static inline uint16_t mavlink_msg_data_transmission_handshake_pack(uint8_t syst * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param type type of requested/acknowledged data (as defined in ENUM DATA_TYPES in mavlink/include/mavlink_types.h) - * @param size total data size in bytes (set on ACK only) - * @param width Width of a matrix or image - * @param height Height of a matrix or image - * @param packets number of packets beeing sent (set on ACK only) - * @param payload payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only) - * @param jpg_quality JPEG quality out of [1,100] + * @param type Type of requested/acknowledged data. + * @param size [bytes] total data size (set on ACK only). + * @param width Width of a matrix or image. + * @param height Height of a matrix or image. + * @param packets Number of packets being sent (set on ACK only). + * @param payload [bytes] Payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only). + * @param jpg_quality [%] JPEG quality. Values: [1-100]. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_data_transmission_handshake_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -177,13 +177,13 @@ static inline uint16_t mavlink_msg_data_transmission_handshake_encode_chan(uint8 * @brief Send a data_transmission_handshake message * @param chan MAVLink channel to send the message * - * @param type type of requested/acknowledged data (as defined in ENUM DATA_TYPES in mavlink/include/mavlink_types.h) - * @param size total data size in bytes (set on ACK only) - * @param width Width of a matrix or image - * @param height Height of a matrix or image - * @param packets number of packets beeing sent (set on ACK only) - * @param payload payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only) - * @param jpg_quality JPEG quality out of [1,100] + * @param type Type of requested/acknowledged data. + * @param size [bytes] total data size (set on ACK only). + * @param width Width of a matrix or image. + * @param height Height of a matrix or image. + * @param packets Number of packets being sent (set on ACK only). + * @param payload [bytes] Payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only). + * @param jpg_quality [%] JPEG quality. Values: [1-100]. */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -272,7 +272,7 @@ static inline void mavlink_msg_data_transmission_handshake_send_buf(mavlink_mess /** * @brief Get field type from data_transmission_handshake message * - * @return type of requested/acknowledged data (as defined in ENUM DATA_TYPES in mavlink/include/mavlink_types.h) + * @return Type of requested/acknowledged data. */ static inline uint8_t mavlink_msg_data_transmission_handshake_get_type(const mavlink_message_t* msg) { @@ -282,7 +282,7 @@ static inline uint8_t mavlink_msg_data_transmission_handshake_get_type(const mav /** * @brief Get field size from data_transmission_handshake message * - * @return total data size in bytes (set on ACK only) + * @return [bytes] total data size (set on ACK only). */ static inline uint32_t mavlink_msg_data_transmission_handshake_get_size(const mavlink_message_t* msg) { @@ -292,7 +292,7 @@ static inline uint32_t mavlink_msg_data_transmission_handshake_get_size(const ma /** * @brief Get field width from data_transmission_handshake message * - * @return Width of a matrix or image + * @return Width of a matrix or image. */ static inline uint16_t mavlink_msg_data_transmission_handshake_get_width(const mavlink_message_t* msg) { @@ -302,7 +302,7 @@ static inline uint16_t mavlink_msg_data_transmission_handshake_get_width(const m /** * @brief Get field height from data_transmission_handshake message * - * @return Height of a matrix or image + * @return Height of a matrix or image. */ static inline uint16_t mavlink_msg_data_transmission_handshake_get_height(const mavlink_message_t* msg) { @@ -312,7 +312,7 @@ static inline uint16_t mavlink_msg_data_transmission_handshake_get_height(const /** * @brief Get field packets from data_transmission_handshake message * - * @return number of packets beeing sent (set on ACK only) + * @return Number of packets being sent (set on ACK only). */ static inline uint16_t mavlink_msg_data_transmission_handshake_get_packets(const mavlink_message_t* msg) { @@ -322,7 +322,7 @@ static inline uint16_t mavlink_msg_data_transmission_handshake_get_packets(const /** * @brief Get field payload from data_transmission_handshake message * - * @return payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only) + * @return [bytes] Payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only). */ static inline uint8_t mavlink_msg_data_transmission_handshake_get_payload(const mavlink_message_t* msg) { @@ -332,7 +332,7 @@ static inline uint8_t mavlink_msg_data_transmission_handshake_get_payload(const /** * @brief Get field jpg_quality from data_transmission_handshake message * - * @return JPEG quality out of [1,100] + * @return [%] JPEG quality. Values: [1-100]. */ static inline uint8_t mavlink_msg_data_transmission_handshake_get_jpg_quality(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_debug.h b/lib/main/MAVLink/common/mavlink_msg_debug.h index d762a89dee..85814e366c 100755 --- a/lib/main/MAVLink/common/mavlink_msg_debug.h +++ b/lib/main/MAVLink/common/mavlink_msg_debug.h @@ -3,12 +3,12 @@ #define MAVLINK_MSG_ID_DEBUG 254 -MAVPACKED( + typedef struct __mavlink_debug_t { - uint32_t time_boot_ms; /*< Timestamp (milliseconds since system boot)*/ - float value; /*< DEBUG value*/ - uint8_t ind; /*< index of debug variable*/ -}) mavlink_debug_t; + uint32_t time_boot_ms; /*< [ms] Timestamp (time since system boot).*/ + float value; /*< DEBUG value*/ + uint8_t ind; /*< index of debug variable*/ +} mavlink_debug_t; #define MAVLINK_MSG_ID_DEBUG_LEN 9 #define MAVLINK_MSG_ID_DEBUG_MIN_LEN 9 @@ -26,8 +26,8 @@ typedef struct __mavlink_debug_t { "DEBUG", \ 3, \ { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_debug_t, time_boot_ms) }, \ - { "value", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_debug_t, value) }, \ { "ind", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_debug_t, ind) }, \ + { "value", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_debug_t, value) }, \ } \ } #else @@ -35,8 +35,8 @@ typedef struct __mavlink_debug_t { "DEBUG", \ 3, \ { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_debug_t, time_boot_ms) }, \ - { "value", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_debug_t, value) }, \ { "ind", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_debug_t, ind) }, \ + { "value", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_debug_t, value) }, \ } \ } #endif @@ -47,9 +47,9 @@ typedef struct __mavlink_debug_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param time_boot_ms Timestamp (milliseconds since system boot) - * @param ind index of debug variable - * @param value DEBUG value + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param ind index of debug variable + * @param value DEBUG value * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_debug_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -81,9 +81,9 @@ static inline uint16_t mavlink_msg_debug_pack(uint8_t system_id, uint8_t compone * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param time_boot_ms Timestamp (milliseconds since system boot) - * @param ind index of debug variable - * @param value DEBUG value + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param ind index of debug variable + * @param value DEBUG value * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_debug_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -141,9 +141,9 @@ static inline uint16_t mavlink_msg_debug_encode_chan(uint8_t system_id, uint8_t * @brief Send a debug message * @param chan MAVLink channel to send the message * - * @param time_boot_ms Timestamp (milliseconds since system boot) - * @param ind index of debug variable - * @param value DEBUG value + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param ind index of debug variable + * @param value DEBUG value */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -216,7 +216,7 @@ static inline void mavlink_msg_debug_send_buf(mavlink_message_t *msgbuf, mavlink /** * @brief Get field time_boot_ms from debug message * - * @return Timestamp (milliseconds since system boot) + * @return [ms] Timestamp (time since system boot). */ static inline uint32_t mavlink_msg_debug_get_time_boot_ms(const mavlink_message_t* msg) { @@ -226,7 +226,7 @@ static inline uint32_t mavlink_msg_debug_get_time_boot_ms(const mavlink_message_ /** * @brief Get field ind from debug message * - * @return index of debug variable + * @return index of debug variable */ static inline uint8_t mavlink_msg_debug_get_ind(const mavlink_message_t* msg) { @@ -236,7 +236,7 @@ static inline uint8_t mavlink_msg_debug_get_ind(const mavlink_message_t* msg) /** * @brief Get field value from debug message * - * @return DEBUG value + * @return DEBUG value */ static inline float mavlink_msg_debug_get_value(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_debug_vect.h b/lib/main/MAVLink/common/mavlink_msg_debug_vect.h index ac485af943..1cb8d77ab5 100755 --- a/lib/main/MAVLink/common/mavlink_msg_debug_vect.h +++ b/lib/main/MAVLink/common/mavlink_msg_debug_vect.h @@ -3,14 +3,14 @@ #define MAVLINK_MSG_ID_DEBUG_VECT 250 -MAVPACKED( + typedef struct __mavlink_debug_vect_t { - uint64_t time_usec; /*< Timestamp*/ - float x; /*< x*/ - float y; /*< y*/ - float z; /*< z*/ - char name[10]; /*< Name*/ -}) mavlink_debug_vect_t; + uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.*/ + float x; /*< x*/ + float y; /*< y*/ + float z; /*< z*/ + char name[10]; /*< Name*/ +} mavlink_debug_vect_t; #define MAVLINK_MSG_ID_DEBUG_VECT_LEN 30 #define MAVLINK_MSG_ID_DEBUG_VECT_MIN_LEN 30 @@ -27,22 +27,22 @@ typedef struct __mavlink_debug_vect_t { 250, \ "DEBUG_VECT", \ 5, \ - { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_debug_vect_t, time_usec) }, \ + { { "name", NULL, MAVLINK_TYPE_CHAR, 10, 20, offsetof(mavlink_debug_vect_t, name) }, \ + { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_debug_vect_t, time_usec) }, \ { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_debug_vect_t, x) }, \ { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_debug_vect_t, y) }, \ { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_debug_vect_t, z) }, \ - { "name", NULL, MAVLINK_TYPE_CHAR, 10, 20, offsetof(mavlink_debug_vect_t, name) }, \ } \ } #else #define MAVLINK_MESSAGE_INFO_DEBUG_VECT { \ "DEBUG_VECT", \ 5, \ - { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_debug_vect_t, time_usec) }, \ + { { "name", NULL, MAVLINK_TYPE_CHAR, 10, 20, offsetof(mavlink_debug_vect_t, name) }, \ + { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_debug_vect_t, time_usec) }, \ { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_debug_vect_t, x) }, \ { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_debug_vect_t, y) }, \ { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_debug_vect_t, z) }, \ - { "name", NULL, MAVLINK_TYPE_CHAR, 10, 20, offsetof(mavlink_debug_vect_t, name) }, \ } \ } #endif @@ -53,11 +53,11 @@ typedef struct __mavlink_debug_vect_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param name Name - * @param time_usec Timestamp - * @param x x - * @param y y - * @param z z + * @param name Name + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param x x + * @param y y + * @param z z * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_debug_vect_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -91,11 +91,11 @@ static inline uint16_t mavlink_msg_debug_vect_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 will be sent over * @param msg The MAVLink message to compress the data into - * @param name Name - * @param time_usec Timestamp - * @param x x - * @param y y - * @param z z + * @param name Name + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param x x + * @param y y + * @param z z * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_debug_vect_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -155,11 +155,11 @@ static inline uint16_t mavlink_msg_debug_vect_encode_chan(uint8_t system_id, uin * @brief Send a debug_vect message * @param chan MAVLink channel to send the message * - * @param name Name - * @param time_usec Timestamp - * @param x x - * @param y y - * @param z z + * @param name Name + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param x x + * @param y y + * @param z z */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -236,7 +236,7 @@ static inline void mavlink_msg_debug_vect_send_buf(mavlink_message_t *msgbuf, ma /** * @brief Get field name from debug_vect message * - * @return Name + * @return Name */ static inline uint16_t mavlink_msg_debug_vect_get_name(const mavlink_message_t* msg, char *name) { @@ -246,7 +246,7 @@ static inline uint16_t mavlink_msg_debug_vect_get_name(const mavlink_message_t* /** * @brief Get field time_usec from debug_vect message * - * @return Timestamp + * @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. */ static inline uint64_t mavlink_msg_debug_vect_get_time_usec(const mavlink_message_t* msg) { @@ -256,7 +256,7 @@ static inline uint64_t mavlink_msg_debug_vect_get_time_usec(const mavlink_messag /** * @brief Get field x from debug_vect message * - * @return x + * @return x */ static inline float mavlink_msg_debug_vect_get_x(const mavlink_message_t* msg) { @@ -266,7 +266,7 @@ static inline float mavlink_msg_debug_vect_get_x(const mavlink_message_t* msg) /** * @brief Get field y from debug_vect message * - * @return y + * @return y */ static inline float mavlink_msg_debug_vect_get_y(const mavlink_message_t* msg) { @@ -276,7 +276,7 @@ static inline float mavlink_msg_debug_vect_get_y(const mavlink_message_t* msg) /** * @brief Get field z from debug_vect message * - * @return z + * @return z */ static inline float mavlink_msg_debug_vect_get_z(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_distance_sensor.h b/lib/main/MAVLink/common/mavlink_msg_distance_sensor.h index 2a52e69293..a5b0107be3 100755 --- a/lib/main/MAVLink/common/mavlink_msg_distance_sensor.h +++ b/lib/main/MAVLink/common/mavlink_msg_distance_sensor.h @@ -3,17 +3,17 @@ #define MAVLINK_MSG_ID_DISTANCE_SENSOR 132 -MAVPACKED( + typedef struct __mavlink_distance_sensor_t { - uint32_t time_boot_ms; /*< Time since system boot*/ - uint16_t min_distance; /*< Minimum distance the sensor can measure in centimeters*/ - uint16_t max_distance; /*< Maximum distance the sensor can measure in centimeters*/ - uint16_t current_distance; /*< Current distance reading*/ - uint8_t type; /*< Type from MAV_DISTANCE_SENSOR enum.*/ - uint8_t id; /*< Onboard ID of the sensor*/ - uint8_t orientation; /*< Direction the sensor faces from MAV_SENSOR_ORIENTATION enum.*/ - uint8_t covariance; /*< Measurement covariance in centimeters, 0 for unknown / invalid readings*/ -}) mavlink_distance_sensor_t; + uint32_t time_boot_ms; /*< [ms] Timestamp (time since system boot).*/ + uint16_t min_distance; /*< [cm] Minimum distance the sensor can measure*/ + uint16_t max_distance; /*< [cm] Maximum distance the sensor can measure*/ + uint16_t current_distance; /*< [cm] Current distance reading*/ + uint8_t type; /*< Type of distance sensor.*/ + uint8_t id; /*< Onboard ID of the sensor*/ + uint8_t orientation; /*< Direction the sensor faces. downward-facing: ROTATION_PITCH_270, upward-facing: ROTATION_PITCH_90, backward-facing: ROTATION_PITCH_180, forward-facing: ROTATION_NONE, left-facing: ROTATION_YAW_90, right-facing: ROTATION_YAW_270*/ + uint8_t covariance; /*< [cm^2] Measurement variance. Max standard deviation is 6cm. 255 if unknown.*/ +} mavlink_distance_sensor_t; #define MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN 14 #define MAVLINK_MSG_ID_DISTANCE_SENSOR_MIN_LEN 14 @@ -62,14 +62,14 @@ typedef struct __mavlink_distance_sensor_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param time_boot_ms Time since system boot - * @param min_distance Minimum distance the sensor can measure in centimeters - * @param max_distance Maximum distance the sensor can measure in centimeters - * @param current_distance Current distance reading - * @param type Type from MAV_DISTANCE_SENSOR enum. - * @param id Onboard ID of the sensor - * @param orientation Direction the sensor faces from MAV_SENSOR_ORIENTATION enum. - * @param covariance Measurement covariance in centimeters, 0 for unknown / invalid readings + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param min_distance [cm] Minimum distance the sensor can measure + * @param max_distance [cm] Maximum distance the sensor can measure + * @param current_distance [cm] Current distance reading + * @param type Type of distance sensor. + * @param id Onboard ID of the sensor + * @param orientation Direction the sensor faces. downward-facing: ROTATION_PITCH_270, upward-facing: ROTATION_PITCH_90, backward-facing: ROTATION_PITCH_180, forward-facing: ROTATION_NONE, left-facing: ROTATION_YAW_90, right-facing: ROTATION_YAW_270 + * @param covariance [cm^2] Measurement variance. Max standard deviation is 6cm. 255 if unknown. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_distance_sensor_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -111,14 +111,14 @@ static inline uint16_t mavlink_msg_distance_sensor_pack(uint8_t system_id, uint8 * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param time_boot_ms Time since system boot - * @param min_distance Minimum distance the sensor can measure in centimeters - * @param max_distance Maximum distance the sensor can measure in centimeters - * @param current_distance Current distance reading - * @param type Type from MAV_DISTANCE_SENSOR enum. - * @param id Onboard ID of the sensor - * @param orientation Direction the sensor faces from MAV_SENSOR_ORIENTATION enum. - * @param covariance Measurement covariance in centimeters, 0 for unknown / invalid readings + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param min_distance [cm] Minimum distance the sensor can measure + * @param max_distance [cm] Maximum distance the sensor can measure + * @param current_distance [cm] Current distance reading + * @param type Type of distance sensor. + * @param id Onboard ID of the sensor + * @param orientation Direction the sensor faces. downward-facing: ROTATION_PITCH_270, upward-facing: ROTATION_PITCH_90, backward-facing: ROTATION_PITCH_180, forward-facing: ROTATION_NONE, left-facing: ROTATION_YAW_90, right-facing: ROTATION_YAW_270 + * @param covariance [cm^2] Measurement variance. Max standard deviation is 6cm. 255 if unknown. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_distance_sensor_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -186,14 +186,14 @@ static inline uint16_t mavlink_msg_distance_sensor_encode_chan(uint8_t system_id * @brief Send a distance_sensor message * @param chan MAVLink channel to send the message * - * @param time_boot_ms Time since system boot - * @param min_distance Minimum distance the sensor can measure in centimeters - * @param max_distance Maximum distance the sensor can measure in centimeters - * @param current_distance Current distance reading - * @param type Type from MAV_DISTANCE_SENSOR enum. - * @param id Onboard ID of the sensor - * @param orientation Direction the sensor faces from MAV_SENSOR_ORIENTATION enum. - * @param covariance Measurement covariance in centimeters, 0 for unknown / invalid readings + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param min_distance [cm] Minimum distance the sensor can measure + * @param max_distance [cm] Maximum distance the sensor can measure + * @param current_distance [cm] Current distance reading + * @param type Type of distance sensor. + * @param id Onboard ID of the sensor + * @param orientation Direction the sensor faces. downward-facing: ROTATION_PITCH_270, upward-facing: ROTATION_PITCH_90, backward-facing: ROTATION_PITCH_180, forward-facing: ROTATION_NONE, left-facing: ROTATION_YAW_90, right-facing: ROTATION_YAW_270 + * @param covariance [cm^2] Measurement variance. Max standard deviation is 6cm. 255 if unknown. */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -286,7 +286,7 @@ static inline void mavlink_msg_distance_sensor_send_buf(mavlink_message_t *msgbu /** * @brief Get field time_boot_ms from distance_sensor message * - * @return Time since system boot + * @return [ms] Timestamp (time since system boot). */ static inline uint32_t mavlink_msg_distance_sensor_get_time_boot_ms(const mavlink_message_t* msg) { @@ -296,7 +296,7 @@ static inline uint32_t mavlink_msg_distance_sensor_get_time_boot_ms(const mavlin /** * @brief Get field min_distance from distance_sensor message * - * @return Minimum distance the sensor can measure in centimeters + * @return [cm] Minimum distance the sensor can measure */ static inline uint16_t mavlink_msg_distance_sensor_get_min_distance(const mavlink_message_t* msg) { @@ -306,7 +306,7 @@ static inline uint16_t mavlink_msg_distance_sensor_get_min_distance(const mavlin /** * @brief Get field max_distance from distance_sensor message * - * @return Maximum distance the sensor can measure in centimeters + * @return [cm] Maximum distance the sensor can measure */ static inline uint16_t mavlink_msg_distance_sensor_get_max_distance(const mavlink_message_t* msg) { @@ -316,7 +316,7 @@ static inline uint16_t mavlink_msg_distance_sensor_get_max_distance(const mavlin /** * @brief Get field current_distance from distance_sensor message * - * @return Current distance reading + * @return [cm] Current distance reading */ static inline uint16_t mavlink_msg_distance_sensor_get_current_distance(const mavlink_message_t* msg) { @@ -326,7 +326,7 @@ static inline uint16_t mavlink_msg_distance_sensor_get_current_distance(const ma /** * @brief Get field type from distance_sensor message * - * @return Type from MAV_DISTANCE_SENSOR enum. + * @return Type of distance sensor. */ static inline uint8_t mavlink_msg_distance_sensor_get_type(const mavlink_message_t* msg) { @@ -336,7 +336,7 @@ static inline uint8_t mavlink_msg_distance_sensor_get_type(const mavlink_message /** * @brief Get field id from distance_sensor message * - * @return Onboard ID of the sensor + * @return Onboard ID of the sensor */ static inline uint8_t mavlink_msg_distance_sensor_get_id(const mavlink_message_t* msg) { @@ -346,7 +346,7 @@ static inline uint8_t mavlink_msg_distance_sensor_get_id(const mavlink_message_t /** * @brief Get field orientation from distance_sensor message * - * @return Direction the sensor faces from MAV_SENSOR_ORIENTATION enum. + * @return Direction the sensor faces. downward-facing: ROTATION_PITCH_270, upward-facing: ROTATION_PITCH_90, backward-facing: ROTATION_PITCH_180, forward-facing: ROTATION_NONE, left-facing: ROTATION_YAW_90, right-facing: ROTATION_YAW_270 */ static inline uint8_t mavlink_msg_distance_sensor_get_orientation(const mavlink_message_t* msg) { @@ -356,7 +356,7 @@ static inline uint8_t mavlink_msg_distance_sensor_get_orientation(const mavlink_ /** * @brief Get field covariance from distance_sensor message * - * @return Measurement covariance in centimeters, 0 for unknown / invalid readings + * @return [cm^2] Measurement variance. Max standard deviation is 6cm. 255 if unknown. */ static inline uint8_t mavlink_msg_distance_sensor_get_covariance(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_encapsulated_data.h b/lib/main/MAVLink/common/mavlink_msg_encapsulated_data.h index 5e9bc926ec..bfcf511b92 100755 --- a/lib/main/MAVLink/common/mavlink_msg_encapsulated_data.h +++ b/lib/main/MAVLink/common/mavlink_msg_encapsulated_data.h @@ -3,11 +3,11 @@ #define MAVLINK_MSG_ID_ENCAPSULATED_DATA 131 -MAVPACKED( + typedef struct __mavlink_encapsulated_data_t { - uint16_t seqnr; /*< sequence number (starting with 0 on every transmission)*/ - uint8_t data[253]; /*< image data bytes*/ -}) mavlink_encapsulated_data_t; + uint16_t seqnr; /*< sequence number (starting with 0 on every transmission)*/ + uint8_t data[253]; /*< image data bytes*/ +} mavlink_encapsulated_data_t; #define MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN 255 #define MAVLINK_MSG_ID_ENCAPSULATED_DATA_MIN_LEN 255 @@ -44,8 +44,8 @@ typedef struct __mavlink_encapsulated_data_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param seqnr sequence number (starting with 0 on every transmission) - * @param data image data bytes + * @param seqnr sequence number (starting with 0 on every transmission) + * @param data image data bytes * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_encapsulated_data_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -73,8 +73,8 @@ static inline uint16_t mavlink_msg_encapsulated_data_pack(uint8_t system_id, uin * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param seqnr sequence number (starting with 0 on every transmission) - * @param data image data bytes + * @param seqnr sequence number (starting with 0 on every transmission) + * @param data image data bytes * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_encapsulated_data_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -128,8 +128,8 @@ static inline uint16_t mavlink_msg_encapsulated_data_encode_chan(uint8_t system_ * @brief Send a encapsulated_data message * @param chan MAVLink channel to send the message * - * @param seqnr sequence number (starting with 0 on every transmission) - * @param data image data bytes + * @param seqnr sequence number (starting with 0 on every transmission) + * @param data image data bytes */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -194,7 +194,7 @@ static inline void mavlink_msg_encapsulated_data_send_buf(mavlink_message_t *msg /** * @brief Get field seqnr from encapsulated_data message * - * @return sequence number (starting with 0 on every transmission) + * @return sequence number (starting with 0 on every transmission) */ static inline uint16_t mavlink_msg_encapsulated_data_get_seqnr(const mavlink_message_t* msg) { @@ -204,7 +204,7 @@ static inline uint16_t mavlink_msg_encapsulated_data_get_seqnr(const mavlink_mes /** * @brief Get field data from encapsulated_data message * - * @return image data bytes + * @return image data bytes */ static inline uint16_t mavlink_msg_encapsulated_data_get_data(const mavlink_message_t* msg, uint8_t *data) { diff --git a/lib/main/MAVLink/common/mavlink_msg_estimator_status.h b/lib/main/MAVLink/common/mavlink_msg_estimator_status.h index 2b7c6c09a3..bc5499b920 100755 --- a/lib/main/MAVLink/common/mavlink_msg_estimator_status.h +++ b/lib/main/MAVLink/common/mavlink_msg_estimator_status.h @@ -3,19 +3,19 @@ #define MAVLINK_MSG_ID_ESTIMATOR_STATUS 230 -MAVPACKED( + typedef struct __mavlink_estimator_status_t { - uint64_t time_usec; /*< Timestamp (micros since boot or Unix epoch)*/ - float vel_ratio; /*< Velocity innovation test ratio*/ - float pos_horiz_ratio; /*< Horizontal position innovation test ratio*/ - float pos_vert_ratio; /*< Vertical position innovation test ratio*/ - float mag_ratio; /*< Magnetometer innovation test ratio*/ - float hagl_ratio; /*< Height above terrain innovation test ratio*/ - float tas_ratio; /*< True airspeed innovation test ratio*/ - float pos_horiz_accuracy; /*< Horizontal position 1-STD accuracy relative to the EKF local origin (m)*/ - float pos_vert_accuracy; /*< Vertical position 1-STD accuracy relative to the EKF local origin (m)*/ - uint16_t flags; /*< Integer bitmask indicating which EKF outputs are valid. See definition for ESTIMATOR_STATUS_FLAGS.*/ -}) mavlink_estimator_status_t; + uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.*/ + float vel_ratio; /*< Velocity innovation test ratio*/ + float pos_horiz_ratio; /*< Horizontal position innovation test ratio*/ + float pos_vert_ratio; /*< Vertical position innovation test ratio*/ + float mag_ratio; /*< Magnetometer innovation test ratio*/ + float hagl_ratio; /*< Height above terrain innovation test ratio*/ + float tas_ratio; /*< True airspeed innovation test ratio*/ + float pos_horiz_accuracy; /*< [m] Horizontal position 1-STD accuracy relative to the EKF local origin*/ + float pos_vert_accuracy; /*< [m] Vertical position 1-STD accuracy relative to the EKF local origin*/ + uint16_t flags; /*< Bitmap indicating which EKF outputs are valid.*/ +} mavlink_estimator_status_t; #define MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN 42 #define MAVLINK_MSG_ID_ESTIMATOR_STATUS_MIN_LEN 42 @@ -33,6 +33,7 @@ typedef struct __mavlink_estimator_status_t { "ESTIMATOR_STATUS", \ 10, \ { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_estimator_status_t, time_usec) }, \ + { "flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 40, offsetof(mavlink_estimator_status_t, flags) }, \ { "vel_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_estimator_status_t, vel_ratio) }, \ { "pos_horiz_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_estimator_status_t, pos_horiz_ratio) }, \ { "pos_vert_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_estimator_status_t, pos_vert_ratio) }, \ @@ -41,7 +42,6 @@ typedef struct __mavlink_estimator_status_t { { "tas_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_estimator_status_t, tas_ratio) }, \ { "pos_horiz_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_estimator_status_t, pos_horiz_accuracy) }, \ { "pos_vert_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_estimator_status_t, pos_vert_accuracy) }, \ - { "flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 40, offsetof(mavlink_estimator_status_t, flags) }, \ } \ } #else @@ -49,6 +49,7 @@ typedef struct __mavlink_estimator_status_t { "ESTIMATOR_STATUS", \ 10, \ { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_estimator_status_t, time_usec) }, \ + { "flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 40, offsetof(mavlink_estimator_status_t, flags) }, \ { "vel_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_estimator_status_t, vel_ratio) }, \ { "pos_horiz_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_estimator_status_t, pos_horiz_ratio) }, \ { "pos_vert_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_estimator_status_t, pos_vert_ratio) }, \ @@ -57,7 +58,6 @@ typedef struct __mavlink_estimator_status_t { { "tas_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_estimator_status_t, tas_ratio) }, \ { "pos_horiz_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_estimator_status_t, pos_horiz_accuracy) }, \ { "pos_vert_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_estimator_status_t, pos_vert_accuracy) }, \ - { "flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 40, offsetof(mavlink_estimator_status_t, flags) }, \ } \ } #endif @@ -68,16 +68,16 @@ typedef struct __mavlink_estimator_status_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param time_usec Timestamp (micros since boot or Unix epoch) - * @param flags Integer bitmask indicating which EKF outputs are valid. See definition for ESTIMATOR_STATUS_FLAGS. - * @param vel_ratio Velocity innovation test ratio - * @param pos_horiz_ratio Horizontal position innovation test ratio - * @param pos_vert_ratio Vertical position innovation test ratio - * @param mag_ratio Magnetometer innovation test ratio - * @param hagl_ratio Height above terrain innovation test ratio - * @param tas_ratio True airspeed innovation test ratio - * @param pos_horiz_accuracy Horizontal position 1-STD accuracy relative to the EKF local origin (m) - * @param pos_vert_accuracy Vertical position 1-STD accuracy relative to the EKF local origin (m) + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param flags Bitmap indicating which EKF outputs are valid. + * @param vel_ratio Velocity innovation test ratio + * @param pos_horiz_ratio Horizontal position innovation test ratio + * @param pos_vert_ratio Vertical position innovation test ratio + * @param mag_ratio Magnetometer innovation test ratio + * @param hagl_ratio Height above terrain innovation test ratio + * @param tas_ratio True airspeed innovation test ratio + * @param pos_horiz_accuracy [m] Horizontal position 1-STD accuracy relative to the EKF local origin + * @param pos_vert_accuracy [m] Vertical position 1-STD accuracy relative to the EKF local origin * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_estimator_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -123,16 +123,16 @@ static inline uint16_t mavlink_msg_estimator_status_pack(uint8_t system_id, uint * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param time_usec Timestamp (micros since boot or Unix epoch) - * @param flags Integer bitmask indicating which EKF outputs are valid. See definition for ESTIMATOR_STATUS_FLAGS. - * @param vel_ratio Velocity innovation test ratio - * @param pos_horiz_ratio Horizontal position innovation test ratio - * @param pos_vert_ratio Vertical position innovation test ratio - * @param mag_ratio Magnetometer innovation test ratio - * @param hagl_ratio Height above terrain innovation test ratio - * @param tas_ratio True airspeed innovation test ratio - * @param pos_horiz_accuracy Horizontal position 1-STD accuracy relative to the EKF local origin (m) - * @param pos_vert_accuracy Vertical position 1-STD accuracy relative to the EKF local origin (m) + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param flags Bitmap indicating which EKF outputs are valid. + * @param vel_ratio Velocity innovation test ratio + * @param pos_horiz_ratio Horizontal position innovation test ratio + * @param pos_vert_ratio Vertical position innovation test ratio + * @param mag_ratio Magnetometer innovation test ratio + * @param hagl_ratio Height above terrain innovation test ratio + * @param tas_ratio True airspeed innovation test ratio + * @param pos_horiz_accuracy [m] Horizontal position 1-STD accuracy relative to the EKF local origin + * @param pos_vert_accuracy [m] Vertical position 1-STD accuracy relative to the EKF local origin * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_estimator_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -204,16 +204,16 @@ static inline uint16_t mavlink_msg_estimator_status_encode_chan(uint8_t system_i * @brief Send a estimator_status message * @param chan MAVLink channel to send the message * - * @param time_usec Timestamp (micros since boot or Unix epoch) - * @param flags Integer bitmask indicating which EKF outputs are valid. See definition for ESTIMATOR_STATUS_FLAGS. - * @param vel_ratio Velocity innovation test ratio - * @param pos_horiz_ratio Horizontal position innovation test ratio - * @param pos_vert_ratio Vertical position innovation test ratio - * @param mag_ratio Magnetometer innovation test ratio - * @param hagl_ratio Height above terrain innovation test ratio - * @param tas_ratio True airspeed innovation test ratio - * @param pos_horiz_accuracy Horizontal position 1-STD accuracy relative to the EKF local origin (m) - * @param pos_vert_accuracy Vertical position 1-STD accuracy relative to the EKF local origin (m) + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param flags Bitmap indicating which EKF outputs are valid. + * @param vel_ratio Velocity innovation test ratio + * @param pos_horiz_ratio Horizontal position innovation test ratio + * @param pos_vert_ratio Vertical position innovation test ratio + * @param mag_ratio Magnetometer innovation test ratio + * @param hagl_ratio Height above terrain innovation test ratio + * @param tas_ratio True airspeed innovation test ratio + * @param pos_horiz_accuracy [m] Horizontal position 1-STD accuracy relative to the EKF local origin + * @param pos_vert_accuracy [m] Vertical position 1-STD accuracy relative to the EKF local origin */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -314,7 +314,7 @@ static inline void mavlink_msg_estimator_status_send_buf(mavlink_message_t *msgb /** * @brief Get field time_usec from estimator_status message * - * @return Timestamp (micros since boot or Unix epoch) + * @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. */ static inline uint64_t mavlink_msg_estimator_status_get_time_usec(const mavlink_message_t* msg) { @@ -324,7 +324,7 @@ static inline uint64_t mavlink_msg_estimator_status_get_time_usec(const mavlink_ /** * @brief Get field flags from estimator_status message * - * @return Integer bitmask indicating which EKF outputs are valid. See definition for ESTIMATOR_STATUS_FLAGS. + * @return Bitmap indicating which EKF outputs are valid. */ static inline uint16_t mavlink_msg_estimator_status_get_flags(const mavlink_message_t* msg) { @@ -334,7 +334,7 @@ static inline uint16_t mavlink_msg_estimator_status_get_flags(const mavlink_mess /** * @brief Get field vel_ratio from estimator_status message * - * @return Velocity innovation test ratio + * @return Velocity innovation test ratio */ static inline float mavlink_msg_estimator_status_get_vel_ratio(const mavlink_message_t* msg) { @@ -344,7 +344,7 @@ static inline float mavlink_msg_estimator_status_get_vel_ratio(const mavlink_mes /** * @brief Get field pos_horiz_ratio from estimator_status message * - * @return Horizontal position innovation test ratio + * @return Horizontal position innovation test ratio */ static inline float mavlink_msg_estimator_status_get_pos_horiz_ratio(const mavlink_message_t* msg) { @@ -354,7 +354,7 @@ static inline float mavlink_msg_estimator_status_get_pos_horiz_ratio(const mavli /** * @brief Get field pos_vert_ratio from estimator_status message * - * @return Vertical position innovation test ratio + * @return Vertical position innovation test ratio */ static inline float mavlink_msg_estimator_status_get_pos_vert_ratio(const mavlink_message_t* msg) { @@ -364,7 +364,7 @@ static inline float mavlink_msg_estimator_status_get_pos_vert_ratio(const mavlin /** * @brief Get field mag_ratio from estimator_status message * - * @return Magnetometer innovation test ratio + * @return Magnetometer innovation test ratio */ static inline float mavlink_msg_estimator_status_get_mag_ratio(const mavlink_message_t* msg) { @@ -374,7 +374,7 @@ static inline float mavlink_msg_estimator_status_get_mag_ratio(const mavlink_mes /** * @brief Get field hagl_ratio from estimator_status message * - * @return Height above terrain innovation test ratio + * @return Height above terrain innovation test ratio */ static inline float mavlink_msg_estimator_status_get_hagl_ratio(const mavlink_message_t* msg) { @@ -384,7 +384,7 @@ static inline float mavlink_msg_estimator_status_get_hagl_ratio(const mavlink_me /** * @brief Get field tas_ratio from estimator_status message * - * @return True airspeed innovation test ratio + * @return True airspeed innovation test ratio */ static inline float mavlink_msg_estimator_status_get_tas_ratio(const mavlink_message_t* msg) { @@ -394,7 +394,7 @@ static inline float mavlink_msg_estimator_status_get_tas_ratio(const mavlink_mes /** * @brief Get field pos_horiz_accuracy from estimator_status message * - * @return Horizontal position 1-STD accuracy relative to the EKF local origin (m) + * @return [m] Horizontal position 1-STD accuracy relative to the EKF local origin */ static inline float mavlink_msg_estimator_status_get_pos_horiz_accuracy(const mavlink_message_t* msg) { @@ -404,7 +404,7 @@ static inline float mavlink_msg_estimator_status_get_pos_horiz_accuracy(const ma /** * @brief Get field pos_vert_accuracy from estimator_status message * - * @return Vertical position 1-STD accuracy relative to the EKF local origin (m) + * @return [m] Vertical position 1-STD accuracy relative to the EKF local origin */ static inline float mavlink_msg_estimator_status_get_pos_vert_accuracy(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_extended_sys_state.h b/lib/main/MAVLink/common/mavlink_msg_extended_sys_state.h index 329a774afb..2eeeed0c0b 100755 --- a/lib/main/MAVLink/common/mavlink_msg_extended_sys_state.h +++ b/lib/main/MAVLink/common/mavlink_msg_extended_sys_state.h @@ -3,11 +3,11 @@ #define MAVLINK_MSG_ID_EXTENDED_SYS_STATE 245 -MAVPACKED( + typedef struct __mavlink_extended_sys_state_t { - uint8_t vtol_state; /*< The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration.*/ - uint8_t landed_state; /*< The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown.*/ -}) mavlink_extended_sys_state_t; + uint8_t vtol_state; /*< The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration.*/ + uint8_t landed_state; /*< The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown.*/ +} mavlink_extended_sys_state_t; #define MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN 2 #define MAVLINK_MSG_ID_EXTENDED_SYS_STATE_MIN_LEN 2 @@ -44,8 +44,8 @@ typedef struct __mavlink_extended_sys_state_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param vtol_state The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration. - * @param landed_state The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown. + * @param vtol_state The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration. + * @param landed_state The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_extended_sys_state_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -75,8 +75,8 @@ static inline uint16_t mavlink_msg_extended_sys_state_pack(uint8_t system_id, ui * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param vtol_state The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration. - * @param landed_state The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown. + * @param vtol_state The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration. + * @param landed_state The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_extended_sys_state_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -132,8 +132,8 @@ static inline uint16_t mavlink_msg_extended_sys_state_encode_chan(uint8_t system * @brief Send a extended_sys_state message * @param chan MAVLink channel to send the message * - * @param vtol_state The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration. - * @param landed_state The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown. + * @param vtol_state The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration. + * @param landed_state The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown. */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -202,7 +202,7 @@ static inline void mavlink_msg_extended_sys_state_send_buf(mavlink_message_t *ms /** * @brief Get field vtol_state from extended_sys_state message * - * @return The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration. + * @return The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration. */ static inline uint8_t mavlink_msg_extended_sys_state_get_vtol_state(const mavlink_message_t* msg) { @@ -212,7 +212,7 @@ static inline uint8_t mavlink_msg_extended_sys_state_get_vtol_state(const mavlin /** * @brief Get field landed_state from extended_sys_state message * - * @return The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown. + * @return The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown. */ static inline uint8_t mavlink_msg_extended_sys_state_get_landed_state(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_fence_status.h b/lib/main/MAVLink/common/mavlink_msg_fence_status.h new file mode 100644 index 0000000000..d15f768d9b --- /dev/null +++ b/lib/main/MAVLink/common/mavlink_msg_fence_status.h @@ -0,0 +1,288 @@ +#pragma once +// MESSAGE FENCE_STATUS PACKING + +#define MAVLINK_MSG_ID_FENCE_STATUS 162 + + +typedef struct __mavlink_fence_status_t { + uint32_t breach_time; /*< [ms] Time (since boot) of last breach.*/ + uint16_t breach_count; /*< Number of fence breaches.*/ + uint8_t breach_status; /*< Breach status (0 if currently inside fence, 1 if outside).*/ + uint8_t breach_type; /*< Last breach type.*/ +} mavlink_fence_status_t; + +#define MAVLINK_MSG_ID_FENCE_STATUS_LEN 8 +#define MAVLINK_MSG_ID_FENCE_STATUS_MIN_LEN 8 +#define MAVLINK_MSG_ID_162_LEN 8 +#define MAVLINK_MSG_ID_162_MIN_LEN 8 + +#define MAVLINK_MSG_ID_FENCE_STATUS_CRC 189 +#define MAVLINK_MSG_ID_162_CRC 189 + + + +#if MAVLINK_COMMAND_24BIT +#define MAVLINK_MESSAGE_INFO_FENCE_STATUS { \ + 162, \ + "FENCE_STATUS", \ + 4, \ + { { "breach_status", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_fence_status_t, breach_status) }, \ + { "breach_count", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_fence_status_t, breach_count) }, \ + { "breach_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_fence_status_t, breach_type) }, \ + { "breach_time", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_fence_status_t, breach_time) }, \ + } \ +} +#else +#define MAVLINK_MESSAGE_INFO_FENCE_STATUS { \ + "FENCE_STATUS", \ + 4, \ + { { "breach_status", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_fence_status_t, breach_status) }, \ + { "breach_count", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_fence_status_t, breach_count) }, \ + { "breach_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_fence_status_t, breach_type) }, \ + { "breach_time", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_fence_status_t, breach_time) }, \ + } \ +} +#endif + +/** + * @brief Pack a fence_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 breach_status Breach status (0 if currently inside fence, 1 if outside). + * @param breach_count Number of fence breaches. + * @param breach_type Last breach type. + * @param breach_time [ms] Time (since boot) of last breach. + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_fence_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, + uint8_t breach_status, uint16_t breach_count, uint8_t breach_type, uint32_t breach_time) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[MAVLINK_MSG_ID_FENCE_STATUS_LEN]; + _mav_put_uint32_t(buf, 0, breach_time); + _mav_put_uint16_t(buf, 4, breach_count); + _mav_put_uint8_t(buf, 6, breach_status); + _mav_put_uint8_t(buf, 7, breach_type); + + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_FENCE_STATUS_LEN); +#else + mavlink_fence_status_t packet; + packet.breach_time = breach_time; + packet.breach_count = breach_count; + packet.breach_status = breach_status; + packet.breach_type = breach_type; + + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_FENCE_STATUS_LEN); +#endif + + msg->msgid = MAVLINK_MSG_ID_FENCE_STATUS; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_FENCE_STATUS_MIN_LEN, MAVLINK_MSG_ID_FENCE_STATUS_LEN, MAVLINK_MSG_ID_FENCE_STATUS_CRC); +} + +/** + * @brief Pack a fence_status message on a channel + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param chan The MAVLink channel this message will be sent over + * @param msg The MAVLink message to compress the data into + * @param breach_status Breach status (0 if currently inside fence, 1 if outside). + * @param breach_count Number of fence breaches. + * @param breach_type Last breach type. + * @param breach_time [ms] Time (since boot) of last breach. + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_fence_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, + mavlink_message_t* msg, + uint8_t breach_status,uint16_t breach_count,uint8_t breach_type,uint32_t breach_time) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[MAVLINK_MSG_ID_FENCE_STATUS_LEN]; + _mav_put_uint32_t(buf, 0, breach_time); + _mav_put_uint16_t(buf, 4, breach_count); + _mav_put_uint8_t(buf, 6, breach_status); + _mav_put_uint8_t(buf, 7, breach_type); + + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_FENCE_STATUS_LEN); +#else + mavlink_fence_status_t packet; + packet.breach_time = breach_time; + packet.breach_count = breach_count; + packet.breach_status = breach_status; + packet.breach_type = breach_type; + + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_FENCE_STATUS_LEN); +#endif + + msg->msgid = MAVLINK_MSG_ID_FENCE_STATUS; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_FENCE_STATUS_MIN_LEN, MAVLINK_MSG_ID_FENCE_STATUS_LEN, MAVLINK_MSG_ID_FENCE_STATUS_CRC); +} + +/** + * @brief Encode a fence_status struct + * + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param msg The MAVLink message to compress the data into + * @param fence_status C-struct to read the message contents from + */ +static inline uint16_t mavlink_msg_fence_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_fence_status_t* fence_status) +{ + return mavlink_msg_fence_status_pack(system_id, component_id, msg, fence_status->breach_status, fence_status->breach_count, fence_status->breach_type, fence_status->breach_time); +} + +/** + * @brief Encode a fence_status struct on a channel + * + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param chan The MAVLink channel this message will be sent over + * @param msg The MAVLink message to compress the data into + * @param fence_status C-struct to read the message contents from + */ +static inline uint16_t mavlink_msg_fence_status_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_fence_status_t* fence_status) +{ + return mavlink_msg_fence_status_pack_chan(system_id, component_id, chan, msg, fence_status->breach_status, fence_status->breach_count, fence_status->breach_type, fence_status->breach_time); +} + +/** + * @brief Send a fence_status message + * @param chan MAVLink channel to send the message + * + * @param breach_status Breach status (0 if currently inside fence, 1 if outside). + * @param breach_count Number of fence breaches. + * @param breach_type Last breach type. + * @param breach_time [ms] Time (since boot) of last breach. + */ +#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS + +static inline void mavlink_msg_fence_status_send(mavlink_channel_t chan, uint8_t breach_status, uint16_t breach_count, uint8_t breach_type, uint32_t breach_time) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[MAVLINK_MSG_ID_FENCE_STATUS_LEN]; + _mav_put_uint32_t(buf, 0, breach_time); + _mav_put_uint16_t(buf, 4, breach_count); + _mav_put_uint8_t(buf, 6, breach_status); + _mav_put_uint8_t(buf, 7, breach_type); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_STATUS, buf, MAVLINK_MSG_ID_FENCE_STATUS_MIN_LEN, MAVLINK_MSG_ID_FENCE_STATUS_LEN, MAVLINK_MSG_ID_FENCE_STATUS_CRC); +#else + mavlink_fence_status_t packet; + packet.breach_time = breach_time; + packet.breach_count = breach_count; + packet.breach_status = breach_status; + packet.breach_type = breach_type; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_STATUS, (const char *)&packet, MAVLINK_MSG_ID_FENCE_STATUS_MIN_LEN, MAVLINK_MSG_ID_FENCE_STATUS_LEN, MAVLINK_MSG_ID_FENCE_STATUS_CRC); +#endif +} + +/** + * @brief Send a fence_status message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_fence_status_send_struct(mavlink_channel_t chan, const mavlink_fence_status_t* fence_status) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_fence_status_send(chan, fence_status->breach_status, fence_status->breach_count, fence_status->breach_type, fence_status->breach_time); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_STATUS, (const char *)fence_status, MAVLINK_MSG_ID_FENCE_STATUS_MIN_LEN, MAVLINK_MSG_ID_FENCE_STATUS_LEN, MAVLINK_MSG_ID_FENCE_STATUS_CRC); +#endif +} + +#if MAVLINK_MSG_ID_FENCE_STATUS_LEN <= MAVLINK_MAX_PAYLOAD_LEN +/* + This varient of _send() can be used to save stack space by re-using + memory from the receive buffer. The caller provides a + mavlink_message_t which is the size of a full mavlink message. This + is usually the receive buffer for the channel, and allows a reply to an + incoming message with minimum stack space usage. + */ +static inline void mavlink_msg_fence_status_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t breach_status, uint16_t breach_count, uint8_t breach_type, uint32_t breach_time) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char *buf = (char *)msgbuf; + _mav_put_uint32_t(buf, 0, breach_time); + _mav_put_uint16_t(buf, 4, breach_count); + _mav_put_uint8_t(buf, 6, breach_status); + _mav_put_uint8_t(buf, 7, breach_type); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_STATUS, buf, MAVLINK_MSG_ID_FENCE_STATUS_MIN_LEN, MAVLINK_MSG_ID_FENCE_STATUS_LEN, MAVLINK_MSG_ID_FENCE_STATUS_CRC); +#else + mavlink_fence_status_t *packet = (mavlink_fence_status_t *)msgbuf; + packet->breach_time = breach_time; + packet->breach_count = breach_count; + packet->breach_status = breach_status; + packet->breach_type = breach_type; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_STATUS, (const char *)packet, MAVLINK_MSG_ID_FENCE_STATUS_MIN_LEN, MAVLINK_MSG_ID_FENCE_STATUS_LEN, MAVLINK_MSG_ID_FENCE_STATUS_CRC); +#endif +} +#endif + +#endif + +// MESSAGE FENCE_STATUS UNPACKING + + +/** + * @brief Get field breach_status from fence_status message + * + * @return Breach status (0 if currently inside fence, 1 if outside). + */ +static inline uint8_t mavlink_msg_fence_status_get_breach_status(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint8_t(msg, 6); +} + +/** + * @brief Get field breach_count from fence_status message + * + * @return Number of fence breaches. + */ +static inline uint16_t mavlink_msg_fence_status_get_breach_count(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint16_t(msg, 4); +} + +/** + * @brief Get field breach_type from fence_status message + * + * @return Last breach type. + */ +static inline uint8_t mavlink_msg_fence_status_get_breach_type(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint8_t(msg, 7); +} + +/** + * @brief Get field breach_time from fence_status message + * + * @return [ms] Time (since boot) of last breach. + */ +static inline uint32_t mavlink_msg_fence_status_get_breach_time(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint32_t(msg, 0); +} + +/** + * @brief Decode a fence_status message into a struct + * + * @param msg The message to decode + * @param fence_status C-struct to decode the message contents into + */ +static inline void mavlink_msg_fence_status_decode(const mavlink_message_t* msg, mavlink_fence_status_t* fence_status) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + fence_status->breach_time = mavlink_msg_fence_status_get_breach_time(msg); + fence_status->breach_count = mavlink_msg_fence_status_get_breach_count(msg); + fence_status->breach_status = mavlink_msg_fence_status_get_breach_status(msg); + fence_status->breach_type = mavlink_msg_fence_status_get_breach_type(msg); +#else + uint8_t len = msg->len < MAVLINK_MSG_ID_FENCE_STATUS_LEN? msg->len : MAVLINK_MSG_ID_FENCE_STATUS_LEN; + memset(fence_status, 0, MAVLINK_MSG_ID_FENCE_STATUS_LEN); + memcpy(fence_status, _MAV_PAYLOAD(msg), len); +#endif +} diff --git a/lib/main/MAVLink/common/mavlink_msg_file_transfer_protocol.h b/lib/main/MAVLink/common/mavlink_msg_file_transfer_protocol.h index 07b5a3ef64..0dd4d0530d 100755 --- a/lib/main/MAVLink/common/mavlink_msg_file_transfer_protocol.h +++ b/lib/main/MAVLink/common/mavlink_msg_file_transfer_protocol.h @@ -3,13 +3,13 @@ #define MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL 110 -MAVPACKED( + typedef struct __mavlink_file_transfer_protocol_t { - uint8_t target_network; /*< Network ID (0 for broadcast)*/ - uint8_t target_system; /*< System ID (0 for broadcast)*/ - uint8_t target_component; /*< Component ID (0 for broadcast)*/ - uint8_t payload[251]; /*< Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The entire content of this block is opaque unless you understand any the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the mavlink specification.*/ -}) mavlink_file_transfer_protocol_t; + uint8_t target_network; /*< Network ID (0 for broadcast)*/ + uint8_t target_system; /*< System ID (0 for broadcast)*/ + uint8_t target_component; /*< Component ID (0 for broadcast)*/ + uint8_t payload[251]; /*< Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The entire content of this block is opaque unless you understand any the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the mavlink specification.*/ +} mavlink_file_transfer_protocol_t; #define MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN 254 #define MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_MIN_LEN 254 @@ -50,10 +50,10 @@ typedef struct __mavlink_file_transfer_protocol_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param target_network Network ID (0 for broadcast) - * @param target_system System ID (0 for broadcast) - * @param target_component Component ID (0 for broadcast) - * @param payload Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The entire content of this block is opaque unless you understand any the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the mavlink specification. + * @param target_network Network ID (0 for broadcast) + * @param target_system System ID (0 for broadcast) + * @param target_component Component ID (0 for broadcast) + * @param payload Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The entire content of this block is opaque unless you understand any the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the mavlink specification. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_file_transfer_protocol_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -85,10 +85,10 @@ static inline uint16_t mavlink_msg_file_transfer_protocol_pack(uint8_t system_id * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param target_network Network ID (0 for broadcast) - * @param target_system System ID (0 for broadcast) - * @param target_component Component ID (0 for broadcast) - * @param payload Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The entire content of this block is opaque unless you understand any the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the mavlink specification. + * @param target_network Network ID (0 for broadcast) + * @param target_system System ID (0 for broadcast) + * @param target_component Component ID (0 for broadcast) + * @param payload Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The entire content of this block is opaque unless you understand any the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the mavlink specification. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_file_transfer_protocol_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -146,10 +146,10 @@ static inline uint16_t mavlink_msg_file_transfer_protocol_encode_chan(uint8_t sy * @brief Send a file_transfer_protocol message * @param chan MAVLink channel to send the message * - * @param target_network Network ID (0 for broadcast) - * @param target_system System ID (0 for broadcast) - * @param target_component Component ID (0 for broadcast) - * @param payload Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The entire content of this block is opaque unless you understand any the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the mavlink specification. + * @param target_network Network ID (0 for broadcast) + * @param target_system System ID (0 for broadcast) + * @param target_component Component ID (0 for broadcast) + * @param payload Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The entire content of this block is opaque unless you understand any the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the mavlink specification. */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -222,7 +222,7 @@ static inline void mavlink_msg_file_transfer_protocol_send_buf(mavlink_message_t /** * @brief Get field target_network from file_transfer_protocol message * - * @return Network ID (0 for broadcast) + * @return Network ID (0 for broadcast) */ static inline uint8_t mavlink_msg_file_transfer_protocol_get_target_network(const mavlink_message_t* msg) { @@ -232,7 +232,7 @@ static inline uint8_t mavlink_msg_file_transfer_protocol_get_target_network(cons /** * @brief Get field target_system from file_transfer_protocol message * - * @return System ID (0 for broadcast) + * @return System ID (0 for broadcast) */ static inline uint8_t mavlink_msg_file_transfer_protocol_get_target_system(const mavlink_message_t* msg) { @@ -242,7 +242,7 @@ static inline uint8_t mavlink_msg_file_transfer_protocol_get_target_system(const /** * @brief Get field target_component from file_transfer_protocol message * - * @return Component ID (0 for broadcast) + * @return Component ID (0 for broadcast) */ static inline uint8_t mavlink_msg_file_transfer_protocol_get_target_component(const mavlink_message_t* msg) { @@ -252,7 +252,7 @@ static inline uint8_t mavlink_msg_file_transfer_protocol_get_target_component(co /** * @brief Get field payload from file_transfer_protocol message * - * @return Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The entire content of this block is opaque unless you understand any the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the mavlink specification. + * @return Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The entire content of this block is opaque unless you understand any the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the mavlink specification. */ static inline uint16_t mavlink_msg_file_transfer_protocol_get_payload(const mavlink_message_t* msg, uint8_t *payload) { diff --git a/lib/main/MAVLink/common/mavlink_msg_follow_target.h b/lib/main/MAVLink/common/mavlink_msg_follow_target.h index bfd45f649e..01d03ab510 100755 --- a/lib/main/MAVLink/common/mavlink_msg_follow_target.h +++ b/lib/main/MAVLink/common/mavlink_msg_follow_target.h @@ -3,20 +3,20 @@ #define MAVLINK_MSG_ID_FOLLOW_TARGET 144 -MAVPACKED( + typedef struct __mavlink_follow_target_t { - uint64_t timestamp; /*< Timestamp in milliseconds since system boot*/ - uint64_t custom_state; /*< button states or switches of a tracker device*/ - int32_t lat; /*< Latitude (WGS84), in degrees * 1E7*/ - int32_t lon; /*< Longitude (WGS84), in degrees * 1E7*/ - float alt; /*< AMSL, in meters*/ - float vel[3]; /*< target velocity (0,0,0) for unknown*/ - float acc[3]; /*< linear target acceleration (0,0,0) for unknown*/ - float attitude_q[4]; /*< (1 0 0 0 for unknown)*/ - float rates[3]; /*< (0 0 0 for unknown)*/ - float position_cov[3]; /*< eph epv*/ - uint8_t est_capabilities; /*< bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3)*/ -}) mavlink_follow_target_t; + uint64_t timestamp; /*< [ms] Timestamp (time since system boot).*/ + uint64_t custom_state; /*< button states or switches of a tracker device*/ + int32_t lat; /*< [degE7] Latitude (WGS84)*/ + int32_t lon; /*< [degE7] Longitude (WGS84)*/ + float alt; /*< [m] Altitude (MSL)*/ + float vel[3]; /*< [m/s] target velocity (0,0,0) for unknown*/ + float acc[3]; /*< [m/s/s] linear target acceleration (0,0,0) for unknown*/ + float attitude_q[4]; /*< (1 0 0 0 for unknown)*/ + float rates[3]; /*< (0 0 0 for unknown)*/ + float position_cov[3]; /*< eph epv*/ + uint8_t est_capabilities; /*< bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3)*/ +} mavlink_follow_target_t; #define MAVLINK_MSG_ID_FOLLOW_TARGET_LEN 93 #define MAVLINK_MSG_ID_FOLLOW_TARGET_MIN_LEN 93 @@ -38,7 +38,7 @@ typedef struct __mavlink_follow_target_t { "FOLLOW_TARGET", \ 11, \ { { "timestamp", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_follow_target_t, timestamp) }, \ - { "custom_state", NULL, MAVLINK_TYPE_UINT64_T, 0, 8, offsetof(mavlink_follow_target_t, custom_state) }, \ + { "est_capabilities", NULL, MAVLINK_TYPE_UINT8_T, 0, 92, offsetof(mavlink_follow_target_t, est_capabilities) }, \ { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_follow_target_t, lat) }, \ { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_follow_target_t, lon) }, \ { "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_follow_target_t, alt) }, \ @@ -47,7 +47,7 @@ typedef struct __mavlink_follow_target_t { { "attitude_q", NULL, MAVLINK_TYPE_FLOAT, 4, 52, offsetof(mavlink_follow_target_t, attitude_q) }, \ { "rates", NULL, MAVLINK_TYPE_FLOAT, 3, 68, offsetof(mavlink_follow_target_t, rates) }, \ { "position_cov", NULL, MAVLINK_TYPE_FLOAT, 3, 80, offsetof(mavlink_follow_target_t, position_cov) }, \ - { "est_capabilities", NULL, MAVLINK_TYPE_UINT8_T, 0, 92, offsetof(mavlink_follow_target_t, est_capabilities) }, \ + { "custom_state", NULL, MAVLINK_TYPE_UINT64_T, 0, 8, offsetof(mavlink_follow_target_t, custom_state) }, \ } \ } #else @@ -55,7 +55,7 @@ typedef struct __mavlink_follow_target_t { "FOLLOW_TARGET", \ 11, \ { { "timestamp", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_follow_target_t, timestamp) }, \ - { "custom_state", NULL, MAVLINK_TYPE_UINT64_T, 0, 8, offsetof(mavlink_follow_target_t, custom_state) }, \ + { "est_capabilities", NULL, MAVLINK_TYPE_UINT8_T, 0, 92, offsetof(mavlink_follow_target_t, est_capabilities) }, \ { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_follow_target_t, lat) }, \ { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_follow_target_t, lon) }, \ { "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_follow_target_t, alt) }, \ @@ -64,7 +64,7 @@ typedef struct __mavlink_follow_target_t { { "attitude_q", NULL, MAVLINK_TYPE_FLOAT, 4, 52, offsetof(mavlink_follow_target_t, attitude_q) }, \ { "rates", NULL, MAVLINK_TYPE_FLOAT, 3, 68, offsetof(mavlink_follow_target_t, rates) }, \ { "position_cov", NULL, MAVLINK_TYPE_FLOAT, 3, 80, offsetof(mavlink_follow_target_t, position_cov) }, \ - { "est_capabilities", NULL, MAVLINK_TYPE_UINT8_T, 0, 92, offsetof(mavlink_follow_target_t, est_capabilities) }, \ + { "custom_state", NULL, MAVLINK_TYPE_UINT64_T, 0, 8, offsetof(mavlink_follow_target_t, custom_state) }, \ } \ } #endif @@ -75,17 +75,17 @@ typedef struct __mavlink_follow_target_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param timestamp Timestamp in milliseconds since system boot - * @param est_capabilities bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3) - * @param lat Latitude (WGS84), in degrees * 1E7 - * @param lon Longitude (WGS84), in degrees * 1E7 - * @param alt AMSL, in meters - * @param vel target velocity (0,0,0) for unknown - * @param acc linear target acceleration (0,0,0) for unknown - * @param attitude_q (1 0 0 0 for unknown) - * @param rates (0 0 0 for unknown) - * @param position_cov eph epv - * @param custom_state button states or switches of a tracker device + * @param timestamp [ms] Timestamp (time since system boot). + * @param est_capabilities bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3) + * @param lat [degE7] Latitude (WGS84) + * @param lon [degE7] Longitude (WGS84) + * @param alt [m] Altitude (MSL) + * @param vel [m/s] target velocity (0,0,0) for unknown + * @param acc [m/s/s] linear target acceleration (0,0,0) for unknown + * @param attitude_q (1 0 0 0 for unknown) + * @param rates (0 0 0 for unknown) + * @param position_cov eph epv + * @param custom_state button states or switches of a tracker device * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_follow_target_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -131,17 +131,17 @@ static inline uint16_t mavlink_msg_follow_target_pack(uint8_t system_id, uint8_t * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param timestamp Timestamp in milliseconds since system boot - * @param est_capabilities bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3) - * @param lat Latitude (WGS84), in degrees * 1E7 - * @param lon Longitude (WGS84), in degrees * 1E7 - * @param alt AMSL, in meters - * @param vel target velocity (0,0,0) for unknown - * @param acc linear target acceleration (0,0,0) for unknown - * @param attitude_q (1 0 0 0 for unknown) - * @param rates (0 0 0 for unknown) - * @param position_cov eph epv - * @param custom_state button states or switches of a tracker device + * @param timestamp [ms] Timestamp (time since system boot). + * @param est_capabilities bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3) + * @param lat [degE7] Latitude (WGS84) + * @param lon [degE7] Longitude (WGS84) + * @param alt [m] Altitude (MSL) + * @param vel [m/s] target velocity (0,0,0) for unknown + * @param acc [m/s/s] linear target acceleration (0,0,0) for unknown + * @param attitude_q (1 0 0 0 for unknown) + * @param rates (0 0 0 for unknown) + * @param position_cov eph epv + * @param custom_state button states or switches of a tracker device * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_follow_target_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -213,17 +213,17 @@ static inline uint16_t mavlink_msg_follow_target_encode_chan(uint8_t system_id, * @brief Send a follow_target message * @param chan MAVLink channel to send the message * - * @param timestamp Timestamp in milliseconds since system boot - * @param est_capabilities bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3) - * @param lat Latitude (WGS84), in degrees * 1E7 - * @param lon Longitude (WGS84), in degrees * 1E7 - * @param alt AMSL, in meters - * @param vel target velocity (0,0,0) for unknown - * @param acc linear target acceleration (0,0,0) for unknown - * @param attitude_q (1 0 0 0 for unknown) - * @param rates (0 0 0 for unknown) - * @param position_cov eph epv - * @param custom_state button states or switches of a tracker device + * @param timestamp [ms] Timestamp (time since system boot). + * @param est_capabilities bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3) + * @param lat [degE7] Latitude (WGS84) + * @param lon [degE7] Longitude (WGS84) + * @param alt [m] Altitude (MSL) + * @param vel [m/s] target velocity (0,0,0) for unknown + * @param acc [m/s/s] linear target acceleration (0,0,0) for unknown + * @param attitude_q (1 0 0 0 for unknown) + * @param rates (0 0 0 for unknown) + * @param position_cov eph epv + * @param custom_state button states or switches of a tracker device */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -324,7 +324,7 @@ static inline void mavlink_msg_follow_target_send_buf(mavlink_message_t *msgbuf, /** * @brief Get field timestamp from follow_target message * - * @return Timestamp in milliseconds since system boot + * @return [ms] Timestamp (time since system boot). */ static inline uint64_t mavlink_msg_follow_target_get_timestamp(const mavlink_message_t* msg) { @@ -334,7 +334,7 @@ static inline uint64_t mavlink_msg_follow_target_get_timestamp(const mavlink_mes /** * @brief Get field est_capabilities from follow_target message * - * @return bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3) + * @return bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3) */ static inline uint8_t mavlink_msg_follow_target_get_est_capabilities(const mavlink_message_t* msg) { @@ -344,7 +344,7 @@ static inline uint8_t mavlink_msg_follow_target_get_est_capabilities(const mavli /** * @brief Get field lat from follow_target message * - * @return Latitude (WGS84), in degrees * 1E7 + * @return [degE7] Latitude (WGS84) */ static inline int32_t mavlink_msg_follow_target_get_lat(const mavlink_message_t* msg) { @@ -354,7 +354,7 @@ static inline int32_t mavlink_msg_follow_target_get_lat(const mavlink_message_t* /** * @brief Get field lon from follow_target message * - * @return Longitude (WGS84), in degrees * 1E7 + * @return [degE7] Longitude (WGS84) */ static inline int32_t mavlink_msg_follow_target_get_lon(const mavlink_message_t* msg) { @@ -364,7 +364,7 @@ static inline int32_t mavlink_msg_follow_target_get_lon(const mavlink_message_t* /** * @brief Get field alt from follow_target message * - * @return AMSL, in meters + * @return [m] Altitude (MSL) */ static inline float mavlink_msg_follow_target_get_alt(const mavlink_message_t* msg) { @@ -374,7 +374,7 @@ static inline float mavlink_msg_follow_target_get_alt(const mavlink_message_t* m /** * @brief Get field vel from follow_target message * - * @return target velocity (0,0,0) for unknown + * @return [m/s] target velocity (0,0,0) for unknown */ static inline uint16_t mavlink_msg_follow_target_get_vel(const mavlink_message_t* msg, float *vel) { @@ -384,7 +384,7 @@ static inline uint16_t mavlink_msg_follow_target_get_vel(const mavlink_message_t /** * @brief Get field acc from follow_target message * - * @return linear target acceleration (0,0,0) for unknown + * @return [m/s/s] linear target acceleration (0,0,0) for unknown */ static inline uint16_t mavlink_msg_follow_target_get_acc(const mavlink_message_t* msg, float *acc) { @@ -394,7 +394,7 @@ static inline uint16_t mavlink_msg_follow_target_get_acc(const mavlink_message_t /** * @brief Get field attitude_q from follow_target message * - * @return (1 0 0 0 for unknown) + * @return (1 0 0 0 for unknown) */ static inline uint16_t mavlink_msg_follow_target_get_attitude_q(const mavlink_message_t* msg, float *attitude_q) { @@ -404,7 +404,7 @@ static inline uint16_t mavlink_msg_follow_target_get_attitude_q(const mavlink_me /** * @brief Get field rates from follow_target message * - * @return (0 0 0 for unknown) + * @return (0 0 0 for unknown) */ static inline uint16_t mavlink_msg_follow_target_get_rates(const mavlink_message_t* msg, float *rates) { @@ -414,7 +414,7 @@ static inline uint16_t mavlink_msg_follow_target_get_rates(const mavlink_message /** * @brief Get field position_cov from follow_target message * - * @return eph epv + * @return eph epv */ static inline uint16_t mavlink_msg_follow_target_get_position_cov(const mavlink_message_t* msg, float *position_cov) { @@ -424,7 +424,7 @@ static inline uint16_t mavlink_msg_follow_target_get_position_cov(const mavlink_ /** * @brief Get field custom_state from follow_target message * - * @return button states or switches of a tracker device + * @return button states or switches of a tracker device */ static inline uint64_t mavlink_msg_follow_target_get_custom_state(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_global_position_int.h b/lib/main/MAVLink/common/mavlink_msg_global_position_int.h index ef6267d2e1..8b601f2347 100755 --- a/lib/main/MAVLink/common/mavlink_msg_global_position_int.h +++ b/lib/main/MAVLink/common/mavlink_msg_global_position_int.h @@ -3,18 +3,18 @@ #define MAVLINK_MSG_ID_GLOBAL_POSITION_INT 33 -MAVPACKED( + typedef struct __mavlink_global_position_int_t { - uint32_t time_boot_ms; /*< Timestamp (milliseconds since system boot)*/ - int32_t lat; /*< Latitude, expressed as degrees * 1E7*/ - int32_t lon; /*< Longitude, expressed as degrees * 1E7*/ - int32_t alt; /*< Altitude in meters, expressed as * 1000 (millimeters), AMSL (not WGS84 - note that virtually all GPS modules provide the AMSL as well)*/ - int32_t relative_alt; /*< Altitude above ground in meters, expressed as * 1000 (millimeters)*/ - int16_t vx; /*< Ground X Speed (Latitude, positive north), expressed as m/s * 100*/ - int16_t vy; /*< Ground Y Speed (Longitude, positive east), expressed as m/s * 100*/ - int16_t vz; /*< Ground Z Speed (Altitude, positive down), expressed as m/s * 100*/ - uint16_t hdg; /*< Vehicle heading (yaw angle) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX*/ -}) mavlink_global_position_int_t; + uint32_t time_boot_ms; /*< [ms] Timestamp (time since system boot).*/ + int32_t lat; /*< [degE7] Latitude, expressed*/ + int32_t lon; /*< [degE7] Longitude, expressed*/ + int32_t alt; /*< [mm] Altitude (MSL). Note that virtually all GPS modules provide both WGS84 and MSL.*/ + int32_t relative_alt; /*< [mm] Altitude above ground*/ + int16_t vx; /*< [cm/s] Ground X Speed (Latitude, positive north)*/ + int16_t vy; /*< [cm/s] Ground Y Speed (Longitude, positive east)*/ + int16_t vz; /*< [cm/s] Ground Z Speed (Altitude, positive down)*/ + uint16_t hdg; /*< [cdeg] Vehicle heading (yaw angle), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX*/ +} mavlink_global_position_int_t; #define MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN 28 #define MAVLINK_MSG_ID_GLOBAL_POSITION_INT_MIN_LEN 28 @@ -65,15 +65,15 @@ typedef struct __mavlink_global_position_int_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param time_boot_ms Timestamp (milliseconds since system boot) - * @param lat Latitude, expressed as degrees * 1E7 - * @param lon Longitude, expressed as degrees * 1E7 - * @param alt Altitude in meters, expressed as * 1000 (millimeters), AMSL (not WGS84 - note that virtually all GPS modules provide the AMSL as well) - * @param relative_alt Altitude above ground in meters, expressed as * 1000 (millimeters) - * @param vx Ground X Speed (Latitude, positive north), expressed as m/s * 100 - * @param vy Ground Y Speed (Longitude, positive east), expressed as m/s * 100 - * @param vz Ground Z Speed (Altitude, positive down), expressed as m/s * 100 - * @param hdg Vehicle heading (yaw angle) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param lat [degE7] Latitude, expressed + * @param lon [degE7] Longitude, expressed + * @param alt [mm] Altitude (MSL). Note that virtually all GPS modules provide both WGS84 and MSL. + * @param relative_alt [mm] Altitude above ground + * @param vx [cm/s] Ground X Speed (Latitude, positive north) + * @param vy [cm/s] Ground Y Speed (Longitude, positive east) + * @param vz [cm/s] Ground Z Speed (Altitude, positive down) + * @param hdg [cdeg] Vehicle heading (yaw angle), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_global_position_int_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -117,15 +117,15 @@ static inline uint16_t mavlink_msg_global_position_int_pack(uint8_t system_id, u * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param time_boot_ms Timestamp (milliseconds since system boot) - * @param lat Latitude, expressed as degrees * 1E7 - * @param lon Longitude, expressed as degrees * 1E7 - * @param alt Altitude in meters, expressed as * 1000 (millimeters), AMSL (not WGS84 - note that virtually all GPS modules provide the AMSL as well) - * @param relative_alt Altitude above ground in meters, expressed as * 1000 (millimeters) - * @param vx Ground X Speed (Latitude, positive north), expressed as m/s * 100 - * @param vy Ground Y Speed (Longitude, positive east), expressed as m/s * 100 - * @param vz Ground Z Speed (Altitude, positive down), expressed as m/s * 100 - * @param hdg Vehicle heading (yaw angle) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param lat [degE7] Latitude, expressed + * @param lon [degE7] Longitude, expressed + * @param alt [mm] Altitude (MSL). Note that virtually all GPS modules provide both WGS84 and MSL. + * @param relative_alt [mm] Altitude above ground + * @param vx [cm/s] Ground X Speed (Latitude, positive north) + * @param vy [cm/s] Ground Y Speed (Longitude, positive east) + * @param vz [cm/s] Ground Z Speed (Altitude, positive down) + * @param hdg [cdeg] Vehicle heading (yaw angle), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_global_position_int_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -195,15 +195,15 @@ static inline uint16_t mavlink_msg_global_position_int_encode_chan(uint8_t syste * @brief Send a global_position_int message * @param chan MAVLink channel to send the message * - * @param time_boot_ms Timestamp (milliseconds since system boot) - * @param lat Latitude, expressed as degrees * 1E7 - * @param lon Longitude, expressed as degrees * 1E7 - * @param alt Altitude in meters, expressed as * 1000 (millimeters), AMSL (not WGS84 - note that virtually all GPS modules provide the AMSL as well) - * @param relative_alt Altitude above ground in meters, expressed as * 1000 (millimeters) - * @param vx Ground X Speed (Latitude, positive north), expressed as m/s * 100 - * @param vy Ground Y Speed (Longitude, positive east), expressed as m/s * 100 - * @param vz Ground Z Speed (Altitude, positive down), expressed as m/s * 100 - * @param hdg Vehicle heading (yaw angle) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param lat [degE7] Latitude, expressed + * @param lon [degE7] Longitude, expressed + * @param alt [mm] Altitude (MSL). Note that virtually all GPS modules provide both WGS84 and MSL. + * @param relative_alt [mm] Altitude above ground + * @param vx [cm/s] Ground X Speed (Latitude, positive north) + * @param vy [cm/s] Ground Y Speed (Longitude, positive east) + * @param vz [cm/s] Ground Z Speed (Altitude, positive down) + * @param hdg [cdeg] Vehicle heading (yaw angle), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -300,7 +300,7 @@ static inline void mavlink_msg_global_position_int_send_buf(mavlink_message_t *m /** * @brief Get field time_boot_ms from global_position_int message * - * @return Timestamp (milliseconds since system boot) + * @return [ms] Timestamp (time since system boot). */ static inline uint32_t mavlink_msg_global_position_int_get_time_boot_ms(const mavlink_message_t* msg) { @@ -310,7 +310,7 @@ static inline uint32_t mavlink_msg_global_position_int_get_time_boot_ms(const ma /** * @brief Get field lat from global_position_int message * - * @return Latitude, expressed as degrees * 1E7 + * @return [degE7] Latitude, expressed */ static inline int32_t mavlink_msg_global_position_int_get_lat(const mavlink_message_t* msg) { @@ -320,7 +320,7 @@ static inline int32_t mavlink_msg_global_position_int_get_lat(const mavlink_mess /** * @brief Get field lon from global_position_int message * - * @return Longitude, expressed as degrees * 1E7 + * @return [degE7] Longitude, expressed */ static inline int32_t mavlink_msg_global_position_int_get_lon(const mavlink_message_t* msg) { @@ -330,7 +330,7 @@ static inline int32_t mavlink_msg_global_position_int_get_lon(const mavlink_mess /** * @brief Get field alt from global_position_int message * - * @return Altitude in meters, expressed as * 1000 (millimeters), AMSL (not WGS84 - note that virtually all GPS modules provide the AMSL as well) + * @return [mm] Altitude (MSL). Note that virtually all GPS modules provide both WGS84 and MSL. */ static inline int32_t mavlink_msg_global_position_int_get_alt(const mavlink_message_t* msg) { @@ -340,7 +340,7 @@ static inline int32_t mavlink_msg_global_position_int_get_alt(const mavlink_mess /** * @brief Get field relative_alt from global_position_int message * - * @return Altitude above ground in meters, expressed as * 1000 (millimeters) + * @return [mm] Altitude above ground */ static inline int32_t mavlink_msg_global_position_int_get_relative_alt(const mavlink_message_t* msg) { @@ -350,7 +350,7 @@ static inline int32_t mavlink_msg_global_position_int_get_relative_alt(const mav /** * @brief Get field vx from global_position_int message * - * @return Ground X Speed (Latitude, positive north), expressed as m/s * 100 + * @return [cm/s] Ground X Speed (Latitude, positive north) */ static inline int16_t mavlink_msg_global_position_int_get_vx(const mavlink_message_t* msg) { @@ -360,7 +360,7 @@ static inline int16_t mavlink_msg_global_position_int_get_vx(const mavlink_messa /** * @brief Get field vy from global_position_int message * - * @return Ground Y Speed (Longitude, positive east), expressed as m/s * 100 + * @return [cm/s] Ground Y Speed (Longitude, positive east) */ static inline int16_t mavlink_msg_global_position_int_get_vy(const mavlink_message_t* msg) { @@ -370,7 +370,7 @@ static inline int16_t mavlink_msg_global_position_int_get_vy(const mavlink_messa /** * @brief Get field vz from global_position_int message * - * @return Ground Z Speed (Altitude, positive down), expressed as m/s * 100 + * @return [cm/s] Ground Z Speed (Altitude, positive down) */ static inline int16_t mavlink_msg_global_position_int_get_vz(const mavlink_message_t* msg) { @@ -380,7 +380,7 @@ static inline int16_t mavlink_msg_global_position_int_get_vz(const mavlink_messa /** * @brief Get field hdg from global_position_int message * - * @return Vehicle heading (yaw angle) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX + * @return [cdeg] Vehicle heading (yaw angle), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX */ static inline uint16_t mavlink_msg_global_position_int_get_hdg(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_global_position_int_cov.h b/lib/main/MAVLink/common/mavlink_msg_global_position_int_cov.h index 0d33faf58b..3cb44be787 100755 --- a/lib/main/MAVLink/common/mavlink_msg_global_position_int_cov.h +++ b/lib/main/MAVLink/common/mavlink_msg_global_position_int_cov.h @@ -3,19 +3,19 @@ #define MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV 63 -MAVPACKED( + typedef struct __mavlink_global_position_int_cov_t { - uint64_t time_usec; /*< Timestamp (microseconds since system boot or since UNIX epoch)*/ - int32_t lat; /*< Latitude, expressed as degrees * 1E7*/ - int32_t lon; /*< Longitude, expressed as degrees * 1E7*/ - int32_t alt; /*< Altitude in meters, expressed as * 1000 (millimeters), above MSL*/ - int32_t relative_alt; /*< Altitude above ground in meters, expressed as * 1000 (millimeters)*/ - float vx; /*< Ground X Speed (Latitude), expressed as m/s*/ - float vy; /*< Ground Y Speed (Longitude), expressed as m/s*/ - float vz; /*< Ground Z Speed (Altitude), expressed as m/s*/ - float covariance[36]; /*< Covariance matrix (first six entries are the first ROW, next six entries are the second row, etc.)*/ - uint8_t estimator_type; /*< Class id of the estimator this estimate originated from.*/ -}) mavlink_global_position_int_cov_t; + uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.*/ + int32_t lat; /*< [degE7] Latitude*/ + int32_t lon; /*< [degE7] Longitude*/ + int32_t alt; /*< [mm] Altitude in meters above MSL*/ + int32_t relative_alt; /*< [mm] Altitude above ground*/ + float vx; /*< [m/s] Ground X Speed (Latitude)*/ + float vy; /*< [m/s] Ground Y Speed (Longitude)*/ + float vz; /*< [m/s] Ground Z Speed (Altitude)*/ + float covariance[36]; /*< Row-major representation of a 6x6 position and velocity 6x6 cross-covariance matrix (states: lat, lon, alt, vx, vy, vz; first six entries are the first ROW, next six entries are the second row, etc.). If unknown, assign NaN value to first element in the array.*/ + uint8_t estimator_type; /*< Class id of the estimator this estimate originated from.*/ +} mavlink_global_position_int_cov_t; #define MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN 181 #define MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_MIN_LEN 181 @@ -33,6 +33,7 @@ typedef struct __mavlink_global_position_int_cov_t { "GLOBAL_POSITION_INT_COV", \ 10, \ { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_global_position_int_cov_t, time_usec) }, \ + { "estimator_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 180, offsetof(mavlink_global_position_int_cov_t, estimator_type) }, \ { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_global_position_int_cov_t, lat) }, \ { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_global_position_int_cov_t, lon) }, \ { "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_global_position_int_cov_t, alt) }, \ @@ -41,7 +42,6 @@ typedef struct __mavlink_global_position_int_cov_t { { "vy", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_global_position_int_cov_t, vy) }, \ { "vz", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_global_position_int_cov_t, vz) }, \ { "covariance", NULL, MAVLINK_TYPE_FLOAT, 36, 36, offsetof(mavlink_global_position_int_cov_t, covariance) }, \ - { "estimator_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 180, offsetof(mavlink_global_position_int_cov_t, estimator_type) }, \ } \ } #else @@ -49,6 +49,7 @@ typedef struct __mavlink_global_position_int_cov_t { "GLOBAL_POSITION_INT_COV", \ 10, \ { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_global_position_int_cov_t, time_usec) }, \ + { "estimator_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 180, offsetof(mavlink_global_position_int_cov_t, estimator_type) }, \ { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_global_position_int_cov_t, lat) }, \ { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_global_position_int_cov_t, lon) }, \ { "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_global_position_int_cov_t, alt) }, \ @@ -57,7 +58,6 @@ typedef struct __mavlink_global_position_int_cov_t { { "vy", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_global_position_int_cov_t, vy) }, \ { "vz", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_global_position_int_cov_t, vz) }, \ { "covariance", NULL, MAVLINK_TYPE_FLOAT, 36, 36, offsetof(mavlink_global_position_int_cov_t, covariance) }, \ - { "estimator_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 180, offsetof(mavlink_global_position_int_cov_t, estimator_type) }, \ } \ } #endif @@ -68,16 +68,16 @@ typedef struct __mavlink_global_position_int_cov_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param time_usec Timestamp (microseconds since system boot or since UNIX epoch) - * @param estimator_type Class id of the estimator this estimate originated from. - * @param lat Latitude, expressed as degrees * 1E7 - * @param lon Longitude, expressed as degrees * 1E7 - * @param alt Altitude in meters, expressed as * 1000 (millimeters), above MSL - * @param relative_alt Altitude above ground in meters, expressed as * 1000 (millimeters) - * @param vx Ground X Speed (Latitude), expressed as m/s - * @param vy Ground Y Speed (Longitude), expressed as m/s - * @param vz Ground Z Speed (Altitude), expressed as m/s - * @param covariance Covariance matrix (first six entries are the first ROW, next six entries are the second row, etc.) + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param estimator_type Class id of the estimator this estimate originated from. + * @param lat [degE7] Latitude + * @param lon [degE7] Longitude + * @param alt [mm] Altitude in meters above MSL + * @param relative_alt [mm] Altitude above ground + * @param vx [m/s] Ground X Speed (Latitude) + * @param vy [m/s] Ground Y Speed (Longitude) + * @param vz [m/s] Ground Z Speed (Altitude) + * @param covariance Row-major representation of a 6x6 position and velocity 6x6 cross-covariance matrix (states: lat, lon, alt, vx, vy, vz; first six entries are the first ROW, next six entries are the second row, etc.). If unknown, assign NaN value to first element in the array. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_global_position_int_cov_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -121,16 +121,16 @@ static inline uint16_t mavlink_msg_global_position_int_cov_pack(uint8_t system_i * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param time_usec Timestamp (microseconds since system boot or since UNIX epoch) - * @param estimator_type Class id of the estimator this estimate originated from. - * @param lat Latitude, expressed as degrees * 1E7 - * @param lon Longitude, expressed as degrees * 1E7 - * @param alt Altitude in meters, expressed as * 1000 (millimeters), above MSL - * @param relative_alt Altitude above ground in meters, expressed as * 1000 (millimeters) - * @param vx Ground X Speed (Latitude), expressed as m/s - * @param vy Ground Y Speed (Longitude), expressed as m/s - * @param vz Ground Z Speed (Altitude), expressed as m/s - * @param covariance Covariance matrix (first six entries are the first ROW, next six entries are the second row, etc.) + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param estimator_type Class id of the estimator this estimate originated from. + * @param lat [degE7] Latitude + * @param lon [degE7] Longitude + * @param alt [mm] Altitude in meters above MSL + * @param relative_alt [mm] Altitude above ground + * @param vx [m/s] Ground X Speed (Latitude) + * @param vy [m/s] Ground Y Speed (Longitude) + * @param vz [m/s] Ground Z Speed (Altitude) + * @param covariance Row-major representation of a 6x6 position and velocity 6x6 cross-covariance matrix (states: lat, lon, alt, vx, vy, vz; first six entries are the first ROW, next six entries are the second row, etc.). If unknown, assign NaN value to first element in the array. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_global_position_int_cov_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -200,16 +200,16 @@ static inline uint16_t mavlink_msg_global_position_int_cov_encode_chan(uint8_t s * @brief Send a global_position_int_cov message * @param chan MAVLink channel to send the message * - * @param time_usec Timestamp (microseconds since system boot or since UNIX epoch) - * @param estimator_type Class id of the estimator this estimate originated from. - * @param lat Latitude, expressed as degrees * 1E7 - * @param lon Longitude, expressed as degrees * 1E7 - * @param alt Altitude in meters, expressed as * 1000 (millimeters), above MSL - * @param relative_alt Altitude above ground in meters, expressed as * 1000 (millimeters) - * @param vx Ground X Speed (Latitude), expressed as m/s - * @param vy Ground Y Speed (Longitude), expressed as m/s - * @param vz Ground Z Speed (Altitude), expressed as m/s - * @param covariance Covariance matrix (first six entries are the first ROW, next six entries are the second row, etc.) + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param estimator_type Class id of the estimator this estimate originated from. + * @param lat [degE7] Latitude + * @param lon [degE7] Longitude + * @param alt [mm] Altitude in meters above MSL + * @param relative_alt [mm] Altitude above ground + * @param vx [m/s] Ground X Speed (Latitude) + * @param vy [m/s] Ground Y Speed (Longitude) + * @param vz [m/s] Ground Z Speed (Altitude) + * @param covariance Row-major representation of a 6x6 position and velocity 6x6 cross-covariance matrix (states: lat, lon, alt, vx, vy, vz; first six entries are the first ROW, next six entries are the second row, etc.). If unknown, assign NaN value to first element in the array. */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -306,7 +306,7 @@ static inline void mavlink_msg_global_position_int_cov_send_buf(mavlink_message_ /** * @brief Get field time_usec from global_position_int_cov message * - * @return Timestamp (microseconds since system boot or since UNIX epoch) + * @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. */ static inline uint64_t mavlink_msg_global_position_int_cov_get_time_usec(const mavlink_message_t* msg) { @@ -316,7 +316,7 @@ static inline uint64_t mavlink_msg_global_position_int_cov_get_time_usec(const m /** * @brief Get field estimator_type from global_position_int_cov message * - * @return Class id of the estimator this estimate originated from. + * @return Class id of the estimator this estimate originated from. */ static inline uint8_t mavlink_msg_global_position_int_cov_get_estimator_type(const mavlink_message_t* msg) { @@ -326,7 +326,7 @@ static inline uint8_t mavlink_msg_global_position_int_cov_get_estimator_type(con /** * @brief Get field lat from global_position_int_cov message * - * @return Latitude, expressed as degrees * 1E7 + * @return [degE7] Latitude */ static inline int32_t mavlink_msg_global_position_int_cov_get_lat(const mavlink_message_t* msg) { @@ -336,7 +336,7 @@ static inline int32_t mavlink_msg_global_position_int_cov_get_lat(const mavlink_ /** * @brief Get field lon from global_position_int_cov message * - * @return Longitude, expressed as degrees * 1E7 + * @return [degE7] Longitude */ static inline int32_t mavlink_msg_global_position_int_cov_get_lon(const mavlink_message_t* msg) { @@ -346,7 +346,7 @@ static inline int32_t mavlink_msg_global_position_int_cov_get_lon(const mavlink_ /** * @brief Get field alt from global_position_int_cov message * - * @return Altitude in meters, expressed as * 1000 (millimeters), above MSL + * @return [mm] Altitude in meters above MSL */ static inline int32_t mavlink_msg_global_position_int_cov_get_alt(const mavlink_message_t* msg) { @@ -356,7 +356,7 @@ static inline int32_t mavlink_msg_global_position_int_cov_get_alt(const mavlink_ /** * @brief Get field relative_alt from global_position_int_cov message * - * @return Altitude above ground in meters, expressed as * 1000 (millimeters) + * @return [mm] Altitude above ground */ static inline int32_t mavlink_msg_global_position_int_cov_get_relative_alt(const mavlink_message_t* msg) { @@ -366,7 +366,7 @@ static inline int32_t mavlink_msg_global_position_int_cov_get_relative_alt(const /** * @brief Get field vx from global_position_int_cov message * - * @return Ground X Speed (Latitude), expressed as m/s + * @return [m/s] Ground X Speed (Latitude) */ static inline float mavlink_msg_global_position_int_cov_get_vx(const mavlink_message_t* msg) { @@ -376,7 +376,7 @@ static inline float mavlink_msg_global_position_int_cov_get_vx(const mavlink_mes /** * @brief Get field vy from global_position_int_cov message * - * @return Ground Y Speed (Longitude), expressed as m/s + * @return [m/s] Ground Y Speed (Longitude) */ static inline float mavlink_msg_global_position_int_cov_get_vy(const mavlink_message_t* msg) { @@ -386,7 +386,7 @@ static inline float mavlink_msg_global_position_int_cov_get_vy(const mavlink_mes /** * @brief Get field vz from global_position_int_cov message * - * @return Ground Z Speed (Altitude), expressed as m/s + * @return [m/s] Ground Z Speed (Altitude) */ static inline float mavlink_msg_global_position_int_cov_get_vz(const mavlink_message_t* msg) { @@ -396,7 +396,7 @@ static inline float mavlink_msg_global_position_int_cov_get_vz(const mavlink_mes /** * @brief Get field covariance from global_position_int_cov message * - * @return Covariance matrix (first six entries are the first ROW, next six entries are the second row, etc.) + * @return Row-major representation of a 6x6 position and velocity 6x6 cross-covariance matrix (states: lat, lon, alt, vx, vy, vz; first six entries are the first ROW, next six entries are the second row, etc.). If unknown, assign NaN value to first element in the array. */ static inline uint16_t mavlink_msg_global_position_int_cov_get_covariance(const mavlink_message_t* msg, float *covariance) { diff --git a/lib/main/MAVLink/common/mavlink_msg_global_vision_position_estimate.h b/lib/main/MAVLink/common/mavlink_msg_global_vision_position_estimate.h index 6b65eb0631..5f191fe3ad 100755 --- a/lib/main/MAVLink/common/mavlink_msg_global_vision_position_estimate.h +++ b/lib/main/MAVLink/common/mavlink_msg_global_vision_position_estimate.h @@ -3,16 +3,16 @@ #define MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE 101 -MAVPACKED( + typedef struct __mavlink_global_vision_position_estimate_t { - uint64_t usec; /*< Timestamp (microseconds, synced to UNIX time or since system boot)*/ - float x; /*< Global X position*/ - float y; /*< Global Y position*/ - float z; /*< Global Z position*/ - float roll; /*< Roll angle in rad*/ - float pitch; /*< Pitch angle in rad*/ - float yaw; /*< Yaw angle in rad*/ -}) mavlink_global_vision_position_estimate_t; + uint64_t usec; /*< [us] Timestamp (UNIX time or since system boot)*/ + float x; /*< [m] Global X position*/ + float y; /*< [m] Global Y position*/ + float z; /*< [m] Global Z position*/ + float roll; /*< [rad] Roll angle*/ + float pitch; /*< [rad] Pitch angle*/ + float yaw; /*< [rad] Yaw angle*/ +} mavlink_global_vision_position_estimate_t; #define MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN 32 #define MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_MIN_LEN 32 @@ -59,13 +59,13 @@ typedef struct __mavlink_global_vision_position_estimate_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param usec Timestamp (microseconds, synced to UNIX time or since system boot) - * @param x Global X position - * @param y Global Y position - * @param z Global Z position - * @param roll Roll angle in rad - * @param pitch Pitch angle in rad - * @param yaw Yaw angle in rad + * @param usec [us] Timestamp (UNIX time or since system boot) + * @param x [m] Global X position + * @param y [m] Global Y position + * @param z [m] Global Z position + * @param roll [rad] Roll angle + * @param pitch [rad] Pitch angle + * @param yaw [rad] Yaw angle * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_global_vision_position_estimate_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -105,13 +105,13 @@ static inline uint16_t mavlink_msg_global_vision_position_estimate_pack(uint8_t * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param usec Timestamp (microseconds, synced to UNIX time or since system boot) - * @param x Global X position - * @param y Global Y position - * @param z Global Z position - * @param roll Roll angle in rad - * @param pitch Pitch angle in rad - * @param yaw Yaw angle in rad + * @param usec [us] Timestamp (UNIX time or since system boot) + * @param x [m] Global X position + * @param y [m] Global Y position + * @param z [m] Global Z position + * @param roll [rad] Roll angle + * @param pitch [rad] Pitch angle + * @param yaw [rad] Yaw angle * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_global_vision_position_estimate_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -177,13 +177,13 @@ static inline uint16_t mavlink_msg_global_vision_position_estimate_encode_chan(u * @brief Send a global_vision_position_estimate message * @param chan MAVLink channel to send the message * - * @param usec Timestamp (microseconds, synced to UNIX time or since system boot) - * @param x Global X position - * @param y Global Y position - * @param z Global Z position - * @param roll Roll angle in rad - * @param pitch Pitch angle in rad - * @param yaw Yaw angle in rad + * @param usec [us] Timestamp (UNIX time or since system boot) + * @param x [m] Global X position + * @param y [m] Global Y position + * @param z [m] Global Z position + * @param roll [rad] Roll angle + * @param pitch [rad] Pitch angle + * @param yaw [rad] Yaw angle */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -272,7 +272,7 @@ static inline void mavlink_msg_global_vision_position_estimate_send_buf(mavlink_ /** * @brief Get field usec from global_vision_position_estimate message * - * @return Timestamp (microseconds, synced to UNIX time or since system boot) + * @return [us] Timestamp (UNIX time or since system boot) */ static inline uint64_t mavlink_msg_global_vision_position_estimate_get_usec(const mavlink_message_t* msg) { @@ -282,7 +282,7 @@ static inline uint64_t mavlink_msg_global_vision_position_estimate_get_usec(cons /** * @brief Get field x from global_vision_position_estimate message * - * @return Global X position + * @return [m] Global X position */ static inline float mavlink_msg_global_vision_position_estimate_get_x(const mavlink_message_t* msg) { @@ -292,7 +292,7 @@ static inline float mavlink_msg_global_vision_position_estimate_get_x(const mavl /** * @brief Get field y from global_vision_position_estimate message * - * @return Global Y position + * @return [m] Global Y position */ static inline float mavlink_msg_global_vision_position_estimate_get_y(const mavlink_message_t* msg) { @@ -302,7 +302,7 @@ static inline float mavlink_msg_global_vision_position_estimate_get_y(const mavl /** * @brief Get field z from global_vision_position_estimate message * - * @return Global Z position + * @return [m] Global Z position */ static inline float mavlink_msg_global_vision_position_estimate_get_z(const mavlink_message_t* msg) { @@ -312,7 +312,7 @@ static inline float mavlink_msg_global_vision_position_estimate_get_z(const mavl /** * @brief Get field roll from global_vision_position_estimate message * - * @return Roll angle in rad + * @return [rad] Roll angle */ static inline float mavlink_msg_global_vision_position_estimate_get_roll(const mavlink_message_t* msg) { @@ -322,7 +322,7 @@ static inline float mavlink_msg_global_vision_position_estimate_get_roll(const m /** * @brief Get field pitch from global_vision_position_estimate message * - * @return Pitch angle in rad + * @return [rad] Pitch angle */ static inline float mavlink_msg_global_vision_position_estimate_get_pitch(const mavlink_message_t* msg) { @@ -332,7 +332,7 @@ static inline float mavlink_msg_global_vision_position_estimate_get_pitch(const /** * @brief Get field yaw from global_vision_position_estimate message * - * @return Yaw angle in rad + * @return [rad] Yaw angle */ static inline float mavlink_msg_global_vision_position_estimate_get_yaw(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_gps2_raw.h b/lib/main/MAVLink/common/mavlink_msg_gps2_raw.h index aeccc4eb33..330b7e96dd 100755 --- a/lib/main/MAVLink/common/mavlink_msg_gps2_raw.h +++ b/lib/main/MAVLink/common/mavlink_msg_gps2_raw.h @@ -3,21 +3,21 @@ #define MAVLINK_MSG_ID_GPS2_RAW 124 -MAVPACKED( + typedef struct __mavlink_gps2_raw_t { - uint64_t time_usec; /*< Timestamp (microseconds since UNIX epoch or microseconds since system boot)*/ - int32_t lat; /*< Latitude (WGS84), in degrees * 1E7*/ - int32_t lon; /*< Longitude (WGS84), in degrees * 1E7*/ - int32_t alt; /*< Altitude (AMSL, not WGS84), in meters * 1000 (positive for up)*/ - uint32_t dgps_age; /*< Age of DGPS info*/ - uint16_t eph; /*< GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: UINT16_MAX*/ - uint16_t epv; /*< GPS VDOP vertical dilution of position in cm (m*100). If unknown, set to: UINT16_MAX*/ - uint16_t vel; /*< GPS ground speed (m/s * 100). If unknown, set to: UINT16_MAX*/ - uint16_t cog; /*< Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX*/ - uint8_t fix_type; /*< See the GPS_FIX_TYPE enum.*/ - uint8_t satellites_visible; /*< Number of satellites visible. If unknown, set to 255*/ - uint8_t dgps_numch; /*< Number of DGPS satellites*/ -}) mavlink_gps2_raw_t; + uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.*/ + int32_t lat; /*< [degE7] Latitude (WGS84)*/ + int32_t lon; /*< [degE7] Longitude (WGS84)*/ + int32_t alt; /*< [mm] Altitude (MSL). Positive for up.*/ + uint32_t dgps_age; /*< [ms] Age of DGPS info*/ + uint16_t eph; /*< [cm] GPS HDOP horizontal dilution of position. If unknown, set to: UINT16_MAX*/ + uint16_t epv; /*< [cm] GPS VDOP vertical dilution of position. If unknown, set to: UINT16_MAX*/ + uint16_t vel; /*< [cm/s] GPS ground speed. If unknown, set to: UINT16_MAX*/ + uint16_t cog; /*< [cdeg] Course over ground (NOT heading, but direction of movement): 0.0..359.99 degrees. If unknown, set to: UINT16_MAX*/ + uint8_t fix_type; /*< GPS fix type.*/ + uint8_t satellites_visible; /*< Number of satellites visible. If unknown, set to 255*/ + uint8_t dgps_numch; /*< Number of DGPS satellites*/ +} mavlink_gps2_raw_t; #define MAVLINK_MSG_ID_GPS2_RAW_LEN 35 #define MAVLINK_MSG_ID_GPS2_RAW_MIN_LEN 35 @@ -35,17 +35,17 @@ typedef struct __mavlink_gps2_raw_t { "GPS2_RAW", \ 12, \ { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_gps2_raw_t, time_usec) }, \ + { "fix_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_gps2_raw_t, fix_type) }, \ { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_gps2_raw_t, lat) }, \ { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_gps2_raw_t, lon) }, \ { "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_gps2_raw_t, alt) }, \ - { "dgps_age", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_gps2_raw_t, dgps_age) }, \ { "eph", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_gps2_raw_t, eph) }, \ { "epv", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_gps2_raw_t, epv) }, \ { "vel", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_gps2_raw_t, vel) }, \ { "cog", NULL, MAVLINK_TYPE_UINT16_T, 0, 30, offsetof(mavlink_gps2_raw_t, cog) }, \ - { "fix_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_gps2_raw_t, fix_type) }, \ { "satellites_visible", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_gps2_raw_t, satellites_visible) }, \ { "dgps_numch", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_gps2_raw_t, dgps_numch) }, \ + { "dgps_age", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_gps2_raw_t, dgps_age) }, \ } \ } #else @@ -53,17 +53,17 @@ typedef struct __mavlink_gps2_raw_t { "GPS2_RAW", \ 12, \ { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_gps2_raw_t, time_usec) }, \ + { "fix_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_gps2_raw_t, fix_type) }, \ { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_gps2_raw_t, lat) }, \ { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_gps2_raw_t, lon) }, \ { "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_gps2_raw_t, alt) }, \ - { "dgps_age", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_gps2_raw_t, dgps_age) }, \ { "eph", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_gps2_raw_t, eph) }, \ { "epv", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_gps2_raw_t, epv) }, \ { "vel", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_gps2_raw_t, vel) }, \ { "cog", NULL, MAVLINK_TYPE_UINT16_T, 0, 30, offsetof(mavlink_gps2_raw_t, cog) }, \ - { "fix_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_gps2_raw_t, fix_type) }, \ { "satellites_visible", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_gps2_raw_t, satellites_visible) }, \ { "dgps_numch", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_gps2_raw_t, dgps_numch) }, \ + { "dgps_age", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_gps2_raw_t, dgps_age) }, \ } \ } #endif @@ -74,18 +74,18 @@ typedef struct __mavlink_gps2_raw_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot) - * @param fix_type See the GPS_FIX_TYPE enum. - * @param lat Latitude (WGS84), in degrees * 1E7 - * @param lon Longitude (WGS84), in degrees * 1E7 - * @param alt Altitude (AMSL, not WGS84), in meters * 1000 (positive for up) - * @param eph GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: UINT16_MAX - * @param epv GPS VDOP vertical dilution of position in cm (m*100). If unknown, set to: UINT16_MAX - * @param vel GPS ground speed (m/s * 100). If unknown, set to: UINT16_MAX - * @param cog Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX - * @param satellites_visible Number of satellites visible. If unknown, set to 255 - * @param dgps_numch Number of DGPS satellites - * @param dgps_age Age of DGPS info + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param fix_type GPS fix type. + * @param lat [degE7] Latitude (WGS84) + * @param lon [degE7] Longitude (WGS84) + * @param alt [mm] Altitude (MSL). Positive for up. + * @param eph [cm] GPS HDOP horizontal dilution of position. If unknown, set to: UINT16_MAX + * @param epv [cm] GPS VDOP vertical dilution of position. If unknown, set to: UINT16_MAX + * @param vel [cm/s] GPS ground speed. If unknown, set to: UINT16_MAX + * @param cog [cdeg] Course over ground (NOT heading, but direction of movement): 0.0..359.99 degrees. If unknown, set to: UINT16_MAX + * @param satellites_visible Number of satellites visible. If unknown, set to 255 + * @param dgps_numch Number of DGPS satellites + * @param dgps_age [ms] Age of DGPS info * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_gps2_raw_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -135,18 +135,18 @@ static inline uint16_t mavlink_msg_gps2_raw_pack(uint8_t system_id, uint8_t comp * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot) - * @param fix_type See the GPS_FIX_TYPE enum. - * @param lat Latitude (WGS84), in degrees * 1E7 - * @param lon Longitude (WGS84), in degrees * 1E7 - * @param alt Altitude (AMSL, not WGS84), in meters * 1000 (positive for up) - * @param eph GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: UINT16_MAX - * @param epv GPS VDOP vertical dilution of position in cm (m*100). If unknown, set to: UINT16_MAX - * @param vel GPS ground speed (m/s * 100). If unknown, set to: UINT16_MAX - * @param cog Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX - * @param satellites_visible Number of satellites visible. If unknown, set to 255 - * @param dgps_numch Number of DGPS satellites - * @param dgps_age Age of DGPS info + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param fix_type GPS fix type. + * @param lat [degE7] Latitude (WGS84) + * @param lon [degE7] Longitude (WGS84) + * @param alt [mm] Altitude (MSL). Positive for up. + * @param eph [cm] GPS HDOP horizontal dilution of position. If unknown, set to: UINT16_MAX + * @param epv [cm] GPS VDOP vertical dilution of position. If unknown, set to: UINT16_MAX + * @param vel [cm/s] GPS ground speed. If unknown, set to: UINT16_MAX + * @param cog [cdeg] Course over ground (NOT heading, but direction of movement): 0.0..359.99 degrees. If unknown, set to: UINT16_MAX + * @param satellites_visible Number of satellites visible. If unknown, set to 255 + * @param dgps_numch Number of DGPS satellites + * @param dgps_age [ms] Age of DGPS info * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_gps2_raw_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -222,18 +222,18 @@ static inline uint16_t mavlink_msg_gps2_raw_encode_chan(uint8_t system_id, uint8 * @brief Send a gps2_raw message * @param chan MAVLink channel to send the message * - * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot) - * @param fix_type See the GPS_FIX_TYPE enum. - * @param lat Latitude (WGS84), in degrees * 1E7 - * @param lon Longitude (WGS84), in degrees * 1E7 - * @param alt Altitude (AMSL, not WGS84), in meters * 1000 (positive for up) - * @param eph GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: UINT16_MAX - * @param epv GPS VDOP vertical dilution of position in cm (m*100). If unknown, set to: UINT16_MAX - * @param vel GPS ground speed (m/s * 100). If unknown, set to: UINT16_MAX - * @param cog Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX - * @param satellites_visible Number of satellites visible. If unknown, set to 255 - * @param dgps_numch Number of DGPS satellites - * @param dgps_age Age of DGPS info + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param fix_type GPS fix type. + * @param lat [degE7] Latitude (WGS84) + * @param lon [degE7] Longitude (WGS84) + * @param alt [mm] Altitude (MSL). Positive for up. + * @param eph [cm] GPS HDOP horizontal dilution of position. If unknown, set to: UINT16_MAX + * @param epv [cm] GPS VDOP vertical dilution of position. If unknown, set to: UINT16_MAX + * @param vel [cm/s] GPS ground speed. If unknown, set to: UINT16_MAX + * @param cog [cdeg] Course over ground (NOT heading, but direction of movement): 0.0..359.99 degrees. If unknown, set to: UINT16_MAX + * @param satellites_visible Number of satellites visible. If unknown, set to 255 + * @param dgps_numch Number of DGPS satellites + * @param dgps_age [ms] Age of DGPS info */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -342,7 +342,7 @@ static inline void mavlink_msg_gps2_raw_send_buf(mavlink_message_t *msgbuf, mavl /** * @brief Get field time_usec from gps2_raw message * - * @return Timestamp (microseconds since UNIX epoch or microseconds since system boot) + * @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. */ static inline uint64_t mavlink_msg_gps2_raw_get_time_usec(const mavlink_message_t* msg) { @@ -352,7 +352,7 @@ static inline uint64_t mavlink_msg_gps2_raw_get_time_usec(const mavlink_message_ /** * @brief Get field fix_type from gps2_raw message * - * @return See the GPS_FIX_TYPE enum. + * @return GPS fix type. */ static inline uint8_t mavlink_msg_gps2_raw_get_fix_type(const mavlink_message_t* msg) { @@ -362,7 +362,7 @@ static inline uint8_t mavlink_msg_gps2_raw_get_fix_type(const mavlink_message_t* /** * @brief Get field lat from gps2_raw message * - * @return Latitude (WGS84), in degrees * 1E7 + * @return [degE7] Latitude (WGS84) */ static inline int32_t mavlink_msg_gps2_raw_get_lat(const mavlink_message_t* msg) { @@ -372,7 +372,7 @@ static inline int32_t mavlink_msg_gps2_raw_get_lat(const mavlink_message_t* msg) /** * @brief Get field lon from gps2_raw message * - * @return Longitude (WGS84), in degrees * 1E7 + * @return [degE7] Longitude (WGS84) */ static inline int32_t mavlink_msg_gps2_raw_get_lon(const mavlink_message_t* msg) { @@ -382,7 +382,7 @@ static inline int32_t mavlink_msg_gps2_raw_get_lon(const mavlink_message_t* msg) /** * @brief Get field alt from gps2_raw message * - * @return Altitude (AMSL, not WGS84), in meters * 1000 (positive for up) + * @return [mm] Altitude (MSL). Positive for up. */ static inline int32_t mavlink_msg_gps2_raw_get_alt(const mavlink_message_t* msg) { @@ -392,7 +392,7 @@ static inline int32_t mavlink_msg_gps2_raw_get_alt(const mavlink_message_t* msg) /** * @brief Get field eph from gps2_raw message * - * @return GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: UINT16_MAX + * @return [cm] GPS HDOP horizontal dilution of position. If unknown, set to: UINT16_MAX */ static inline uint16_t mavlink_msg_gps2_raw_get_eph(const mavlink_message_t* msg) { @@ -402,7 +402,7 @@ static inline uint16_t mavlink_msg_gps2_raw_get_eph(const mavlink_message_t* msg /** * @brief Get field epv from gps2_raw message * - * @return GPS VDOP vertical dilution of position in cm (m*100). If unknown, set to: UINT16_MAX + * @return [cm] GPS VDOP vertical dilution of position. If unknown, set to: UINT16_MAX */ static inline uint16_t mavlink_msg_gps2_raw_get_epv(const mavlink_message_t* msg) { @@ -412,7 +412,7 @@ static inline uint16_t mavlink_msg_gps2_raw_get_epv(const mavlink_message_t* msg /** * @brief Get field vel from gps2_raw message * - * @return GPS ground speed (m/s * 100). If unknown, set to: UINT16_MAX + * @return [cm/s] GPS ground speed. If unknown, set to: UINT16_MAX */ static inline uint16_t mavlink_msg_gps2_raw_get_vel(const mavlink_message_t* msg) { @@ -422,7 +422,7 @@ static inline uint16_t mavlink_msg_gps2_raw_get_vel(const mavlink_message_t* msg /** * @brief Get field cog from gps2_raw message * - * @return Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX + * @return [cdeg] Course over ground (NOT heading, but direction of movement): 0.0..359.99 degrees. If unknown, set to: UINT16_MAX */ static inline uint16_t mavlink_msg_gps2_raw_get_cog(const mavlink_message_t* msg) { @@ -432,7 +432,7 @@ static inline uint16_t mavlink_msg_gps2_raw_get_cog(const mavlink_message_t* msg /** * @brief Get field satellites_visible from gps2_raw message * - * @return Number of satellites visible. If unknown, set to 255 + * @return Number of satellites visible. If unknown, set to 255 */ static inline uint8_t mavlink_msg_gps2_raw_get_satellites_visible(const mavlink_message_t* msg) { @@ -442,7 +442,7 @@ static inline uint8_t mavlink_msg_gps2_raw_get_satellites_visible(const mavlink_ /** * @brief Get field dgps_numch from gps2_raw message * - * @return Number of DGPS satellites + * @return Number of DGPS satellites */ static inline uint8_t mavlink_msg_gps2_raw_get_dgps_numch(const mavlink_message_t* msg) { @@ -452,7 +452,7 @@ static inline uint8_t mavlink_msg_gps2_raw_get_dgps_numch(const mavlink_message_ /** * @brief Get field dgps_age from gps2_raw message * - * @return Age of DGPS info + * @return [ms] Age of DGPS info */ static inline uint32_t mavlink_msg_gps2_raw_get_dgps_age(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_gps2_rtk.h b/lib/main/MAVLink/common/mavlink_msg_gps2_rtk.h index e383647232..2af9b53ca7 100755 --- a/lib/main/MAVLink/common/mavlink_msg_gps2_rtk.h +++ b/lib/main/MAVLink/common/mavlink_msg_gps2_rtk.h @@ -3,22 +3,22 @@ #define MAVLINK_MSG_ID_GPS2_RTK 128 -MAVPACKED( + typedef struct __mavlink_gps2_rtk_t { - uint32_t time_last_baseline_ms; /*< Time since boot of last baseline message received in ms.*/ - uint32_t tow; /*< GPS Time of Week of last baseline*/ - int32_t baseline_a_mm; /*< Current baseline in ECEF x or NED north component in mm.*/ - int32_t baseline_b_mm; /*< Current baseline in ECEF y or NED east component in mm.*/ - int32_t baseline_c_mm; /*< Current baseline in ECEF z or NED down component in mm.*/ - uint32_t accuracy; /*< Current estimate of baseline accuracy.*/ - int32_t iar_num_hypotheses; /*< Current number of integer ambiguity hypotheses.*/ - uint16_t wn; /*< GPS Week Number of last baseline*/ - uint8_t rtk_receiver_id; /*< Identification of connected RTK receiver.*/ - uint8_t rtk_health; /*< GPS-specific health report for RTK data.*/ - uint8_t rtk_rate; /*< Rate of baseline messages being received by GPS, in HZ*/ - uint8_t nsats; /*< Current number of sats used for RTK calculation.*/ - uint8_t baseline_coords_type; /*< Coordinate system of baseline. 0 == ECEF, 1 == NED*/ -}) mavlink_gps2_rtk_t; + uint32_t time_last_baseline_ms; /*< [ms] Time since boot of last baseline message received.*/ + uint32_t tow; /*< [ms] GPS Time of Week of last baseline*/ + int32_t baseline_a_mm; /*< [mm] Current baseline in ECEF x or NED north component.*/ + int32_t baseline_b_mm; /*< [mm] Current baseline in ECEF y or NED east component.*/ + int32_t baseline_c_mm; /*< [mm] Current baseline in ECEF z or NED down component.*/ + uint32_t accuracy; /*< Current estimate of baseline accuracy.*/ + int32_t iar_num_hypotheses; /*< Current number of integer ambiguity hypotheses.*/ + uint16_t wn; /*< GPS Week Number of last baseline*/ + uint8_t rtk_receiver_id; /*< Identification of connected RTK receiver.*/ + uint8_t rtk_health; /*< GPS-specific health report for RTK data.*/ + uint8_t rtk_rate; /*< [Hz] Rate of baseline messages being received by GPS*/ + uint8_t nsats; /*< Current number of sats used for RTK calculation.*/ + uint8_t baseline_coords_type; /*< Coordinate system of baseline*/ +} mavlink_gps2_rtk_t; #define MAVLINK_MSG_ID_GPS2_RTK_LEN 35 #define MAVLINK_MSG_ID_GPS2_RTK_MIN_LEN 35 @@ -36,18 +36,18 @@ typedef struct __mavlink_gps2_rtk_t { "GPS2_RTK", \ 13, \ { { "time_last_baseline_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_gps2_rtk_t, time_last_baseline_ms) }, \ + { "rtk_receiver_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_gps2_rtk_t, rtk_receiver_id) }, \ + { "wn", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_gps2_rtk_t, wn) }, \ { "tow", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_gps2_rtk_t, tow) }, \ + { "rtk_health", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_gps2_rtk_t, rtk_health) }, \ + { "rtk_rate", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_gps2_rtk_t, rtk_rate) }, \ + { "nsats", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_gps2_rtk_t, nsats) }, \ + { "baseline_coords_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_gps2_rtk_t, baseline_coords_type) }, \ { "baseline_a_mm", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_gps2_rtk_t, baseline_a_mm) }, \ { "baseline_b_mm", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_gps2_rtk_t, baseline_b_mm) }, \ { "baseline_c_mm", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_gps2_rtk_t, baseline_c_mm) }, \ { "accuracy", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_gps2_rtk_t, accuracy) }, \ { "iar_num_hypotheses", NULL, MAVLINK_TYPE_INT32_T, 0, 24, offsetof(mavlink_gps2_rtk_t, iar_num_hypotheses) }, \ - { "wn", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_gps2_rtk_t, wn) }, \ - { "rtk_receiver_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_gps2_rtk_t, rtk_receiver_id) }, \ - { "rtk_health", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_gps2_rtk_t, rtk_health) }, \ - { "rtk_rate", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_gps2_rtk_t, rtk_rate) }, \ - { "nsats", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_gps2_rtk_t, nsats) }, \ - { "baseline_coords_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_gps2_rtk_t, baseline_coords_type) }, \ } \ } #else @@ -55,18 +55,18 @@ typedef struct __mavlink_gps2_rtk_t { "GPS2_RTK", \ 13, \ { { "time_last_baseline_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_gps2_rtk_t, time_last_baseline_ms) }, \ + { "rtk_receiver_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_gps2_rtk_t, rtk_receiver_id) }, \ + { "wn", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_gps2_rtk_t, wn) }, \ { "tow", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_gps2_rtk_t, tow) }, \ + { "rtk_health", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_gps2_rtk_t, rtk_health) }, \ + { "rtk_rate", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_gps2_rtk_t, rtk_rate) }, \ + { "nsats", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_gps2_rtk_t, nsats) }, \ + { "baseline_coords_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_gps2_rtk_t, baseline_coords_type) }, \ { "baseline_a_mm", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_gps2_rtk_t, baseline_a_mm) }, \ { "baseline_b_mm", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_gps2_rtk_t, baseline_b_mm) }, \ { "baseline_c_mm", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_gps2_rtk_t, baseline_c_mm) }, \ { "accuracy", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_gps2_rtk_t, accuracy) }, \ { "iar_num_hypotheses", NULL, MAVLINK_TYPE_INT32_T, 0, 24, offsetof(mavlink_gps2_rtk_t, iar_num_hypotheses) }, \ - { "wn", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_gps2_rtk_t, wn) }, \ - { "rtk_receiver_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_gps2_rtk_t, rtk_receiver_id) }, \ - { "rtk_health", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_gps2_rtk_t, rtk_health) }, \ - { "rtk_rate", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_gps2_rtk_t, rtk_rate) }, \ - { "nsats", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_gps2_rtk_t, nsats) }, \ - { "baseline_coords_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_gps2_rtk_t, baseline_coords_type) }, \ } \ } #endif @@ -77,19 +77,19 @@ typedef struct __mavlink_gps2_rtk_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param time_last_baseline_ms Time since boot of last baseline message received in ms. - * @param rtk_receiver_id Identification of connected RTK receiver. - * @param wn GPS Week Number of last baseline - * @param tow GPS Time of Week of last baseline - * @param rtk_health GPS-specific health report for RTK data. - * @param rtk_rate Rate of baseline messages being received by GPS, in HZ - * @param nsats Current number of sats used for RTK calculation. - * @param baseline_coords_type Coordinate system of baseline. 0 == ECEF, 1 == NED - * @param baseline_a_mm Current baseline in ECEF x or NED north component in mm. - * @param baseline_b_mm Current baseline in ECEF y or NED east component in mm. - * @param baseline_c_mm Current baseline in ECEF z or NED down component in mm. - * @param accuracy Current estimate of baseline accuracy. - * @param iar_num_hypotheses Current number of integer ambiguity hypotheses. + * @param time_last_baseline_ms [ms] Time since boot of last baseline message received. + * @param rtk_receiver_id Identification of connected RTK receiver. + * @param wn GPS Week Number of last baseline + * @param tow [ms] GPS Time of Week of last baseline + * @param rtk_health GPS-specific health report for RTK data. + * @param rtk_rate [Hz] Rate of baseline messages being received by GPS + * @param nsats Current number of sats used for RTK calculation. + * @param baseline_coords_type Coordinate system of baseline + * @param baseline_a_mm [mm] Current baseline in ECEF x or NED north component. + * @param baseline_b_mm [mm] Current baseline in ECEF y or NED east component. + * @param baseline_c_mm [mm] Current baseline in ECEF z or NED down component. + * @param accuracy Current estimate of baseline accuracy. + * @param iar_num_hypotheses Current number of integer ambiguity hypotheses. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_gps2_rtk_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -141,19 +141,19 @@ static inline uint16_t mavlink_msg_gps2_rtk_pack(uint8_t system_id, uint8_t comp * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param time_last_baseline_ms Time since boot of last baseline message received in ms. - * @param rtk_receiver_id Identification of connected RTK receiver. - * @param wn GPS Week Number of last baseline - * @param tow GPS Time of Week of last baseline - * @param rtk_health GPS-specific health report for RTK data. - * @param rtk_rate Rate of baseline messages being received by GPS, in HZ - * @param nsats Current number of sats used for RTK calculation. - * @param baseline_coords_type Coordinate system of baseline. 0 == ECEF, 1 == NED - * @param baseline_a_mm Current baseline in ECEF x or NED north component in mm. - * @param baseline_b_mm Current baseline in ECEF y or NED east component in mm. - * @param baseline_c_mm Current baseline in ECEF z or NED down component in mm. - * @param accuracy Current estimate of baseline accuracy. - * @param iar_num_hypotheses Current number of integer ambiguity hypotheses. + * @param time_last_baseline_ms [ms] Time since boot of last baseline message received. + * @param rtk_receiver_id Identification of connected RTK receiver. + * @param wn GPS Week Number of last baseline + * @param tow [ms] GPS Time of Week of last baseline + * @param rtk_health GPS-specific health report for RTK data. + * @param rtk_rate [Hz] Rate of baseline messages being received by GPS + * @param nsats Current number of sats used for RTK calculation. + * @param baseline_coords_type Coordinate system of baseline + * @param baseline_a_mm [mm] Current baseline in ECEF x or NED north component. + * @param baseline_b_mm [mm] Current baseline in ECEF y or NED east component. + * @param baseline_c_mm [mm] Current baseline in ECEF z or NED down component. + * @param accuracy Current estimate of baseline accuracy. + * @param iar_num_hypotheses Current number of integer ambiguity hypotheses. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_gps2_rtk_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -231,19 +231,19 @@ static inline uint16_t mavlink_msg_gps2_rtk_encode_chan(uint8_t system_id, uint8 * @brief Send a gps2_rtk message * @param chan MAVLink channel to send the message * - * @param time_last_baseline_ms Time since boot of last baseline message received in ms. - * @param rtk_receiver_id Identification of connected RTK receiver. - * @param wn GPS Week Number of last baseline - * @param tow GPS Time of Week of last baseline - * @param rtk_health GPS-specific health report for RTK data. - * @param rtk_rate Rate of baseline messages being received by GPS, in HZ - * @param nsats Current number of sats used for RTK calculation. - * @param baseline_coords_type Coordinate system of baseline. 0 == ECEF, 1 == NED - * @param baseline_a_mm Current baseline in ECEF x or NED north component in mm. - * @param baseline_b_mm Current baseline in ECEF y or NED east component in mm. - * @param baseline_c_mm Current baseline in ECEF z or NED down component in mm. - * @param accuracy Current estimate of baseline accuracy. - * @param iar_num_hypotheses Current number of integer ambiguity hypotheses. + * @param time_last_baseline_ms [ms] Time since boot of last baseline message received. + * @param rtk_receiver_id Identification of connected RTK receiver. + * @param wn GPS Week Number of last baseline + * @param tow [ms] GPS Time of Week of last baseline + * @param rtk_health GPS-specific health report for RTK data. + * @param rtk_rate [Hz] Rate of baseline messages being received by GPS + * @param nsats Current number of sats used for RTK calculation. + * @param baseline_coords_type Coordinate system of baseline + * @param baseline_a_mm [mm] Current baseline in ECEF x or NED north component. + * @param baseline_b_mm [mm] Current baseline in ECEF y or NED east component. + * @param baseline_c_mm [mm] Current baseline in ECEF z or NED down component. + * @param accuracy Current estimate of baseline accuracy. + * @param iar_num_hypotheses Current number of integer ambiguity hypotheses. */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -356,7 +356,7 @@ static inline void mavlink_msg_gps2_rtk_send_buf(mavlink_message_t *msgbuf, mavl /** * @brief Get field time_last_baseline_ms from gps2_rtk message * - * @return Time since boot of last baseline message received in ms. + * @return [ms] Time since boot of last baseline message received. */ static inline uint32_t mavlink_msg_gps2_rtk_get_time_last_baseline_ms(const mavlink_message_t* msg) { @@ -366,7 +366,7 @@ static inline uint32_t mavlink_msg_gps2_rtk_get_time_last_baseline_ms(const mavl /** * @brief Get field rtk_receiver_id from gps2_rtk message * - * @return Identification of connected RTK receiver. + * @return Identification of connected RTK receiver. */ static inline uint8_t mavlink_msg_gps2_rtk_get_rtk_receiver_id(const mavlink_message_t* msg) { @@ -376,7 +376,7 @@ static inline uint8_t mavlink_msg_gps2_rtk_get_rtk_receiver_id(const mavlink_mes /** * @brief Get field wn from gps2_rtk message * - * @return GPS Week Number of last baseline + * @return GPS Week Number of last baseline */ static inline uint16_t mavlink_msg_gps2_rtk_get_wn(const mavlink_message_t* msg) { @@ -386,7 +386,7 @@ static inline uint16_t mavlink_msg_gps2_rtk_get_wn(const mavlink_message_t* msg) /** * @brief Get field tow from gps2_rtk message * - * @return GPS Time of Week of last baseline + * @return [ms] GPS Time of Week of last baseline */ static inline uint32_t mavlink_msg_gps2_rtk_get_tow(const mavlink_message_t* msg) { @@ -396,7 +396,7 @@ static inline uint32_t mavlink_msg_gps2_rtk_get_tow(const mavlink_message_t* msg /** * @brief Get field rtk_health from gps2_rtk message * - * @return GPS-specific health report for RTK data. + * @return GPS-specific health report for RTK data. */ static inline uint8_t mavlink_msg_gps2_rtk_get_rtk_health(const mavlink_message_t* msg) { @@ -406,7 +406,7 @@ static inline uint8_t mavlink_msg_gps2_rtk_get_rtk_health(const mavlink_message_ /** * @brief Get field rtk_rate from gps2_rtk message * - * @return Rate of baseline messages being received by GPS, in HZ + * @return [Hz] Rate of baseline messages being received by GPS */ static inline uint8_t mavlink_msg_gps2_rtk_get_rtk_rate(const mavlink_message_t* msg) { @@ -416,7 +416,7 @@ static inline uint8_t mavlink_msg_gps2_rtk_get_rtk_rate(const mavlink_message_t* /** * @brief Get field nsats from gps2_rtk message * - * @return Current number of sats used for RTK calculation. + * @return Current number of sats used for RTK calculation. */ static inline uint8_t mavlink_msg_gps2_rtk_get_nsats(const mavlink_message_t* msg) { @@ -426,7 +426,7 @@ static inline uint8_t mavlink_msg_gps2_rtk_get_nsats(const mavlink_message_t* ms /** * @brief Get field baseline_coords_type from gps2_rtk message * - * @return Coordinate system of baseline. 0 == ECEF, 1 == NED + * @return Coordinate system of baseline */ static inline uint8_t mavlink_msg_gps2_rtk_get_baseline_coords_type(const mavlink_message_t* msg) { @@ -436,7 +436,7 @@ static inline uint8_t mavlink_msg_gps2_rtk_get_baseline_coords_type(const mavlin /** * @brief Get field baseline_a_mm from gps2_rtk message * - * @return Current baseline in ECEF x or NED north component in mm. + * @return [mm] Current baseline in ECEF x or NED north component. */ static inline int32_t mavlink_msg_gps2_rtk_get_baseline_a_mm(const mavlink_message_t* msg) { @@ -446,7 +446,7 @@ static inline int32_t mavlink_msg_gps2_rtk_get_baseline_a_mm(const mavlink_messa /** * @brief Get field baseline_b_mm from gps2_rtk message * - * @return Current baseline in ECEF y or NED east component in mm. + * @return [mm] Current baseline in ECEF y or NED east component. */ static inline int32_t mavlink_msg_gps2_rtk_get_baseline_b_mm(const mavlink_message_t* msg) { @@ -456,7 +456,7 @@ static inline int32_t mavlink_msg_gps2_rtk_get_baseline_b_mm(const mavlink_messa /** * @brief Get field baseline_c_mm from gps2_rtk message * - * @return Current baseline in ECEF z or NED down component in mm. + * @return [mm] Current baseline in ECEF z or NED down component. */ static inline int32_t mavlink_msg_gps2_rtk_get_baseline_c_mm(const mavlink_message_t* msg) { @@ -466,7 +466,7 @@ static inline int32_t mavlink_msg_gps2_rtk_get_baseline_c_mm(const mavlink_messa /** * @brief Get field accuracy from gps2_rtk message * - * @return Current estimate of baseline accuracy. + * @return Current estimate of baseline accuracy. */ static inline uint32_t mavlink_msg_gps2_rtk_get_accuracy(const mavlink_message_t* msg) { @@ -476,7 +476,7 @@ static inline uint32_t mavlink_msg_gps2_rtk_get_accuracy(const mavlink_message_t /** * @brief Get field iar_num_hypotheses from gps2_rtk message * - * @return Current number of integer ambiguity hypotheses. + * @return Current number of integer ambiguity hypotheses. */ static inline int32_t mavlink_msg_gps2_rtk_get_iar_num_hypotheses(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_gps_global_origin.h b/lib/main/MAVLink/common/mavlink_msg_gps_global_origin.h index 3008058f10..7719543ee2 100755 --- a/lib/main/MAVLink/common/mavlink_msg_gps_global_origin.h +++ b/lib/main/MAVLink/common/mavlink_msg_gps_global_origin.h @@ -3,12 +3,12 @@ #define MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN 49 -MAVPACKED( + typedef struct __mavlink_gps_global_origin_t { - int32_t latitude; /*< Latitude (WGS84), in degrees * 1E7*/ - int32_t longitude; /*< Longitude (WGS84), in degrees * 1E7*/ - int32_t altitude; /*< Altitude (AMSL), in meters * 1000 (positive for up)*/ -}) mavlink_gps_global_origin_t; + int32_t latitude; /*< [degE7] Latitude (WGS84)*/ + int32_t longitude; /*< [degE7] Longitude (WGS84)*/ + int32_t altitude; /*< [mm] Altitude (MSL). Positive for up.*/ +} mavlink_gps_global_origin_t; #define MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN 12 #define MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_MIN_LEN 12 @@ -47,9 +47,9 @@ typedef struct __mavlink_gps_global_origin_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param latitude Latitude (WGS84), in degrees * 1E7 - * @param longitude Longitude (WGS84), in degrees * 1E7 - * @param altitude Altitude (AMSL), in meters * 1000 (positive for up) + * @param latitude [degE7] Latitude (WGS84) + * @param longitude [degE7] Longitude (WGS84) + * @param altitude [mm] Altitude (MSL). Positive for up. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_gps_global_origin_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -81,9 +81,9 @@ static inline uint16_t mavlink_msg_gps_global_origin_pack(uint8_t system_id, uin * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param latitude Latitude (WGS84), in degrees * 1E7 - * @param longitude Longitude (WGS84), in degrees * 1E7 - * @param altitude Altitude (AMSL), in meters * 1000 (positive for up) + * @param latitude [degE7] Latitude (WGS84) + * @param longitude [degE7] Longitude (WGS84) + * @param altitude [mm] Altitude (MSL). Positive for up. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_gps_global_origin_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -141,9 +141,9 @@ static inline uint16_t mavlink_msg_gps_global_origin_encode_chan(uint8_t system_ * @brief Send a gps_global_origin message * @param chan MAVLink channel to send the message * - * @param latitude Latitude (WGS84), in degrees * 1E7 - * @param longitude Longitude (WGS84), in degrees * 1E7 - * @param altitude Altitude (AMSL), in meters * 1000 (positive for up) + * @param latitude [degE7] Latitude (WGS84) + * @param longitude [degE7] Longitude (WGS84) + * @param altitude [mm] Altitude (MSL). Positive for up. */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -216,7 +216,7 @@ static inline void mavlink_msg_gps_global_origin_send_buf(mavlink_message_t *msg /** * @brief Get field latitude from gps_global_origin message * - * @return Latitude (WGS84), in degrees * 1E7 + * @return [degE7] Latitude (WGS84) */ static inline int32_t mavlink_msg_gps_global_origin_get_latitude(const mavlink_message_t* msg) { @@ -226,7 +226,7 @@ static inline int32_t mavlink_msg_gps_global_origin_get_latitude(const mavlink_m /** * @brief Get field longitude from gps_global_origin message * - * @return Longitude (WGS84), in degrees * 1E7 + * @return [degE7] Longitude (WGS84) */ static inline int32_t mavlink_msg_gps_global_origin_get_longitude(const mavlink_message_t* msg) { @@ -236,7 +236,7 @@ static inline int32_t mavlink_msg_gps_global_origin_get_longitude(const mavlink_ /** * @brief Get field altitude from gps_global_origin message * - * @return Altitude (AMSL), in meters * 1000 (positive for up) + * @return [mm] Altitude (MSL). Positive for up. */ static inline int32_t mavlink_msg_gps_global_origin_get_altitude(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_gps_inject_data.h b/lib/main/MAVLink/common/mavlink_msg_gps_inject_data.h index 4fbd5fc976..ff6dc0ee91 100755 --- a/lib/main/MAVLink/common/mavlink_msg_gps_inject_data.h +++ b/lib/main/MAVLink/common/mavlink_msg_gps_inject_data.h @@ -3,13 +3,13 @@ #define MAVLINK_MSG_ID_GPS_INJECT_DATA 123 -MAVPACKED( + typedef struct __mavlink_gps_inject_data_t { - uint8_t target_system; /*< System ID*/ - uint8_t target_component; /*< Component ID*/ - uint8_t len; /*< data length*/ - uint8_t data[110]; /*< raw data (110 is enough for 12 satellites of RTCMv2)*/ -}) mavlink_gps_inject_data_t; + uint8_t target_system; /*< System ID*/ + uint8_t target_component; /*< Component ID*/ + uint8_t len; /*< [bytes] Data length*/ + uint8_t data[110]; /*< Raw data (110 is enough for 12 satellites of RTCMv2)*/ +} mavlink_gps_inject_data_t; #define MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN 113 #define MAVLINK_MSG_ID_GPS_INJECT_DATA_MIN_LEN 113 @@ -50,10 +50,10 @@ typedef struct __mavlink_gps_inject_data_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param target_system System ID - * @param target_component Component ID - * @param len data length - * @param data raw data (110 is enough for 12 satellites of RTCMv2) + * @param target_system System ID + * @param target_component Component ID + * @param len [bytes] Data length + * @param data Raw data (110 is enough for 12 satellites of RTCMv2) * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_gps_inject_data_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -85,10 +85,10 @@ static inline uint16_t mavlink_msg_gps_inject_data_pack(uint8_t system_id, uint8 * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param target_system System ID - * @param target_component Component ID - * @param len data length - * @param data raw data (110 is enough for 12 satellites of RTCMv2) + * @param target_system System ID + * @param target_component Component ID + * @param len [bytes] Data length + * @param data Raw data (110 is enough for 12 satellites of RTCMv2) * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_gps_inject_data_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -146,10 +146,10 @@ static inline uint16_t mavlink_msg_gps_inject_data_encode_chan(uint8_t system_id * @brief Send a gps_inject_data message * @param chan MAVLink channel to send the message * - * @param target_system System ID - * @param target_component Component ID - * @param len data length - * @param data raw data (110 is enough for 12 satellites of RTCMv2) + * @param target_system System ID + * @param target_component Component ID + * @param len [bytes] Data length + * @param data Raw data (110 is enough for 12 satellites of RTCMv2) */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -222,7 +222,7 @@ static inline void mavlink_msg_gps_inject_data_send_buf(mavlink_message_t *msgbu /** * @brief Get field target_system from gps_inject_data message * - * @return System ID + * @return System ID */ static inline uint8_t mavlink_msg_gps_inject_data_get_target_system(const mavlink_message_t* msg) { @@ -232,7 +232,7 @@ static inline uint8_t mavlink_msg_gps_inject_data_get_target_system(const mavlin /** * @brief Get field target_component from gps_inject_data message * - * @return Component ID + * @return Component ID */ static inline uint8_t mavlink_msg_gps_inject_data_get_target_component(const mavlink_message_t* msg) { @@ -242,7 +242,7 @@ static inline uint8_t mavlink_msg_gps_inject_data_get_target_component(const mav /** * @brief Get field len from gps_inject_data message * - * @return data length + * @return [bytes] Data length */ static inline uint8_t mavlink_msg_gps_inject_data_get_len(const mavlink_message_t* msg) { @@ -252,7 +252,7 @@ static inline uint8_t mavlink_msg_gps_inject_data_get_len(const mavlink_message_ /** * @brief Get field data from gps_inject_data message * - * @return raw data (110 is enough for 12 satellites of RTCMv2) + * @return Raw data (110 is enough for 12 satellites of RTCMv2) */ static inline uint16_t mavlink_msg_gps_inject_data_get_data(const mavlink_message_t* msg, uint8_t *data) { diff --git a/lib/main/MAVLink/common/mavlink_msg_gps_input.h b/lib/main/MAVLink/common/mavlink_msg_gps_input.h index 5fb9e9c5a5..6268b11af3 100755 --- a/lib/main/MAVLink/common/mavlink_msg_gps_input.h +++ b/lib/main/MAVLink/common/mavlink_msg_gps_input.h @@ -3,27 +3,27 @@ #define MAVLINK_MSG_ID_GPS_INPUT 232 -MAVPACKED( + typedef struct __mavlink_gps_input_t { - uint64_t time_usec; /*< Timestamp (micros since boot or Unix epoch)*/ - uint32_t time_week_ms; /*< GPS time (milliseconds from start of GPS week)*/ - int32_t lat; /*< Latitude (WGS84), in degrees * 1E7*/ - int32_t lon; /*< Longitude (WGS84), in degrees * 1E7*/ - float alt; /*< Altitude (AMSL, not WGS84), in m (positive for up)*/ - float hdop; /*< GPS HDOP horizontal dilution of position in m*/ - float vdop; /*< GPS VDOP vertical dilution of position in m*/ - float vn; /*< GPS velocity in m/s in NORTH direction in earth-fixed NED frame*/ - float ve; /*< GPS velocity in m/s in EAST direction in earth-fixed NED frame*/ - float vd; /*< GPS velocity in m/s in DOWN direction in earth-fixed NED frame*/ - float speed_accuracy; /*< GPS speed accuracy in m/s*/ - float horiz_accuracy; /*< GPS horizontal accuracy in m*/ - float vert_accuracy; /*< GPS vertical accuracy in m*/ - uint16_t ignore_flags; /*< Flags indicating which fields to ignore (see GPS_INPUT_IGNORE_FLAGS enum). All other fields must be provided.*/ - uint16_t time_week; /*< GPS week number*/ - uint8_t gps_id; /*< ID of the GPS for multiple GPS inputs*/ - uint8_t fix_type; /*< 0-1: no fix, 2: 2D fix, 3: 3D fix. 4: 3D with DGPS. 5: 3D with RTK*/ - uint8_t satellites_visible; /*< Number of satellites visible.*/ -}) mavlink_gps_input_t; + uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.*/ + uint32_t time_week_ms; /*< [ms] GPS time (from start of GPS week)*/ + int32_t lat; /*< [degE7] Latitude (WGS84)*/ + int32_t lon; /*< [degE7] Longitude (WGS84)*/ + float alt; /*< [m] Altitude (MSL). Positive for up.*/ + float hdop; /*< [m] GPS HDOP horizontal dilution of position*/ + float vdop; /*< [m] GPS VDOP vertical dilution of position*/ + float vn; /*< [m/s] GPS velocity in north direction in earth-fixed NED frame*/ + float ve; /*< [m/s] GPS velocity in east direction in earth-fixed NED frame*/ + float vd; /*< [m/s] GPS velocity in down direction in earth-fixed NED frame*/ + float speed_accuracy; /*< [m/s] GPS speed accuracy*/ + float horiz_accuracy; /*< [m] GPS horizontal accuracy*/ + float vert_accuracy; /*< [m] GPS vertical accuracy*/ + uint16_t ignore_flags; /*< Bitmap indicating which GPS input flags fields to ignore. All other fields must be provided.*/ + uint16_t time_week; /*< GPS week number*/ + uint8_t gps_id; /*< ID of the GPS for multiple GPS inputs*/ + uint8_t fix_type; /*< 0-1: no fix, 2: 2D fix, 3: 3D fix. 4: 3D with DGPS. 5: 3D with RTK*/ + uint8_t satellites_visible; /*< Number of satellites visible.*/ +} mavlink_gps_input_t; #define MAVLINK_MSG_ID_GPS_INPUT_LEN 63 #define MAVLINK_MSG_ID_GPS_INPUT_MIN_LEN 63 @@ -41,7 +41,11 @@ typedef struct __mavlink_gps_input_t { "GPS_INPUT", \ 18, \ { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_gps_input_t, time_usec) }, \ + { "gps_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 60, offsetof(mavlink_gps_input_t, gps_id) }, \ + { "ignore_flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 56, offsetof(mavlink_gps_input_t, ignore_flags) }, \ { "time_week_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_gps_input_t, time_week_ms) }, \ + { "time_week", NULL, MAVLINK_TYPE_UINT16_T, 0, 58, offsetof(mavlink_gps_input_t, time_week) }, \ + { "fix_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 61, offsetof(mavlink_gps_input_t, fix_type) }, \ { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_gps_input_t, lat) }, \ { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_gps_input_t, lon) }, \ { "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_gps_input_t, alt) }, \ @@ -53,10 +57,6 @@ typedef struct __mavlink_gps_input_t { { "speed_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_gps_input_t, speed_accuracy) }, \ { "horiz_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_gps_input_t, horiz_accuracy) }, \ { "vert_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 52, offsetof(mavlink_gps_input_t, vert_accuracy) }, \ - { "ignore_flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 56, offsetof(mavlink_gps_input_t, ignore_flags) }, \ - { "time_week", NULL, MAVLINK_TYPE_UINT16_T, 0, 58, offsetof(mavlink_gps_input_t, time_week) }, \ - { "gps_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 60, offsetof(mavlink_gps_input_t, gps_id) }, \ - { "fix_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 61, offsetof(mavlink_gps_input_t, fix_type) }, \ { "satellites_visible", NULL, MAVLINK_TYPE_UINT8_T, 0, 62, offsetof(mavlink_gps_input_t, satellites_visible) }, \ } \ } @@ -65,7 +65,11 @@ typedef struct __mavlink_gps_input_t { "GPS_INPUT", \ 18, \ { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_gps_input_t, time_usec) }, \ + { "gps_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 60, offsetof(mavlink_gps_input_t, gps_id) }, \ + { "ignore_flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 56, offsetof(mavlink_gps_input_t, ignore_flags) }, \ { "time_week_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_gps_input_t, time_week_ms) }, \ + { "time_week", NULL, MAVLINK_TYPE_UINT16_T, 0, 58, offsetof(mavlink_gps_input_t, time_week) }, \ + { "fix_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 61, offsetof(mavlink_gps_input_t, fix_type) }, \ { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_gps_input_t, lat) }, \ { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_gps_input_t, lon) }, \ { "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_gps_input_t, alt) }, \ @@ -77,10 +81,6 @@ typedef struct __mavlink_gps_input_t { { "speed_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_gps_input_t, speed_accuracy) }, \ { "horiz_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_gps_input_t, horiz_accuracy) }, \ { "vert_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 52, offsetof(mavlink_gps_input_t, vert_accuracy) }, \ - { "ignore_flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 56, offsetof(mavlink_gps_input_t, ignore_flags) }, \ - { "time_week", NULL, MAVLINK_TYPE_UINT16_T, 0, 58, offsetof(mavlink_gps_input_t, time_week) }, \ - { "gps_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 60, offsetof(mavlink_gps_input_t, gps_id) }, \ - { "fix_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 61, offsetof(mavlink_gps_input_t, fix_type) }, \ { "satellites_visible", NULL, MAVLINK_TYPE_UINT8_T, 0, 62, offsetof(mavlink_gps_input_t, satellites_visible) }, \ } \ } @@ -92,24 +92,24 @@ typedef struct __mavlink_gps_input_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param time_usec Timestamp (micros since boot or Unix epoch) - * @param gps_id ID of the GPS for multiple GPS inputs - * @param ignore_flags Flags indicating which fields to ignore (see GPS_INPUT_IGNORE_FLAGS enum). All other fields must be provided. - * @param time_week_ms GPS time (milliseconds from start of GPS week) - * @param time_week GPS week number - * @param fix_type 0-1: no fix, 2: 2D fix, 3: 3D fix. 4: 3D with DGPS. 5: 3D with RTK - * @param lat Latitude (WGS84), in degrees * 1E7 - * @param lon Longitude (WGS84), in degrees * 1E7 - * @param alt Altitude (AMSL, not WGS84), in m (positive for up) - * @param hdop GPS HDOP horizontal dilution of position in m - * @param vdop GPS VDOP vertical dilution of position in m - * @param vn GPS velocity in m/s in NORTH direction in earth-fixed NED frame - * @param ve GPS velocity in m/s in EAST direction in earth-fixed NED frame - * @param vd GPS velocity in m/s in DOWN direction in earth-fixed NED frame - * @param speed_accuracy GPS speed accuracy in m/s - * @param horiz_accuracy GPS horizontal accuracy in m - * @param vert_accuracy GPS vertical accuracy in m - * @param satellites_visible Number of satellites visible. + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param gps_id ID of the GPS for multiple GPS inputs + * @param ignore_flags Bitmap indicating which GPS input flags fields to ignore. All other fields must be provided. + * @param time_week_ms [ms] GPS time (from start of GPS week) + * @param time_week GPS week number + * @param fix_type 0-1: no fix, 2: 2D fix, 3: 3D fix. 4: 3D with DGPS. 5: 3D with RTK + * @param lat [degE7] Latitude (WGS84) + * @param lon [degE7] Longitude (WGS84) + * @param alt [m] Altitude (MSL). Positive for up. + * @param hdop [m] GPS HDOP horizontal dilution of position + * @param vdop [m] GPS VDOP vertical dilution of position + * @param vn [m/s] GPS velocity in north direction in earth-fixed NED frame + * @param ve [m/s] GPS velocity in east direction in earth-fixed NED frame + * @param vd [m/s] GPS velocity in down direction in earth-fixed NED frame + * @param speed_accuracy [m/s] GPS speed accuracy + * @param horiz_accuracy [m] GPS horizontal accuracy + * @param vert_accuracy [m] GPS vertical accuracy + * @param satellites_visible Number of satellites visible. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_gps_input_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -171,24 +171,24 @@ static inline uint16_t mavlink_msg_gps_input_pack(uint8_t system_id, uint8_t com * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param time_usec Timestamp (micros since boot or Unix epoch) - * @param gps_id ID of the GPS for multiple GPS inputs - * @param ignore_flags Flags indicating which fields to ignore (see GPS_INPUT_IGNORE_FLAGS enum). All other fields must be provided. - * @param time_week_ms GPS time (milliseconds from start of GPS week) - * @param time_week GPS week number - * @param fix_type 0-1: no fix, 2: 2D fix, 3: 3D fix. 4: 3D with DGPS. 5: 3D with RTK - * @param lat Latitude (WGS84), in degrees * 1E7 - * @param lon Longitude (WGS84), in degrees * 1E7 - * @param alt Altitude (AMSL, not WGS84), in m (positive for up) - * @param hdop GPS HDOP horizontal dilution of position in m - * @param vdop GPS VDOP vertical dilution of position in m - * @param vn GPS velocity in m/s in NORTH direction in earth-fixed NED frame - * @param ve GPS velocity in m/s in EAST direction in earth-fixed NED frame - * @param vd GPS velocity in m/s in DOWN direction in earth-fixed NED frame - * @param speed_accuracy GPS speed accuracy in m/s - * @param horiz_accuracy GPS horizontal accuracy in m - * @param vert_accuracy GPS vertical accuracy in m - * @param satellites_visible Number of satellites visible. + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param gps_id ID of the GPS for multiple GPS inputs + * @param ignore_flags Bitmap indicating which GPS input flags fields to ignore. All other fields must be provided. + * @param time_week_ms [ms] GPS time (from start of GPS week) + * @param time_week GPS week number + * @param fix_type 0-1: no fix, 2: 2D fix, 3: 3D fix. 4: 3D with DGPS. 5: 3D with RTK + * @param lat [degE7] Latitude (WGS84) + * @param lon [degE7] Longitude (WGS84) + * @param alt [m] Altitude (MSL). Positive for up. + * @param hdop [m] GPS HDOP horizontal dilution of position + * @param vdop [m] GPS VDOP vertical dilution of position + * @param vn [m/s] GPS velocity in north direction in earth-fixed NED frame + * @param ve [m/s] GPS velocity in east direction in earth-fixed NED frame + * @param vd [m/s] GPS velocity in down direction in earth-fixed NED frame + * @param speed_accuracy [m/s] GPS speed accuracy + * @param horiz_accuracy [m] GPS horizontal accuracy + * @param vert_accuracy [m] GPS vertical accuracy + * @param satellites_visible Number of satellites visible. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_gps_input_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -276,24 +276,24 @@ static inline uint16_t mavlink_msg_gps_input_encode_chan(uint8_t system_id, uint * @brief Send a gps_input message * @param chan MAVLink channel to send the message * - * @param time_usec Timestamp (micros since boot or Unix epoch) - * @param gps_id ID of the GPS for multiple GPS inputs - * @param ignore_flags Flags indicating which fields to ignore (see GPS_INPUT_IGNORE_FLAGS enum). All other fields must be provided. - * @param time_week_ms GPS time (milliseconds from start of GPS week) - * @param time_week GPS week number - * @param fix_type 0-1: no fix, 2: 2D fix, 3: 3D fix. 4: 3D with DGPS. 5: 3D with RTK - * @param lat Latitude (WGS84), in degrees * 1E7 - * @param lon Longitude (WGS84), in degrees * 1E7 - * @param alt Altitude (AMSL, not WGS84), in m (positive for up) - * @param hdop GPS HDOP horizontal dilution of position in m - * @param vdop GPS VDOP vertical dilution of position in m - * @param vn GPS velocity in m/s in NORTH direction in earth-fixed NED frame - * @param ve GPS velocity in m/s in EAST direction in earth-fixed NED frame - * @param vd GPS velocity in m/s in DOWN direction in earth-fixed NED frame - * @param speed_accuracy GPS speed accuracy in m/s - * @param horiz_accuracy GPS horizontal accuracy in m - * @param vert_accuracy GPS vertical accuracy in m - * @param satellites_visible Number of satellites visible. + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param gps_id ID of the GPS for multiple GPS inputs + * @param ignore_flags Bitmap indicating which GPS input flags fields to ignore. All other fields must be provided. + * @param time_week_ms [ms] GPS time (from start of GPS week) + * @param time_week GPS week number + * @param fix_type 0-1: no fix, 2: 2D fix, 3: 3D fix. 4: 3D with DGPS. 5: 3D with RTK + * @param lat [degE7] Latitude (WGS84) + * @param lon [degE7] Longitude (WGS84) + * @param alt [m] Altitude (MSL). Positive for up. + * @param hdop [m] GPS HDOP horizontal dilution of position + * @param vdop [m] GPS VDOP vertical dilution of position + * @param vn [m/s] GPS velocity in north direction in earth-fixed NED frame + * @param ve [m/s] GPS velocity in east direction in earth-fixed NED frame + * @param vd [m/s] GPS velocity in down direction in earth-fixed NED frame + * @param speed_accuracy [m/s] GPS speed accuracy + * @param horiz_accuracy [m] GPS horizontal accuracy + * @param vert_accuracy [m] GPS vertical accuracy + * @param satellites_visible Number of satellites visible. */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -426,7 +426,7 @@ static inline void mavlink_msg_gps_input_send_buf(mavlink_message_t *msgbuf, mav /** * @brief Get field time_usec from gps_input message * - * @return Timestamp (micros since boot or Unix epoch) + * @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. */ static inline uint64_t mavlink_msg_gps_input_get_time_usec(const mavlink_message_t* msg) { @@ -436,7 +436,7 @@ static inline uint64_t mavlink_msg_gps_input_get_time_usec(const mavlink_message /** * @brief Get field gps_id from gps_input message * - * @return ID of the GPS for multiple GPS inputs + * @return ID of the GPS for multiple GPS inputs */ static inline uint8_t mavlink_msg_gps_input_get_gps_id(const mavlink_message_t* msg) { @@ -446,7 +446,7 @@ static inline uint8_t mavlink_msg_gps_input_get_gps_id(const mavlink_message_t* /** * @brief Get field ignore_flags from gps_input message * - * @return Flags indicating which fields to ignore (see GPS_INPUT_IGNORE_FLAGS enum). All other fields must be provided. + * @return Bitmap indicating which GPS input flags fields to ignore. All other fields must be provided. */ static inline uint16_t mavlink_msg_gps_input_get_ignore_flags(const mavlink_message_t* msg) { @@ -456,7 +456,7 @@ static inline uint16_t mavlink_msg_gps_input_get_ignore_flags(const mavlink_mess /** * @brief Get field time_week_ms from gps_input message * - * @return GPS time (milliseconds from start of GPS week) + * @return [ms] GPS time (from start of GPS week) */ static inline uint32_t mavlink_msg_gps_input_get_time_week_ms(const mavlink_message_t* msg) { @@ -466,7 +466,7 @@ static inline uint32_t mavlink_msg_gps_input_get_time_week_ms(const mavlink_mess /** * @brief Get field time_week from gps_input message * - * @return GPS week number + * @return GPS week number */ static inline uint16_t mavlink_msg_gps_input_get_time_week(const mavlink_message_t* msg) { @@ -476,7 +476,7 @@ static inline uint16_t mavlink_msg_gps_input_get_time_week(const mavlink_message /** * @brief Get field fix_type from gps_input message * - * @return 0-1: no fix, 2: 2D fix, 3: 3D fix. 4: 3D with DGPS. 5: 3D with RTK + * @return 0-1: no fix, 2: 2D fix, 3: 3D fix. 4: 3D with DGPS. 5: 3D with RTK */ static inline uint8_t mavlink_msg_gps_input_get_fix_type(const mavlink_message_t* msg) { @@ -486,7 +486,7 @@ static inline uint8_t mavlink_msg_gps_input_get_fix_type(const mavlink_message_t /** * @brief Get field lat from gps_input message * - * @return Latitude (WGS84), in degrees * 1E7 + * @return [degE7] Latitude (WGS84) */ static inline int32_t mavlink_msg_gps_input_get_lat(const mavlink_message_t* msg) { @@ -496,7 +496,7 @@ static inline int32_t mavlink_msg_gps_input_get_lat(const mavlink_message_t* msg /** * @brief Get field lon from gps_input message * - * @return Longitude (WGS84), in degrees * 1E7 + * @return [degE7] Longitude (WGS84) */ static inline int32_t mavlink_msg_gps_input_get_lon(const mavlink_message_t* msg) { @@ -506,7 +506,7 @@ static inline int32_t mavlink_msg_gps_input_get_lon(const mavlink_message_t* msg /** * @brief Get field alt from gps_input message * - * @return Altitude (AMSL, not WGS84), in m (positive for up) + * @return [m] Altitude (MSL). Positive for up. */ static inline float mavlink_msg_gps_input_get_alt(const mavlink_message_t* msg) { @@ -516,7 +516,7 @@ static inline float mavlink_msg_gps_input_get_alt(const mavlink_message_t* msg) /** * @brief Get field hdop from gps_input message * - * @return GPS HDOP horizontal dilution of position in m + * @return [m] GPS HDOP horizontal dilution of position */ static inline float mavlink_msg_gps_input_get_hdop(const mavlink_message_t* msg) { @@ -526,7 +526,7 @@ static inline float mavlink_msg_gps_input_get_hdop(const mavlink_message_t* msg) /** * @brief Get field vdop from gps_input message * - * @return GPS VDOP vertical dilution of position in m + * @return [m] GPS VDOP vertical dilution of position */ static inline float mavlink_msg_gps_input_get_vdop(const mavlink_message_t* msg) { @@ -536,7 +536,7 @@ static inline float mavlink_msg_gps_input_get_vdop(const mavlink_message_t* msg) /** * @brief Get field vn from gps_input message * - * @return GPS velocity in m/s in NORTH direction in earth-fixed NED frame + * @return [m/s] GPS velocity in north direction in earth-fixed NED frame */ static inline float mavlink_msg_gps_input_get_vn(const mavlink_message_t* msg) { @@ -546,7 +546,7 @@ static inline float mavlink_msg_gps_input_get_vn(const mavlink_message_t* msg) /** * @brief Get field ve from gps_input message * - * @return GPS velocity in m/s in EAST direction in earth-fixed NED frame + * @return [m/s] GPS velocity in east direction in earth-fixed NED frame */ static inline float mavlink_msg_gps_input_get_ve(const mavlink_message_t* msg) { @@ -556,7 +556,7 @@ static inline float mavlink_msg_gps_input_get_ve(const mavlink_message_t* msg) /** * @brief Get field vd from gps_input message * - * @return GPS velocity in m/s in DOWN direction in earth-fixed NED frame + * @return [m/s] GPS velocity in down direction in earth-fixed NED frame */ static inline float mavlink_msg_gps_input_get_vd(const mavlink_message_t* msg) { @@ -566,7 +566,7 @@ static inline float mavlink_msg_gps_input_get_vd(const mavlink_message_t* msg) /** * @brief Get field speed_accuracy from gps_input message * - * @return GPS speed accuracy in m/s + * @return [m/s] GPS speed accuracy */ static inline float mavlink_msg_gps_input_get_speed_accuracy(const mavlink_message_t* msg) { @@ -576,7 +576,7 @@ static inline float mavlink_msg_gps_input_get_speed_accuracy(const mavlink_messa /** * @brief Get field horiz_accuracy from gps_input message * - * @return GPS horizontal accuracy in m + * @return [m] GPS horizontal accuracy */ static inline float mavlink_msg_gps_input_get_horiz_accuracy(const mavlink_message_t* msg) { @@ -586,7 +586,7 @@ static inline float mavlink_msg_gps_input_get_horiz_accuracy(const mavlink_messa /** * @brief Get field vert_accuracy from gps_input message * - * @return GPS vertical accuracy in m + * @return [m] GPS vertical accuracy */ static inline float mavlink_msg_gps_input_get_vert_accuracy(const mavlink_message_t* msg) { @@ -596,7 +596,7 @@ static inline float mavlink_msg_gps_input_get_vert_accuracy(const mavlink_messag /** * @brief Get field satellites_visible from gps_input message * - * @return Number of satellites visible. + * @return Number of satellites visible. */ static inline uint8_t mavlink_msg_gps_input_get_satellites_visible(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_gps_raw_int.h b/lib/main/MAVLink/common/mavlink_msg_gps_raw_int.h index 3033b6d5fc..6e22537c93 100755 --- a/lib/main/MAVLink/common/mavlink_msg_gps_raw_int.h +++ b/lib/main/MAVLink/common/mavlink_msg_gps_raw_int.h @@ -3,19 +3,19 @@ #define MAVLINK_MSG_ID_GPS_RAW_INT 24 -MAVPACKED( + typedef struct __mavlink_gps_raw_int_t { - uint64_t time_usec; /*< Timestamp (microseconds since UNIX epoch or microseconds since system boot)*/ - int32_t lat; /*< Latitude (WGS84), in degrees * 1E7*/ - int32_t lon; /*< Longitude (WGS84), in degrees * 1E7*/ - int32_t alt; /*< Altitude (AMSL, NOT WGS84), in meters * 1000 (positive for up). Note that virtually all GPS modules provide the AMSL altitude in addition to the WGS84 altitude.*/ - uint16_t eph; /*< GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX*/ - uint16_t epv; /*< GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX*/ - uint16_t vel; /*< GPS ground speed (m/s * 100). If unknown, set to: UINT16_MAX*/ - uint16_t cog; /*< Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX*/ - uint8_t fix_type; /*< See the GPS_FIX_TYPE enum.*/ - uint8_t satellites_visible; /*< Number of satellites visible. If unknown, set to 255*/ -}) mavlink_gps_raw_int_t; + uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.*/ + int32_t lat; /*< [degE7] Latitude (WGS84, EGM96 ellipsoid)*/ + int32_t lon; /*< [degE7] Longitude (WGS84, EGM96 ellipsoid)*/ + int32_t alt; /*< [mm] Altitude (MSL). Positive for up. Note that virtually all GPS modules provide the MSL altitude in addition to the WGS84 altitude.*/ + uint16_t eph; /*< GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX*/ + uint16_t epv; /*< GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX*/ + uint16_t vel; /*< [cm/s] GPS ground speed. If unknown, set to: UINT16_MAX*/ + uint16_t cog; /*< [cdeg] Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX*/ + uint8_t fix_type; /*< GPS fix type.*/ + uint8_t satellites_visible; /*< Number of satellites visible. If unknown, set to 255*/ +} mavlink_gps_raw_int_t; #define MAVLINK_MSG_ID_GPS_RAW_INT_LEN 30 #define MAVLINK_MSG_ID_GPS_RAW_INT_MIN_LEN 30 @@ -33,6 +33,7 @@ typedef struct __mavlink_gps_raw_int_t { "GPS_RAW_INT", \ 10, \ { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_gps_raw_int_t, time_usec) }, \ + { "fix_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 28, offsetof(mavlink_gps_raw_int_t, fix_type) }, \ { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_gps_raw_int_t, lat) }, \ { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_gps_raw_int_t, lon) }, \ { "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_gps_raw_int_t, alt) }, \ @@ -40,7 +41,6 @@ typedef struct __mavlink_gps_raw_int_t { { "epv", NULL, MAVLINK_TYPE_UINT16_T, 0, 22, offsetof(mavlink_gps_raw_int_t, epv) }, \ { "vel", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_gps_raw_int_t, vel) }, \ { "cog", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_gps_raw_int_t, cog) }, \ - { "fix_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 28, offsetof(mavlink_gps_raw_int_t, fix_type) }, \ { "satellites_visible", NULL, MAVLINK_TYPE_UINT8_T, 0, 29, offsetof(mavlink_gps_raw_int_t, satellites_visible) }, \ } \ } @@ -49,6 +49,7 @@ typedef struct __mavlink_gps_raw_int_t { "GPS_RAW_INT", \ 10, \ { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_gps_raw_int_t, time_usec) }, \ + { "fix_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 28, offsetof(mavlink_gps_raw_int_t, fix_type) }, \ { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_gps_raw_int_t, lat) }, \ { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_gps_raw_int_t, lon) }, \ { "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_gps_raw_int_t, alt) }, \ @@ -56,7 +57,6 @@ typedef struct __mavlink_gps_raw_int_t { { "epv", NULL, MAVLINK_TYPE_UINT16_T, 0, 22, offsetof(mavlink_gps_raw_int_t, epv) }, \ { "vel", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_gps_raw_int_t, vel) }, \ { "cog", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_gps_raw_int_t, cog) }, \ - { "fix_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 28, offsetof(mavlink_gps_raw_int_t, fix_type) }, \ { "satellites_visible", NULL, MAVLINK_TYPE_UINT8_T, 0, 29, offsetof(mavlink_gps_raw_int_t, satellites_visible) }, \ } \ } @@ -68,16 +68,16 @@ typedef struct __mavlink_gps_raw_int_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot) - * @param fix_type See the GPS_FIX_TYPE enum. - * @param lat Latitude (WGS84), in degrees * 1E7 - * @param lon Longitude (WGS84), in degrees * 1E7 - * @param alt Altitude (AMSL, NOT WGS84), in meters * 1000 (positive for up). Note that virtually all GPS modules provide the AMSL altitude in addition to the WGS84 altitude. - * @param eph GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX - * @param epv GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX - * @param vel GPS ground speed (m/s * 100). If unknown, set to: UINT16_MAX - * @param cog Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX - * @param satellites_visible Number of satellites visible. If unknown, set to 255 + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param fix_type GPS fix type. + * @param lat [degE7] Latitude (WGS84, EGM96 ellipsoid) + * @param lon [degE7] Longitude (WGS84, EGM96 ellipsoid) + * @param alt [mm] Altitude (MSL). Positive for up. Note that virtually all GPS modules provide the MSL altitude in addition to the WGS84 altitude. + * @param eph GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX + * @param epv GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX + * @param vel [cm/s] GPS ground speed. If unknown, set to: UINT16_MAX + * @param cog [cdeg] Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX + * @param satellites_visible Number of satellites visible. If unknown, set to 255 * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_gps_raw_int_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -123,16 +123,16 @@ static inline uint16_t mavlink_msg_gps_raw_int_pack(uint8_t system_id, uint8_t c * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot) - * @param fix_type See the GPS_FIX_TYPE enum. - * @param lat Latitude (WGS84), in degrees * 1E7 - * @param lon Longitude (WGS84), in degrees * 1E7 - * @param alt Altitude (AMSL, NOT WGS84), in meters * 1000 (positive for up). Note that virtually all GPS modules provide the AMSL altitude in addition to the WGS84 altitude. - * @param eph GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX - * @param epv GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX - * @param vel GPS ground speed (m/s * 100). If unknown, set to: UINT16_MAX - * @param cog Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX - * @param satellites_visible Number of satellites visible. If unknown, set to 255 + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param fix_type GPS fix type. + * @param lat [degE7] Latitude (WGS84, EGM96 ellipsoid) + * @param lon [degE7] Longitude (WGS84, EGM96 ellipsoid) + * @param alt [mm] Altitude (MSL). Positive for up. Note that virtually all GPS modules provide the MSL altitude in addition to the WGS84 altitude. + * @param eph GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX + * @param epv GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX + * @param vel [cm/s] GPS ground speed. If unknown, set to: UINT16_MAX + * @param cog [cdeg] Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX + * @param satellites_visible Number of satellites visible. If unknown, set to 255 * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_gps_raw_int_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -204,16 +204,16 @@ static inline uint16_t mavlink_msg_gps_raw_int_encode_chan(uint8_t system_id, ui * @brief Send a gps_raw_int message * @param chan MAVLink channel to send the message * - * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot) - * @param fix_type See the GPS_FIX_TYPE enum. - * @param lat Latitude (WGS84), in degrees * 1E7 - * @param lon Longitude (WGS84), in degrees * 1E7 - * @param alt Altitude (AMSL, NOT WGS84), in meters * 1000 (positive for up). Note that virtually all GPS modules provide the AMSL altitude in addition to the WGS84 altitude. - * @param eph GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX - * @param epv GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX - * @param vel GPS ground speed (m/s * 100). If unknown, set to: UINT16_MAX - * @param cog Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX - * @param satellites_visible Number of satellites visible. If unknown, set to 255 + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param fix_type GPS fix type. + * @param lat [degE7] Latitude (WGS84, EGM96 ellipsoid) + * @param lon [degE7] Longitude (WGS84, EGM96 ellipsoid) + * @param alt [mm] Altitude (MSL). Positive for up. Note that virtually all GPS modules provide the MSL altitude in addition to the WGS84 altitude. + * @param eph GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX + * @param epv GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX + * @param vel [cm/s] GPS ground speed. If unknown, set to: UINT16_MAX + * @param cog [cdeg] Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX + * @param satellites_visible Number of satellites visible. If unknown, set to 255 */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -314,7 +314,7 @@ static inline void mavlink_msg_gps_raw_int_send_buf(mavlink_message_t *msgbuf, m /** * @brief Get field time_usec from gps_raw_int message * - * @return Timestamp (microseconds since UNIX epoch or microseconds since system boot) + * @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. */ static inline uint64_t mavlink_msg_gps_raw_int_get_time_usec(const mavlink_message_t* msg) { @@ -324,7 +324,7 @@ static inline uint64_t mavlink_msg_gps_raw_int_get_time_usec(const mavlink_messa /** * @brief Get field fix_type from gps_raw_int message * - * @return See the GPS_FIX_TYPE enum. + * @return GPS fix type. */ static inline uint8_t mavlink_msg_gps_raw_int_get_fix_type(const mavlink_message_t* msg) { @@ -334,7 +334,7 @@ static inline uint8_t mavlink_msg_gps_raw_int_get_fix_type(const mavlink_message /** * @brief Get field lat from gps_raw_int message * - * @return Latitude (WGS84), in degrees * 1E7 + * @return [degE7] Latitude (WGS84, EGM96 ellipsoid) */ static inline int32_t mavlink_msg_gps_raw_int_get_lat(const mavlink_message_t* msg) { @@ -344,7 +344,7 @@ static inline int32_t mavlink_msg_gps_raw_int_get_lat(const mavlink_message_t* m /** * @brief Get field lon from gps_raw_int message * - * @return Longitude (WGS84), in degrees * 1E7 + * @return [degE7] Longitude (WGS84, EGM96 ellipsoid) */ static inline int32_t mavlink_msg_gps_raw_int_get_lon(const mavlink_message_t* msg) { @@ -354,7 +354,7 @@ static inline int32_t mavlink_msg_gps_raw_int_get_lon(const mavlink_message_t* m /** * @brief Get field alt from gps_raw_int message * - * @return Altitude (AMSL, NOT WGS84), in meters * 1000 (positive for up). Note that virtually all GPS modules provide the AMSL altitude in addition to the WGS84 altitude. + * @return [mm] Altitude (MSL). Positive for up. Note that virtually all GPS modules provide the MSL altitude in addition to the WGS84 altitude. */ static inline int32_t mavlink_msg_gps_raw_int_get_alt(const mavlink_message_t* msg) { @@ -364,7 +364,7 @@ static inline int32_t mavlink_msg_gps_raw_int_get_alt(const mavlink_message_t* m /** * @brief Get field eph from gps_raw_int message * - * @return GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX + * @return GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX */ static inline uint16_t mavlink_msg_gps_raw_int_get_eph(const mavlink_message_t* msg) { @@ -374,7 +374,7 @@ static inline uint16_t mavlink_msg_gps_raw_int_get_eph(const mavlink_message_t* /** * @brief Get field epv from gps_raw_int message * - * @return GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX + * @return GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX */ static inline uint16_t mavlink_msg_gps_raw_int_get_epv(const mavlink_message_t* msg) { @@ -384,7 +384,7 @@ static inline uint16_t mavlink_msg_gps_raw_int_get_epv(const mavlink_message_t* /** * @brief Get field vel from gps_raw_int message * - * @return GPS ground speed (m/s * 100). If unknown, set to: UINT16_MAX + * @return [cm/s] GPS ground speed. If unknown, set to: UINT16_MAX */ static inline uint16_t mavlink_msg_gps_raw_int_get_vel(const mavlink_message_t* msg) { @@ -394,7 +394,7 @@ static inline uint16_t mavlink_msg_gps_raw_int_get_vel(const mavlink_message_t* /** * @brief Get field cog from gps_raw_int message * - * @return Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX + * @return [cdeg] Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX */ static inline uint16_t mavlink_msg_gps_raw_int_get_cog(const mavlink_message_t* msg) { @@ -404,7 +404,7 @@ static inline uint16_t mavlink_msg_gps_raw_int_get_cog(const mavlink_message_t* /** * @brief Get field satellites_visible from gps_raw_int message * - * @return Number of satellites visible. If unknown, set to 255 + * @return Number of satellites visible. If unknown, set to 255 */ static inline uint8_t mavlink_msg_gps_raw_int_get_satellites_visible(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_gps_rtcm_data.h b/lib/main/MAVLink/common/mavlink_msg_gps_rtcm_data.h index 2d6955c4d2..393d6adb31 100755 --- a/lib/main/MAVLink/common/mavlink_msg_gps_rtcm_data.h +++ b/lib/main/MAVLink/common/mavlink_msg_gps_rtcm_data.h @@ -3,12 +3,12 @@ #define MAVLINK_MSG_ID_GPS_RTCM_DATA 233 -MAVPACKED( + typedef struct __mavlink_gps_rtcm_data_t { - uint8_t flags; /*< LSB: 1 means message is fragmented*/ - uint8_t len; /*< data length*/ - uint8_t data[180]; /*< RTCM message (may be fragmented)*/ -}) mavlink_gps_rtcm_data_t; + uint8_t flags; /*< LSB: 1 means message is fragmented, next 2 bits are the fragment ID, the remaining 5 bits are used for the sequence ID. Messages are only to be flushed to the GPS when the entire message has been reconstructed on the autopilot. The fragment ID specifies which order the fragments should be assembled into a buffer, while the sequence ID is used to detect a mismatch between different buffers. The buffer is considered fully reconstructed when either all 4 fragments are present, or all the fragments before the first fragment with a non full payload is received. This management is used to ensure that normal GPS operation doesn't corrupt RTCM data, and to recover from a unreliable transport delivery order.*/ + uint8_t len; /*< [bytes] data length*/ + uint8_t data[180]; /*< RTCM message (may be fragmented)*/ +} mavlink_gps_rtcm_data_t; #define MAVLINK_MSG_ID_GPS_RTCM_DATA_LEN 182 #define MAVLINK_MSG_ID_GPS_RTCM_DATA_MIN_LEN 182 @@ -47,9 +47,9 @@ typedef struct __mavlink_gps_rtcm_data_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param flags LSB: 1 means message is fragmented - * @param len data length - * @param data RTCM message (may be fragmented) + * @param flags LSB: 1 means message is fragmented, next 2 bits are the fragment ID, the remaining 5 bits are used for the sequence ID. Messages are only to be flushed to the GPS when the entire message has been reconstructed on the autopilot. The fragment ID specifies which order the fragments should be assembled into a buffer, while the sequence ID is used to detect a mismatch between different buffers. The buffer is considered fully reconstructed when either all 4 fragments are present, or all the fragments before the first fragment with a non full payload is received. This management is used to ensure that normal GPS operation doesn't corrupt RTCM data, and to recover from a unreliable transport delivery order. + * @param len [bytes] data length + * @param data RTCM message (may be fragmented) * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_gps_rtcm_data_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -79,9 +79,9 @@ static inline uint16_t mavlink_msg_gps_rtcm_data_pack(uint8_t system_id, uint8_t * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param flags LSB: 1 means message is fragmented - * @param len data length - * @param data RTCM message (may be fragmented) + * @param flags LSB: 1 means message is fragmented, next 2 bits are the fragment ID, the remaining 5 bits are used for the sequence ID. Messages are only to be flushed to the GPS when the entire message has been reconstructed on the autopilot. The fragment ID specifies which order the fragments should be assembled into a buffer, while the sequence ID is used to detect a mismatch between different buffers. The buffer is considered fully reconstructed when either all 4 fragments are present, or all the fragments before the first fragment with a non full payload is received. This management is used to ensure that normal GPS operation doesn't corrupt RTCM data, and to recover from a unreliable transport delivery order. + * @param len [bytes] data length + * @param data RTCM message (may be fragmented) * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_gps_rtcm_data_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -137,9 +137,9 @@ static inline uint16_t mavlink_msg_gps_rtcm_data_encode_chan(uint8_t system_id, * @brief Send a gps_rtcm_data message * @param chan MAVLink channel to send the message * - * @param flags LSB: 1 means message is fragmented - * @param len data length - * @param data RTCM message (may be fragmented) + * @param flags LSB: 1 means message is fragmented, next 2 bits are the fragment ID, the remaining 5 bits are used for the sequence ID. Messages are only to be flushed to the GPS when the entire message has been reconstructed on the autopilot. The fragment ID specifies which order the fragments should be assembled into a buffer, while the sequence ID is used to detect a mismatch between different buffers. The buffer is considered fully reconstructed when either all 4 fragments are present, or all the fragments before the first fragment with a non full payload is received. This management is used to ensure that normal GPS operation doesn't corrupt RTCM data, and to recover from a unreliable transport delivery order. + * @param len [bytes] data length + * @param data RTCM message (may be fragmented) */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -208,7 +208,7 @@ static inline void mavlink_msg_gps_rtcm_data_send_buf(mavlink_message_t *msgbuf, /** * @brief Get field flags from gps_rtcm_data message * - * @return LSB: 1 means message is fragmented + * @return LSB: 1 means message is fragmented, next 2 bits are the fragment ID, the remaining 5 bits are used for the sequence ID. Messages are only to be flushed to the GPS when the entire message has been reconstructed on the autopilot. The fragment ID specifies which order the fragments should be assembled into a buffer, while the sequence ID is used to detect a mismatch between different buffers. The buffer is considered fully reconstructed when either all 4 fragments are present, or all the fragments before the first fragment with a non full payload is received. This management is used to ensure that normal GPS operation doesn't corrupt RTCM data, and to recover from a unreliable transport delivery order. */ static inline uint8_t mavlink_msg_gps_rtcm_data_get_flags(const mavlink_message_t* msg) { @@ -218,7 +218,7 @@ static inline uint8_t mavlink_msg_gps_rtcm_data_get_flags(const mavlink_message_ /** * @brief Get field len from gps_rtcm_data message * - * @return data length + * @return [bytes] data length */ static inline uint8_t mavlink_msg_gps_rtcm_data_get_len(const mavlink_message_t* msg) { @@ -228,7 +228,7 @@ static inline uint8_t mavlink_msg_gps_rtcm_data_get_len(const mavlink_message_t* /** * @brief Get field data from gps_rtcm_data message * - * @return RTCM message (may be fragmented) + * @return RTCM message (may be fragmented) */ static inline uint16_t mavlink_msg_gps_rtcm_data_get_data(const mavlink_message_t* msg, uint8_t *data) { diff --git a/lib/main/MAVLink/common/mavlink_msg_gps_rtk.h b/lib/main/MAVLink/common/mavlink_msg_gps_rtk.h index 3b25c802af..abf898f2d4 100755 --- a/lib/main/MAVLink/common/mavlink_msg_gps_rtk.h +++ b/lib/main/MAVLink/common/mavlink_msg_gps_rtk.h @@ -3,22 +3,22 @@ #define MAVLINK_MSG_ID_GPS_RTK 127 -MAVPACKED( + typedef struct __mavlink_gps_rtk_t { - uint32_t time_last_baseline_ms; /*< Time since boot of last baseline message received in ms.*/ - uint32_t tow; /*< GPS Time of Week of last baseline*/ - int32_t baseline_a_mm; /*< Current baseline in ECEF x or NED north component in mm.*/ - int32_t baseline_b_mm; /*< Current baseline in ECEF y or NED east component in mm.*/ - int32_t baseline_c_mm; /*< Current baseline in ECEF z or NED down component in mm.*/ - uint32_t accuracy; /*< Current estimate of baseline accuracy.*/ - int32_t iar_num_hypotheses; /*< Current number of integer ambiguity hypotheses.*/ - uint16_t wn; /*< GPS Week Number of last baseline*/ - uint8_t rtk_receiver_id; /*< Identification of connected RTK receiver.*/ - uint8_t rtk_health; /*< GPS-specific health report for RTK data.*/ - uint8_t rtk_rate; /*< Rate of baseline messages being received by GPS, in HZ*/ - uint8_t nsats; /*< Current number of sats used for RTK calculation.*/ - uint8_t baseline_coords_type; /*< Coordinate system of baseline. 0 == ECEF, 1 == NED*/ -}) mavlink_gps_rtk_t; + uint32_t time_last_baseline_ms; /*< [ms] Time since boot of last baseline message received.*/ + uint32_t tow; /*< [ms] GPS Time of Week of last baseline*/ + int32_t baseline_a_mm; /*< [mm] Current baseline in ECEF x or NED north component.*/ + int32_t baseline_b_mm; /*< [mm] Current baseline in ECEF y or NED east component.*/ + int32_t baseline_c_mm; /*< [mm] Current baseline in ECEF z or NED down component.*/ + uint32_t accuracy; /*< Current estimate of baseline accuracy.*/ + int32_t iar_num_hypotheses; /*< Current number of integer ambiguity hypotheses.*/ + uint16_t wn; /*< GPS Week Number of last baseline*/ + uint8_t rtk_receiver_id; /*< Identification of connected RTK receiver.*/ + uint8_t rtk_health; /*< GPS-specific health report for RTK data.*/ + uint8_t rtk_rate; /*< [Hz] Rate of baseline messages being received by GPS*/ + uint8_t nsats; /*< Current number of sats used for RTK calculation.*/ + uint8_t baseline_coords_type; /*< Coordinate system of baseline*/ +} mavlink_gps_rtk_t; #define MAVLINK_MSG_ID_GPS_RTK_LEN 35 #define MAVLINK_MSG_ID_GPS_RTK_MIN_LEN 35 @@ -36,18 +36,18 @@ typedef struct __mavlink_gps_rtk_t { "GPS_RTK", \ 13, \ { { "time_last_baseline_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_gps_rtk_t, time_last_baseline_ms) }, \ + { "rtk_receiver_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_gps_rtk_t, rtk_receiver_id) }, \ + { "wn", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_gps_rtk_t, wn) }, \ { "tow", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_gps_rtk_t, tow) }, \ + { "rtk_health", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_gps_rtk_t, rtk_health) }, \ + { "rtk_rate", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_gps_rtk_t, rtk_rate) }, \ + { "nsats", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_gps_rtk_t, nsats) }, \ + { "baseline_coords_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_gps_rtk_t, baseline_coords_type) }, \ { "baseline_a_mm", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_gps_rtk_t, baseline_a_mm) }, \ { "baseline_b_mm", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_gps_rtk_t, baseline_b_mm) }, \ { "baseline_c_mm", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_gps_rtk_t, baseline_c_mm) }, \ { "accuracy", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_gps_rtk_t, accuracy) }, \ { "iar_num_hypotheses", NULL, MAVLINK_TYPE_INT32_T, 0, 24, offsetof(mavlink_gps_rtk_t, iar_num_hypotheses) }, \ - { "wn", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_gps_rtk_t, wn) }, \ - { "rtk_receiver_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_gps_rtk_t, rtk_receiver_id) }, \ - { "rtk_health", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_gps_rtk_t, rtk_health) }, \ - { "rtk_rate", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_gps_rtk_t, rtk_rate) }, \ - { "nsats", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_gps_rtk_t, nsats) }, \ - { "baseline_coords_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_gps_rtk_t, baseline_coords_type) }, \ } \ } #else @@ -55,18 +55,18 @@ typedef struct __mavlink_gps_rtk_t { "GPS_RTK", \ 13, \ { { "time_last_baseline_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_gps_rtk_t, time_last_baseline_ms) }, \ + { "rtk_receiver_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_gps_rtk_t, rtk_receiver_id) }, \ + { "wn", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_gps_rtk_t, wn) }, \ { "tow", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_gps_rtk_t, tow) }, \ + { "rtk_health", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_gps_rtk_t, rtk_health) }, \ + { "rtk_rate", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_gps_rtk_t, rtk_rate) }, \ + { "nsats", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_gps_rtk_t, nsats) }, \ + { "baseline_coords_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_gps_rtk_t, baseline_coords_type) }, \ { "baseline_a_mm", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_gps_rtk_t, baseline_a_mm) }, \ { "baseline_b_mm", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_gps_rtk_t, baseline_b_mm) }, \ { "baseline_c_mm", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_gps_rtk_t, baseline_c_mm) }, \ { "accuracy", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_gps_rtk_t, accuracy) }, \ { "iar_num_hypotheses", NULL, MAVLINK_TYPE_INT32_T, 0, 24, offsetof(mavlink_gps_rtk_t, iar_num_hypotheses) }, \ - { "wn", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_gps_rtk_t, wn) }, \ - { "rtk_receiver_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_gps_rtk_t, rtk_receiver_id) }, \ - { "rtk_health", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_gps_rtk_t, rtk_health) }, \ - { "rtk_rate", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_gps_rtk_t, rtk_rate) }, \ - { "nsats", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_gps_rtk_t, nsats) }, \ - { "baseline_coords_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_gps_rtk_t, baseline_coords_type) }, \ } \ } #endif @@ -77,19 +77,19 @@ typedef struct __mavlink_gps_rtk_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param time_last_baseline_ms Time since boot of last baseline message received in ms. - * @param rtk_receiver_id Identification of connected RTK receiver. - * @param wn GPS Week Number of last baseline - * @param tow GPS Time of Week of last baseline - * @param rtk_health GPS-specific health report for RTK data. - * @param rtk_rate Rate of baseline messages being received by GPS, in HZ - * @param nsats Current number of sats used for RTK calculation. - * @param baseline_coords_type Coordinate system of baseline. 0 == ECEF, 1 == NED - * @param baseline_a_mm Current baseline in ECEF x or NED north component in mm. - * @param baseline_b_mm Current baseline in ECEF y or NED east component in mm. - * @param baseline_c_mm Current baseline in ECEF z or NED down component in mm. - * @param accuracy Current estimate of baseline accuracy. - * @param iar_num_hypotheses Current number of integer ambiguity hypotheses. + * @param time_last_baseline_ms [ms] Time since boot of last baseline message received. + * @param rtk_receiver_id Identification of connected RTK receiver. + * @param wn GPS Week Number of last baseline + * @param tow [ms] GPS Time of Week of last baseline + * @param rtk_health GPS-specific health report for RTK data. + * @param rtk_rate [Hz] Rate of baseline messages being received by GPS + * @param nsats Current number of sats used for RTK calculation. + * @param baseline_coords_type Coordinate system of baseline + * @param baseline_a_mm [mm] Current baseline in ECEF x or NED north component. + * @param baseline_b_mm [mm] Current baseline in ECEF y or NED east component. + * @param baseline_c_mm [mm] Current baseline in ECEF z or NED down component. + * @param accuracy Current estimate of baseline accuracy. + * @param iar_num_hypotheses Current number of integer ambiguity hypotheses. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_gps_rtk_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -141,19 +141,19 @@ static inline uint16_t mavlink_msg_gps_rtk_pack(uint8_t system_id, uint8_t compo * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param time_last_baseline_ms Time since boot of last baseline message received in ms. - * @param rtk_receiver_id Identification of connected RTK receiver. - * @param wn GPS Week Number of last baseline - * @param tow GPS Time of Week of last baseline - * @param rtk_health GPS-specific health report for RTK data. - * @param rtk_rate Rate of baseline messages being received by GPS, in HZ - * @param nsats Current number of sats used for RTK calculation. - * @param baseline_coords_type Coordinate system of baseline. 0 == ECEF, 1 == NED - * @param baseline_a_mm Current baseline in ECEF x or NED north component in mm. - * @param baseline_b_mm Current baseline in ECEF y or NED east component in mm. - * @param baseline_c_mm Current baseline in ECEF z or NED down component in mm. - * @param accuracy Current estimate of baseline accuracy. - * @param iar_num_hypotheses Current number of integer ambiguity hypotheses. + * @param time_last_baseline_ms [ms] Time since boot of last baseline message received. + * @param rtk_receiver_id Identification of connected RTK receiver. + * @param wn GPS Week Number of last baseline + * @param tow [ms] GPS Time of Week of last baseline + * @param rtk_health GPS-specific health report for RTK data. + * @param rtk_rate [Hz] Rate of baseline messages being received by GPS + * @param nsats Current number of sats used for RTK calculation. + * @param baseline_coords_type Coordinate system of baseline + * @param baseline_a_mm [mm] Current baseline in ECEF x or NED north component. + * @param baseline_b_mm [mm] Current baseline in ECEF y or NED east component. + * @param baseline_c_mm [mm] Current baseline in ECEF z or NED down component. + * @param accuracy Current estimate of baseline accuracy. + * @param iar_num_hypotheses Current number of integer ambiguity hypotheses. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_gps_rtk_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -231,19 +231,19 @@ static inline uint16_t mavlink_msg_gps_rtk_encode_chan(uint8_t system_id, uint8_ * @brief Send a gps_rtk message * @param chan MAVLink channel to send the message * - * @param time_last_baseline_ms Time since boot of last baseline message received in ms. - * @param rtk_receiver_id Identification of connected RTK receiver. - * @param wn GPS Week Number of last baseline - * @param tow GPS Time of Week of last baseline - * @param rtk_health GPS-specific health report for RTK data. - * @param rtk_rate Rate of baseline messages being received by GPS, in HZ - * @param nsats Current number of sats used for RTK calculation. - * @param baseline_coords_type Coordinate system of baseline. 0 == ECEF, 1 == NED - * @param baseline_a_mm Current baseline in ECEF x or NED north component in mm. - * @param baseline_b_mm Current baseline in ECEF y or NED east component in mm. - * @param baseline_c_mm Current baseline in ECEF z or NED down component in mm. - * @param accuracy Current estimate of baseline accuracy. - * @param iar_num_hypotheses Current number of integer ambiguity hypotheses. + * @param time_last_baseline_ms [ms] Time since boot of last baseline message received. + * @param rtk_receiver_id Identification of connected RTK receiver. + * @param wn GPS Week Number of last baseline + * @param tow [ms] GPS Time of Week of last baseline + * @param rtk_health GPS-specific health report for RTK data. + * @param rtk_rate [Hz] Rate of baseline messages being received by GPS + * @param nsats Current number of sats used for RTK calculation. + * @param baseline_coords_type Coordinate system of baseline + * @param baseline_a_mm [mm] Current baseline in ECEF x or NED north component. + * @param baseline_b_mm [mm] Current baseline in ECEF y or NED east component. + * @param baseline_c_mm [mm] Current baseline in ECEF z or NED down component. + * @param accuracy Current estimate of baseline accuracy. + * @param iar_num_hypotheses Current number of integer ambiguity hypotheses. */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -356,7 +356,7 @@ static inline void mavlink_msg_gps_rtk_send_buf(mavlink_message_t *msgbuf, mavli /** * @brief Get field time_last_baseline_ms from gps_rtk message * - * @return Time since boot of last baseline message received in ms. + * @return [ms] Time since boot of last baseline message received. */ static inline uint32_t mavlink_msg_gps_rtk_get_time_last_baseline_ms(const mavlink_message_t* msg) { @@ -366,7 +366,7 @@ static inline uint32_t mavlink_msg_gps_rtk_get_time_last_baseline_ms(const mavli /** * @brief Get field rtk_receiver_id from gps_rtk message * - * @return Identification of connected RTK receiver. + * @return Identification of connected RTK receiver. */ static inline uint8_t mavlink_msg_gps_rtk_get_rtk_receiver_id(const mavlink_message_t* msg) { @@ -376,7 +376,7 @@ static inline uint8_t mavlink_msg_gps_rtk_get_rtk_receiver_id(const mavlink_mess /** * @brief Get field wn from gps_rtk message * - * @return GPS Week Number of last baseline + * @return GPS Week Number of last baseline */ static inline uint16_t mavlink_msg_gps_rtk_get_wn(const mavlink_message_t* msg) { @@ -386,7 +386,7 @@ static inline uint16_t mavlink_msg_gps_rtk_get_wn(const mavlink_message_t* msg) /** * @brief Get field tow from gps_rtk message * - * @return GPS Time of Week of last baseline + * @return [ms] GPS Time of Week of last baseline */ static inline uint32_t mavlink_msg_gps_rtk_get_tow(const mavlink_message_t* msg) { @@ -396,7 +396,7 @@ static inline uint32_t mavlink_msg_gps_rtk_get_tow(const mavlink_message_t* msg) /** * @brief Get field rtk_health from gps_rtk message * - * @return GPS-specific health report for RTK data. + * @return GPS-specific health report for RTK data. */ static inline uint8_t mavlink_msg_gps_rtk_get_rtk_health(const mavlink_message_t* msg) { @@ -406,7 +406,7 @@ static inline uint8_t mavlink_msg_gps_rtk_get_rtk_health(const mavlink_message_t /** * @brief Get field rtk_rate from gps_rtk message * - * @return Rate of baseline messages being received by GPS, in HZ + * @return [Hz] Rate of baseline messages being received by GPS */ static inline uint8_t mavlink_msg_gps_rtk_get_rtk_rate(const mavlink_message_t* msg) { @@ -416,7 +416,7 @@ static inline uint8_t mavlink_msg_gps_rtk_get_rtk_rate(const mavlink_message_t* /** * @brief Get field nsats from gps_rtk message * - * @return Current number of sats used for RTK calculation. + * @return Current number of sats used for RTK calculation. */ static inline uint8_t mavlink_msg_gps_rtk_get_nsats(const mavlink_message_t* msg) { @@ -426,7 +426,7 @@ static inline uint8_t mavlink_msg_gps_rtk_get_nsats(const mavlink_message_t* msg /** * @brief Get field baseline_coords_type from gps_rtk message * - * @return Coordinate system of baseline. 0 == ECEF, 1 == NED + * @return Coordinate system of baseline */ static inline uint8_t mavlink_msg_gps_rtk_get_baseline_coords_type(const mavlink_message_t* msg) { @@ -436,7 +436,7 @@ static inline uint8_t mavlink_msg_gps_rtk_get_baseline_coords_type(const mavlink /** * @brief Get field baseline_a_mm from gps_rtk message * - * @return Current baseline in ECEF x or NED north component in mm. + * @return [mm] Current baseline in ECEF x or NED north component. */ static inline int32_t mavlink_msg_gps_rtk_get_baseline_a_mm(const mavlink_message_t* msg) { @@ -446,7 +446,7 @@ static inline int32_t mavlink_msg_gps_rtk_get_baseline_a_mm(const mavlink_messag /** * @brief Get field baseline_b_mm from gps_rtk message * - * @return Current baseline in ECEF y or NED east component in mm. + * @return [mm] Current baseline in ECEF y or NED east component. */ static inline int32_t mavlink_msg_gps_rtk_get_baseline_b_mm(const mavlink_message_t* msg) { @@ -456,7 +456,7 @@ static inline int32_t mavlink_msg_gps_rtk_get_baseline_b_mm(const mavlink_messag /** * @brief Get field baseline_c_mm from gps_rtk message * - * @return Current baseline in ECEF z or NED down component in mm. + * @return [mm] Current baseline in ECEF z or NED down component. */ static inline int32_t mavlink_msg_gps_rtk_get_baseline_c_mm(const mavlink_message_t* msg) { @@ -466,7 +466,7 @@ static inline int32_t mavlink_msg_gps_rtk_get_baseline_c_mm(const mavlink_messag /** * @brief Get field accuracy from gps_rtk message * - * @return Current estimate of baseline accuracy. + * @return Current estimate of baseline accuracy. */ static inline uint32_t mavlink_msg_gps_rtk_get_accuracy(const mavlink_message_t* msg) { @@ -476,7 +476,7 @@ static inline uint32_t mavlink_msg_gps_rtk_get_accuracy(const mavlink_message_t* /** * @brief Get field iar_num_hypotheses from gps_rtk message * - * @return Current number of integer ambiguity hypotheses. + * @return Current number of integer ambiguity hypotheses. */ static inline int32_t mavlink_msg_gps_rtk_get_iar_num_hypotheses(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_gps_status.h b/lib/main/MAVLink/common/mavlink_msg_gps_status.h index 8511be97ce..cedd545845 100755 --- a/lib/main/MAVLink/common/mavlink_msg_gps_status.h +++ b/lib/main/MAVLink/common/mavlink_msg_gps_status.h @@ -3,15 +3,15 @@ #define MAVLINK_MSG_ID_GPS_STATUS 25 -MAVPACKED( + typedef struct __mavlink_gps_status_t { - uint8_t satellites_visible; /*< Number of satellites visible*/ - uint8_t satellite_prn[20]; /*< Global satellite ID*/ - uint8_t satellite_used[20]; /*< 0: Satellite not used, 1: used for localization*/ - uint8_t satellite_elevation[20]; /*< Elevation (0: right on top of receiver, 90: on the horizon) of satellite*/ - uint8_t satellite_azimuth[20]; /*< Direction of satellite, 0: 0 deg, 255: 360 deg.*/ - uint8_t satellite_snr[20]; /*< Signal to noise ratio of satellite*/ -}) mavlink_gps_status_t; + uint8_t satellites_visible; /*< Number of satellites visible*/ + uint8_t satellite_prn[20]; /*< Global satellite ID*/ + uint8_t satellite_used[20]; /*< 0: Satellite not used, 1: used for localization*/ + uint8_t satellite_elevation[20]; /*< [deg] Elevation (0: right on top of receiver, 90: on the horizon) of satellite*/ + uint8_t satellite_azimuth[20]; /*< [deg] Direction of satellite, 0: 0 deg, 255: 360 deg.*/ + uint8_t satellite_snr[20]; /*< [dB] Signal to noise ratio of satellite*/ +} mavlink_gps_status_t; #define MAVLINK_MSG_ID_GPS_STATUS_LEN 101 #define MAVLINK_MSG_ID_GPS_STATUS_MIN_LEN 101 @@ -60,12 +60,12 @@ typedef struct __mavlink_gps_status_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param satellites_visible Number of satellites visible - * @param satellite_prn Global satellite ID - * @param satellite_used 0: Satellite not used, 1: used for localization - * @param satellite_elevation Elevation (0: right on top of receiver, 90: on the horizon) of satellite - * @param satellite_azimuth Direction of satellite, 0: 0 deg, 255: 360 deg. - * @param satellite_snr Signal to noise ratio of satellite + * @param satellites_visible Number of satellites visible + * @param satellite_prn Global satellite ID + * @param satellite_used 0: Satellite not used, 1: used for localization + * @param satellite_elevation [deg] Elevation (0: right on top of receiver, 90: on the horizon) of satellite + * @param satellite_azimuth [deg] Direction of satellite, 0: 0 deg, 255: 360 deg. + * @param satellite_snr [dB] Signal to noise ratio of satellite * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_gps_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -101,12 +101,12 @@ static inline uint16_t mavlink_msg_gps_status_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 will be sent over * @param msg The MAVLink message to compress the data into - * @param satellites_visible Number of satellites visible - * @param satellite_prn Global satellite ID - * @param satellite_used 0: Satellite not used, 1: used for localization - * @param satellite_elevation Elevation (0: right on top of receiver, 90: on the horizon) of satellite - * @param satellite_azimuth Direction of satellite, 0: 0 deg, 255: 360 deg. - * @param satellite_snr Signal to noise ratio of satellite + * @param satellites_visible Number of satellites visible + * @param satellite_prn Global satellite ID + * @param satellite_used 0: Satellite not used, 1: used for localization + * @param satellite_elevation [deg] Elevation (0: right on top of receiver, 90: on the horizon) of satellite + * @param satellite_azimuth [deg] Direction of satellite, 0: 0 deg, 255: 360 deg. + * @param satellite_snr [dB] Signal to noise ratio of satellite * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_gps_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -168,12 +168,12 @@ static inline uint16_t mavlink_msg_gps_status_encode_chan(uint8_t system_id, uin * @brief Send a gps_status message * @param chan MAVLink channel to send the message * - * @param satellites_visible Number of satellites visible - * @param satellite_prn Global satellite ID - * @param satellite_used 0: Satellite not used, 1: used for localization - * @param satellite_elevation Elevation (0: right on top of receiver, 90: on the horizon) of satellite - * @param satellite_azimuth Direction of satellite, 0: 0 deg, 255: 360 deg. - * @param satellite_snr Signal to noise ratio of satellite + * @param satellites_visible Number of satellites visible + * @param satellite_prn Global satellite ID + * @param satellite_used 0: Satellite not used, 1: used for localization + * @param satellite_elevation [deg] Elevation (0: right on top of receiver, 90: on the horizon) of satellite + * @param satellite_azimuth [deg] Direction of satellite, 0: 0 deg, 255: 360 deg. + * @param satellite_snr [dB] Signal to noise ratio of satellite */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -254,7 +254,7 @@ static inline void mavlink_msg_gps_status_send_buf(mavlink_message_t *msgbuf, ma /** * @brief Get field satellites_visible from gps_status message * - * @return Number of satellites visible + * @return Number of satellites visible */ static inline uint8_t mavlink_msg_gps_status_get_satellites_visible(const mavlink_message_t* msg) { @@ -264,7 +264,7 @@ static inline uint8_t mavlink_msg_gps_status_get_satellites_visible(const mavlin /** * @brief Get field satellite_prn from gps_status message * - * @return Global satellite ID + * @return Global satellite ID */ static inline uint16_t mavlink_msg_gps_status_get_satellite_prn(const mavlink_message_t* msg, uint8_t *satellite_prn) { @@ -274,7 +274,7 @@ static inline uint16_t mavlink_msg_gps_status_get_satellite_prn(const mavlink_me /** * @brief Get field satellite_used from gps_status message * - * @return 0: Satellite not used, 1: used for localization + * @return 0: Satellite not used, 1: used for localization */ static inline uint16_t mavlink_msg_gps_status_get_satellite_used(const mavlink_message_t* msg, uint8_t *satellite_used) { @@ -284,7 +284,7 @@ static inline uint16_t mavlink_msg_gps_status_get_satellite_used(const mavlink_m /** * @brief Get field satellite_elevation from gps_status message * - * @return Elevation (0: right on top of receiver, 90: on the horizon) of satellite + * @return [deg] Elevation (0: right on top of receiver, 90: on the horizon) of satellite */ static inline uint16_t mavlink_msg_gps_status_get_satellite_elevation(const mavlink_message_t* msg, uint8_t *satellite_elevation) { @@ -294,7 +294,7 @@ static inline uint16_t mavlink_msg_gps_status_get_satellite_elevation(const mavl /** * @brief Get field satellite_azimuth from gps_status message * - * @return Direction of satellite, 0: 0 deg, 255: 360 deg. + * @return [deg] Direction of satellite, 0: 0 deg, 255: 360 deg. */ static inline uint16_t mavlink_msg_gps_status_get_satellite_azimuth(const mavlink_message_t* msg, uint8_t *satellite_azimuth) { @@ -304,7 +304,7 @@ static inline uint16_t mavlink_msg_gps_status_get_satellite_azimuth(const mavlin /** * @brief Get field satellite_snr from gps_status message * - * @return Signal to noise ratio of satellite + * @return [dB] Signal to noise ratio of satellite */ static inline uint16_t mavlink_msg_gps_status_get_satellite_snr(const mavlink_message_t* msg, uint8_t *satellite_snr) { diff --git a/lib/main/MAVLink/common/mavlink_msg_heartbeat.h b/lib/main/MAVLink/common/mavlink_msg_heartbeat.h index 66020ff41f..7774a1006b 100755 --- a/lib/main/MAVLink/common/mavlink_msg_heartbeat.h +++ b/lib/main/MAVLink/common/mavlink_msg_heartbeat.h @@ -3,15 +3,15 @@ #define MAVLINK_MSG_ID_HEARTBEAT 0 -MAVPACKED( + typedef struct __mavlink_heartbeat_t { - uint32_t custom_mode; /*< A bitfield for use for autopilot-specific flags.*/ - uint8_t type; /*< Type of the MAV (quadrotor, helicopter, etc., up to 15 types, defined in MAV_TYPE ENUM)*/ - uint8_t autopilot; /*< Autopilot type / class. defined in MAV_AUTOPILOT ENUM*/ - uint8_t base_mode; /*< System mode bitfield, see MAV_MODE_FLAG ENUM in mavlink/include/mavlink_types.h*/ - uint8_t system_status; /*< System status flag, see MAV_STATE ENUM*/ - uint8_t mavlink_version; /*< MAVLink version, not writable by user, gets added by protocol because of magic data type: uint8_t_mavlink_version*/ -}) mavlink_heartbeat_t; + uint32_t custom_mode; /*< A bitfield for use for autopilot-specific flags*/ + uint8_t type; /*< Vehicle or component type. For a flight controller component the vehicle type (quadrotor, helicopter, etc.). For other components the component type (e.g. camera, gimbal, etc.). This should be used in preference to component id for identifying the component type.*/ + uint8_t autopilot; /*< Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers.*/ + uint8_t base_mode; /*< System mode bitmap.*/ + uint8_t system_status; /*< System status flag.*/ + uint8_t mavlink_version; /*< MAVLink version, not writable by user, gets added by protocol because of magic data type: uint8_t_mavlink_version*/ +} mavlink_heartbeat_t; #define MAVLINK_MSG_ID_HEARTBEAT_LEN 9 #define MAVLINK_MSG_ID_HEARTBEAT_MIN_LEN 9 @@ -28,10 +28,10 @@ typedef struct __mavlink_heartbeat_t { 0, \ "HEARTBEAT", \ 6, \ - { { "custom_mode", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_heartbeat_t, custom_mode) }, \ - { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_heartbeat_t, type) }, \ + { { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_heartbeat_t, type) }, \ { "autopilot", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_heartbeat_t, autopilot) }, \ { "base_mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_heartbeat_t, base_mode) }, \ + { "custom_mode", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_heartbeat_t, custom_mode) }, \ { "system_status", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_heartbeat_t, system_status) }, \ { "mavlink_version", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_heartbeat_t, mavlink_version) }, \ } \ @@ -40,10 +40,10 @@ typedef struct __mavlink_heartbeat_t { #define MAVLINK_MESSAGE_INFO_HEARTBEAT { \ "HEARTBEAT", \ 6, \ - { { "custom_mode", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_heartbeat_t, custom_mode) }, \ - { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_heartbeat_t, type) }, \ + { { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_heartbeat_t, type) }, \ { "autopilot", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_heartbeat_t, autopilot) }, \ { "base_mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_heartbeat_t, base_mode) }, \ + { "custom_mode", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_heartbeat_t, custom_mode) }, \ { "system_status", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_heartbeat_t, system_status) }, \ { "mavlink_version", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_heartbeat_t, mavlink_version) }, \ } \ @@ -56,11 +56,11 @@ typedef struct __mavlink_heartbeat_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param type Type of the MAV (quadrotor, helicopter, etc., up to 15 types, defined in MAV_TYPE ENUM) - * @param autopilot Autopilot type / class. defined in MAV_AUTOPILOT ENUM - * @param base_mode System mode bitfield, see MAV_MODE_FLAG ENUM in mavlink/include/mavlink_types.h - * @param custom_mode A bitfield for use for autopilot-specific flags. - * @param system_status System status flag, see MAV_STATE ENUM + * @param type Vehicle or component type. For a flight controller component the vehicle type (quadrotor, helicopter, etc.). For other components the component type (e.g. camera, gimbal, etc.). This should be used in preference to component id for identifying the component type. + * @param autopilot Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers. + * @param base_mode System mode bitmap. + * @param custom_mode A bitfield for use for autopilot-specific flags + * @param system_status System status flag. * @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, @@ -98,11 +98,11 @@ static inline uint16_t mavlink_msg_heartbeat_pack(uint8_t system_id, uint8_t com * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param type Type of the MAV (quadrotor, helicopter, etc., up to 15 types, defined in MAV_TYPE ENUM) - * @param autopilot Autopilot type / class. defined in MAV_AUTOPILOT ENUM - * @param base_mode System mode bitfield, see MAV_MODE_FLAG ENUM in mavlink/include/mavlink_types.h - * @param custom_mode A bitfield for use for autopilot-specific flags. - * @param system_status System status flag, see MAV_STATE ENUM + * @param type Vehicle or component type. For a flight controller component the vehicle type (quadrotor, helicopter, etc.). For other components the component type (e.g. camera, gimbal, etc.). This should be used in preference to component id for identifying the component type. + * @param autopilot Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers. + * @param base_mode System mode bitmap. + * @param custom_mode A bitfield for use for autopilot-specific flags + * @param system_status System status flag. * @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, @@ -166,11 +166,11 @@ static inline uint16_t mavlink_msg_heartbeat_encode_chan(uint8_t system_id, uint * @brief Send a heartbeat message * @param chan MAVLink channel to send the message * - * @param type Type of the MAV (quadrotor, helicopter, etc., up to 15 types, defined in MAV_TYPE ENUM) - * @param autopilot Autopilot type / class. defined in MAV_AUTOPILOT ENUM - * @param base_mode System mode bitfield, see MAV_MODE_FLAG ENUM in mavlink/include/mavlink_types.h - * @param custom_mode A bitfield for use for autopilot-specific flags. - * @param system_status System status flag, see MAV_STATE ENUM + * @param type Vehicle or component type. For a flight controller component the vehicle type (quadrotor, helicopter, etc.). For other components the component type (e.g. camera, gimbal, etc.). This should be used in preference to component id for identifying the component type. + * @param autopilot Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers. + * @param base_mode System mode bitmap. + * @param custom_mode A bitfield for use for autopilot-specific flags + * @param system_status System status flag. */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -255,7 +255,7 @@ static inline void mavlink_msg_heartbeat_send_buf(mavlink_message_t *msgbuf, mav /** * @brief Get field type from heartbeat message * - * @return Type of the MAV (quadrotor, helicopter, etc., up to 15 types, defined in MAV_TYPE ENUM) + * @return Vehicle or component type. For a flight controller component the vehicle type (quadrotor, helicopter, etc.). For other components the component type (e.g. camera, gimbal, etc.). This should be used in preference to component id for identifying the component type. */ static inline uint8_t mavlink_msg_heartbeat_get_type(const mavlink_message_t* msg) { @@ -265,7 +265,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_AUTOPILOT ENUM + * @return Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers. */ static inline uint8_t mavlink_msg_heartbeat_get_autopilot(const mavlink_message_t* msg) { @@ -275,7 +275,7 @@ static inline uint8_t mavlink_msg_heartbeat_get_autopilot(const mavlink_message_ /** * @brief Get field base_mode from heartbeat message * - * @return System mode bitfield, see MAV_MODE_FLAG ENUM in mavlink/include/mavlink_types.h + * @return System mode bitmap. */ static inline uint8_t mavlink_msg_heartbeat_get_base_mode(const mavlink_message_t* msg) { @@ -285,7 +285,7 @@ static inline uint8_t mavlink_msg_heartbeat_get_base_mode(const mavlink_message_ /** * @brief Get field custom_mode from heartbeat message * - * @return A bitfield for use for autopilot-specific flags. + * @return A bitfield for use for autopilot-specific flags */ static inline uint32_t mavlink_msg_heartbeat_get_custom_mode(const mavlink_message_t* msg) { @@ -295,7 +295,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_STATE ENUM + * @return System status flag. */ static inline uint8_t mavlink_msg_heartbeat_get_system_status(const mavlink_message_t* msg) { @@ -305,7 +305,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, not writable by user, gets added by protocol because of magic data type: uint8_t_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/lib/main/MAVLink/common/mavlink_msg_high_latency.h b/lib/main/MAVLink/common/mavlink_msg_high_latency.h index 7c87e5c2d9..a0f4e84963 100755 --- a/lib/main/MAVLink/common/mavlink_msg_high_latency.h +++ b/lib/main/MAVLink/common/mavlink_msg_high_latency.h @@ -3,33 +3,33 @@ #define MAVLINK_MSG_ID_HIGH_LATENCY 234 -MAVPACKED( + typedef struct __mavlink_high_latency_t { - uint32_t custom_mode; /*< A bitfield for use for autopilot-specific flags.*/ - int32_t latitude; /*< Latitude, expressed as degrees * 1E7*/ - int32_t longitude; /*< Longitude, expressed as degrees * 1E7*/ - int16_t roll; /*< roll (centidegrees)*/ - int16_t pitch; /*< pitch (centidegrees)*/ - uint16_t heading; /*< heading (centidegrees)*/ - int16_t heading_sp; /*< heading setpoint (centidegrees)*/ - int16_t altitude_amsl; /*< Altitude above mean sea level (meters)*/ - int16_t altitude_sp; /*< Altitude setpoint relative to the home position (meters)*/ - uint16_t wp_distance; /*< distance to target (meters)*/ - uint8_t base_mode; /*< System mode bitfield, see MAV_MODE_FLAG ENUM in mavlink/include/mavlink_types.h*/ - uint8_t landed_state; /*< The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown.*/ - int8_t throttle; /*< throttle (percentage)*/ - uint8_t airspeed; /*< airspeed (m/s)*/ - uint8_t airspeed_sp; /*< airspeed setpoint (m/s)*/ - uint8_t groundspeed; /*< groundspeed (m/s)*/ - int8_t climb_rate; /*< climb rate (m/s)*/ - uint8_t gps_nsat; /*< Number of satellites visible. If unknown, set to 255*/ - uint8_t gps_fix_type; /*< See the GPS_FIX_TYPE enum.*/ - uint8_t battery_remaining; /*< Remaining battery (percentage)*/ - int8_t temperature; /*< Autopilot temperature (degrees C)*/ - int8_t temperature_air; /*< Air temperature (degrees C) from airspeed sensor*/ - uint8_t failsafe; /*< failsafe (each bit represents a failsafe where 0=ok, 1=failsafe active (bit0:RC, bit1:batt, bit2:GPS, bit3:GCS, bit4:fence)*/ - uint8_t wp_num; /*< current waypoint number*/ -}) mavlink_high_latency_t; + uint32_t custom_mode; /*< A bitfield for use for autopilot-specific flags.*/ + int32_t latitude; /*< [degE7] Latitude*/ + int32_t longitude; /*< [degE7] Longitude*/ + int16_t roll; /*< [cdeg] roll*/ + int16_t pitch; /*< [cdeg] pitch*/ + uint16_t heading; /*< [cdeg] heading*/ + int16_t heading_sp; /*< [cdeg] heading setpoint*/ + int16_t altitude_amsl; /*< [m] Altitude above mean sea level*/ + int16_t altitude_sp; /*< [m] Altitude setpoint relative to the home position*/ + uint16_t wp_distance; /*< [m] distance to target*/ + uint8_t base_mode; /*< Bitmap of enabled system modes.*/ + uint8_t landed_state; /*< The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown.*/ + int8_t throttle; /*< [%] throttle (percentage)*/ + uint8_t airspeed; /*< [m/s] airspeed*/ + uint8_t airspeed_sp; /*< [m/s] airspeed setpoint*/ + uint8_t groundspeed; /*< [m/s] groundspeed*/ + int8_t climb_rate; /*< [m/s] climb rate*/ + uint8_t gps_nsat; /*< Number of satellites visible. If unknown, set to 255*/ + uint8_t gps_fix_type; /*< GPS Fix type.*/ + uint8_t battery_remaining; /*< [%] Remaining battery (percentage)*/ + int8_t temperature; /*< [degC] Autopilot temperature (degrees C)*/ + int8_t temperature_air; /*< [degC] Air temperature (degrees C) from airspeed sensor*/ + uint8_t failsafe; /*< failsafe (each bit represents a failsafe where 0=ok, 1=failsafe active (bit0:RC, bit1:batt, bit2:GPS, bit3:GCS, bit4:fence)*/ + uint8_t wp_num; /*< current waypoint number*/ +} mavlink_high_latency_t; #define MAVLINK_MSG_ID_HIGH_LATENCY_LEN 40 #define MAVLINK_MSG_ID_HIGH_LATENCY_MIN_LEN 40 @@ -46,19 +46,18 @@ typedef struct __mavlink_high_latency_t { 234, \ "HIGH_LATENCY", \ 24, \ - { { "custom_mode", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_high_latency_t, custom_mode) }, \ - { "latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_high_latency_t, latitude) }, \ - { "longitude", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_high_latency_t, longitude) }, \ + { { "base_mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 26, offsetof(mavlink_high_latency_t, base_mode) }, \ + { "custom_mode", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_high_latency_t, custom_mode) }, \ + { "landed_state", NULL, MAVLINK_TYPE_UINT8_T, 0, 27, offsetof(mavlink_high_latency_t, landed_state) }, \ { "roll", NULL, MAVLINK_TYPE_INT16_T, 0, 12, offsetof(mavlink_high_latency_t, roll) }, \ { "pitch", NULL, MAVLINK_TYPE_INT16_T, 0, 14, offsetof(mavlink_high_latency_t, pitch) }, \ { "heading", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_high_latency_t, heading) }, \ + { "throttle", NULL, MAVLINK_TYPE_INT8_T, 0, 28, offsetof(mavlink_high_latency_t, throttle) }, \ { "heading_sp", NULL, MAVLINK_TYPE_INT16_T, 0, 18, offsetof(mavlink_high_latency_t, heading_sp) }, \ + { "latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_high_latency_t, latitude) }, \ + { "longitude", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_high_latency_t, longitude) }, \ { "altitude_amsl", NULL, MAVLINK_TYPE_INT16_T, 0, 20, offsetof(mavlink_high_latency_t, altitude_amsl) }, \ { "altitude_sp", NULL, MAVLINK_TYPE_INT16_T, 0, 22, offsetof(mavlink_high_latency_t, altitude_sp) }, \ - { "wp_distance", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_high_latency_t, wp_distance) }, \ - { "base_mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 26, offsetof(mavlink_high_latency_t, base_mode) }, \ - { "landed_state", NULL, MAVLINK_TYPE_UINT8_T, 0, 27, offsetof(mavlink_high_latency_t, landed_state) }, \ - { "throttle", NULL, MAVLINK_TYPE_INT8_T, 0, 28, offsetof(mavlink_high_latency_t, throttle) }, \ { "airspeed", NULL, MAVLINK_TYPE_UINT8_T, 0, 29, offsetof(mavlink_high_latency_t, airspeed) }, \ { "airspeed_sp", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_high_latency_t, airspeed_sp) }, \ { "groundspeed", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_high_latency_t, groundspeed) }, \ @@ -70,25 +69,25 @@ typedef struct __mavlink_high_latency_t { { "temperature_air", NULL, MAVLINK_TYPE_INT8_T, 0, 37, offsetof(mavlink_high_latency_t, temperature_air) }, \ { "failsafe", NULL, MAVLINK_TYPE_UINT8_T, 0, 38, offsetof(mavlink_high_latency_t, failsafe) }, \ { "wp_num", NULL, MAVLINK_TYPE_UINT8_T, 0, 39, offsetof(mavlink_high_latency_t, wp_num) }, \ + { "wp_distance", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_high_latency_t, wp_distance) }, \ } \ } #else #define MAVLINK_MESSAGE_INFO_HIGH_LATENCY { \ "HIGH_LATENCY", \ 24, \ - { { "custom_mode", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_high_latency_t, custom_mode) }, \ - { "latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_high_latency_t, latitude) }, \ - { "longitude", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_high_latency_t, longitude) }, \ + { { "base_mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 26, offsetof(mavlink_high_latency_t, base_mode) }, \ + { "custom_mode", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_high_latency_t, custom_mode) }, \ + { "landed_state", NULL, MAVLINK_TYPE_UINT8_T, 0, 27, offsetof(mavlink_high_latency_t, landed_state) }, \ { "roll", NULL, MAVLINK_TYPE_INT16_T, 0, 12, offsetof(mavlink_high_latency_t, roll) }, \ { "pitch", NULL, MAVLINK_TYPE_INT16_T, 0, 14, offsetof(mavlink_high_latency_t, pitch) }, \ { "heading", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_high_latency_t, heading) }, \ + { "throttle", NULL, MAVLINK_TYPE_INT8_T, 0, 28, offsetof(mavlink_high_latency_t, throttle) }, \ { "heading_sp", NULL, MAVLINK_TYPE_INT16_T, 0, 18, offsetof(mavlink_high_latency_t, heading_sp) }, \ + { "latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_high_latency_t, latitude) }, \ + { "longitude", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_high_latency_t, longitude) }, \ { "altitude_amsl", NULL, MAVLINK_TYPE_INT16_T, 0, 20, offsetof(mavlink_high_latency_t, altitude_amsl) }, \ { "altitude_sp", NULL, MAVLINK_TYPE_INT16_T, 0, 22, offsetof(mavlink_high_latency_t, altitude_sp) }, \ - { "wp_distance", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_high_latency_t, wp_distance) }, \ - { "base_mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 26, offsetof(mavlink_high_latency_t, base_mode) }, \ - { "landed_state", NULL, MAVLINK_TYPE_UINT8_T, 0, 27, offsetof(mavlink_high_latency_t, landed_state) }, \ - { "throttle", NULL, MAVLINK_TYPE_INT8_T, 0, 28, offsetof(mavlink_high_latency_t, throttle) }, \ { "airspeed", NULL, MAVLINK_TYPE_UINT8_T, 0, 29, offsetof(mavlink_high_latency_t, airspeed) }, \ { "airspeed_sp", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_high_latency_t, airspeed_sp) }, \ { "groundspeed", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_high_latency_t, groundspeed) }, \ @@ -100,6 +99,7 @@ typedef struct __mavlink_high_latency_t { { "temperature_air", NULL, MAVLINK_TYPE_INT8_T, 0, 37, offsetof(mavlink_high_latency_t, temperature_air) }, \ { "failsafe", NULL, MAVLINK_TYPE_UINT8_T, 0, 38, offsetof(mavlink_high_latency_t, failsafe) }, \ { "wp_num", NULL, MAVLINK_TYPE_UINT8_T, 0, 39, offsetof(mavlink_high_latency_t, wp_num) }, \ + { "wp_distance", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_high_latency_t, wp_distance) }, \ } \ } #endif @@ -110,30 +110,30 @@ typedef struct __mavlink_high_latency_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param base_mode System mode bitfield, see MAV_MODE_FLAG ENUM in mavlink/include/mavlink_types.h - * @param custom_mode A bitfield for use for autopilot-specific flags. - * @param landed_state The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown. - * @param roll roll (centidegrees) - * @param pitch pitch (centidegrees) - * @param heading heading (centidegrees) - * @param throttle throttle (percentage) - * @param heading_sp heading setpoint (centidegrees) - * @param latitude Latitude, expressed as degrees * 1E7 - * @param longitude Longitude, expressed as degrees * 1E7 - * @param altitude_amsl Altitude above mean sea level (meters) - * @param altitude_sp Altitude setpoint relative to the home position (meters) - * @param airspeed airspeed (m/s) - * @param airspeed_sp airspeed setpoint (m/s) - * @param groundspeed groundspeed (m/s) - * @param climb_rate climb rate (m/s) - * @param gps_nsat Number of satellites visible. If unknown, set to 255 - * @param gps_fix_type See the GPS_FIX_TYPE enum. - * @param battery_remaining Remaining battery (percentage) - * @param temperature Autopilot temperature (degrees C) - * @param temperature_air Air temperature (degrees C) from airspeed sensor - * @param failsafe failsafe (each bit represents a failsafe where 0=ok, 1=failsafe active (bit0:RC, bit1:batt, bit2:GPS, bit3:GCS, bit4:fence) - * @param wp_num current waypoint number - * @param wp_distance distance to target (meters) + * @param base_mode Bitmap of enabled system modes. + * @param custom_mode A bitfield for use for autopilot-specific flags. + * @param landed_state The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown. + * @param roll [cdeg] roll + * @param pitch [cdeg] pitch + * @param heading [cdeg] heading + * @param throttle [%] throttle (percentage) + * @param heading_sp [cdeg] heading setpoint + * @param latitude [degE7] Latitude + * @param longitude [degE7] Longitude + * @param altitude_amsl [m] Altitude above mean sea level + * @param altitude_sp [m] Altitude setpoint relative to the home position + * @param airspeed [m/s] airspeed + * @param airspeed_sp [m/s] airspeed setpoint + * @param groundspeed [m/s] groundspeed + * @param climb_rate [m/s] climb rate + * @param gps_nsat Number of satellites visible. If unknown, set to 255 + * @param gps_fix_type GPS Fix type. + * @param battery_remaining [%] Remaining battery (percentage) + * @param temperature [degC] Autopilot temperature (degrees C) + * @param temperature_air [degC] Air temperature (degrees C) from airspeed sensor + * @param failsafe failsafe (each bit represents a failsafe where 0=ok, 1=failsafe active (bit0:RC, bit1:batt, bit2:GPS, bit3:GCS, bit4:fence) + * @param wp_num current waypoint number + * @param wp_distance [m] distance to target * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_high_latency_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -207,30 +207,30 @@ static inline uint16_t mavlink_msg_high_latency_pack(uint8_t system_id, uint8_t * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param base_mode System mode bitfield, see MAV_MODE_FLAG ENUM in mavlink/include/mavlink_types.h - * @param custom_mode A bitfield for use for autopilot-specific flags. - * @param landed_state The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown. - * @param roll roll (centidegrees) - * @param pitch pitch (centidegrees) - * @param heading heading (centidegrees) - * @param throttle throttle (percentage) - * @param heading_sp heading setpoint (centidegrees) - * @param latitude Latitude, expressed as degrees * 1E7 - * @param longitude Longitude, expressed as degrees * 1E7 - * @param altitude_amsl Altitude above mean sea level (meters) - * @param altitude_sp Altitude setpoint relative to the home position (meters) - * @param airspeed airspeed (m/s) - * @param airspeed_sp airspeed setpoint (m/s) - * @param groundspeed groundspeed (m/s) - * @param climb_rate climb rate (m/s) - * @param gps_nsat Number of satellites visible. If unknown, set to 255 - * @param gps_fix_type See the GPS_FIX_TYPE enum. - * @param battery_remaining Remaining battery (percentage) - * @param temperature Autopilot temperature (degrees C) - * @param temperature_air Air temperature (degrees C) from airspeed sensor - * @param failsafe failsafe (each bit represents a failsafe where 0=ok, 1=failsafe active (bit0:RC, bit1:batt, bit2:GPS, bit3:GCS, bit4:fence) - * @param wp_num current waypoint number - * @param wp_distance distance to target (meters) + * @param base_mode Bitmap of enabled system modes. + * @param custom_mode A bitfield for use for autopilot-specific flags. + * @param landed_state The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown. + * @param roll [cdeg] roll + * @param pitch [cdeg] pitch + * @param heading [cdeg] heading + * @param throttle [%] throttle (percentage) + * @param heading_sp [cdeg] heading setpoint + * @param latitude [degE7] Latitude + * @param longitude [degE7] Longitude + * @param altitude_amsl [m] Altitude above mean sea level + * @param altitude_sp [m] Altitude setpoint relative to the home position + * @param airspeed [m/s] airspeed + * @param airspeed_sp [m/s] airspeed setpoint + * @param groundspeed [m/s] groundspeed + * @param climb_rate [m/s] climb rate + * @param gps_nsat Number of satellites visible. If unknown, set to 255 + * @param gps_fix_type GPS Fix type. + * @param battery_remaining [%] Remaining battery (percentage) + * @param temperature [degC] Autopilot temperature (degrees C) + * @param temperature_air [degC] Air temperature (degrees C) from airspeed sensor + * @param failsafe failsafe (each bit represents a failsafe where 0=ok, 1=failsafe active (bit0:RC, bit1:batt, bit2:GPS, bit3:GCS, bit4:fence) + * @param wp_num current waypoint number + * @param wp_distance [m] distance to target * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_high_latency_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -330,30 +330,30 @@ static inline uint16_t mavlink_msg_high_latency_encode_chan(uint8_t system_id, u * @brief Send a high_latency message * @param chan MAVLink channel to send the message * - * @param base_mode System mode bitfield, see MAV_MODE_FLAG ENUM in mavlink/include/mavlink_types.h - * @param custom_mode A bitfield for use for autopilot-specific flags. - * @param landed_state The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown. - * @param roll roll (centidegrees) - * @param pitch pitch (centidegrees) - * @param heading heading (centidegrees) - * @param throttle throttle (percentage) - * @param heading_sp heading setpoint (centidegrees) - * @param latitude Latitude, expressed as degrees * 1E7 - * @param longitude Longitude, expressed as degrees * 1E7 - * @param altitude_amsl Altitude above mean sea level (meters) - * @param altitude_sp Altitude setpoint relative to the home position (meters) - * @param airspeed airspeed (m/s) - * @param airspeed_sp airspeed setpoint (m/s) - * @param groundspeed groundspeed (m/s) - * @param climb_rate climb rate (m/s) - * @param gps_nsat Number of satellites visible. If unknown, set to 255 - * @param gps_fix_type See the GPS_FIX_TYPE enum. - * @param battery_remaining Remaining battery (percentage) - * @param temperature Autopilot temperature (degrees C) - * @param temperature_air Air temperature (degrees C) from airspeed sensor - * @param failsafe failsafe (each bit represents a failsafe where 0=ok, 1=failsafe active (bit0:RC, bit1:batt, bit2:GPS, bit3:GCS, bit4:fence) - * @param wp_num current waypoint number - * @param wp_distance distance to target (meters) + * @param base_mode Bitmap of enabled system modes. + * @param custom_mode A bitfield for use for autopilot-specific flags. + * @param landed_state The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown. + * @param roll [cdeg] roll + * @param pitch [cdeg] pitch + * @param heading [cdeg] heading + * @param throttle [%] throttle (percentage) + * @param heading_sp [cdeg] heading setpoint + * @param latitude [degE7] Latitude + * @param longitude [degE7] Longitude + * @param altitude_amsl [m] Altitude above mean sea level + * @param altitude_sp [m] Altitude setpoint relative to the home position + * @param airspeed [m/s] airspeed + * @param airspeed_sp [m/s] airspeed setpoint + * @param groundspeed [m/s] groundspeed + * @param climb_rate [m/s] climb rate + * @param gps_nsat Number of satellites visible. If unknown, set to 255 + * @param gps_fix_type GPS Fix type. + * @param battery_remaining [%] Remaining battery (percentage) + * @param temperature [degC] Autopilot temperature (degrees C) + * @param temperature_air [degC] Air temperature (degrees C) from airspeed sensor + * @param failsafe failsafe (each bit represents a failsafe where 0=ok, 1=failsafe active (bit0:RC, bit1:batt, bit2:GPS, bit3:GCS, bit4:fence) + * @param wp_num current waypoint number + * @param wp_distance [m] distance to target */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -510,7 +510,7 @@ static inline void mavlink_msg_high_latency_send_buf(mavlink_message_t *msgbuf, /** * @brief Get field base_mode from high_latency message * - * @return System mode bitfield, see MAV_MODE_FLAG ENUM in mavlink/include/mavlink_types.h + * @return Bitmap of enabled system modes. */ static inline uint8_t mavlink_msg_high_latency_get_base_mode(const mavlink_message_t* msg) { @@ -520,7 +520,7 @@ static inline uint8_t mavlink_msg_high_latency_get_base_mode(const mavlink_messa /** * @brief Get field custom_mode from high_latency message * - * @return A bitfield for use for autopilot-specific flags. + * @return A bitfield for use for autopilot-specific flags. */ static inline uint32_t mavlink_msg_high_latency_get_custom_mode(const mavlink_message_t* msg) { @@ -530,7 +530,7 @@ static inline uint32_t mavlink_msg_high_latency_get_custom_mode(const mavlink_me /** * @brief Get field landed_state from high_latency message * - * @return The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown. + * @return The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown. */ static inline uint8_t mavlink_msg_high_latency_get_landed_state(const mavlink_message_t* msg) { @@ -540,7 +540,7 @@ static inline uint8_t mavlink_msg_high_latency_get_landed_state(const mavlink_me /** * @brief Get field roll from high_latency message * - * @return roll (centidegrees) + * @return [cdeg] roll */ static inline int16_t mavlink_msg_high_latency_get_roll(const mavlink_message_t* msg) { @@ -550,7 +550,7 @@ static inline int16_t mavlink_msg_high_latency_get_roll(const mavlink_message_t* /** * @brief Get field pitch from high_latency message * - * @return pitch (centidegrees) + * @return [cdeg] pitch */ static inline int16_t mavlink_msg_high_latency_get_pitch(const mavlink_message_t* msg) { @@ -560,7 +560,7 @@ static inline int16_t mavlink_msg_high_latency_get_pitch(const mavlink_message_t /** * @brief Get field heading from high_latency message * - * @return heading (centidegrees) + * @return [cdeg] heading */ static inline uint16_t mavlink_msg_high_latency_get_heading(const mavlink_message_t* msg) { @@ -570,7 +570,7 @@ static inline uint16_t mavlink_msg_high_latency_get_heading(const mavlink_messag /** * @brief Get field throttle from high_latency message * - * @return throttle (percentage) + * @return [%] throttle (percentage) */ static inline int8_t mavlink_msg_high_latency_get_throttle(const mavlink_message_t* msg) { @@ -580,7 +580,7 @@ static inline int8_t mavlink_msg_high_latency_get_throttle(const mavlink_message /** * @brief Get field heading_sp from high_latency message * - * @return heading setpoint (centidegrees) + * @return [cdeg] heading setpoint */ static inline int16_t mavlink_msg_high_latency_get_heading_sp(const mavlink_message_t* msg) { @@ -590,7 +590,7 @@ static inline int16_t mavlink_msg_high_latency_get_heading_sp(const mavlink_mess /** * @brief Get field latitude from high_latency message * - * @return Latitude, expressed as degrees * 1E7 + * @return [degE7] Latitude */ static inline int32_t mavlink_msg_high_latency_get_latitude(const mavlink_message_t* msg) { @@ -600,7 +600,7 @@ static inline int32_t mavlink_msg_high_latency_get_latitude(const mavlink_messag /** * @brief Get field longitude from high_latency message * - * @return Longitude, expressed as degrees * 1E7 + * @return [degE7] Longitude */ static inline int32_t mavlink_msg_high_latency_get_longitude(const mavlink_message_t* msg) { @@ -610,7 +610,7 @@ static inline int32_t mavlink_msg_high_latency_get_longitude(const mavlink_messa /** * @brief Get field altitude_amsl from high_latency message * - * @return Altitude above mean sea level (meters) + * @return [m] Altitude above mean sea level */ static inline int16_t mavlink_msg_high_latency_get_altitude_amsl(const mavlink_message_t* msg) { @@ -620,7 +620,7 @@ static inline int16_t mavlink_msg_high_latency_get_altitude_amsl(const mavlink_m /** * @brief Get field altitude_sp from high_latency message * - * @return Altitude setpoint relative to the home position (meters) + * @return [m] Altitude setpoint relative to the home position */ static inline int16_t mavlink_msg_high_latency_get_altitude_sp(const mavlink_message_t* msg) { @@ -630,7 +630,7 @@ static inline int16_t mavlink_msg_high_latency_get_altitude_sp(const mavlink_mes /** * @brief Get field airspeed from high_latency message * - * @return airspeed (m/s) + * @return [m/s] airspeed */ static inline uint8_t mavlink_msg_high_latency_get_airspeed(const mavlink_message_t* msg) { @@ -640,7 +640,7 @@ static inline uint8_t mavlink_msg_high_latency_get_airspeed(const mavlink_messag /** * @brief Get field airspeed_sp from high_latency message * - * @return airspeed setpoint (m/s) + * @return [m/s] airspeed setpoint */ static inline uint8_t mavlink_msg_high_latency_get_airspeed_sp(const mavlink_message_t* msg) { @@ -650,7 +650,7 @@ static inline uint8_t mavlink_msg_high_latency_get_airspeed_sp(const mavlink_mes /** * @brief Get field groundspeed from high_latency message * - * @return groundspeed (m/s) + * @return [m/s] groundspeed */ static inline uint8_t mavlink_msg_high_latency_get_groundspeed(const mavlink_message_t* msg) { @@ -660,7 +660,7 @@ static inline uint8_t mavlink_msg_high_latency_get_groundspeed(const mavlink_mes /** * @brief Get field climb_rate from high_latency message * - * @return climb rate (m/s) + * @return [m/s] climb rate */ static inline int8_t mavlink_msg_high_latency_get_climb_rate(const mavlink_message_t* msg) { @@ -670,7 +670,7 @@ static inline int8_t mavlink_msg_high_latency_get_climb_rate(const mavlink_messa /** * @brief Get field gps_nsat from high_latency message * - * @return Number of satellites visible. If unknown, set to 255 + * @return Number of satellites visible. If unknown, set to 255 */ static inline uint8_t mavlink_msg_high_latency_get_gps_nsat(const mavlink_message_t* msg) { @@ -680,7 +680,7 @@ static inline uint8_t mavlink_msg_high_latency_get_gps_nsat(const mavlink_messag /** * @brief Get field gps_fix_type from high_latency message * - * @return See the GPS_FIX_TYPE enum. + * @return GPS Fix type. */ static inline uint8_t mavlink_msg_high_latency_get_gps_fix_type(const mavlink_message_t* msg) { @@ -690,7 +690,7 @@ static inline uint8_t mavlink_msg_high_latency_get_gps_fix_type(const mavlink_me /** * @brief Get field battery_remaining from high_latency message * - * @return Remaining battery (percentage) + * @return [%] Remaining battery (percentage) */ static inline uint8_t mavlink_msg_high_latency_get_battery_remaining(const mavlink_message_t* msg) { @@ -700,7 +700,7 @@ static inline uint8_t mavlink_msg_high_latency_get_battery_remaining(const mavli /** * @brief Get field temperature from high_latency message * - * @return Autopilot temperature (degrees C) + * @return [degC] Autopilot temperature (degrees C) */ static inline int8_t mavlink_msg_high_latency_get_temperature(const mavlink_message_t* msg) { @@ -710,7 +710,7 @@ static inline int8_t mavlink_msg_high_latency_get_temperature(const mavlink_mess /** * @brief Get field temperature_air from high_latency message * - * @return Air temperature (degrees C) from airspeed sensor + * @return [degC] Air temperature (degrees C) from airspeed sensor */ static inline int8_t mavlink_msg_high_latency_get_temperature_air(const mavlink_message_t* msg) { @@ -720,7 +720,7 @@ static inline int8_t mavlink_msg_high_latency_get_temperature_air(const mavlink_ /** * @brief Get field failsafe from high_latency message * - * @return failsafe (each bit represents a failsafe where 0=ok, 1=failsafe active (bit0:RC, bit1:batt, bit2:GPS, bit3:GCS, bit4:fence) + * @return failsafe (each bit represents a failsafe where 0=ok, 1=failsafe active (bit0:RC, bit1:batt, bit2:GPS, bit3:GCS, bit4:fence) */ static inline uint8_t mavlink_msg_high_latency_get_failsafe(const mavlink_message_t* msg) { @@ -730,7 +730,7 @@ static inline uint8_t mavlink_msg_high_latency_get_failsafe(const mavlink_messag /** * @brief Get field wp_num from high_latency message * - * @return current waypoint number + * @return current waypoint number */ static inline uint8_t mavlink_msg_high_latency_get_wp_num(const mavlink_message_t* msg) { @@ -740,7 +740,7 @@ static inline uint8_t mavlink_msg_high_latency_get_wp_num(const mavlink_message_ /** * @brief Get field wp_distance from high_latency message * - * @return distance to target (meters) + * @return [m] distance to target */ static inline uint16_t mavlink_msg_high_latency_get_wp_distance(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_high_latency2.h b/lib/main/MAVLink/common/mavlink_msg_high_latency2.h new file mode 100644 index 0000000000..3de15a7101 --- /dev/null +++ b/lib/main/MAVLink/common/mavlink_msg_high_latency2.h @@ -0,0 +1,863 @@ +#pragma once +// MESSAGE HIGH_LATENCY2 PACKING + +#define MAVLINK_MSG_ID_HIGH_LATENCY2 235 + + +typedef struct __mavlink_high_latency2_t { + uint32_t timestamp; /*< [ms] Timestamp (milliseconds since boot or Unix epoch)*/ + int32_t latitude; /*< [degE7] Latitude*/ + int32_t longitude; /*< [degE7] Longitude*/ + uint16_t custom_mode; /*< A bitfield for use for autopilot-specific flags (2 byte version).*/ + int16_t altitude; /*< [m] Altitude above mean sea level*/ + int16_t target_altitude; /*< [m] Altitude setpoint*/ + uint16_t target_distance; /*< [dam] Distance to target waypoint or position*/ + uint16_t wp_num; /*< Current waypoint number*/ + uint16_t failure_flags; /*< Bitmap of failure flags.*/ + uint8_t type; /*< Type of the MAV (quadrotor, helicopter, etc.)*/ + uint8_t autopilot; /*< Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers.*/ + uint8_t heading; /*< [deg/2] Heading*/ + uint8_t target_heading; /*< [deg/2] Heading setpoint*/ + uint8_t throttle; /*< [%] Throttle*/ + uint8_t airspeed; /*< [m/s*5] Airspeed*/ + uint8_t airspeed_sp; /*< [m/s*5] Airspeed setpoint*/ + uint8_t groundspeed; /*< [m/s*5] Groundspeed*/ + uint8_t windspeed; /*< [m/s*5] Windspeed*/ + uint8_t wind_heading; /*< [deg/2] Wind heading*/ + uint8_t eph; /*< [dm] Maximum error horizontal position since last message*/ + uint8_t epv; /*< [dm] Maximum error vertical position since last message*/ + int8_t temperature_air; /*< [degC] Air temperature from airspeed sensor*/ + int8_t climb_rate; /*< [dm/s] Maximum climb rate magnitude since last message*/ + int8_t battery; /*< [%] Battery level (-1 if field not provided).*/ + int8_t custom0; /*< Field for custom payload.*/ + int8_t custom1; /*< Field for custom payload.*/ + int8_t custom2; /*< Field for custom payload.*/ +} mavlink_high_latency2_t; + +#define MAVLINK_MSG_ID_HIGH_LATENCY2_LEN 42 +#define MAVLINK_MSG_ID_HIGH_LATENCY2_MIN_LEN 42 +#define MAVLINK_MSG_ID_235_LEN 42 +#define MAVLINK_MSG_ID_235_MIN_LEN 42 + +#define MAVLINK_MSG_ID_HIGH_LATENCY2_CRC 179 +#define MAVLINK_MSG_ID_235_CRC 179 + + + +#if MAVLINK_COMMAND_24BIT +#define MAVLINK_MESSAGE_INFO_HIGH_LATENCY2 { \ + 235, \ + "HIGH_LATENCY2", \ + 27, \ + { { "timestamp", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_high_latency2_t, timestamp) }, \ + { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 24, offsetof(mavlink_high_latency2_t, type) }, \ + { "autopilot", NULL, MAVLINK_TYPE_UINT8_T, 0, 25, offsetof(mavlink_high_latency2_t, autopilot) }, \ + { "custom_mode", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_high_latency2_t, custom_mode) }, \ + { "latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_high_latency2_t, latitude) }, \ + { "longitude", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_high_latency2_t, longitude) }, \ + { "altitude", NULL, MAVLINK_TYPE_INT16_T, 0, 14, offsetof(mavlink_high_latency2_t, altitude) }, \ + { "target_altitude", NULL, MAVLINK_TYPE_INT16_T, 0, 16, offsetof(mavlink_high_latency2_t, target_altitude) }, \ + { "heading", NULL, MAVLINK_TYPE_UINT8_T, 0, 26, offsetof(mavlink_high_latency2_t, heading) }, \ + { "target_heading", NULL, MAVLINK_TYPE_UINT8_T, 0, 27, offsetof(mavlink_high_latency2_t, target_heading) }, \ + { "target_distance", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_high_latency2_t, target_distance) }, \ + { "throttle", NULL, MAVLINK_TYPE_UINT8_T, 0, 28, offsetof(mavlink_high_latency2_t, throttle) }, \ + { "airspeed", NULL, MAVLINK_TYPE_UINT8_T, 0, 29, offsetof(mavlink_high_latency2_t, airspeed) }, \ + { "airspeed_sp", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_high_latency2_t, airspeed_sp) }, \ + { "groundspeed", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_high_latency2_t, groundspeed) }, \ + { "windspeed", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_high_latency2_t, windspeed) }, \ + { "wind_heading", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_high_latency2_t, wind_heading) }, \ + { "eph", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_high_latency2_t, eph) }, \ + { "epv", NULL, MAVLINK_TYPE_UINT8_T, 0, 35, offsetof(mavlink_high_latency2_t, epv) }, \ + { "temperature_air", NULL, MAVLINK_TYPE_INT8_T, 0, 36, offsetof(mavlink_high_latency2_t, temperature_air) }, \ + { "climb_rate", NULL, MAVLINK_TYPE_INT8_T, 0, 37, offsetof(mavlink_high_latency2_t, climb_rate) }, \ + { "battery", NULL, MAVLINK_TYPE_INT8_T, 0, 38, offsetof(mavlink_high_latency2_t, battery) }, \ + { "wp_num", NULL, MAVLINK_TYPE_UINT16_T, 0, 20, offsetof(mavlink_high_latency2_t, wp_num) }, \ + { "failure_flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 22, offsetof(mavlink_high_latency2_t, failure_flags) }, \ + { "custom0", NULL, MAVLINK_TYPE_INT8_T, 0, 39, offsetof(mavlink_high_latency2_t, custom0) }, \ + { "custom1", NULL, MAVLINK_TYPE_INT8_T, 0, 40, offsetof(mavlink_high_latency2_t, custom1) }, \ + { "custom2", NULL, MAVLINK_TYPE_INT8_T, 0, 41, offsetof(mavlink_high_latency2_t, custom2) }, \ + } \ +} +#else +#define MAVLINK_MESSAGE_INFO_HIGH_LATENCY2 { \ + "HIGH_LATENCY2", \ + 27, \ + { { "timestamp", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_high_latency2_t, timestamp) }, \ + { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 24, offsetof(mavlink_high_latency2_t, type) }, \ + { "autopilot", NULL, MAVLINK_TYPE_UINT8_T, 0, 25, offsetof(mavlink_high_latency2_t, autopilot) }, \ + { "custom_mode", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_high_latency2_t, custom_mode) }, \ + { "latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_high_latency2_t, latitude) }, \ + { "longitude", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_high_latency2_t, longitude) }, \ + { "altitude", NULL, MAVLINK_TYPE_INT16_T, 0, 14, offsetof(mavlink_high_latency2_t, altitude) }, \ + { "target_altitude", NULL, MAVLINK_TYPE_INT16_T, 0, 16, offsetof(mavlink_high_latency2_t, target_altitude) }, \ + { "heading", NULL, MAVLINK_TYPE_UINT8_T, 0, 26, offsetof(mavlink_high_latency2_t, heading) }, \ + { "target_heading", NULL, MAVLINK_TYPE_UINT8_T, 0, 27, offsetof(mavlink_high_latency2_t, target_heading) }, \ + { "target_distance", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_high_latency2_t, target_distance) }, \ + { "throttle", NULL, MAVLINK_TYPE_UINT8_T, 0, 28, offsetof(mavlink_high_latency2_t, throttle) }, \ + { "airspeed", NULL, MAVLINK_TYPE_UINT8_T, 0, 29, offsetof(mavlink_high_latency2_t, airspeed) }, \ + { "airspeed_sp", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_high_latency2_t, airspeed_sp) }, \ + { "groundspeed", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_high_latency2_t, groundspeed) }, \ + { "windspeed", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_high_latency2_t, windspeed) }, \ + { "wind_heading", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_high_latency2_t, wind_heading) }, \ + { "eph", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_high_latency2_t, eph) }, \ + { "epv", NULL, MAVLINK_TYPE_UINT8_T, 0, 35, offsetof(mavlink_high_latency2_t, epv) }, \ + { "temperature_air", NULL, MAVLINK_TYPE_INT8_T, 0, 36, offsetof(mavlink_high_latency2_t, temperature_air) }, \ + { "climb_rate", NULL, MAVLINK_TYPE_INT8_T, 0, 37, offsetof(mavlink_high_latency2_t, climb_rate) }, \ + { "battery", NULL, MAVLINK_TYPE_INT8_T, 0, 38, offsetof(mavlink_high_latency2_t, battery) }, \ + { "wp_num", NULL, MAVLINK_TYPE_UINT16_T, 0, 20, offsetof(mavlink_high_latency2_t, wp_num) }, \ + { "failure_flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 22, offsetof(mavlink_high_latency2_t, failure_flags) }, \ + { "custom0", NULL, MAVLINK_TYPE_INT8_T, 0, 39, offsetof(mavlink_high_latency2_t, custom0) }, \ + { "custom1", NULL, MAVLINK_TYPE_INT8_T, 0, 40, offsetof(mavlink_high_latency2_t, custom1) }, \ + { "custom2", NULL, MAVLINK_TYPE_INT8_T, 0, 41, offsetof(mavlink_high_latency2_t, custom2) }, \ + } \ +} +#endif + +/** + * @brief Pack a high_latency2 message + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param msg The MAVLink message to compress the data into + * + * @param timestamp [ms] Timestamp (milliseconds since boot or Unix epoch) + * @param type Type of the MAV (quadrotor, helicopter, etc.) + * @param autopilot Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers. + * @param custom_mode A bitfield for use for autopilot-specific flags (2 byte version). + * @param latitude [degE7] Latitude + * @param longitude [degE7] Longitude + * @param altitude [m] Altitude above mean sea level + * @param target_altitude [m] Altitude setpoint + * @param heading [deg/2] Heading + * @param target_heading [deg/2] Heading setpoint + * @param target_distance [dam] Distance to target waypoint or position + * @param throttle [%] Throttle + * @param airspeed [m/s*5] Airspeed + * @param airspeed_sp [m/s*5] Airspeed setpoint + * @param groundspeed [m/s*5] Groundspeed + * @param windspeed [m/s*5] Windspeed + * @param wind_heading [deg/2] Wind heading + * @param eph [dm] Maximum error horizontal position since last message + * @param epv [dm] Maximum error vertical position since last message + * @param temperature_air [degC] Air temperature from airspeed sensor + * @param climb_rate [dm/s] Maximum climb rate magnitude since last message + * @param battery [%] Battery level (-1 if field not provided). + * @param wp_num Current waypoint number + * @param failure_flags Bitmap of failure flags. + * @param custom0 Field for custom payload. + * @param custom1 Field for custom payload. + * @param custom2 Field for custom payload. + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_high_latency2_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, + uint32_t timestamp, uint8_t type, uint8_t autopilot, uint16_t custom_mode, int32_t latitude, int32_t longitude, int16_t altitude, int16_t target_altitude, uint8_t heading, uint8_t target_heading, uint16_t target_distance, uint8_t throttle, uint8_t airspeed, uint8_t airspeed_sp, uint8_t groundspeed, uint8_t windspeed, uint8_t wind_heading, uint8_t eph, uint8_t epv, int8_t temperature_air, int8_t climb_rate, int8_t battery, uint16_t wp_num, uint16_t failure_flags, int8_t custom0, int8_t custom1, int8_t custom2) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[MAVLINK_MSG_ID_HIGH_LATENCY2_LEN]; + _mav_put_uint32_t(buf, 0, timestamp); + _mav_put_int32_t(buf, 4, latitude); + _mav_put_int32_t(buf, 8, longitude); + _mav_put_uint16_t(buf, 12, custom_mode); + _mav_put_int16_t(buf, 14, altitude); + _mav_put_int16_t(buf, 16, target_altitude); + _mav_put_uint16_t(buf, 18, target_distance); + _mav_put_uint16_t(buf, 20, wp_num); + _mav_put_uint16_t(buf, 22, failure_flags); + _mav_put_uint8_t(buf, 24, type); + _mav_put_uint8_t(buf, 25, autopilot); + _mav_put_uint8_t(buf, 26, heading); + _mav_put_uint8_t(buf, 27, target_heading); + _mav_put_uint8_t(buf, 28, throttle); + _mav_put_uint8_t(buf, 29, airspeed); + _mav_put_uint8_t(buf, 30, airspeed_sp); + _mav_put_uint8_t(buf, 31, groundspeed); + _mav_put_uint8_t(buf, 32, windspeed); + _mav_put_uint8_t(buf, 33, wind_heading); + _mav_put_uint8_t(buf, 34, eph); + _mav_put_uint8_t(buf, 35, epv); + _mav_put_int8_t(buf, 36, temperature_air); + _mav_put_int8_t(buf, 37, climb_rate); + _mav_put_int8_t(buf, 38, battery); + _mav_put_int8_t(buf, 39, custom0); + _mav_put_int8_t(buf, 40, custom1); + _mav_put_int8_t(buf, 41, custom2); + + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIGH_LATENCY2_LEN); +#else + mavlink_high_latency2_t packet; + packet.timestamp = timestamp; + packet.latitude = latitude; + packet.longitude = longitude; + packet.custom_mode = custom_mode; + packet.altitude = altitude; + packet.target_altitude = target_altitude; + packet.target_distance = target_distance; + packet.wp_num = wp_num; + packet.failure_flags = failure_flags; + packet.type = type; + packet.autopilot = autopilot; + packet.heading = heading; + packet.target_heading = target_heading; + packet.throttle = throttle; + packet.airspeed = airspeed; + packet.airspeed_sp = airspeed_sp; + packet.groundspeed = groundspeed; + packet.windspeed = windspeed; + packet.wind_heading = wind_heading; + packet.eph = eph; + packet.epv = epv; + packet.temperature_air = temperature_air; + packet.climb_rate = climb_rate; + packet.battery = battery; + packet.custom0 = custom0; + packet.custom1 = custom1; + packet.custom2 = custom2; + + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIGH_LATENCY2_LEN); +#endif + + msg->msgid = MAVLINK_MSG_ID_HIGH_LATENCY2; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HIGH_LATENCY2_MIN_LEN, MAVLINK_MSG_ID_HIGH_LATENCY2_LEN, MAVLINK_MSG_ID_HIGH_LATENCY2_CRC); +} + +/** + * @brief Pack a high_latency2 message on a channel + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param chan The MAVLink channel this message will be sent over + * @param msg The MAVLink message to compress the data into + * @param timestamp [ms] Timestamp (milliseconds since boot or Unix epoch) + * @param type Type of the MAV (quadrotor, helicopter, etc.) + * @param autopilot Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers. + * @param custom_mode A bitfield for use for autopilot-specific flags (2 byte version). + * @param latitude [degE7] Latitude + * @param longitude [degE7] Longitude + * @param altitude [m] Altitude above mean sea level + * @param target_altitude [m] Altitude setpoint + * @param heading [deg/2] Heading + * @param target_heading [deg/2] Heading setpoint + * @param target_distance [dam] Distance to target waypoint or position + * @param throttle [%] Throttle + * @param airspeed [m/s*5] Airspeed + * @param airspeed_sp [m/s*5] Airspeed setpoint + * @param groundspeed [m/s*5] Groundspeed + * @param windspeed [m/s*5] Windspeed + * @param wind_heading [deg/2] Wind heading + * @param eph [dm] Maximum error horizontal position since last message + * @param epv [dm] Maximum error vertical position since last message + * @param temperature_air [degC] Air temperature from airspeed sensor + * @param climb_rate [dm/s] Maximum climb rate magnitude since last message + * @param battery [%] Battery level (-1 if field not provided). + * @param wp_num Current waypoint number + * @param failure_flags Bitmap of failure flags. + * @param custom0 Field for custom payload. + * @param custom1 Field for custom payload. + * @param custom2 Field for custom payload. + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_high_latency2_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, + mavlink_message_t* msg, + uint32_t timestamp,uint8_t type,uint8_t autopilot,uint16_t custom_mode,int32_t latitude,int32_t longitude,int16_t altitude,int16_t target_altitude,uint8_t heading,uint8_t target_heading,uint16_t target_distance,uint8_t throttle,uint8_t airspeed,uint8_t airspeed_sp,uint8_t groundspeed,uint8_t windspeed,uint8_t wind_heading,uint8_t eph,uint8_t epv,int8_t temperature_air,int8_t climb_rate,int8_t battery,uint16_t wp_num,uint16_t failure_flags,int8_t custom0,int8_t custom1,int8_t custom2) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[MAVLINK_MSG_ID_HIGH_LATENCY2_LEN]; + _mav_put_uint32_t(buf, 0, timestamp); + _mav_put_int32_t(buf, 4, latitude); + _mav_put_int32_t(buf, 8, longitude); + _mav_put_uint16_t(buf, 12, custom_mode); + _mav_put_int16_t(buf, 14, altitude); + _mav_put_int16_t(buf, 16, target_altitude); + _mav_put_uint16_t(buf, 18, target_distance); + _mav_put_uint16_t(buf, 20, wp_num); + _mav_put_uint16_t(buf, 22, failure_flags); + _mav_put_uint8_t(buf, 24, type); + _mav_put_uint8_t(buf, 25, autopilot); + _mav_put_uint8_t(buf, 26, heading); + _mav_put_uint8_t(buf, 27, target_heading); + _mav_put_uint8_t(buf, 28, throttle); + _mav_put_uint8_t(buf, 29, airspeed); + _mav_put_uint8_t(buf, 30, airspeed_sp); + _mav_put_uint8_t(buf, 31, groundspeed); + _mav_put_uint8_t(buf, 32, windspeed); + _mav_put_uint8_t(buf, 33, wind_heading); + _mav_put_uint8_t(buf, 34, eph); + _mav_put_uint8_t(buf, 35, epv); + _mav_put_int8_t(buf, 36, temperature_air); + _mav_put_int8_t(buf, 37, climb_rate); + _mav_put_int8_t(buf, 38, battery); + _mav_put_int8_t(buf, 39, custom0); + _mav_put_int8_t(buf, 40, custom1); + _mav_put_int8_t(buf, 41, custom2); + + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIGH_LATENCY2_LEN); +#else + mavlink_high_latency2_t packet; + packet.timestamp = timestamp; + packet.latitude = latitude; + packet.longitude = longitude; + packet.custom_mode = custom_mode; + packet.altitude = altitude; + packet.target_altitude = target_altitude; + packet.target_distance = target_distance; + packet.wp_num = wp_num; + packet.failure_flags = failure_flags; + packet.type = type; + packet.autopilot = autopilot; + packet.heading = heading; + packet.target_heading = target_heading; + packet.throttle = throttle; + packet.airspeed = airspeed; + packet.airspeed_sp = airspeed_sp; + packet.groundspeed = groundspeed; + packet.windspeed = windspeed; + packet.wind_heading = wind_heading; + packet.eph = eph; + packet.epv = epv; + packet.temperature_air = temperature_air; + packet.climb_rate = climb_rate; + packet.battery = battery; + packet.custom0 = custom0; + packet.custom1 = custom1; + packet.custom2 = custom2; + + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIGH_LATENCY2_LEN); +#endif + + msg->msgid = MAVLINK_MSG_ID_HIGH_LATENCY2; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HIGH_LATENCY2_MIN_LEN, MAVLINK_MSG_ID_HIGH_LATENCY2_LEN, MAVLINK_MSG_ID_HIGH_LATENCY2_CRC); +} + +/** + * @brief Encode a high_latency2 struct + * + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param msg The MAVLink message to compress the data into + * @param high_latency2 C-struct to read the message contents from + */ +static inline uint16_t mavlink_msg_high_latency2_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_high_latency2_t* high_latency2) +{ + return mavlink_msg_high_latency2_pack(system_id, component_id, msg, high_latency2->timestamp, high_latency2->type, high_latency2->autopilot, high_latency2->custom_mode, high_latency2->latitude, high_latency2->longitude, high_latency2->altitude, high_latency2->target_altitude, high_latency2->heading, high_latency2->target_heading, high_latency2->target_distance, high_latency2->throttle, high_latency2->airspeed, high_latency2->airspeed_sp, high_latency2->groundspeed, high_latency2->windspeed, high_latency2->wind_heading, high_latency2->eph, high_latency2->epv, high_latency2->temperature_air, high_latency2->climb_rate, high_latency2->battery, high_latency2->wp_num, high_latency2->failure_flags, high_latency2->custom0, high_latency2->custom1, high_latency2->custom2); +} + +/** + * @brief Encode a high_latency2 struct on a channel + * + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param chan The MAVLink channel this message will be sent over + * @param msg The MAVLink message to compress the data into + * @param high_latency2 C-struct to read the message contents from + */ +static inline uint16_t mavlink_msg_high_latency2_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_high_latency2_t* high_latency2) +{ + return mavlink_msg_high_latency2_pack_chan(system_id, component_id, chan, msg, high_latency2->timestamp, high_latency2->type, high_latency2->autopilot, high_latency2->custom_mode, high_latency2->latitude, high_latency2->longitude, high_latency2->altitude, high_latency2->target_altitude, high_latency2->heading, high_latency2->target_heading, high_latency2->target_distance, high_latency2->throttle, high_latency2->airspeed, high_latency2->airspeed_sp, high_latency2->groundspeed, high_latency2->windspeed, high_latency2->wind_heading, high_latency2->eph, high_latency2->epv, high_latency2->temperature_air, high_latency2->climb_rate, high_latency2->battery, high_latency2->wp_num, high_latency2->failure_flags, high_latency2->custom0, high_latency2->custom1, high_latency2->custom2); +} + +/** + * @brief Send a high_latency2 message + * @param chan MAVLink channel to send the message + * + * @param timestamp [ms] Timestamp (milliseconds since boot or Unix epoch) + * @param type Type of the MAV (quadrotor, helicopter, etc.) + * @param autopilot Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers. + * @param custom_mode A bitfield for use for autopilot-specific flags (2 byte version). + * @param latitude [degE7] Latitude + * @param longitude [degE7] Longitude + * @param altitude [m] Altitude above mean sea level + * @param target_altitude [m] Altitude setpoint + * @param heading [deg/2] Heading + * @param target_heading [deg/2] Heading setpoint + * @param target_distance [dam] Distance to target waypoint or position + * @param throttle [%] Throttle + * @param airspeed [m/s*5] Airspeed + * @param airspeed_sp [m/s*5] Airspeed setpoint + * @param groundspeed [m/s*5] Groundspeed + * @param windspeed [m/s*5] Windspeed + * @param wind_heading [deg/2] Wind heading + * @param eph [dm] Maximum error horizontal position since last message + * @param epv [dm] Maximum error vertical position since last message + * @param temperature_air [degC] Air temperature from airspeed sensor + * @param climb_rate [dm/s] Maximum climb rate magnitude since last message + * @param battery [%] Battery level (-1 if field not provided). + * @param wp_num Current waypoint number + * @param failure_flags Bitmap of failure flags. + * @param custom0 Field for custom payload. + * @param custom1 Field for custom payload. + * @param custom2 Field for custom payload. + */ +#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS + +static inline void mavlink_msg_high_latency2_send(mavlink_channel_t chan, uint32_t timestamp, uint8_t type, uint8_t autopilot, uint16_t custom_mode, int32_t latitude, int32_t longitude, int16_t altitude, int16_t target_altitude, uint8_t heading, uint8_t target_heading, uint16_t target_distance, uint8_t throttle, uint8_t airspeed, uint8_t airspeed_sp, uint8_t groundspeed, uint8_t windspeed, uint8_t wind_heading, uint8_t eph, uint8_t epv, int8_t temperature_air, int8_t climb_rate, int8_t battery, uint16_t wp_num, uint16_t failure_flags, int8_t custom0, int8_t custom1, int8_t custom2) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[MAVLINK_MSG_ID_HIGH_LATENCY2_LEN]; + _mav_put_uint32_t(buf, 0, timestamp); + _mav_put_int32_t(buf, 4, latitude); + _mav_put_int32_t(buf, 8, longitude); + _mav_put_uint16_t(buf, 12, custom_mode); + _mav_put_int16_t(buf, 14, altitude); + _mav_put_int16_t(buf, 16, target_altitude); + _mav_put_uint16_t(buf, 18, target_distance); + _mav_put_uint16_t(buf, 20, wp_num); + _mav_put_uint16_t(buf, 22, failure_flags); + _mav_put_uint8_t(buf, 24, type); + _mav_put_uint8_t(buf, 25, autopilot); + _mav_put_uint8_t(buf, 26, heading); + _mav_put_uint8_t(buf, 27, target_heading); + _mav_put_uint8_t(buf, 28, throttle); + _mav_put_uint8_t(buf, 29, airspeed); + _mav_put_uint8_t(buf, 30, airspeed_sp); + _mav_put_uint8_t(buf, 31, groundspeed); + _mav_put_uint8_t(buf, 32, windspeed); + _mav_put_uint8_t(buf, 33, wind_heading); + _mav_put_uint8_t(buf, 34, eph); + _mav_put_uint8_t(buf, 35, epv); + _mav_put_int8_t(buf, 36, temperature_air); + _mav_put_int8_t(buf, 37, climb_rate); + _mav_put_int8_t(buf, 38, battery); + _mav_put_int8_t(buf, 39, custom0); + _mav_put_int8_t(buf, 40, custom1); + _mav_put_int8_t(buf, 41, custom2); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIGH_LATENCY2, buf, MAVLINK_MSG_ID_HIGH_LATENCY2_MIN_LEN, MAVLINK_MSG_ID_HIGH_LATENCY2_LEN, MAVLINK_MSG_ID_HIGH_LATENCY2_CRC); +#else + mavlink_high_latency2_t packet; + packet.timestamp = timestamp; + packet.latitude = latitude; + packet.longitude = longitude; + packet.custom_mode = custom_mode; + packet.altitude = altitude; + packet.target_altitude = target_altitude; + packet.target_distance = target_distance; + packet.wp_num = wp_num; + packet.failure_flags = failure_flags; + packet.type = type; + packet.autopilot = autopilot; + packet.heading = heading; + packet.target_heading = target_heading; + packet.throttle = throttle; + packet.airspeed = airspeed; + packet.airspeed_sp = airspeed_sp; + packet.groundspeed = groundspeed; + packet.windspeed = windspeed; + packet.wind_heading = wind_heading; + packet.eph = eph; + packet.epv = epv; + packet.temperature_air = temperature_air; + packet.climb_rate = climb_rate; + packet.battery = battery; + packet.custom0 = custom0; + packet.custom1 = custom1; + packet.custom2 = custom2; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIGH_LATENCY2, (const char *)&packet, MAVLINK_MSG_ID_HIGH_LATENCY2_MIN_LEN, MAVLINK_MSG_ID_HIGH_LATENCY2_LEN, MAVLINK_MSG_ID_HIGH_LATENCY2_CRC); +#endif +} + +/** + * @brief Send a high_latency2 message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_high_latency2_send_struct(mavlink_channel_t chan, const mavlink_high_latency2_t* high_latency2) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_high_latency2_send(chan, high_latency2->timestamp, high_latency2->type, high_latency2->autopilot, high_latency2->custom_mode, high_latency2->latitude, high_latency2->longitude, high_latency2->altitude, high_latency2->target_altitude, high_latency2->heading, high_latency2->target_heading, high_latency2->target_distance, high_latency2->throttle, high_latency2->airspeed, high_latency2->airspeed_sp, high_latency2->groundspeed, high_latency2->windspeed, high_latency2->wind_heading, high_latency2->eph, high_latency2->epv, high_latency2->temperature_air, high_latency2->climb_rate, high_latency2->battery, high_latency2->wp_num, high_latency2->failure_flags, high_latency2->custom0, high_latency2->custom1, high_latency2->custom2); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIGH_LATENCY2, (const char *)high_latency2, MAVLINK_MSG_ID_HIGH_LATENCY2_MIN_LEN, MAVLINK_MSG_ID_HIGH_LATENCY2_LEN, MAVLINK_MSG_ID_HIGH_LATENCY2_CRC); +#endif +} + +#if MAVLINK_MSG_ID_HIGH_LATENCY2_LEN <= MAVLINK_MAX_PAYLOAD_LEN +/* + This varient of _send() can be used to save stack space by re-using + memory from the receive buffer. The caller provides a + mavlink_message_t which is the size of a full mavlink message. This + is usually the receive buffer for the channel, and allows a reply to an + incoming message with minimum stack space usage. + */ +static inline void mavlink_msg_high_latency2_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t timestamp, uint8_t type, uint8_t autopilot, uint16_t custom_mode, int32_t latitude, int32_t longitude, int16_t altitude, int16_t target_altitude, uint8_t heading, uint8_t target_heading, uint16_t target_distance, uint8_t throttle, uint8_t airspeed, uint8_t airspeed_sp, uint8_t groundspeed, uint8_t windspeed, uint8_t wind_heading, uint8_t eph, uint8_t epv, int8_t temperature_air, int8_t climb_rate, int8_t battery, uint16_t wp_num, uint16_t failure_flags, int8_t custom0, int8_t custom1, int8_t custom2) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char *buf = (char *)msgbuf; + _mav_put_uint32_t(buf, 0, timestamp); + _mav_put_int32_t(buf, 4, latitude); + _mav_put_int32_t(buf, 8, longitude); + _mav_put_uint16_t(buf, 12, custom_mode); + _mav_put_int16_t(buf, 14, altitude); + _mav_put_int16_t(buf, 16, target_altitude); + _mav_put_uint16_t(buf, 18, target_distance); + _mav_put_uint16_t(buf, 20, wp_num); + _mav_put_uint16_t(buf, 22, failure_flags); + _mav_put_uint8_t(buf, 24, type); + _mav_put_uint8_t(buf, 25, autopilot); + _mav_put_uint8_t(buf, 26, heading); + _mav_put_uint8_t(buf, 27, target_heading); + _mav_put_uint8_t(buf, 28, throttle); + _mav_put_uint8_t(buf, 29, airspeed); + _mav_put_uint8_t(buf, 30, airspeed_sp); + _mav_put_uint8_t(buf, 31, groundspeed); + _mav_put_uint8_t(buf, 32, windspeed); + _mav_put_uint8_t(buf, 33, wind_heading); + _mav_put_uint8_t(buf, 34, eph); + _mav_put_uint8_t(buf, 35, epv); + _mav_put_int8_t(buf, 36, temperature_air); + _mav_put_int8_t(buf, 37, climb_rate); + _mav_put_int8_t(buf, 38, battery); + _mav_put_int8_t(buf, 39, custom0); + _mav_put_int8_t(buf, 40, custom1); + _mav_put_int8_t(buf, 41, custom2); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIGH_LATENCY2, buf, MAVLINK_MSG_ID_HIGH_LATENCY2_MIN_LEN, MAVLINK_MSG_ID_HIGH_LATENCY2_LEN, MAVLINK_MSG_ID_HIGH_LATENCY2_CRC); +#else + mavlink_high_latency2_t *packet = (mavlink_high_latency2_t *)msgbuf; + packet->timestamp = timestamp; + packet->latitude = latitude; + packet->longitude = longitude; + packet->custom_mode = custom_mode; + packet->altitude = altitude; + packet->target_altitude = target_altitude; + packet->target_distance = target_distance; + packet->wp_num = wp_num; + packet->failure_flags = failure_flags; + packet->type = type; + packet->autopilot = autopilot; + packet->heading = heading; + packet->target_heading = target_heading; + packet->throttle = throttle; + packet->airspeed = airspeed; + packet->airspeed_sp = airspeed_sp; + packet->groundspeed = groundspeed; + packet->windspeed = windspeed; + packet->wind_heading = wind_heading; + packet->eph = eph; + packet->epv = epv; + packet->temperature_air = temperature_air; + packet->climb_rate = climb_rate; + packet->battery = battery; + packet->custom0 = custom0; + packet->custom1 = custom1; + packet->custom2 = custom2; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIGH_LATENCY2, (const char *)packet, MAVLINK_MSG_ID_HIGH_LATENCY2_MIN_LEN, MAVLINK_MSG_ID_HIGH_LATENCY2_LEN, MAVLINK_MSG_ID_HIGH_LATENCY2_CRC); +#endif +} +#endif + +#endif + +// MESSAGE HIGH_LATENCY2 UNPACKING + + +/** + * @brief Get field timestamp from high_latency2 message + * + * @return [ms] Timestamp (milliseconds since boot or Unix epoch) + */ +static inline uint32_t mavlink_msg_high_latency2_get_timestamp(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint32_t(msg, 0); +} + +/** + * @brief Get field type from high_latency2 message + * + * @return Type of the MAV (quadrotor, helicopter, etc.) + */ +static inline uint8_t mavlink_msg_high_latency2_get_type(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint8_t(msg, 24); +} + +/** + * @brief Get field autopilot from high_latency2 message + * + * @return Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers. + */ +static inline uint8_t mavlink_msg_high_latency2_get_autopilot(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint8_t(msg, 25); +} + +/** + * @brief Get field custom_mode from high_latency2 message + * + * @return A bitfield for use for autopilot-specific flags (2 byte version). + */ +static inline uint16_t mavlink_msg_high_latency2_get_custom_mode(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint16_t(msg, 12); +} + +/** + * @brief Get field latitude from high_latency2 message + * + * @return [degE7] Latitude + */ +static inline int32_t mavlink_msg_high_latency2_get_latitude(const mavlink_message_t* msg) +{ + return _MAV_RETURN_int32_t(msg, 4); +} + +/** + * @brief Get field longitude from high_latency2 message + * + * @return [degE7] Longitude + */ +static inline int32_t mavlink_msg_high_latency2_get_longitude(const mavlink_message_t* msg) +{ + return _MAV_RETURN_int32_t(msg, 8); +} + +/** + * @brief Get field altitude from high_latency2 message + * + * @return [m] Altitude above mean sea level + */ +static inline int16_t mavlink_msg_high_latency2_get_altitude(const mavlink_message_t* msg) +{ + return _MAV_RETURN_int16_t(msg, 14); +} + +/** + * @brief Get field target_altitude from high_latency2 message + * + * @return [m] Altitude setpoint + */ +static inline int16_t mavlink_msg_high_latency2_get_target_altitude(const mavlink_message_t* msg) +{ + return _MAV_RETURN_int16_t(msg, 16); +} + +/** + * @brief Get field heading from high_latency2 message + * + * @return [deg/2] Heading + */ +static inline uint8_t mavlink_msg_high_latency2_get_heading(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint8_t(msg, 26); +} + +/** + * @brief Get field target_heading from high_latency2 message + * + * @return [deg/2] Heading setpoint + */ +static inline uint8_t mavlink_msg_high_latency2_get_target_heading(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint8_t(msg, 27); +} + +/** + * @brief Get field target_distance from high_latency2 message + * + * @return [dam] Distance to target waypoint or position + */ +static inline uint16_t mavlink_msg_high_latency2_get_target_distance(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint16_t(msg, 18); +} + +/** + * @brief Get field throttle from high_latency2 message + * + * @return [%] Throttle + */ +static inline uint8_t mavlink_msg_high_latency2_get_throttle(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint8_t(msg, 28); +} + +/** + * @brief Get field airspeed from high_latency2 message + * + * @return [m/s*5] Airspeed + */ +static inline uint8_t mavlink_msg_high_latency2_get_airspeed(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint8_t(msg, 29); +} + +/** + * @brief Get field airspeed_sp from high_latency2 message + * + * @return [m/s*5] Airspeed setpoint + */ +static inline uint8_t mavlink_msg_high_latency2_get_airspeed_sp(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint8_t(msg, 30); +} + +/** + * @brief Get field groundspeed from high_latency2 message + * + * @return [m/s*5] Groundspeed + */ +static inline uint8_t mavlink_msg_high_latency2_get_groundspeed(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint8_t(msg, 31); +} + +/** + * @brief Get field windspeed from high_latency2 message + * + * @return [m/s*5] Windspeed + */ +static inline uint8_t mavlink_msg_high_latency2_get_windspeed(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint8_t(msg, 32); +} + +/** + * @brief Get field wind_heading from high_latency2 message + * + * @return [deg/2] Wind heading + */ +static inline uint8_t mavlink_msg_high_latency2_get_wind_heading(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint8_t(msg, 33); +} + +/** + * @brief Get field eph from high_latency2 message + * + * @return [dm] Maximum error horizontal position since last message + */ +static inline uint8_t mavlink_msg_high_latency2_get_eph(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint8_t(msg, 34); +} + +/** + * @brief Get field epv from high_latency2 message + * + * @return [dm] Maximum error vertical position since last message + */ +static inline uint8_t mavlink_msg_high_latency2_get_epv(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint8_t(msg, 35); +} + +/** + * @brief Get field temperature_air from high_latency2 message + * + * @return [degC] Air temperature from airspeed sensor + */ +static inline int8_t mavlink_msg_high_latency2_get_temperature_air(const mavlink_message_t* msg) +{ + return _MAV_RETURN_int8_t(msg, 36); +} + +/** + * @brief Get field climb_rate from high_latency2 message + * + * @return [dm/s] Maximum climb rate magnitude since last message + */ +static inline int8_t mavlink_msg_high_latency2_get_climb_rate(const mavlink_message_t* msg) +{ + return _MAV_RETURN_int8_t(msg, 37); +} + +/** + * @brief Get field battery from high_latency2 message + * + * @return [%] Battery level (-1 if field not provided). + */ +static inline int8_t mavlink_msg_high_latency2_get_battery(const mavlink_message_t* msg) +{ + return _MAV_RETURN_int8_t(msg, 38); +} + +/** + * @brief Get field wp_num from high_latency2 message + * + * @return Current waypoint number + */ +static inline uint16_t mavlink_msg_high_latency2_get_wp_num(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint16_t(msg, 20); +} + +/** + * @brief Get field failure_flags from high_latency2 message + * + * @return Bitmap of failure flags. + */ +static inline uint16_t mavlink_msg_high_latency2_get_failure_flags(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint16_t(msg, 22); +} + +/** + * @brief Get field custom0 from high_latency2 message + * + * @return Field for custom payload. + */ +static inline int8_t mavlink_msg_high_latency2_get_custom0(const mavlink_message_t* msg) +{ + return _MAV_RETURN_int8_t(msg, 39); +} + +/** + * @brief Get field custom1 from high_latency2 message + * + * @return Field for custom payload. + */ +static inline int8_t mavlink_msg_high_latency2_get_custom1(const mavlink_message_t* msg) +{ + return _MAV_RETURN_int8_t(msg, 40); +} + +/** + * @brief Get field custom2 from high_latency2 message + * + * @return Field for custom payload. + */ +static inline int8_t mavlink_msg_high_latency2_get_custom2(const mavlink_message_t* msg) +{ + return _MAV_RETURN_int8_t(msg, 41); +} + +/** + * @brief Decode a high_latency2 message into a struct + * + * @param msg The message to decode + * @param high_latency2 C-struct to decode the message contents into + */ +static inline void mavlink_msg_high_latency2_decode(const mavlink_message_t* msg, mavlink_high_latency2_t* high_latency2) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + high_latency2->timestamp = mavlink_msg_high_latency2_get_timestamp(msg); + high_latency2->latitude = mavlink_msg_high_latency2_get_latitude(msg); + high_latency2->longitude = mavlink_msg_high_latency2_get_longitude(msg); + high_latency2->custom_mode = mavlink_msg_high_latency2_get_custom_mode(msg); + high_latency2->altitude = mavlink_msg_high_latency2_get_altitude(msg); + high_latency2->target_altitude = mavlink_msg_high_latency2_get_target_altitude(msg); + high_latency2->target_distance = mavlink_msg_high_latency2_get_target_distance(msg); + high_latency2->wp_num = mavlink_msg_high_latency2_get_wp_num(msg); + high_latency2->failure_flags = mavlink_msg_high_latency2_get_failure_flags(msg); + high_latency2->type = mavlink_msg_high_latency2_get_type(msg); + high_latency2->autopilot = mavlink_msg_high_latency2_get_autopilot(msg); + high_latency2->heading = mavlink_msg_high_latency2_get_heading(msg); + high_latency2->target_heading = mavlink_msg_high_latency2_get_target_heading(msg); + high_latency2->throttle = mavlink_msg_high_latency2_get_throttle(msg); + high_latency2->airspeed = mavlink_msg_high_latency2_get_airspeed(msg); + high_latency2->airspeed_sp = mavlink_msg_high_latency2_get_airspeed_sp(msg); + high_latency2->groundspeed = mavlink_msg_high_latency2_get_groundspeed(msg); + high_latency2->windspeed = mavlink_msg_high_latency2_get_windspeed(msg); + high_latency2->wind_heading = mavlink_msg_high_latency2_get_wind_heading(msg); + high_latency2->eph = mavlink_msg_high_latency2_get_eph(msg); + high_latency2->epv = mavlink_msg_high_latency2_get_epv(msg); + high_latency2->temperature_air = mavlink_msg_high_latency2_get_temperature_air(msg); + high_latency2->climb_rate = mavlink_msg_high_latency2_get_climb_rate(msg); + high_latency2->battery = mavlink_msg_high_latency2_get_battery(msg); + high_latency2->custom0 = mavlink_msg_high_latency2_get_custom0(msg); + high_latency2->custom1 = mavlink_msg_high_latency2_get_custom1(msg); + high_latency2->custom2 = mavlink_msg_high_latency2_get_custom2(msg); +#else + uint8_t len = msg->len < MAVLINK_MSG_ID_HIGH_LATENCY2_LEN? msg->len : MAVLINK_MSG_ID_HIGH_LATENCY2_LEN; + memset(high_latency2, 0, MAVLINK_MSG_ID_HIGH_LATENCY2_LEN); + memcpy(high_latency2, _MAV_PAYLOAD(msg), len); +#endif +} diff --git a/lib/main/MAVLink/common/mavlink_msg_highres_imu.h b/lib/main/MAVLink/common/mavlink_msg_highres_imu.h index be7e5d33d2..59718e30cd 100755 --- a/lib/main/MAVLink/common/mavlink_msg_highres_imu.h +++ b/lib/main/MAVLink/common/mavlink_msg_highres_imu.h @@ -3,24 +3,24 @@ #define MAVLINK_MSG_ID_HIGHRES_IMU 105 -MAVPACKED( + typedef struct __mavlink_highres_imu_t { - uint64_t time_usec; /*< Timestamp (microseconds, synced to UNIX time or since system boot)*/ - float xacc; /*< X acceleration (m/s^2)*/ - float yacc; /*< Y acceleration (m/s^2)*/ - float zacc; /*< Z acceleration (m/s^2)*/ - float xgyro; /*< Angular speed around X axis (rad / sec)*/ - float ygyro; /*< Angular speed around Y axis (rad / sec)*/ - float zgyro; /*< Angular speed around Z axis (rad / sec)*/ - float xmag; /*< X Magnetic field (Gauss)*/ - float ymag; /*< Y Magnetic field (Gauss)*/ - float zmag; /*< Z Magnetic field (Gauss)*/ - float abs_pressure; /*< Absolute pressure in millibar*/ - float diff_pressure; /*< Differential pressure in millibar*/ - float pressure_alt; /*< Altitude calculated from pressure*/ - float temperature; /*< Temperature in degrees celsius*/ - uint16_t fields_updated; /*< Bitmask for fields that have updated since last message, bit 0 = xacc, bit 12: temperature*/ -}) mavlink_highres_imu_t; + uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.*/ + float xacc; /*< [m/s/s] X acceleration*/ + float yacc; /*< [m/s/s] Y acceleration*/ + float zacc; /*< [m/s/s] Z acceleration*/ + float xgyro; /*< [rad/s] Angular speed around X axis*/ + float ygyro; /*< [rad/s] Angular speed around Y axis*/ + float zgyro; /*< [rad/s] Angular speed around Z axis*/ + float xmag; /*< [gauss] X Magnetic field*/ + float ymag; /*< [gauss] Y Magnetic field*/ + float zmag; /*< [gauss] Z Magnetic field*/ + float abs_pressure; /*< [mbar] Absolute pressure*/ + float diff_pressure; /*< [mbar] Differential pressure*/ + float pressure_alt; /*< Altitude calculated from pressure*/ + float temperature; /*< [degC] Temperature*/ + uint16_t fields_updated; /*< Bitmap for fields that have updated since last message, bit 0 = xacc, bit 12: temperature*/ +} mavlink_highres_imu_t; #define MAVLINK_MSG_ID_HIGHRES_IMU_LEN 62 #define MAVLINK_MSG_ID_HIGHRES_IMU_MIN_LEN 62 @@ -83,21 +83,21 @@ typedef struct __mavlink_highres_imu_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param time_usec Timestamp (microseconds, synced to UNIX time or since system boot) - * @param xacc X acceleration (m/s^2) - * @param yacc Y acceleration (m/s^2) - * @param zacc Z acceleration (m/s^2) - * @param xgyro Angular speed around X axis (rad / sec) - * @param ygyro Angular speed around Y axis (rad / sec) - * @param zgyro Angular speed around Z axis (rad / sec) - * @param xmag X Magnetic field (Gauss) - * @param ymag Y Magnetic field (Gauss) - * @param zmag Z Magnetic field (Gauss) - * @param abs_pressure Absolute pressure in millibar - * @param diff_pressure Differential pressure in millibar - * @param pressure_alt Altitude calculated from pressure - * @param temperature Temperature in degrees celsius - * @param fields_updated Bitmask for fields that have updated since last message, bit 0 = xacc, bit 12: temperature + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param xacc [m/s/s] X acceleration + * @param yacc [m/s/s] Y acceleration + * @param zacc [m/s/s] Z acceleration + * @param xgyro [rad/s] Angular speed around X axis + * @param ygyro [rad/s] Angular speed around Y axis + * @param zgyro [rad/s] Angular speed around Z axis + * @param xmag [gauss] X Magnetic field + * @param ymag [gauss] Y Magnetic field + * @param zmag [gauss] Z Magnetic field + * @param abs_pressure [mbar] Absolute pressure + * @param diff_pressure [mbar] Differential pressure + * @param pressure_alt Altitude calculated from pressure + * @param temperature [degC] Temperature + * @param fields_updated Bitmap for fields that have updated since last message, bit 0 = xacc, bit 12: temperature * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_highres_imu_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -153,21 +153,21 @@ static inline uint16_t mavlink_msg_highres_imu_pack(uint8_t system_id, uint8_t c * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param time_usec Timestamp (microseconds, synced to UNIX time or since system boot) - * @param xacc X acceleration (m/s^2) - * @param yacc Y acceleration (m/s^2) - * @param zacc Z acceleration (m/s^2) - * @param xgyro Angular speed around X axis (rad / sec) - * @param ygyro Angular speed around Y axis (rad / sec) - * @param zgyro Angular speed around Z axis (rad / sec) - * @param xmag X Magnetic field (Gauss) - * @param ymag Y Magnetic field (Gauss) - * @param zmag Z Magnetic field (Gauss) - * @param abs_pressure Absolute pressure in millibar - * @param diff_pressure Differential pressure in millibar - * @param pressure_alt Altitude calculated from pressure - * @param temperature Temperature in degrees celsius - * @param fields_updated Bitmask for fields that have updated since last message, bit 0 = xacc, bit 12: temperature + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param xacc [m/s/s] X acceleration + * @param yacc [m/s/s] Y acceleration + * @param zacc [m/s/s] Z acceleration + * @param xgyro [rad/s] Angular speed around X axis + * @param ygyro [rad/s] Angular speed around Y axis + * @param zgyro [rad/s] Angular speed around Z axis + * @param xmag [gauss] X Magnetic field + * @param ymag [gauss] Y Magnetic field + * @param zmag [gauss] Z Magnetic field + * @param abs_pressure [mbar] Absolute pressure + * @param diff_pressure [mbar] Differential pressure + * @param pressure_alt Altitude calculated from pressure + * @param temperature [degC] Temperature + * @param fields_updated Bitmap for fields that have updated since last message, bit 0 = xacc, bit 12: temperature * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_highres_imu_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -249,21 +249,21 @@ static inline uint16_t mavlink_msg_highres_imu_encode_chan(uint8_t system_id, ui * @brief Send a highres_imu message * @param chan MAVLink channel to send the message * - * @param time_usec Timestamp (microseconds, synced to UNIX time or since system boot) - * @param xacc X acceleration (m/s^2) - * @param yacc Y acceleration (m/s^2) - * @param zacc Z acceleration (m/s^2) - * @param xgyro Angular speed around X axis (rad / sec) - * @param ygyro Angular speed around Y axis (rad / sec) - * @param zgyro Angular speed around Z axis (rad / sec) - * @param xmag X Magnetic field (Gauss) - * @param ymag Y Magnetic field (Gauss) - * @param zmag Z Magnetic field (Gauss) - * @param abs_pressure Absolute pressure in millibar - * @param diff_pressure Differential pressure in millibar - * @param pressure_alt Altitude calculated from pressure - * @param temperature Temperature in degrees celsius - * @param fields_updated Bitmask for fields that have updated since last message, bit 0 = xacc, bit 12: temperature + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param xacc [m/s/s] X acceleration + * @param yacc [m/s/s] Y acceleration + * @param zacc [m/s/s] Z acceleration + * @param xgyro [rad/s] Angular speed around X axis + * @param ygyro [rad/s] Angular speed around Y axis + * @param zgyro [rad/s] Angular speed around Z axis + * @param xmag [gauss] X Magnetic field + * @param ymag [gauss] Y Magnetic field + * @param zmag [gauss] Z Magnetic field + * @param abs_pressure [mbar] Absolute pressure + * @param diff_pressure [mbar] Differential pressure + * @param pressure_alt Altitude calculated from pressure + * @param temperature [degC] Temperature + * @param fields_updated Bitmap for fields that have updated since last message, bit 0 = xacc, bit 12: temperature */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -384,7 +384,7 @@ static inline void mavlink_msg_highres_imu_send_buf(mavlink_message_t *msgbuf, m /** * @brief Get field time_usec from highres_imu message * - * @return Timestamp (microseconds, synced to UNIX time or since system boot) + * @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. */ static inline uint64_t mavlink_msg_highres_imu_get_time_usec(const mavlink_message_t* msg) { @@ -394,7 +394,7 @@ static inline uint64_t mavlink_msg_highres_imu_get_time_usec(const mavlink_messa /** * @brief Get field xacc from highres_imu message * - * @return X acceleration (m/s^2) + * @return [m/s/s] X acceleration */ static inline float mavlink_msg_highres_imu_get_xacc(const mavlink_message_t* msg) { @@ -404,7 +404,7 @@ static inline float mavlink_msg_highres_imu_get_xacc(const mavlink_message_t* ms /** * @brief Get field yacc from highres_imu message * - * @return Y acceleration (m/s^2) + * @return [m/s/s] Y acceleration */ static inline float mavlink_msg_highres_imu_get_yacc(const mavlink_message_t* msg) { @@ -414,7 +414,7 @@ static inline float mavlink_msg_highres_imu_get_yacc(const mavlink_message_t* ms /** * @brief Get field zacc from highres_imu message * - * @return Z acceleration (m/s^2) + * @return [m/s/s] Z acceleration */ static inline float mavlink_msg_highres_imu_get_zacc(const mavlink_message_t* msg) { @@ -424,7 +424,7 @@ static inline float mavlink_msg_highres_imu_get_zacc(const mavlink_message_t* ms /** * @brief Get field xgyro from highres_imu message * - * @return Angular speed around X axis (rad / sec) + * @return [rad/s] Angular speed around X axis */ static inline float mavlink_msg_highres_imu_get_xgyro(const mavlink_message_t* msg) { @@ -434,7 +434,7 @@ static inline float mavlink_msg_highres_imu_get_xgyro(const mavlink_message_t* m /** * @brief Get field ygyro from highres_imu message * - * @return Angular speed around Y axis (rad / sec) + * @return [rad/s] Angular speed around Y axis */ static inline float mavlink_msg_highres_imu_get_ygyro(const mavlink_message_t* msg) { @@ -444,7 +444,7 @@ static inline float mavlink_msg_highres_imu_get_ygyro(const mavlink_message_t* m /** * @brief Get field zgyro from highres_imu message * - * @return Angular speed around Z axis (rad / sec) + * @return [rad/s] Angular speed around Z axis */ static inline float mavlink_msg_highres_imu_get_zgyro(const mavlink_message_t* msg) { @@ -454,7 +454,7 @@ static inline float mavlink_msg_highres_imu_get_zgyro(const mavlink_message_t* m /** * @brief Get field xmag from highres_imu message * - * @return X Magnetic field (Gauss) + * @return [gauss] X Magnetic field */ static inline float mavlink_msg_highres_imu_get_xmag(const mavlink_message_t* msg) { @@ -464,7 +464,7 @@ static inline float mavlink_msg_highres_imu_get_xmag(const mavlink_message_t* ms /** * @brief Get field ymag from highres_imu message * - * @return Y Magnetic field (Gauss) + * @return [gauss] Y Magnetic field */ static inline float mavlink_msg_highres_imu_get_ymag(const mavlink_message_t* msg) { @@ -474,7 +474,7 @@ static inline float mavlink_msg_highres_imu_get_ymag(const mavlink_message_t* ms /** * @brief Get field zmag from highres_imu message * - * @return Z Magnetic field (Gauss) + * @return [gauss] Z Magnetic field */ static inline float mavlink_msg_highres_imu_get_zmag(const mavlink_message_t* msg) { @@ -484,7 +484,7 @@ static inline float mavlink_msg_highres_imu_get_zmag(const mavlink_message_t* ms /** * @brief Get field abs_pressure from highres_imu message * - * @return Absolute pressure in millibar + * @return [mbar] Absolute pressure */ static inline float mavlink_msg_highres_imu_get_abs_pressure(const mavlink_message_t* msg) { @@ -494,7 +494,7 @@ static inline float mavlink_msg_highres_imu_get_abs_pressure(const mavlink_messa /** * @brief Get field diff_pressure from highres_imu message * - * @return Differential pressure in millibar + * @return [mbar] Differential pressure */ static inline float mavlink_msg_highres_imu_get_diff_pressure(const mavlink_message_t* msg) { @@ -504,7 +504,7 @@ static inline float mavlink_msg_highres_imu_get_diff_pressure(const mavlink_mess /** * @brief Get field pressure_alt from highres_imu message * - * @return Altitude calculated from pressure + * @return Altitude calculated from pressure */ static inline float mavlink_msg_highres_imu_get_pressure_alt(const mavlink_message_t* msg) { @@ -514,7 +514,7 @@ static inline float mavlink_msg_highres_imu_get_pressure_alt(const mavlink_messa /** * @brief Get field temperature from highres_imu message * - * @return Temperature in degrees celsius + * @return [degC] Temperature */ static inline float mavlink_msg_highres_imu_get_temperature(const mavlink_message_t* msg) { @@ -524,7 +524,7 @@ static inline float mavlink_msg_highres_imu_get_temperature(const mavlink_messag /** * @brief Get field fields_updated from highres_imu message * - * @return Bitmask for fields that have updated since last message, bit 0 = xacc, bit 12: temperature + * @return Bitmap for fields that have updated since last message, bit 0 = xacc, bit 12: temperature */ static inline uint16_t mavlink_msg_highres_imu_get_fields_updated(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_hil_actuator_controls.h b/lib/main/MAVLink/common/mavlink_msg_hil_actuator_controls.h index f60e920e5a..31c28db427 100755 --- a/lib/main/MAVLink/common/mavlink_msg_hil_actuator_controls.h +++ b/lib/main/MAVLink/common/mavlink_msg_hil_actuator_controls.h @@ -3,13 +3,13 @@ #define MAVLINK_MSG_ID_HIL_ACTUATOR_CONTROLS 93 -MAVPACKED( + typedef struct __mavlink_hil_actuator_controls_t { - uint64_t time_usec; /*< Timestamp (microseconds since UNIX epoch or microseconds since system boot)*/ - uint64_t flags; /*< Flags as bitfield, reserved for future use.*/ - float controls[16]; /*< Control outputs -1 .. 1. Channel assignment depends on the simulated hardware.*/ - uint8_t mode; /*< System mode (MAV_MODE), includes arming state.*/ -}) mavlink_hil_actuator_controls_t; + uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.*/ + uint64_t flags; /*< Flags as bitfield, 1: indicate simulation using lockstep.*/ + float controls[16]; /*< Control outputs -1 .. 1. Channel assignment depends on the simulated hardware.*/ + uint8_t mode; /*< System mode. Includes arming state.*/ +} mavlink_hil_actuator_controls_t; #define MAVLINK_MSG_ID_HIL_ACTUATOR_CONTROLS_LEN 81 #define MAVLINK_MSG_ID_HIL_ACTUATOR_CONTROLS_MIN_LEN 81 @@ -27,9 +27,9 @@ typedef struct __mavlink_hil_actuator_controls_t { "HIL_ACTUATOR_CONTROLS", \ 4, \ { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_actuator_controls_t, time_usec) }, \ - { "flags", NULL, MAVLINK_TYPE_UINT64_T, 0, 8, offsetof(mavlink_hil_actuator_controls_t, flags) }, \ { "controls", NULL, MAVLINK_TYPE_FLOAT, 16, 16, offsetof(mavlink_hil_actuator_controls_t, controls) }, \ { "mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 80, offsetof(mavlink_hil_actuator_controls_t, mode) }, \ + { "flags", NULL, MAVLINK_TYPE_UINT64_T, 0, 8, offsetof(mavlink_hil_actuator_controls_t, flags) }, \ } \ } #else @@ -37,9 +37,9 @@ typedef struct __mavlink_hil_actuator_controls_t { "HIL_ACTUATOR_CONTROLS", \ 4, \ { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_actuator_controls_t, time_usec) }, \ - { "flags", NULL, MAVLINK_TYPE_UINT64_T, 0, 8, offsetof(mavlink_hil_actuator_controls_t, flags) }, \ { "controls", NULL, MAVLINK_TYPE_FLOAT, 16, 16, offsetof(mavlink_hil_actuator_controls_t, controls) }, \ { "mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 80, offsetof(mavlink_hil_actuator_controls_t, mode) }, \ + { "flags", NULL, MAVLINK_TYPE_UINT64_T, 0, 8, offsetof(mavlink_hil_actuator_controls_t, flags) }, \ } \ } #endif @@ -50,10 +50,10 @@ typedef struct __mavlink_hil_actuator_controls_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot) - * @param controls Control outputs -1 .. 1. Channel assignment depends on the simulated hardware. - * @param mode System mode (MAV_MODE), includes arming state. - * @param flags Flags as bitfield, reserved for future use. + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param controls Control outputs -1 .. 1. Channel assignment depends on the simulated hardware. + * @param mode System mode. Includes arming state. + * @param flags Flags as bitfield, 1: indicate simulation using lockstep. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_hil_actuator_controls_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -85,10 +85,10 @@ static inline uint16_t mavlink_msg_hil_actuator_controls_pack(uint8_t system_id, * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot) - * @param controls Control outputs -1 .. 1. Channel assignment depends on the simulated hardware. - * @param mode System mode (MAV_MODE), includes arming state. - * @param flags Flags as bitfield, reserved for future use. + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param controls Control outputs -1 .. 1. Channel assignment depends on the simulated hardware. + * @param mode System mode. Includes arming state. + * @param flags Flags as bitfield, 1: indicate simulation using lockstep. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_hil_actuator_controls_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -146,10 +146,10 @@ static inline uint16_t mavlink_msg_hil_actuator_controls_encode_chan(uint8_t sys * @brief Send a hil_actuator_controls message * @param chan MAVLink channel to send the message * - * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot) - * @param controls Control outputs -1 .. 1. Channel assignment depends on the simulated hardware. - * @param mode System mode (MAV_MODE), includes arming state. - * @param flags Flags as bitfield, reserved for future use. + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param controls Control outputs -1 .. 1. Channel assignment depends on the simulated hardware. + * @param mode System mode. Includes arming state. + * @param flags Flags as bitfield, 1: indicate simulation using lockstep. */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -222,7 +222,7 @@ static inline void mavlink_msg_hil_actuator_controls_send_buf(mavlink_message_t /** * @brief Get field time_usec from hil_actuator_controls message * - * @return Timestamp (microseconds since UNIX epoch or microseconds since system boot) + * @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. */ static inline uint64_t mavlink_msg_hil_actuator_controls_get_time_usec(const mavlink_message_t* msg) { @@ -232,7 +232,7 @@ static inline uint64_t mavlink_msg_hil_actuator_controls_get_time_usec(const mav /** * @brief Get field controls from hil_actuator_controls message * - * @return Control outputs -1 .. 1. Channel assignment depends on the simulated hardware. + * @return Control outputs -1 .. 1. Channel assignment depends on the simulated hardware. */ static inline uint16_t mavlink_msg_hil_actuator_controls_get_controls(const mavlink_message_t* msg, float *controls) { @@ -242,7 +242,7 @@ static inline uint16_t mavlink_msg_hil_actuator_controls_get_controls(const mavl /** * @brief Get field mode from hil_actuator_controls message * - * @return System mode (MAV_MODE), includes arming state. + * @return System mode. Includes arming state. */ static inline uint8_t mavlink_msg_hil_actuator_controls_get_mode(const mavlink_message_t* msg) { @@ -252,7 +252,7 @@ static inline uint8_t mavlink_msg_hil_actuator_controls_get_mode(const mavlink_m /** * @brief Get field flags from hil_actuator_controls message * - * @return Flags as bitfield, reserved for future use. + * @return Flags as bitfield, 1: indicate simulation using lockstep. */ static inline uint64_t mavlink_msg_hil_actuator_controls_get_flags(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_hil_controls.h b/lib/main/MAVLink/common/mavlink_msg_hil_controls.h index 39dca7eec9..a3bd993bfb 100755 --- a/lib/main/MAVLink/common/mavlink_msg_hil_controls.h +++ b/lib/main/MAVLink/common/mavlink_msg_hil_controls.h @@ -3,20 +3,20 @@ #define MAVLINK_MSG_ID_HIL_CONTROLS 91 -MAVPACKED( + typedef struct __mavlink_hil_controls_t { - uint64_t time_usec; /*< Timestamp (microseconds since UNIX epoch or microseconds since system boot)*/ - float roll_ailerons; /*< Control output -1 .. 1*/ - float pitch_elevator; /*< Control output -1 .. 1*/ - float yaw_rudder; /*< Control output -1 .. 1*/ - float throttle; /*< Throttle 0 .. 1*/ - float aux1; /*< Aux 1, -1 .. 1*/ - float aux2; /*< Aux 2, -1 .. 1*/ - float aux3; /*< Aux 3, -1 .. 1*/ - float aux4; /*< Aux 4, -1 .. 1*/ - uint8_t mode; /*< System mode (MAV_MODE)*/ - uint8_t nav_mode; /*< Navigation mode (MAV_NAV_MODE)*/ -}) mavlink_hil_controls_t; + uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.*/ + float roll_ailerons; /*< Control output -1 .. 1*/ + float pitch_elevator; /*< Control output -1 .. 1*/ + float yaw_rudder; /*< Control output -1 .. 1*/ + float throttle; /*< Throttle 0 .. 1*/ + float aux1; /*< Aux 1, -1 .. 1*/ + float aux2; /*< Aux 2, -1 .. 1*/ + float aux3; /*< Aux 3, -1 .. 1*/ + float aux4; /*< Aux 4, -1 .. 1*/ + uint8_t mode; /*< System mode.*/ + uint8_t nav_mode; /*< Navigation mode (MAV_NAV_MODE)*/ +} mavlink_hil_controls_t; #define MAVLINK_MSG_ID_HIL_CONTROLS_LEN 42 #define MAVLINK_MSG_ID_HIL_CONTROLS_MIN_LEN 42 @@ -71,17 +71,17 @@ typedef struct __mavlink_hil_controls_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot) - * @param roll_ailerons Control output -1 .. 1 - * @param pitch_elevator Control output -1 .. 1 - * @param yaw_rudder Control output -1 .. 1 - * @param throttle Throttle 0 .. 1 - * @param aux1 Aux 1, -1 .. 1 - * @param aux2 Aux 2, -1 .. 1 - * @param aux3 Aux 3, -1 .. 1 - * @param aux4 Aux 4, -1 .. 1 - * @param mode System mode (MAV_MODE) - * @param nav_mode Navigation mode (MAV_NAV_MODE) + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param roll_ailerons Control output -1 .. 1 + * @param pitch_elevator Control output -1 .. 1 + * @param yaw_rudder Control output -1 .. 1 + * @param throttle Throttle 0 .. 1 + * @param aux1 Aux 1, -1 .. 1 + * @param aux2 Aux 2, -1 .. 1 + * @param aux3 Aux 3, -1 .. 1 + * @param aux4 Aux 4, -1 .. 1 + * @param mode System mode. + * @param nav_mode Navigation mode (MAV_NAV_MODE) * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_hil_controls_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -129,17 +129,17 @@ static inline uint16_t mavlink_msg_hil_controls_pack(uint8_t system_id, uint8_t * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot) - * @param roll_ailerons Control output -1 .. 1 - * @param pitch_elevator Control output -1 .. 1 - * @param yaw_rudder Control output -1 .. 1 - * @param throttle Throttle 0 .. 1 - * @param aux1 Aux 1, -1 .. 1 - * @param aux2 Aux 2, -1 .. 1 - * @param aux3 Aux 3, -1 .. 1 - * @param aux4 Aux 4, -1 .. 1 - * @param mode System mode (MAV_MODE) - * @param nav_mode Navigation mode (MAV_NAV_MODE) + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param roll_ailerons Control output -1 .. 1 + * @param pitch_elevator Control output -1 .. 1 + * @param yaw_rudder Control output -1 .. 1 + * @param throttle Throttle 0 .. 1 + * @param aux1 Aux 1, -1 .. 1 + * @param aux2 Aux 2, -1 .. 1 + * @param aux3 Aux 3, -1 .. 1 + * @param aux4 Aux 4, -1 .. 1 + * @param mode System mode. + * @param nav_mode Navigation mode (MAV_NAV_MODE) * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_hil_controls_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -213,17 +213,17 @@ static inline uint16_t mavlink_msg_hil_controls_encode_chan(uint8_t system_id, u * @brief Send a hil_controls message * @param chan MAVLink channel to send the message * - * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot) - * @param roll_ailerons Control output -1 .. 1 - * @param pitch_elevator Control output -1 .. 1 - * @param yaw_rudder Control output -1 .. 1 - * @param throttle Throttle 0 .. 1 - * @param aux1 Aux 1, -1 .. 1 - * @param aux2 Aux 2, -1 .. 1 - * @param aux3 Aux 3, -1 .. 1 - * @param aux4 Aux 4, -1 .. 1 - * @param mode System mode (MAV_MODE) - * @param nav_mode Navigation mode (MAV_NAV_MODE) + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param roll_ailerons Control output -1 .. 1 + * @param pitch_elevator Control output -1 .. 1 + * @param yaw_rudder Control output -1 .. 1 + * @param throttle Throttle 0 .. 1 + * @param aux1 Aux 1, -1 .. 1 + * @param aux2 Aux 2, -1 .. 1 + * @param aux3 Aux 3, -1 .. 1 + * @param aux4 Aux 4, -1 .. 1 + * @param mode System mode. + * @param nav_mode Navigation mode (MAV_NAV_MODE) */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -328,7 +328,7 @@ static inline void mavlink_msg_hil_controls_send_buf(mavlink_message_t *msgbuf, /** * @brief Get field time_usec from hil_controls message * - * @return Timestamp (microseconds since UNIX epoch or microseconds since system boot) + * @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. */ static inline uint64_t mavlink_msg_hil_controls_get_time_usec(const mavlink_message_t* msg) { @@ -338,7 +338,7 @@ static inline uint64_t mavlink_msg_hil_controls_get_time_usec(const mavlink_mess /** * @brief Get field roll_ailerons from hil_controls message * - * @return Control output -1 .. 1 + * @return Control output -1 .. 1 */ static inline float mavlink_msg_hil_controls_get_roll_ailerons(const mavlink_message_t* msg) { @@ -348,7 +348,7 @@ static inline float mavlink_msg_hil_controls_get_roll_ailerons(const mavlink_mes /** * @brief Get field pitch_elevator from hil_controls message * - * @return Control output -1 .. 1 + * @return Control output -1 .. 1 */ static inline float mavlink_msg_hil_controls_get_pitch_elevator(const mavlink_message_t* msg) { @@ -358,7 +358,7 @@ static inline float mavlink_msg_hil_controls_get_pitch_elevator(const mavlink_me /** * @brief Get field yaw_rudder from hil_controls message * - * @return Control output -1 .. 1 + * @return Control output -1 .. 1 */ static inline float mavlink_msg_hil_controls_get_yaw_rudder(const mavlink_message_t* msg) { @@ -368,7 +368,7 @@ static inline float mavlink_msg_hil_controls_get_yaw_rudder(const mavlink_messag /** * @brief Get field throttle from hil_controls message * - * @return Throttle 0 .. 1 + * @return Throttle 0 .. 1 */ static inline float mavlink_msg_hil_controls_get_throttle(const mavlink_message_t* msg) { @@ -378,7 +378,7 @@ static inline float mavlink_msg_hil_controls_get_throttle(const mavlink_message_ /** * @brief Get field aux1 from hil_controls message * - * @return Aux 1, -1 .. 1 + * @return Aux 1, -1 .. 1 */ static inline float mavlink_msg_hil_controls_get_aux1(const mavlink_message_t* msg) { @@ -388,7 +388,7 @@ static inline float mavlink_msg_hil_controls_get_aux1(const mavlink_message_t* m /** * @brief Get field aux2 from hil_controls message * - * @return Aux 2, -1 .. 1 + * @return Aux 2, -1 .. 1 */ static inline float mavlink_msg_hil_controls_get_aux2(const mavlink_message_t* msg) { @@ -398,7 +398,7 @@ static inline float mavlink_msg_hil_controls_get_aux2(const mavlink_message_t* m /** * @brief Get field aux3 from hil_controls message * - * @return Aux 3, -1 .. 1 + * @return Aux 3, -1 .. 1 */ static inline float mavlink_msg_hil_controls_get_aux3(const mavlink_message_t* msg) { @@ -408,7 +408,7 @@ static inline float mavlink_msg_hil_controls_get_aux3(const mavlink_message_t* m /** * @brief Get field aux4 from hil_controls message * - * @return Aux 4, -1 .. 1 + * @return Aux 4, -1 .. 1 */ static inline float mavlink_msg_hil_controls_get_aux4(const mavlink_message_t* msg) { @@ -418,7 +418,7 @@ static inline float mavlink_msg_hil_controls_get_aux4(const mavlink_message_t* m /** * @brief Get field mode from hil_controls message * - * @return System mode (MAV_MODE) + * @return System mode. */ static inline uint8_t mavlink_msg_hil_controls_get_mode(const mavlink_message_t* msg) { @@ -428,7 +428,7 @@ static inline uint8_t mavlink_msg_hil_controls_get_mode(const mavlink_message_t* /** * @brief Get field nav_mode from hil_controls message * - * @return Navigation mode (MAV_NAV_MODE) + * @return Navigation mode (MAV_NAV_MODE) */ static inline uint8_t mavlink_msg_hil_controls_get_nav_mode(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_hil_gps.h b/lib/main/MAVLink/common/mavlink_msg_hil_gps.h index 8333269ff4..1d1c2575c8 100755 --- a/lib/main/MAVLink/common/mavlink_msg_hil_gps.h +++ b/lib/main/MAVLink/common/mavlink_msg_hil_gps.h @@ -3,22 +3,22 @@ #define MAVLINK_MSG_ID_HIL_GPS 113 -MAVPACKED( + typedef struct __mavlink_hil_gps_t { - uint64_t time_usec; /*< Timestamp (microseconds since UNIX epoch or microseconds since system boot)*/ - int32_t lat; /*< Latitude (WGS84), in degrees * 1E7*/ - int32_t lon; /*< Longitude (WGS84), in degrees * 1E7*/ - int32_t alt; /*< Altitude (AMSL, not WGS84), in meters * 1000 (positive for up)*/ - uint16_t eph; /*< GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: 65535*/ - uint16_t epv; /*< GPS VDOP vertical dilution of position in cm (m*100). If unknown, set to: 65535*/ - uint16_t vel; /*< GPS ground speed (m/s * 100). If unknown, set to: 65535*/ - int16_t vn; /*< GPS velocity in cm/s in NORTH direction in earth-fixed NED frame*/ - int16_t ve; /*< GPS velocity in cm/s in EAST direction in earth-fixed NED frame*/ - int16_t vd; /*< GPS velocity in cm/s in DOWN direction in earth-fixed NED frame*/ - uint16_t cog; /*< Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: 65535*/ - uint8_t fix_type; /*< 0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix.*/ - uint8_t satellites_visible; /*< Number of satellites visible. If unknown, set to 255*/ -}) mavlink_hil_gps_t; + uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.*/ + int32_t lat; /*< [degE7] Latitude (WGS84)*/ + int32_t lon; /*< [degE7] Longitude (WGS84)*/ + int32_t alt; /*< [mm] Altitude (MSL). Positive for up.*/ + uint16_t eph; /*< [cm] GPS HDOP horizontal dilution of position. If unknown, set to: 65535*/ + uint16_t epv; /*< [cm] GPS VDOP vertical dilution of position. If unknown, set to: 65535*/ + uint16_t vel; /*< [cm/s] GPS ground speed. If unknown, set to: 65535*/ + int16_t vn; /*< [cm/s] GPS velocity in north direction in earth-fixed NED frame*/ + int16_t ve; /*< [cm/s] GPS velocity in east direction in earth-fixed NED frame*/ + int16_t vd; /*< [cm/s] GPS velocity in down direction in earth-fixed NED frame*/ + uint16_t cog; /*< [cdeg] Course over ground (NOT heading, but direction of movement), 0.0..359.99 degrees. If unknown, set to: 65535*/ + uint8_t fix_type; /*< 0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix.*/ + uint8_t satellites_visible; /*< Number of satellites visible. If unknown, set to 255*/ +} mavlink_hil_gps_t; #define MAVLINK_MSG_ID_HIL_GPS_LEN 36 #define MAVLINK_MSG_ID_HIL_GPS_MIN_LEN 36 @@ -36,6 +36,7 @@ typedef struct __mavlink_hil_gps_t { "HIL_GPS", \ 13, \ { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_gps_t, time_usec) }, \ + { "fix_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_hil_gps_t, fix_type) }, \ { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_hil_gps_t, lat) }, \ { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_hil_gps_t, lon) }, \ { "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_hil_gps_t, alt) }, \ @@ -46,7 +47,6 @@ typedef struct __mavlink_hil_gps_t { { "ve", NULL, MAVLINK_TYPE_INT16_T, 0, 28, offsetof(mavlink_hil_gps_t, ve) }, \ { "vd", NULL, MAVLINK_TYPE_INT16_T, 0, 30, offsetof(mavlink_hil_gps_t, vd) }, \ { "cog", NULL, MAVLINK_TYPE_UINT16_T, 0, 32, offsetof(mavlink_hil_gps_t, cog) }, \ - { "fix_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_hil_gps_t, fix_type) }, \ { "satellites_visible", NULL, MAVLINK_TYPE_UINT8_T, 0, 35, offsetof(mavlink_hil_gps_t, satellites_visible) }, \ } \ } @@ -55,6 +55,7 @@ typedef struct __mavlink_hil_gps_t { "HIL_GPS", \ 13, \ { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_gps_t, time_usec) }, \ + { "fix_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_hil_gps_t, fix_type) }, \ { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_hil_gps_t, lat) }, \ { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_hil_gps_t, lon) }, \ { "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_hil_gps_t, alt) }, \ @@ -65,7 +66,6 @@ typedef struct __mavlink_hil_gps_t { { "ve", NULL, MAVLINK_TYPE_INT16_T, 0, 28, offsetof(mavlink_hil_gps_t, ve) }, \ { "vd", NULL, MAVLINK_TYPE_INT16_T, 0, 30, offsetof(mavlink_hil_gps_t, vd) }, \ { "cog", NULL, MAVLINK_TYPE_UINT16_T, 0, 32, offsetof(mavlink_hil_gps_t, cog) }, \ - { "fix_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_hil_gps_t, fix_type) }, \ { "satellites_visible", NULL, MAVLINK_TYPE_UINT8_T, 0, 35, offsetof(mavlink_hil_gps_t, satellites_visible) }, \ } \ } @@ -77,19 +77,19 @@ typedef struct __mavlink_hil_gps_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot) - * @param fix_type 0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix. - * @param lat Latitude (WGS84), in degrees * 1E7 - * @param lon Longitude (WGS84), in degrees * 1E7 - * @param alt Altitude (AMSL, not WGS84), in meters * 1000 (positive for up) - * @param eph GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: 65535 - * @param epv GPS VDOP vertical dilution of position in cm (m*100). If unknown, set to: 65535 - * @param vel GPS ground speed (m/s * 100). If unknown, set to: 65535 - * @param vn GPS velocity in cm/s in NORTH direction in earth-fixed NED frame - * @param ve GPS velocity in cm/s in EAST direction in earth-fixed NED frame - * @param vd GPS velocity in cm/s in DOWN direction in earth-fixed NED frame - * @param cog Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: 65535 - * @param satellites_visible Number of satellites visible. If unknown, set to 255 + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @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 [degE7] Latitude (WGS84) + * @param lon [degE7] Longitude (WGS84) + * @param alt [mm] Altitude (MSL). Positive for up. + * @param eph [cm] GPS HDOP horizontal dilution of position. If unknown, set to: 65535 + * @param epv [cm] GPS VDOP vertical dilution of position. If unknown, set to: 65535 + * @param vel [cm/s] GPS ground speed. If unknown, set to: 65535 + * @param vn [cm/s] GPS velocity in north direction in earth-fixed NED frame + * @param ve [cm/s] GPS velocity in east direction in earth-fixed NED frame + * @param vd [cm/s] GPS velocity in down direction in earth-fixed NED frame + * @param cog [cdeg] Course over ground (NOT heading, but direction of movement), 0.0..359.99 degrees. If unknown, set to: 65535 + * @param satellites_visible Number of satellites visible. If unknown, set to 255 * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_hil_gps_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -141,19 +141,19 @@ static inline uint16_t mavlink_msg_hil_gps_pack(uint8_t system_id, uint8_t compo * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot) - * @param fix_type 0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix. - * @param lat Latitude (WGS84), in degrees * 1E7 - * @param lon Longitude (WGS84), in degrees * 1E7 - * @param alt Altitude (AMSL, not WGS84), in meters * 1000 (positive for up) - * @param eph GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: 65535 - * @param epv GPS VDOP vertical dilution of position in cm (m*100). If unknown, set to: 65535 - * @param vel GPS ground speed (m/s * 100). If unknown, set to: 65535 - * @param vn GPS velocity in cm/s in NORTH direction in earth-fixed NED frame - * @param ve GPS velocity in cm/s in EAST direction in earth-fixed NED frame - * @param vd GPS velocity in cm/s in DOWN direction in earth-fixed NED frame - * @param cog Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: 65535 - * @param satellites_visible Number of satellites visible. If unknown, set to 255 + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @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 [degE7] Latitude (WGS84) + * @param lon [degE7] Longitude (WGS84) + * @param alt [mm] Altitude (MSL). Positive for up. + * @param eph [cm] GPS HDOP horizontal dilution of position. If unknown, set to: 65535 + * @param epv [cm] GPS VDOP vertical dilution of position. If unknown, set to: 65535 + * @param vel [cm/s] GPS ground speed. If unknown, set to: 65535 + * @param vn [cm/s] GPS velocity in north direction in earth-fixed NED frame + * @param ve [cm/s] GPS velocity in east direction in earth-fixed NED frame + * @param vd [cm/s] GPS velocity in down direction in earth-fixed NED frame + * @param cog [cdeg] Course over ground (NOT heading, but direction of movement), 0.0..359.99 degrees. If unknown, set to: 65535 + * @param satellites_visible Number of satellites visible. If unknown, set to 255 * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_hil_gps_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -231,19 +231,19 @@ static inline uint16_t mavlink_msg_hil_gps_encode_chan(uint8_t system_id, uint8_ * @brief Send a hil_gps message * @param chan MAVLink channel to send the message * - * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot) - * @param fix_type 0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix. - * @param lat Latitude (WGS84), in degrees * 1E7 - * @param lon Longitude (WGS84), in degrees * 1E7 - * @param alt Altitude (AMSL, not WGS84), in meters * 1000 (positive for up) - * @param eph GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: 65535 - * @param epv GPS VDOP vertical dilution of position in cm (m*100). If unknown, set to: 65535 - * @param vel GPS ground speed (m/s * 100). If unknown, set to: 65535 - * @param vn GPS velocity in cm/s in NORTH direction in earth-fixed NED frame - * @param ve GPS velocity in cm/s in EAST direction in earth-fixed NED frame - * @param vd GPS velocity in cm/s in DOWN direction in earth-fixed NED frame - * @param cog Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: 65535 - * @param satellites_visible Number of satellites visible. If unknown, set to 255 + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @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 [degE7] Latitude (WGS84) + * @param lon [degE7] Longitude (WGS84) + * @param alt [mm] Altitude (MSL). Positive for up. + * @param eph [cm] GPS HDOP horizontal dilution of position. If unknown, set to: 65535 + * @param epv [cm] GPS VDOP vertical dilution of position. If unknown, set to: 65535 + * @param vel [cm/s] GPS ground speed. If unknown, set to: 65535 + * @param vn [cm/s] GPS velocity in north direction in earth-fixed NED frame + * @param ve [cm/s] GPS velocity in east direction in earth-fixed NED frame + * @param vd [cm/s] GPS velocity in down direction in earth-fixed NED frame + * @param cog [cdeg] Course over ground (NOT heading, but direction of movement), 0.0..359.99 degrees. If unknown, set to: 65535 + * @param satellites_visible Number of satellites visible. If unknown, set to 255 */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -356,7 +356,7 @@ static inline void mavlink_msg_hil_gps_send_buf(mavlink_message_t *msgbuf, mavli /** * @brief Get field time_usec from hil_gps message * - * @return Timestamp (microseconds since UNIX epoch or microseconds since system boot) + * @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. */ static inline uint64_t mavlink_msg_hil_gps_get_time_usec(const mavlink_message_t* msg) { @@ -366,7 +366,7 @@ static inline uint64_t mavlink_msg_hil_gps_get_time_usec(const mavlink_message_t /** * @brief Get field fix_type from hil_gps message * - * @return 0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix. + * @return 0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix. */ static inline uint8_t mavlink_msg_hil_gps_get_fix_type(const mavlink_message_t* msg) { @@ -376,7 +376,7 @@ static inline uint8_t mavlink_msg_hil_gps_get_fix_type(const mavlink_message_t* /** * @brief Get field lat from hil_gps message * - * @return Latitude (WGS84), in degrees * 1E7 + * @return [degE7] Latitude (WGS84) */ static inline int32_t mavlink_msg_hil_gps_get_lat(const mavlink_message_t* msg) { @@ -386,7 +386,7 @@ static inline int32_t mavlink_msg_hil_gps_get_lat(const mavlink_message_t* msg) /** * @brief Get field lon from hil_gps message * - * @return Longitude (WGS84), in degrees * 1E7 + * @return [degE7] Longitude (WGS84) */ static inline int32_t mavlink_msg_hil_gps_get_lon(const mavlink_message_t* msg) { @@ -396,7 +396,7 @@ static inline int32_t mavlink_msg_hil_gps_get_lon(const mavlink_message_t* msg) /** * @brief Get field alt from hil_gps message * - * @return Altitude (AMSL, not WGS84), in meters * 1000 (positive for up) + * @return [mm] Altitude (MSL). Positive for up. */ static inline int32_t mavlink_msg_hil_gps_get_alt(const mavlink_message_t* msg) { @@ -406,7 +406,7 @@ static inline int32_t mavlink_msg_hil_gps_get_alt(const mavlink_message_t* msg) /** * @brief Get field eph from hil_gps message * - * @return GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: 65535 + * @return [cm] GPS HDOP horizontal dilution of position. If unknown, set to: 65535 */ static inline uint16_t mavlink_msg_hil_gps_get_eph(const mavlink_message_t* msg) { @@ -416,7 +416,7 @@ static inline uint16_t mavlink_msg_hil_gps_get_eph(const mavlink_message_t* msg) /** * @brief Get field epv from hil_gps message * - * @return GPS VDOP vertical dilution of position in cm (m*100). If unknown, set to: 65535 + * @return [cm] GPS VDOP vertical dilution of position. If unknown, set to: 65535 */ static inline uint16_t mavlink_msg_hil_gps_get_epv(const mavlink_message_t* msg) { @@ -426,7 +426,7 @@ static inline uint16_t mavlink_msg_hil_gps_get_epv(const mavlink_message_t* msg) /** * @brief Get field vel from hil_gps message * - * @return GPS ground speed (m/s * 100). If unknown, set to: 65535 + * @return [cm/s] GPS ground speed. If unknown, set to: 65535 */ static inline uint16_t mavlink_msg_hil_gps_get_vel(const mavlink_message_t* msg) { @@ -436,7 +436,7 @@ static inline uint16_t mavlink_msg_hil_gps_get_vel(const mavlink_message_t* msg) /** * @brief Get field vn from hil_gps message * - * @return GPS velocity in cm/s in NORTH direction in earth-fixed NED frame + * @return [cm/s] GPS velocity in north direction in earth-fixed NED frame */ static inline int16_t mavlink_msg_hil_gps_get_vn(const mavlink_message_t* msg) { @@ -446,7 +446,7 @@ static inline int16_t mavlink_msg_hil_gps_get_vn(const mavlink_message_t* msg) /** * @brief Get field ve from hil_gps message * - * @return GPS velocity in cm/s in EAST direction in earth-fixed NED frame + * @return [cm/s] GPS velocity in east direction in earth-fixed NED frame */ static inline int16_t mavlink_msg_hil_gps_get_ve(const mavlink_message_t* msg) { @@ -456,7 +456,7 @@ static inline int16_t mavlink_msg_hil_gps_get_ve(const mavlink_message_t* msg) /** * @brief Get field vd from hil_gps message * - * @return GPS velocity in cm/s in DOWN direction in earth-fixed NED frame + * @return [cm/s] GPS velocity in down direction in earth-fixed NED frame */ static inline int16_t mavlink_msg_hil_gps_get_vd(const mavlink_message_t* msg) { @@ -466,7 +466,7 @@ static inline int16_t mavlink_msg_hil_gps_get_vd(const mavlink_message_t* msg) /** * @brief Get field cog from hil_gps message * - * @return Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: 65535 + * @return [cdeg] Course over ground (NOT heading, but direction of movement), 0.0..359.99 degrees. If unknown, set to: 65535 */ static inline uint16_t mavlink_msg_hil_gps_get_cog(const mavlink_message_t* msg) { @@ -476,7 +476,7 @@ static inline uint16_t mavlink_msg_hil_gps_get_cog(const mavlink_message_t* msg) /** * @brief Get field satellites_visible from hil_gps message * - * @return Number of satellites visible. If unknown, set to 255 + * @return Number of satellites visible. If unknown, set to 255 */ static inline uint8_t mavlink_msg_hil_gps_get_satellites_visible(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_hil_optical_flow.h b/lib/main/MAVLink/common/mavlink_msg_hil_optical_flow.h index 9d1cf8e7d7..98c61fd5e5 100755 --- a/lib/main/MAVLink/common/mavlink_msg_hil_optical_flow.h +++ b/lib/main/MAVLink/common/mavlink_msg_hil_optical_flow.h @@ -3,21 +3,21 @@ #define MAVLINK_MSG_ID_HIL_OPTICAL_FLOW 114 -MAVPACKED( + typedef struct __mavlink_hil_optical_flow_t { - uint64_t time_usec; /*< Timestamp (microseconds, synced to UNIX time or since system boot)*/ - uint32_t integration_time_us; /*< Integration time in microseconds. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the.*/ - float integrated_x; /*< Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)*/ - float integrated_y; /*< Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)*/ - float integrated_xgyro; /*< RH rotation around X axis (rad)*/ - float integrated_ygyro; /*< RH rotation around Y axis (rad)*/ - float integrated_zgyro; /*< RH rotation around Z axis (rad)*/ - uint32_t time_delta_distance_us; /*< Time in microseconds since the distance was sampled.*/ - float distance; /*< Distance to the center of the flow field in meters. Positive value (including zero): distance known. Negative value: Unknown distance.*/ - int16_t temperature; /*< Temperature * 100 in centi-degrees Celsius*/ - uint8_t sensor_id; /*< Sensor ID*/ - uint8_t quality; /*< Optical flow quality / confidence. 0: no valid flow, 255: maximum quality*/ -}) mavlink_hil_optical_flow_t; + uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.*/ + uint32_t integration_time_us; /*< [us] Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the.*/ + float integrated_x; /*< [rad] Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)*/ + float integrated_y; /*< [rad] Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)*/ + float integrated_xgyro; /*< [rad] RH rotation around X axis*/ + float integrated_ygyro; /*< [rad] RH rotation around Y axis*/ + float integrated_zgyro; /*< [rad] RH rotation around Z axis*/ + uint32_t time_delta_distance_us; /*< [us] Time since the distance was sampled.*/ + float distance; /*< [m] Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance.*/ + int16_t temperature; /*< [cdegC] Temperature*/ + uint8_t sensor_id; /*< Sensor ID*/ + uint8_t quality; /*< Optical flow quality / confidence. 0: no valid flow, 255: maximum quality*/ +} mavlink_hil_optical_flow_t; #define MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN 44 #define MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_MIN_LEN 44 @@ -35,17 +35,17 @@ typedef struct __mavlink_hil_optical_flow_t { "HIL_OPTICAL_FLOW", \ 12, \ { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_optical_flow_t, time_usec) }, \ + { "sensor_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 42, offsetof(mavlink_hil_optical_flow_t, sensor_id) }, \ { "integration_time_us", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_hil_optical_flow_t, integration_time_us) }, \ { "integrated_x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_hil_optical_flow_t, integrated_x) }, \ { "integrated_y", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_hil_optical_flow_t, integrated_y) }, \ { "integrated_xgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_hil_optical_flow_t, integrated_xgyro) }, \ { "integrated_ygyro", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_hil_optical_flow_t, integrated_ygyro) }, \ { "integrated_zgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_hil_optical_flow_t, integrated_zgyro) }, \ + { "temperature", NULL, MAVLINK_TYPE_INT16_T, 0, 40, offsetof(mavlink_hil_optical_flow_t, temperature) }, \ + { "quality", NULL, MAVLINK_TYPE_UINT8_T, 0, 43, offsetof(mavlink_hil_optical_flow_t, quality) }, \ { "time_delta_distance_us", NULL, MAVLINK_TYPE_UINT32_T, 0, 32, offsetof(mavlink_hil_optical_flow_t, time_delta_distance_us) }, \ { "distance", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_hil_optical_flow_t, distance) }, \ - { "temperature", NULL, MAVLINK_TYPE_INT16_T, 0, 40, offsetof(mavlink_hil_optical_flow_t, temperature) }, \ - { "sensor_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 42, offsetof(mavlink_hil_optical_flow_t, sensor_id) }, \ - { "quality", NULL, MAVLINK_TYPE_UINT8_T, 0, 43, offsetof(mavlink_hil_optical_flow_t, quality) }, \ } \ } #else @@ -53,17 +53,17 @@ typedef struct __mavlink_hil_optical_flow_t { "HIL_OPTICAL_FLOW", \ 12, \ { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_optical_flow_t, time_usec) }, \ + { "sensor_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 42, offsetof(mavlink_hil_optical_flow_t, sensor_id) }, \ { "integration_time_us", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_hil_optical_flow_t, integration_time_us) }, \ { "integrated_x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_hil_optical_flow_t, integrated_x) }, \ { "integrated_y", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_hil_optical_flow_t, integrated_y) }, \ { "integrated_xgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_hil_optical_flow_t, integrated_xgyro) }, \ { "integrated_ygyro", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_hil_optical_flow_t, integrated_ygyro) }, \ { "integrated_zgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_hil_optical_flow_t, integrated_zgyro) }, \ + { "temperature", NULL, MAVLINK_TYPE_INT16_T, 0, 40, offsetof(mavlink_hil_optical_flow_t, temperature) }, \ + { "quality", NULL, MAVLINK_TYPE_UINT8_T, 0, 43, offsetof(mavlink_hil_optical_flow_t, quality) }, \ { "time_delta_distance_us", NULL, MAVLINK_TYPE_UINT32_T, 0, 32, offsetof(mavlink_hil_optical_flow_t, time_delta_distance_us) }, \ { "distance", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_hil_optical_flow_t, distance) }, \ - { "temperature", NULL, MAVLINK_TYPE_INT16_T, 0, 40, offsetof(mavlink_hil_optical_flow_t, temperature) }, \ - { "sensor_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 42, offsetof(mavlink_hil_optical_flow_t, sensor_id) }, \ - { "quality", NULL, MAVLINK_TYPE_UINT8_T, 0, 43, offsetof(mavlink_hil_optical_flow_t, quality) }, \ } \ } #endif @@ -74,18 +74,18 @@ typedef struct __mavlink_hil_optical_flow_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param time_usec Timestamp (microseconds, synced to UNIX time or since system boot) - * @param sensor_id Sensor ID - * @param integration_time_us Integration time in microseconds. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the. - * @param integrated_x Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.) - * @param integrated_y Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.) - * @param integrated_xgyro RH rotation around X axis (rad) - * @param integrated_ygyro RH rotation around Y axis (rad) - * @param integrated_zgyro RH rotation around Z axis (rad) - * @param temperature Temperature * 100 in centi-degrees Celsius - * @param quality Optical flow quality / confidence. 0: no valid flow, 255: maximum quality - * @param time_delta_distance_us Time in microseconds since the distance was sampled. - * @param distance Distance to the center of the flow field in meters. Positive value (including zero): distance known. Negative value: Unknown distance. + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param sensor_id Sensor ID + * @param integration_time_us [us] Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the. + * @param integrated_x [rad] Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.) + * @param integrated_y [rad] Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.) + * @param integrated_xgyro [rad] RH rotation around X axis + * @param integrated_ygyro [rad] RH rotation around Y axis + * @param integrated_zgyro [rad] RH rotation around Z axis + * @param temperature [cdegC] Temperature + * @param quality Optical flow quality / confidence. 0: no valid flow, 255: maximum quality + * @param time_delta_distance_us [us] Time since the distance was sampled. + * @param distance [m] Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_hil_optical_flow_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -135,18 +135,18 @@ static inline uint16_t mavlink_msg_hil_optical_flow_pack(uint8_t system_id, uint * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param time_usec Timestamp (microseconds, synced to UNIX time or since system boot) - * @param sensor_id Sensor ID - * @param integration_time_us Integration time in microseconds. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the. - * @param integrated_x Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.) - * @param integrated_y Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.) - * @param integrated_xgyro RH rotation around X axis (rad) - * @param integrated_ygyro RH rotation around Y axis (rad) - * @param integrated_zgyro RH rotation around Z axis (rad) - * @param temperature Temperature * 100 in centi-degrees Celsius - * @param quality Optical flow quality / confidence. 0: no valid flow, 255: maximum quality - * @param time_delta_distance_us Time in microseconds since the distance was sampled. - * @param distance Distance to the center of the flow field in meters. Positive value (including zero): distance known. Negative value: Unknown distance. + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param sensor_id Sensor ID + * @param integration_time_us [us] Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the. + * @param integrated_x [rad] Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.) + * @param integrated_y [rad] Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.) + * @param integrated_xgyro [rad] RH rotation around X axis + * @param integrated_ygyro [rad] RH rotation around Y axis + * @param integrated_zgyro [rad] RH rotation around Z axis + * @param temperature [cdegC] Temperature + * @param quality Optical flow quality / confidence. 0: no valid flow, 255: maximum quality + * @param time_delta_distance_us [us] Time since the distance was sampled. + * @param distance [m] Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_hil_optical_flow_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -222,18 +222,18 @@ static inline uint16_t mavlink_msg_hil_optical_flow_encode_chan(uint8_t system_i * @brief Send a hil_optical_flow message * @param chan MAVLink channel to send the message * - * @param time_usec Timestamp (microseconds, synced to UNIX time or since system boot) - * @param sensor_id Sensor ID - * @param integration_time_us Integration time in microseconds. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the. - * @param integrated_x Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.) - * @param integrated_y Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.) - * @param integrated_xgyro RH rotation around X axis (rad) - * @param integrated_ygyro RH rotation around Y axis (rad) - * @param integrated_zgyro RH rotation around Z axis (rad) - * @param temperature Temperature * 100 in centi-degrees Celsius - * @param quality Optical flow quality / confidence. 0: no valid flow, 255: maximum quality - * @param time_delta_distance_us Time in microseconds since the distance was sampled. - * @param distance Distance to the center of the flow field in meters. Positive value (including zero): distance known. Negative value: Unknown distance. + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param sensor_id Sensor ID + * @param integration_time_us [us] Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the. + * @param integrated_x [rad] Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.) + * @param integrated_y [rad] Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.) + * @param integrated_xgyro [rad] RH rotation around X axis + * @param integrated_ygyro [rad] RH rotation around Y axis + * @param integrated_zgyro [rad] RH rotation around Z axis + * @param temperature [cdegC] Temperature + * @param quality Optical flow quality / confidence. 0: no valid flow, 255: maximum quality + * @param time_delta_distance_us [us] Time since the distance was sampled. + * @param distance [m] Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance. */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -342,7 +342,7 @@ static inline void mavlink_msg_hil_optical_flow_send_buf(mavlink_message_t *msgb /** * @brief Get field time_usec from hil_optical_flow message * - * @return Timestamp (microseconds, synced to UNIX time or since system boot) + * @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. */ static inline uint64_t mavlink_msg_hil_optical_flow_get_time_usec(const mavlink_message_t* msg) { @@ -352,7 +352,7 @@ static inline uint64_t mavlink_msg_hil_optical_flow_get_time_usec(const mavlink_ /** * @brief Get field sensor_id from hil_optical_flow message * - * @return Sensor ID + * @return Sensor ID */ static inline uint8_t mavlink_msg_hil_optical_flow_get_sensor_id(const mavlink_message_t* msg) { @@ -362,7 +362,7 @@ static inline uint8_t mavlink_msg_hil_optical_flow_get_sensor_id(const mavlink_m /** * @brief Get field integration_time_us from hil_optical_flow message * - * @return Integration time in microseconds. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the. + * @return [us] Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the. */ static inline uint32_t mavlink_msg_hil_optical_flow_get_integration_time_us(const mavlink_message_t* msg) { @@ -372,7 +372,7 @@ static inline uint32_t mavlink_msg_hil_optical_flow_get_integration_time_us(cons /** * @brief Get field integrated_x from hil_optical_flow message * - * @return Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.) + * @return [rad] Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.) */ static inline float mavlink_msg_hil_optical_flow_get_integrated_x(const mavlink_message_t* msg) { @@ -382,7 +382,7 @@ static inline float mavlink_msg_hil_optical_flow_get_integrated_x(const mavlink_ /** * @brief Get field integrated_y from hil_optical_flow message * - * @return Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.) + * @return [rad] Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.) */ static inline float mavlink_msg_hil_optical_flow_get_integrated_y(const mavlink_message_t* msg) { @@ -392,7 +392,7 @@ static inline float mavlink_msg_hil_optical_flow_get_integrated_y(const mavlink_ /** * @brief Get field integrated_xgyro from hil_optical_flow message * - * @return RH rotation around X axis (rad) + * @return [rad] RH rotation around X axis */ static inline float mavlink_msg_hil_optical_flow_get_integrated_xgyro(const mavlink_message_t* msg) { @@ -402,7 +402,7 @@ static inline float mavlink_msg_hil_optical_flow_get_integrated_xgyro(const mavl /** * @brief Get field integrated_ygyro from hil_optical_flow message * - * @return RH rotation around Y axis (rad) + * @return [rad] RH rotation around Y axis */ static inline float mavlink_msg_hil_optical_flow_get_integrated_ygyro(const mavlink_message_t* msg) { @@ -412,7 +412,7 @@ static inline float mavlink_msg_hil_optical_flow_get_integrated_ygyro(const mavl /** * @brief Get field integrated_zgyro from hil_optical_flow message * - * @return RH rotation around Z axis (rad) + * @return [rad] RH rotation around Z axis */ static inline float mavlink_msg_hil_optical_flow_get_integrated_zgyro(const mavlink_message_t* msg) { @@ -422,7 +422,7 @@ static inline float mavlink_msg_hil_optical_flow_get_integrated_zgyro(const mavl /** * @brief Get field temperature from hil_optical_flow message * - * @return Temperature * 100 in centi-degrees Celsius + * @return [cdegC] Temperature */ static inline int16_t mavlink_msg_hil_optical_flow_get_temperature(const mavlink_message_t* msg) { @@ -432,7 +432,7 @@ static inline int16_t mavlink_msg_hil_optical_flow_get_temperature(const mavlink /** * @brief Get field quality from hil_optical_flow message * - * @return Optical flow quality / confidence. 0: no valid flow, 255: maximum quality + * @return Optical flow quality / confidence. 0: no valid flow, 255: maximum quality */ static inline uint8_t mavlink_msg_hil_optical_flow_get_quality(const mavlink_message_t* msg) { @@ -442,7 +442,7 @@ static inline uint8_t mavlink_msg_hil_optical_flow_get_quality(const mavlink_mes /** * @brief Get field time_delta_distance_us from hil_optical_flow message * - * @return Time in microseconds since the distance was sampled. + * @return [us] Time since the distance was sampled. */ static inline uint32_t mavlink_msg_hil_optical_flow_get_time_delta_distance_us(const mavlink_message_t* msg) { @@ -452,7 +452,7 @@ static inline uint32_t mavlink_msg_hil_optical_flow_get_time_delta_distance_us(c /** * @brief Get field distance from hil_optical_flow message * - * @return Distance to the center of the flow field in meters. Positive value (including zero): distance known. Negative value: Unknown distance. + * @return [m] Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance. */ static inline float mavlink_msg_hil_optical_flow_get_distance(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_hil_rc_inputs_raw.h b/lib/main/MAVLink/common/mavlink_msg_hil_rc_inputs_raw.h index 04b8a45a44..28ce091ab8 100755 --- a/lib/main/MAVLink/common/mavlink_msg_hil_rc_inputs_raw.h +++ b/lib/main/MAVLink/common/mavlink_msg_hil_rc_inputs_raw.h @@ -3,23 +3,23 @@ #define MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW 92 -MAVPACKED( + typedef struct __mavlink_hil_rc_inputs_raw_t { - uint64_t time_usec; /*< Timestamp (microseconds since UNIX epoch or microseconds since system boot)*/ - uint16_t chan1_raw; /*< RC channel 1 value, in microseconds*/ - uint16_t chan2_raw; /*< RC channel 2 value, in microseconds*/ - uint16_t chan3_raw; /*< RC channel 3 value, in microseconds*/ - uint16_t chan4_raw; /*< RC channel 4 value, in microseconds*/ - uint16_t chan5_raw; /*< RC channel 5 value, in microseconds*/ - uint16_t chan6_raw; /*< RC channel 6 value, in microseconds*/ - uint16_t chan7_raw; /*< RC channel 7 value, in microseconds*/ - uint16_t chan8_raw; /*< RC channel 8 value, in microseconds*/ - uint16_t chan9_raw; /*< RC channel 9 value, in microseconds*/ - uint16_t chan10_raw; /*< RC channel 10 value, in microseconds*/ - uint16_t chan11_raw; /*< RC channel 11 value, in microseconds*/ - uint16_t chan12_raw; /*< RC channel 12 value, in microseconds*/ - uint8_t rssi; /*< Receive signal strength indicator, 0: 0%, 255: 100%*/ -}) mavlink_hil_rc_inputs_raw_t; + uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.*/ + uint16_t chan1_raw; /*< [us] RC channel 1 value*/ + uint16_t chan2_raw; /*< [us] RC channel 2 value*/ + uint16_t chan3_raw; /*< [us] RC channel 3 value*/ + uint16_t chan4_raw; /*< [us] RC channel 4 value*/ + uint16_t chan5_raw; /*< [us] RC channel 5 value*/ + uint16_t chan6_raw; /*< [us] RC channel 6 value*/ + uint16_t chan7_raw; /*< [us] RC channel 7 value*/ + uint16_t chan8_raw; /*< [us] RC channel 8 value*/ + uint16_t chan9_raw; /*< [us] RC channel 9 value*/ + uint16_t chan10_raw; /*< [us] RC channel 10 value*/ + uint16_t chan11_raw; /*< [us] RC channel 11 value*/ + uint16_t chan12_raw; /*< [us] RC channel 12 value*/ + uint8_t rssi; /*< Receive signal strength indicator in device-dependent units/scale. Values: [0-254], 255: invalid/unknown.*/ +} mavlink_hil_rc_inputs_raw_t; #define MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN 33 #define MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_MIN_LEN 33 @@ -80,20 +80,20 @@ typedef struct __mavlink_hil_rc_inputs_raw_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot) - * @param chan1_raw RC channel 1 value, in microseconds - * @param chan2_raw RC channel 2 value, in microseconds - * @param chan3_raw RC channel 3 value, in microseconds - * @param chan4_raw RC channel 4 value, in microseconds - * @param chan5_raw RC channel 5 value, in microseconds - * @param chan6_raw RC channel 6 value, in microseconds - * @param chan7_raw RC channel 7 value, in microseconds - * @param chan8_raw RC channel 8 value, in microseconds - * @param chan9_raw RC channel 9 value, in microseconds - * @param chan10_raw RC channel 10 value, in microseconds - * @param chan11_raw RC channel 11 value, in microseconds - * @param chan12_raw RC channel 12 value, in microseconds - * @param rssi Receive signal strength indicator, 0: 0%, 255: 100% + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param chan1_raw [us] RC channel 1 value + * @param chan2_raw [us] RC channel 2 value + * @param chan3_raw [us] RC channel 3 value + * @param chan4_raw [us] RC channel 4 value + * @param chan5_raw [us] RC channel 5 value + * @param chan6_raw [us] RC channel 6 value + * @param chan7_raw [us] RC channel 7 value + * @param chan8_raw [us] RC channel 8 value + * @param chan9_raw [us] RC channel 9 value + * @param chan10_raw [us] RC channel 10 value + * @param chan11_raw [us] RC channel 11 value + * @param chan12_raw [us] RC channel 12 value + * @param rssi Receive signal strength indicator in device-dependent units/scale. Values: [0-254], 255: invalid/unknown. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -147,20 +147,20 @@ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_pack(uint8_t system_id, uin * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot) - * @param chan1_raw RC channel 1 value, in microseconds - * @param chan2_raw RC channel 2 value, in microseconds - * @param chan3_raw RC channel 3 value, in microseconds - * @param chan4_raw RC channel 4 value, in microseconds - * @param chan5_raw RC channel 5 value, in microseconds - * @param chan6_raw RC channel 6 value, in microseconds - * @param chan7_raw RC channel 7 value, in microseconds - * @param chan8_raw RC channel 8 value, in microseconds - * @param chan9_raw RC channel 9 value, in microseconds - * @param chan10_raw RC channel 10 value, in microseconds - * @param chan11_raw RC channel 11 value, in microseconds - * @param chan12_raw RC channel 12 value, in microseconds - * @param rssi Receive signal strength indicator, 0: 0%, 255: 100% + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param chan1_raw [us] RC channel 1 value + * @param chan2_raw [us] RC channel 2 value + * @param chan3_raw [us] RC channel 3 value + * @param chan4_raw [us] RC channel 4 value + * @param chan5_raw [us] RC channel 5 value + * @param chan6_raw [us] RC channel 6 value + * @param chan7_raw [us] RC channel 7 value + * @param chan8_raw [us] RC channel 8 value + * @param chan9_raw [us] RC channel 9 value + * @param chan10_raw [us] RC channel 10 value + * @param chan11_raw [us] RC channel 11 value + * @param chan12_raw [us] RC channel 12 value + * @param rssi Receive signal strength indicator in device-dependent units/scale. Values: [0-254], 255: invalid/unknown. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -240,20 +240,20 @@ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_encode_chan(uint8_t system_ * @brief Send a hil_rc_inputs_raw message * @param chan MAVLink channel to send the message * - * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot) - * @param chan1_raw RC channel 1 value, in microseconds - * @param chan2_raw RC channel 2 value, in microseconds - * @param chan3_raw RC channel 3 value, in microseconds - * @param chan4_raw RC channel 4 value, in microseconds - * @param chan5_raw RC channel 5 value, in microseconds - * @param chan6_raw RC channel 6 value, in microseconds - * @param chan7_raw RC channel 7 value, in microseconds - * @param chan8_raw RC channel 8 value, in microseconds - * @param chan9_raw RC channel 9 value, in microseconds - * @param chan10_raw RC channel 10 value, in microseconds - * @param chan11_raw RC channel 11 value, in microseconds - * @param chan12_raw RC channel 12 value, in microseconds - * @param rssi Receive signal strength indicator, 0: 0%, 255: 100% + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param chan1_raw [us] RC channel 1 value + * @param chan2_raw [us] RC channel 2 value + * @param chan3_raw [us] RC channel 3 value + * @param chan4_raw [us] RC channel 4 value + * @param chan5_raw [us] RC channel 5 value + * @param chan6_raw [us] RC channel 6 value + * @param chan7_raw [us] RC channel 7 value + * @param chan8_raw [us] RC channel 8 value + * @param chan9_raw [us] RC channel 9 value + * @param chan10_raw [us] RC channel 10 value + * @param chan11_raw [us] RC channel 11 value + * @param chan12_raw [us] RC channel 12 value + * @param rssi Receive signal strength indicator in device-dependent units/scale. Values: [0-254], 255: invalid/unknown. */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -370,7 +370,7 @@ static inline void mavlink_msg_hil_rc_inputs_raw_send_buf(mavlink_message_t *msg /** * @brief Get field time_usec from hil_rc_inputs_raw message * - * @return Timestamp (microseconds since UNIX epoch or microseconds since system boot) + * @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. */ static inline uint64_t mavlink_msg_hil_rc_inputs_raw_get_time_usec(const mavlink_message_t* msg) { @@ -380,7 +380,7 @@ static inline uint64_t mavlink_msg_hil_rc_inputs_raw_get_time_usec(const mavlink /** * @brief Get field chan1_raw from hil_rc_inputs_raw message * - * @return RC channel 1 value, in microseconds + * @return [us] RC channel 1 value */ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan1_raw(const mavlink_message_t* msg) { @@ -390,7 +390,7 @@ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan1_raw(const mavlink /** * @brief Get field chan2_raw from hil_rc_inputs_raw message * - * @return RC channel 2 value, in microseconds + * @return [us] RC channel 2 value */ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan2_raw(const mavlink_message_t* msg) { @@ -400,7 +400,7 @@ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan2_raw(const mavlink /** * @brief Get field chan3_raw from hil_rc_inputs_raw message * - * @return RC channel 3 value, in microseconds + * @return [us] RC channel 3 value */ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan3_raw(const mavlink_message_t* msg) { @@ -410,7 +410,7 @@ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan3_raw(const mavlink /** * @brief Get field chan4_raw from hil_rc_inputs_raw message * - * @return RC channel 4 value, in microseconds + * @return [us] RC channel 4 value */ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan4_raw(const mavlink_message_t* msg) { @@ -420,7 +420,7 @@ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan4_raw(const mavlink /** * @brief Get field chan5_raw from hil_rc_inputs_raw message * - * @return RC channel 5 value, in microseconds + * @return [us] RC channel 5 value */ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan5_raw(const mavlink_message_t* msg) { @@ -430,7 +430,7 @@ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan5_raw(const mavlink /** * @brief Get field chan6_raw from hil_rc_inputs_raw message * - * @return RC channel 6 value, in microseconds + * @return [us] RC channel 6 value */ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan6_raw(const mavlink_message_t* msg) { @@ -440,7 +440,7 @@ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan6_raw(const mavlink /** * @brief Get field chan7_raw from hil_rc_inputs_raw message * - * @return RC channel 7 value, in microseconds + * @return [us] RC channel 7 value */ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan7_raw(const mavlink_message_t* msg) { @@ -450,7 +450,7 @@ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan7_raw(const mavlink /** * @brief Get field chan8_raw from hil_rc_inputs_raw message * - * @return RC channel 8 value, in microseconds + * @return [us] RC channel 8 value */ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan8_raw(const mavlink_message_t* msg) { @@ -460,7 +460,7 @@ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan8_raw(const mavlink /** * @brief Get field chan9_raw from hil_rc_inputs_raw message * - * @return RC channel 9 value, in microseconds + * @return [us] RC channel 9 value */ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan9_raw(const mavlink_message_t* msg) { @@ -470,7 +470,7 @@ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan9_raw(const mavlink /** * @brief Get field chan10_raw from hil_rc_inputs_raw message * - * @return RC channel 10 value, in microseconds + * @return [us] RC channel 10 value */ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan10_raw(const mavlink_message_t* msg) { @@ -480,7 +480,7 @@ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan10_raw(const mavlin /** * @brief Get field chan11_raw from hil_rc_inputs_raw message * - * @return RC channel 11 value, in microseconds + * @return [us] RC channel 11 value */ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan11_raw(const mavlink_message_t* msg) { @@ -490,7 +490,7 @@ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan11_raw(const mavlin /** * @brief Get field chan12_raw from hil_rc_inputs_raw message * - * @return RC channel 12 value, in microseconds + * @return [us] RC channel 12 value */ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan12_raw(const mavlink_message_t* msg) { @@ -500,7 +500,7 @@ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan12_raw(const mavlin /** * @brief Get field rssi from hil_rc_inputs_raw message * - * @return Receive signal strength indicator, 0: 0%, 255: 100% + * @return Receive signal strength indicator in device-dependent units/scale. Values: [0-254], 255: invalid/unknown. */ static inline uint8_t mavlink_msg_hil_rc_inputs_raw_get_rssi(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_hil_sensor.h b/lib/main/MAVLink/common/mavlink_msg_hil_sensor.h index e7f561da33..e9d03cc70e 100755 --- a/lib/main/MAVLink/common/mavlink_msg_hil_sensor.h +++ b/lib/main/MAVLink/common/mavlink_msg_hil_sensor.h @@ -3,24 +3,24 @@ #define MAVLINK_MSG_ID_HIL_SENSOR 107 -MAVPACKED( + typedef struct __mavlink_hil_sensor_t { - uint64_t time_usec; /*< Timestamp (microseconds, synced to UNIX time or since system boot)*/ - float xacc; /*< X acceleration (m/s^2)*/ - float yacc; /*< Y acceleration (m/s^2)*/ - float zacc; /*< Z acceleration (m/s^2)*/ - float xgyro; /*< Angular speed around X axis in body frame (rad / sec)*/ - float ygyro; /*< Angular speed around Y axis in body frame (rad / sec)*/ - float zgyro; /*< Angular speed around Z axis in body frame (rad / sec)*/ - float xmag; /*< X Magnetic field (Gauss)*/ - float ymag; /*< Y Magnetic field (Gauss)*/ - float zmag; /*< Z Magnetic field (Gauss)*/ - float abs_pressure; /*< Absolute pressure in millibar*/ - float diff_pressure; /*< Differential pressure (airspeed) in millibar*/ - float pressure_alt; /*< Altitude calculated from pressure*/ - float temperature; /*< Temperature in degrees celsius*/ - uint32_t fields_updated; /*< Bitmask for fields that have updated since last message, bit 0 = xacc, bit 12: temperature, bit 31: full reset of attitude/position/velocities/etc was performed in sim.*/ -}) mavlink_hil_sensor_t; + uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.*/ + float xacc; /*< [m/s/s] X acceleration*/ + float yacc; /*< [m/s/s] Y acceleration*/ + float zacc; /*< [m/s/s] Z acceleration*/ + float xgyro; /*< [rad/s] Angular speed around X axis in body frame*/ + float ygyro; /*< [rad/s] Angular speed around Y axis in body frame*/ + float zgyro; /*< [rad/s] Angular speed around Z axis in body frame*/ + float xmag; /*< [gauss] X Magnetic field*/ + float ymag; /*< [gauss] Y Magnetic field*/ + float zmag; /*< [gauss] Z Magnetic field*/ + float abs_pressure; /*< [mbar] Absolute pressure*/ + float diff_pressure; /*< [mbar] Differential pressure (airspeed)*/ + float pressure_alt; /*< Altitude calculated from pressure*/ + float temperature; /*< [degC] Temperature*/ + uint32_t fields_updated; /*< Bitmap for fields that have updated since last message, bit 0 = xacc, bit 12: temperature, bit 31: full reset of attitude/position/velocities/etc was performed in sim.*/ +} mavlink_hil_sensor_t; #define MAVLINK_MSG_ID_HIL_SENSOR_LEN 64 #define MAVLINK_MSG_ID_HIL_SENSOR_MIN_LEN 64 @@ -83,21 +83,21 @@ typedef struct __mavlink_hil_sensor_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param time_usec Timestamp (microseconds, synced to UNIX time or since system boot) - * @param xacc X acceleration (m/s^2) - * @param yacc Y acceleration (m/s^2) - * @param zacc Z acceleration (m/s^2) - * @param xgyro Angular speed around X axis in body frame (rad / sec) - * @param ygyro Angular speed around Y axis in body frame (rad / sec) - * @param zgyro Angular speed around Z axis in body frame (rad / sec) - * @param xmag X Magnetic field (Gauss) - * @param ymag Y Magnetic field (Gauss) - * @param zmag Z Magnetic field (Gauss) - * @param abs_pressure Absolute pressure in millibar - * @param diff_pressure Differential pressure (airspeed) in millibar - * @param pressure_alt Altitude calculated from pressure - * @param temperature Temperature in degrees celsius - * @param fields_updated Bitmask for fields that have updated since last message, bit 0 = xacc, bit 12: temperature, bit 31: full reset of attitude/position/velocities/etc was performed in sim. + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param xacc [m/s/s] X acceleration + * @param yacc [m/s/s] Y acceleration + * @param zacc [m/s/s] Z acceleration + * @param xgyro [rad/s] Angular speed around X axis in body frame + * @param ygyro [rad/s] Angular speed around Y axis in body frame + * @param zgyro [rad/s] Angular speed around Z axis in body frame + * @param xmag [gauss] X Magnetic field + * @param ymag [gauss] Y Magnetic field + * @param zmag [gauss] Z Magnetic field + * @param abs_pressure [mbar] Absolute pressure + * @param diff_pressure [mbar] Differential pressure (airspeed) + * @param pressure_alt Altitude calculated from pressure + * @param temperature [degC] Temperature + * @param fields_updated Bitmap for fields that have updated since last message, bit 0 = xacc, bit 12: temperature, bit 31: full reset of attitude/position/velocities/etc was performed in sim. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_hil_sensor_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -153,21 +153,21 @@ static inline uint16_t mavlink_msg_hil_sensor_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 will be sent over * @param msg The MAVLink message to compress the data into - * @param time_usec Timestamp (microseconds, synced to UNIX time or since system boot) - * @param xacc X acceleration (m/s^2) - * @param yacc Y acceleration (m/s^2) - * @param zacc Z acceleration (m/s^2) - * @param xgyro Angular speed around X axis in body frame (rad / sec) - * @param ygyro Angular speed around Y axis in body frame (rad / sec) - * @param zgyro Angular speed around Z axis in body frame (rad / sec) - * @param xmag X Magnetic field (Gauss) - * @param ymag Y Magnetic field (Gauss) - * @param zmag Z Magnetic field (Gauss) - * @param abs_pressure Absolute pressure in millibar - * @param diff_pressure Differential pressure (airspeed) in millibar - * @param pressure_alt Altitude calculated from pressure - * @param temperature Temperature in degrees celsius - * @param fields_updated Bitmask for fields that have updated since last message, bit 0 = xacc, bit 12: temperature, bit 31: full reset of attitude/position/velocities/etc was performed in sim. + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param xacc [m/s/s] X acceleration + * @param yacc [m/s/s] Y acceleration + * @param zacc [m/s/s] Z acceleration + * @param xgyro [rad/s] Angular speed around X axis in body frame + * @param ygyro [rad/s] Angular speed around Y axis in body frame + * @param zgyro [rad/s] Angular speed around Z axis in body frame + * @param xmag [gauss] X Magnetic field + * @param ymag [gauss] Y Magnetic field + * @param zmag [gauss] Z Magnetic field + * @param abs_pressure [mbar] Absolute pressure + * @param diff_pressure [mbar] Differential pressure (airspeed) + * @param pressure_alt Altitude calculated from pressure + * @param temperature [degC] Temperature + * @param fields_updated Bitmap for fields that have updated since last message, bit 0 = xacc, bit 12: temperature, bit 31: full reset of attitude/position/velocities/etc was performed in sim. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_hil_sensor_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -249,21 +249,21 @@ static inline uint16_t mavlink_msg_hil_sensor_encode_chan(uint8_t system_id, uin * @brief Send a hil_sensor message * @param chan MAVLink channel to send the message * - * @param time_usec Timestamp (microseconds, synced to UNIX time or since system boot) - * @param xacc X acceleration (m/s^2) - * @param yacc Y acceleration (m/s^2) - * @param zacc Z acceleration (m/s^2) - * @param xgyro Angular speed around X axis in body frame (rad / sec) - * @param ygyro Angular speed around Y axis in body frame (rad / sec) - * @param zgyro Angular speed around Z axis in body frame (rad / sec) - * @param xmag X Magnetic field (Gauss) - * @param ymag Y Magnetic field (Gauss) - * @param zmag Z Magnetic field (Gauss) - * @param abs_pressure Absolute pressure in millibar - * @param diff_pressure Differential pressure (airspeed) in millibar - * @param pressure_alt Altitude calculated from pressure - * @param temperature Temperature in degrees celsius - * @param fields_updated Bitmask for fields that have updated since last message, bit 0 = xacc, bit 12: temperature, bit 31: full reset of attitude/position/velocities/etc was performed in sim. + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param xacc [m/s/s] X acceleration + * @param yacc [m/s/s] Y acceleration + * @param zacc [m/s/s] Z acceleration + * @param xgyro [rad/s] Angular speed around X axis in body frame + * @param ygyro [rad/s] Angular speed around Y axis in body frame + * @param zgyro [rad/s] Angular speed around Z axis in body frame + * @param xmag [gauss] X Magnetic field + * @param ymag [gauss] Y Magnetic field + * @param zmag [gauss] Z Magnetic field + * @param abs_pressure [mbar] Absolute pressure + * @param diff_pressure [mbar] Differential pressure (airspeed) + * @param pressure_alt Altitude calculated from pressure + * @param temperature [degC] Temperature + * @param fields_updated Bitmap for fields that have updated since last message, bit 0 = xacc, bit 12: temperature, bit 31: full reset of attitude/position/velocities/etc was performed in sim. */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -384,7 +384,7 @@ static inline void mavlink_msg_hil_sensor_send_buf(mavlink_message_t *msgbuf, ma /** * @brief Get field time_usec from hil_sensor message * - * @return Timestamp (microseconds, synced to UNIX time or since system boot) + * @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. */ static inline uint64_t mavlink_msg_hil_sensor_get_time_usec(const mavlink_message_t* msg) { @@ -394,7 +394,7 @@ static inline uint64_t mavlink_msg_hil_sensor_get_time_usec(const mavlink_messag /** * @brief Get field xacc from hil_sensor message * - * @return X acceleration (m/s^2) + * @return [m/s/s] X acceleration */ static inline float mavlink_msg_hil_sensor_get_xacc(const mavlink_message_t* msg) { @@ -404,7 +404,7 @@ static inline float mavlink_msg_hil_sensor_get_xacc(const mavlink_message_t* msg /** * @brief Get field yacc from hil_sensor message * - * @return Y acceleration (m/s^2) + * @return [m/s/s] Y acceleration */ static inline float mavlink_msg_hil_sensor_get_yacc(const mavlink_message_t* msg) { @@ -414,7 +414,7 @@ static inline float mavlink_msg_hil_sensor_get_yacc(const mavlink_message_t* msg /** * @brief Get field zacc from hil_sensor message * - * @return Z acceleration (m/s^2) + * @return [m/s/s] Z acceleration */ static inline float mavlink_msg_hil_sensor_get_zacc(const mavlink_message_t* msg) { @@ -424,7 +424,7 @@ static inline float mavlink_msg_hil_sensor_get_zacc(const mavlink_message_t* msg /** * @brief Get field xgyro from hil_sensor message * - * @return Angular speed around X axis in body frame (rad / sec) + * @return [rad/s] Angular speed around X axis in body frame */ static inline float mavlink_msg_hil_sensor_get_xgyro(const mavlink_message_t* msg) { @@ -434,7 +434,7 @@ static inline float mavlink_msg_hil_sensor_get_xgyro(const mavlink_message_t* ms /** * @brief Get field ygyro from hil_sensor message * - * @return Angular speed around Y axis in body frame (rad / sec) + * @return [rad/s] Angular speed around Y axis in body frame */ static inline float mavlink_msg_hil_sensor_get_ygyro(const mavlink_message_t* msg) { @@ -444,7 +444,7 @@ static inline float mavlink_msg_hil_sensor_get_ygyro(const mavlink_message_t* ms /** * @brief Get field zgyro from hil_sensor message * - * @return Angular speed around Z axis in body frame (rad / sec) + * @return [rad/s] Angular speed around Z axis in body frame */ static inline float mavlink_msg_hil_sensor_get_zgyro(const mavlink_message_t* msg) { @@ -454,7 +454,7 @@ static inline float mavlink_msg_hil_sensor_get_zgyro(const mavlink_message_t* ms /** * @brief Get field xmag from hil_sensor message * - * @return X Magnetic field (Gauss) + * @return [gauss] X Magnetic field */ static inline float mavlink_msg_hil_sensor_get_xmag(const mavlink_message_t* msg) { @@ -464,7 +464,7 @@ static inline float mavlink_msg_hil_sensor_get_xmag(const mavlink_message_t* msg /** * @brief Get field ymag from hil_sensor message * - * @return Y Magnetic field (Gauss) + * @return [gauss] Y Magnetic field */ static inline float mavlink_msg_hil_sensor_get_ymag(const mavlink_message_t* msg) { @@ -474,7 +474,7 @@ static inline float mavlink_msg_hil_sensor_get_ymag(const mavlink_message_t* msg /** * @brief Get field zmag from hil_sensor message * - * @return Z Magnetic field (Gauss) + * @return [gauss] Z Magnetic field */ static inline float mavlink_msg_hil_sensor_get_zmag(const mavlink_message_t* msg) { @@ -484,7 +484,7 @@ static inline float mavlink_msg_hil_sensor_get_zmag(const mavlink_message_t* msg /** * @brief Get field abs_pressure from hil_sensor message * - * @return Absolute pressure in millibar + * @return [mbar] Absolute pressure */ static inline float mavlink_msg_hil_sensor_get_abs_pressure(const mavlink_message_t* msg) { @@ -494,7 +494,7 @@ static inline float mavlink_msg_hil_sensor_get_abs_pressure(const mavlink_messag /** * @brief Get field diff_pressure from hil_sensor message * - * @return Differential pressure (airspeed) in millibar + * @return [mbar] Differential pressure (airspeed) */ static inline float mavlink_msg_hil_sensor_get_diff_pressure(const mavlink_message_t* msg) { @@ -504,7 +504,7 @@ static inline float mavlink_msg_hil_sensor_get_diff_pressure(const mavlink_messa /** * @brief Get field pressure_alt from hil_sensor message * - * @return Altitude calculated from pressure + * @return Altitude calculated from pressure */ static inline float mavlink_msg_hil_sensor_get_pressure_alt(const mavlink_message_t* msg) { @@ -514,7 +514,7 @@ static inline float mavlink_msg_hil_sensor_get_pressure_alt(const mavlink_messag /** * @brief Get field temperature from hil_sensor message * - * @return Temperature in degrees celsius + * @return [degC] Temperature */ static inline float mavlink_msg_hil_sensor_get_temperature(const mavlink_message_t* msg) { @@ -524,7 +524,7 @@ static inline float mavlink_msg_hil_sensor_get_temperature(const mavlink_message /** * @brief Get field fields_updated from hil_sensor message * - * @return Bitmask for fields that have updated since last message, bit 0 = xacc, bit 12: temperature, bit 31: full reset of attitude/position/velocities/etc was performed in sim. + * @return Bitmap for fields that have updated since last message, bit 0 = xacc, bit 12: temperature, bit 31: full reset of attitude/position/velocities/etc was performed in sim. */ static inline uint32_t mavlink_msg_hil_sensor_get_fields_updated(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_hil_state.h b/lib/main/MAVLink/common/mavlink_msg_hil_state.h index 722c5835be..e5c4ed8097 100755 --- a/lib/main/MAVLink/common/mavlink_msg_hil_state.h +++ b/lib/main/MAVLink/common/mavlink_msg_hil_state.h @@ -3,25 +3,25 @@ #define MAVLINK_MSG_ID_HIL_STATE 90 -MAVPACKED( + typedef struct __mavlink_hil_state_t { - uint64_t time_usec; /*< Timestamp (microseconds since UNIX epoch or microseconds since system boot)*/ - float roll; /*< Roll angle (rad)*/ - float pitch; /*< Pitch angle (rad)*/ - float yaw; /*< Yaw angle (rad)*/ - float rollspeed; /*< Body frame roll / phi angular speed (rad/s)*/ - float pitchspeed; /*< Body frame pitch / theta angular speed (rad/s)*/ - float yawspeed; /*< Body frame yaw / psi angular speed (rad/s)*/ - int32_t lat; /*< Latitude, expressed as * 1E7*/ - int32_t lon; /*< Longitude, expressed as * 1E7*/ - int32_t alt; /*< Altitude in meters, expressed as * 1000 (millimeters)*/ - int16_t vx; /*< Ground X Speed (Latitude), expressed as m/s * 100*/ - int16_t vy; /*< Ground Y Speed (Longitude), expressed as m/s * 100*/ - int16_t vz; /*< Ground Z Speed (Altitude), expressed as m/s * 100*/ - int16_t xacc; /*< X acceleration (mg)*/ - int16_t yacc; /*< Y acceleration (mg)*/ - int16_t zacc; /*< Z acceleration (mg)*/ -}) mavlink_hil_state_t; + uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.*/ + float roll; /*< [rad] Roll angle*/ + float pitch; /*< [rad] Pitch angle*/ + float yaw; /*< [rad] Yaw angle*/ + float rollspeed; /*< [rad/s] Body frame roll / phi angular speed*/ + float pitchspeed; /*< [rad/s] Body frame pitch / theta angular speed*/ + float yawspeed; /*< [rad/s] Body frame yaw / psi angular speed*/ + int32_t lat; /*< [degE7] Latitude*/ + int32_t lon; /*< [degE7] Longitude*/ + int32_t alt; /*< [mm] Altitude*/ + int16_t vx; /*< [cm/s] Ground X Speed (Latitude)*/ + int16_t vy; /*< [cm/s] Ground Y Speed (Longitude)*/ + int16_t vz; /*< [cm/s] Ground Z Speed (Altitude)*/ + int16_t xacc; /*< [mG] X acceleration*/ + int16_t yacc; /*< [mG] Y acceleration*/ + int16_t zacc; /*< [mG] Z acceleration*/ +} mavlink_hil_state_t; #define MAVLINK_MSG_ID_HIL_STATE_LEN 56 #define MAVLINK_MSG_ID_HIL_STATE_MIN_LEN 56 @@ -86,22 +86,22 @@ typedef struct __mavlink_hil_state_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot) - * @param roll Roll angle (rad) - * @param pitch Pitch angle (rad) - * @param yaw Yaw angle (rad) - * @param rollspeed Body frame roll / phi angular speed (rad/s) - * @param pitchspeed Body frame pitch / theta angular speed (rad/s) - * @param yawspeed Body frame yaw / psi angular speed (rad/s) - * @param lat Latitude, expressed as * 1E7 - * @param lon Longitude, expressed as * 1E7 - * @param alt Altitude in meters, expressed as * 1000 (millimeters) - * @param vx Ground X Speed (Latitude), expressed as m/s * 100 - * @param vy Ground Y Speed (Longitude), expressed as m/s * 100 - * @param vz Ground Z Speed (Altitude), expressed as m/s * 100 - * @param xacc X acceleration (mg) - * @param yacc Y acceleration (mg) - * @param zacc Z acceleration (mg) + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param roll [rad] Roll angle + * @param pitch [rad] Pitch angle + * @param yaw [rad] Yaw angle + * @param rollspeed [rad/s] Body frame roll / phi angular speed + * @param pitchspeed [rad/s] Body frame pitch / theta angular speed + * @param yawspeed [rad/s] Body frame yaw / psi angular speed + * @param lat [degE7] Latitude + * @param lon [degE7] Longitude + * @param alt [mm] Altitude + * @param vx [cm/s] Ground X Speed (Latitude) + * @param vy [cm/s] Ground Y Speed (Longitude) + * @param vz [cm/s] Ground Z Speed (Altitude) + * @param xacc [mG] X acceleration + * @param yacc [mG] Y acceleration + * @param zacc [mG] Z acceleration * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_hil_state_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -159,22 +159,22 @@ static inline uint16_t mavlink_msg_hil_state_pack(uint8_t system_id, uint8_t com * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot) - * @param roll Roll angle (rad) - * @param pitch Pitch angle (rad) - * @param yaw Yaw angle (rad) - * @param rollspeed Body frame roll / phi angular speed (rad/s) - * @param pitchspeed Body frame pitch / theta angular speed (rad/s) - * @param yawspeed Body frame yaw / psi angular speed (rad/s) - * @param lat Latitude, expressed as * 1E7 - * @param lon Longitude, expressed as * 1E7 - * @param alt Altitude in meters, expressed as * 1000 (millimeters) - * @param vx Ground X Speed (Latitude), expressed as m/s * 100 - * @param vy Ground Y Speed (Longitude), expressed as m/s * 100 - * @param vz Ground Z Speed (Altitude), expressed as m/s * 100 - * @param xacc X acceleration (mg) - * @param yacc Y acceleration (mg) - * @param zacc Z acceleration (mg) + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param roll [rad] Roll angle + * @param pitch [rad] Pitch angle + * @param yaw [rad] Yaw angle + * @param rollspeed [rad/s] Body frame roll / phi angular speed + * @param pitchspeed [rad/s] Body frame pitch / theta angular speed + * @param yawspeed [rad/s] Body frame yaw / psi angular speed + * @param lat [degE7] Latitude + * @param lon [degE7] Longitude + * @param alt [mm] Altitude + * @param vx [cm/s] Ground X Speed (Latitude) + * @param vy [cm/s] Ground Y Speed (Longitude) + * @param vz [cm/s] Ground Z Speed (Altitude) + * @param xacc [mG] X acceleration + * @param yacc [mG] Y acceleration + * @param zacc [mG] Z acceleration * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_hil_state_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -258,22 +258,22 @@ static inline uint16_t mavlink_msg_hil_state_encode_chan(uint8_t system_id, uint * @brief Send a hil_state message * @param chan MAVLink channel to send the message * - * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot) - * @param roll Roll angle (rad) - * @param pitch Pitch angle (rad) - * @param yaw Yaw angle (rad) - * @param rollspeed Body frame roll / phi angular speed (rad/s) - * @param pitchspeed Body frame pitch / theta angular speed (rad/s) - * @param yawspeed Body frame yaw / psi angular speed (rad/s) - * @param lat Latitude, expressed as * 1E7 - * @param lon Longitude, expressed as * 1E7 - * @param alt Altitude in meters, expressed as * 1000 (millimeters) - * @param vx Ground X Speed (Latitude), expressed as m/s * 100 - * @param vy Ground Y Speed (Longitude), expressed as m/s * 100 - * @param vz Ground Z Speed (Altitude), expressed as m/s * 100 - * @param xacc X acceleration (mg) - * @param yacc Y acceleration (mg) - * @param zacc Z acceleration (mg) + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param roll [rad] Roll angle + * @param pitch [rad] Pitch angle + * @param yaw [rad] Yaw angle + * @param rollspeed [rad/s] Body frame roll / phi angular speed + * @param pitchspeed [rad/s] Body frame pitch / theta angular speed + * @param yawspeed [rad/s] Body frame yaw / psi angular speed + * @param lat [degE7] Latitude + * @param lon [degE7] Longitude + * @param alt [mm] Altitude + * @param vx [cm/s] Ground X Speed (Latitude) + * @param vy [cm/s] Ground Y Speed (Longitude) + * @param vz [cm/s] Ground Z Speed (Altitude) + * @param xacc [mG] X acceleration + * @param yacc [mG] Y acceleration + * @param zacc [mG] Z acceleration */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -398,7 +398,7 @@ static inline void mavlink_msg_hil_state_send_buf(mavlink_message_t *msgbuf, mav /** * @brief Get field time_usec from hil_state message * - * @return Timestamp (microseconds since UNIX epoch or microseconds since system boot) + * @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. */ static inline uint64_t mavlink_msg_hil_state_get_time_usec(const mavlink_message_t* msg) { @@ -408,7 +408,7 @@ static inline uint64_t mavlink_msg_hil_state_get_time_usec(const mavlink_message /** * @brief Get field roll from hil_state message * - * @return Roll angle (rad) + * @return [rad] Roll angle */ static inline float mavlink_msg_hil_state_get_roll(const mavlink_message_t* msg) { @@ -418,7 +418,7 @@ static inline float mavlink_msg_hil_state_get_roll(const mavlink_message_t* msg) /** * @brief Get field pitch from hil_state message * - * @return Pitch angle (rad) + * @return [rad] Pitch angle */ static inline float mavlink_msg_hil_state_get_pitch(const mavlink_message_t* msg) { @@ -428,7 +428,7 @@ static inline float mavlink_msg_hil_state_get_pitch(const mavlink_message_t* msg /** * @brief Get field yaw from hil_state message * - * @return Yaw angle (rad) + * @return [rad] Yaw angle */ static inline float mavlink_msg_hil_state_get_yaw(const mavlink_message_t* msg) { @@ -438,7 +438,7 @@ static inline float mavlink_msg_hil_state_get_yaw(const mavlink_message_t* msg) /** * @brief Get field rollspeed from hil_state message * - * @return Body frame roll / phi angular speed (rad/s) + * @return [rad/s] Body frame roll / phi angular speed */ static inline float mavlink_msg_hil_state_get_rollspeed(const mavlink_message_t* msg) { @@ -448,7 +448,7 @@ static inline float mavlink_msg_hil_state_get_rollspeed(const mavlink_message_t* /** * @brief Get field pitchspeed from hil_state message * - * @return Body frame pitch / theta angular speed (rad/s) + * @return [rad/s] Body frame pitch / theta angular speed */ static inline float mavlink_msg_hil_state_get_pitchspeed(const mavlink_message_t* msg) { @@ -458,7 +458,7 @@ static inline float mavlink_msg_hil_state_get_pitchspeed(const mavlink_message_t /** * @brief Get field yawspeed from hil_state message * - * @return Body frame yaw / psi angular speed (rad/s) + * @return [rad/s] Body frame yaw / psi angular speed */ static inline float mavlink_msg_hil_state_get_yawspeed(const mavlink_message_t* msg) { @@ -468,7 +468,7 @@ static inline float mavlink_msg_hil_state_get_yawspeed(const mavlink_message_t* /** * @brief Get field lat from hil_state message * - * @return Latitude, expressed as * 1E7 + * @return [degE7] Latitude */ static inline int32_t mavlink_msg_hil_state_get_lat(const mavlink_message_t* msg) { @@ -478,7 +478,7 @@ static inline int32_t mavlink_msg_hil_state_get_lat(const mavlink_message_t* msg /** * @brief Get field lon from hil_state message * - * @return Longitude, expressed as * 1E7 + * @return [degE7] Longitude */ static inline int32_t mavlink_msg_hil_state_get_lon(const mavlink_message_t* msg) { @@ -488,7 +488,7 @@ static inline int32_t mavlink_msg_hil_state_get_lon(const mavlink_message_t* msg /** * @brief Get field alt from hil_state message * - * @return Altitude in meters, expressed as * 1000 (millimeters) + * @return [mm] Altitude */ static inline int32_t mavlink_msg_hil_state_get_alt(const mavlink_message_t* msg) { @@ -498,7 +498,7 @@ static inline int32_t mavlink_msg_hil_state_get_alt(const mavlink_message_t* msg /** * @brief Get field vx from hil_state message * - * @return Ground X Speed (Latitude), expressed as m/s * 100 + * @return [cm/s] Ground X Speed (Latitude) */ static inline int16_t mavlink_msg_hil_state_get_vx(const mavlink_message_t* msg) { @@ -508,7 +508,7 @@ static inline int16_t mavlink_msg_hil_state_get_vx(const mavlink_message_t* msg) /** * @brief Get field vy from hil_state message * - * @return Ground Y Speed (Longitude), expressed as m/s * 100 + * @return [cm/s] Ground Y Speed (Longitude) */ static inline int16_t mavlink_msg_hil_state_get_vy(const mavlink_message_t* msg) { @@ -518,7 +518,7 @@ static inline int16_t mavlink_msg_hil_state_get_vy(const mavlink_message_t* msg) /** * @brief Get field vz from hil_state message * - * @return Ground Z Speed (Altitude), expressed as m/s * 100 + * @return [cm/s] Ground Z Speed (Altitude) */ static inline int16_t mavlink_msg_hil_state_get_vz(const mavlink_message_t* msg) { @@ -528,7 +528,7 @@ static inline int16_t mavlink_msg_hil_state_get_vz(const mavlink_message_t* msg) /** * @brief Get field xacc from hil_state message * - * @return X acceleration (mg) + * @return [mG] X acceleration */ static inline int16_t mavlink_msg_hil_state_get_xacc(const mavlink_message_t* msg) { @@ -538,7 +538,7 @@ static inline int16_t mavlink_msg_hil_state_get_xacc(const mavlink_message_t* ms /** * @brief Get field yacc from hil_state message * - * @return Y acceleration (mg) + * @return [mG] Y acceleration */ static inline int16_t mavlink_msg_hil_state_get_yacc(const mavlink_message_t* msg) { @@ -548,7 +548,7 @@ static inline int16_t mavlink_msg_hil_state_get_yacc(const mavlink_message_t* ms /** * @brief Get field zacc from hil_state message * - * @return Z acceleration (mg) + * @return [mG] Z acceleration */ static inline int16_t mavlink_msg_hil_state_get_zacc(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_hil_state_quaternion.h b/lib/main/MAVLink/common/mavlink_msg_hil_state_quaternion.h index 442d229bea..a605f39feb 100755 --- a/lib/main/MAVLink/common/mavlink_msg_hil_state_quaternion.h +++ b/lib/main/MAVLink/common/mavlink_msg_hil_state_quaternion.h @@ -3,25 +3,25 @@ #define MAVLINK_MSG_ID_HIL_STATE_QUATERNION 115 -MAVPACKED( + typedef struct __mavlink_hil_state_quaternion_t { - uint64_t time_usec; /*< Timestamp (microseconds since UNIX epoch or microseconds since system boot)*/ - float attitude_quaternion[4]; /*< Vehicle attitude expressed as normalized quaternion in w, x, y, z order (with 1 0 0 0 being the null-rotation)*/ - float rollspeed; /*< Body frame roll / phi angular speed (rad/s)*/ - float pitchspeed; /*< Body frame pitch / theta angular speed (rad/s)*/ - float yawspeed; /*< Body frame yaw / psi angular speed (rad/s)*/ - int32_t lat; /*< Latitude, expressed as * 1E7*/ - int32_t lon; /*< Longitude, expressed as * 1E7*/ - int32_t alt; /*< Altitude in meters, expressed as * 1000 (millimeters)*/ - int16_t vx; /*< Ground X Speed (Latitude), expressed as m/s * 100*/ - int16_t vy; /*< Ground Y Speed (Longitude), expressed as m/s * 100*/ - int16_t vz; /*< Ground Z Speed (Altitude), expressed as m/s * 100*/ - uint16_t ind_airspeed; /*< Indicated airspeed, expressed as m/s * 100*/ - uint16_t true_airspeed; /*< True airspeed, expressed as m/s * 100*/ - int16_t xacc; /*< X acceleration (mg)*/ - int16_t yacc; /*< Y acceleration (mg)*/ - int16_t zacc; /*< Z acceleration (mg)*/ -}) mavlink_hil_state_quaternion_t; + uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.*/ + float attitude_quaternion[4]; /*< Vehicle attitude expressed as normalized quaternion in w, x, y, z order (with 1 0 0 0 being the null-rotation)*/ + float rollspeed; /*< [rad/s] Body frame roll / phi angular speed*/ + float pitchspeed; /*< [rad/s] Body frame pitch / theta angular speed*/ + float yawspeed; /*< [rad/s] Body frame yaw / psi angular speed*/ + int32_t lat; /*< [degE7] Latitude*/ + int32_t lon; /*< [degE7] Longitude*/ + int32_t alt; /*< [mm] Altitude*/ + int16_t vx; /*< [cm/s] Ground X Speed (Latitude)*/ + int16_t vy; /*< [cm/s] Ground Y Speed (Longitude)*/ + int16_t vz; /*< [cm/s] Ground Z Speed (Altitude)*/ + uint16_t ind_airspeed; /*< [cm/s] Indicated airspeed*/ + uint16_t true_airspeed; /*< [cm/s] True airspeed*/ + int16_t xacc; /*< [mG] X acceleration*/ + int16_t yacc; /*< [mG] Y acceleration*/ + int16_t zacc; /*< [mG] Z acceleration*/ +} mavlink_hil_state_quaternion_t; #define MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN 64 #define MAVLINK_MSG_ID_HIL_STATE_QUATERNION_MIN_LEN 64 @@ -86,22 +86,22 @@ typedef struct __mavlink_hil_state_quaternion_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot) - * @param attitude_quaternion Vehicle attitude expressed as normalized quaternion in w, x, y, z order (with 1 0 0 0 being the null-rotation) - * @param rollspeed Body frame roll / phi angular speed (rad/s) - * @param pitchspeed Body frame pitch / theta angular speed (rad/s) - * @param yawspeed Body frame yaw / psi angular speed (rad/s) - * @param lat Latitude, expressed as * 1E7 - * @param lon Longitude, expressed as * 1E7 - * @param alt Altitude in meters, expressed as * 1000 (millimeters) - * @param vx Ground X Speed (Latitude), expressed as m/s * 100 - * @param vy Ground Y Speed (Longitude), expressed as m/s * 100 - * @param vz Ground Z Speed (Altitude), expressed as m/s * 100 - * @param ind_airspeed Indicated airspeed, expressed as m/s * 100 - * @param true_airspeed True airspeed, expressed as m/s * 100 - * @param xacc X acceleration (mg) - * @param yacc Y acceleration (mg) - * @param zacc Z acceleration (mg) + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param attitude_quaternion Vehicle attitude expressed as normalized quaternion in w, x, y, z order (with 1 0 0 0 being the null-rotation) + * @param rollspeed [rad/s] Body frame roll / phi angular speed + * @param pitchspeed [rad/s] Body frame pitch / theta angular speed + * @param yawspeed [rad/s] Body frame yaw / psi angular speed + * @param lat [degE7] Latitude + * @param lon [degE7] Longitude + * @param alt [mm] Altitude + * @param vx [cm/s] Ground X Speed (Latitude) + * @param vy [cm/s] Ground Y Speed (Longitude) + * @param vz [cm/s] Ground Z Speed (Altitude) + * @param ind_airspeed [cm/s] Indicated airspeed + * @param true_airspeed [cm/s] True airspeed + * @param xacc [mG] X acceleration + * @param yacc [mG] Y acceleration + * @param zacc [mG] Z acceleration * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_hil_state_quaternion_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -157,22 +157,22 @@ static inline uint16_t mavlink_msg_hil_state_quaternion_pack(uint8_t system_id, * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot) - * @param attitude_quaternion Vehicle attitude expressed as normalized quaternion in w, x, y, z order (with 1 0 0 0 being the null-rotation) - * @param rollspeed Body frame roll / phi angular speed (rad/s) - * @param pitchspeed Body frame pitch / theta angular speed (rad/s) - * @param yawspeed Body frame yaw / psi angular speed (rad/s) - * @param lat Latitude, expressed as * 1E7 - * @param lon Longitude, expressed as * 1E7 - * @param alt Altitude in meters, expressed as * 1000 (millimeters) - * @param vx Ground X Speed (Latitude), expressed as m/s * 100 - * @param vy Ground Y Speed (Longitude), expressed as m/s * 100 - * @param vz Ground Z Speed (Altitude), expressed as m/s * 100 - * @param ind_airspeed Indicated airspeed, expressed as m/s * 100 - * @param true_airspeed True airspeed, expressed as m/s * 100 - * @param xacc X acceleration (mg) - * @param yacc Y acceleration (mg) - * @param zacc Z acceleration (mg) + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param attitude_quaternion Vehicle attitude expressed as normalized quaternion in w, x, y, z order (with 1 0 0 0 being the null-rotation) + * @param rollspeed [rad/s] Body frame roll / phi angular speed + * @param pitchspeed [rad/s] Body frame pitch / theta angular speed + * @param yawspeed [rad/s] Body frame yaw / psi angular speed + * @param lat [degE7] Latitude + * @param lon [degE7] Longitude + * @param alt [mm] Altitude + * @param vx [cm/s] Ground X Speed (Latitude) + * @param vy [cm/s] Ground Y Speed (Longitude) + * @param vz [cm/s] Ground Z Speed (Altitude) + * @param ind_airspeed [cm/s] Indicated airspeed + * @param true_airspeed [cm/s] True airspeed + * @param xacc [mG] X acceleration + * @param yacc [mG] Y acceleration + * @param zacc [mG] Z acceleration * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_hil_state_quaternion_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -254,22 +254,22 @@ static inline uint16_t mavlink_msg_hil_state_quaternion_encode_chan(uint8_t syst * @brief Send a hil_state_quaternion message * @param chan MAVLink channel to send the message * - * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot) - * @param attitude_quaternion Vehicle attitude expressed as normalized quaternion in w, x, y, z order (with 1 0 0 0 being the null-rotation) - * @param rollspeed Body frame roll / phi angular speed (rad/s) - * @param pitchspeed Body frame pitch / theta angular speed (rad/s) - * @param yawspeed Body frame yaw / psi angular speed (rad/s) - * @param lat Latitude, expressed as * 1E7 - * @param lon Longitude, expressed as * 1E7 - * @param alt Altitude in meters, expressed as * 1000 (millimeters) - * @param vx Ground X Speed (Latitude), expressed as m/s * 100 - * @param vy Ground Y Speed (Longitude), expressed as m/s * 100 - * @param vz Ground Z Speed (Altitude), expressed as m/s * 100 - * @param ind_airspeed Indicated airspeed, expressed as m/s * 100 - * @param true_airspeed True airspeed, expressed as m/s * 100 - * @param xacc X acceleration (mg) - * @param yacc Y acceleration (mg) - * @param zacc Z acceleration (mg) + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param attitude_quaternion Vehicle attitude expressed as normalized quaternion in w, x, y, z order (with 1 0 0 0 being the null-rotation) + * @param rollspeed [rad/s] Body frame roll / phi angular speed + * @param pitchspeed [rad/s] Body frame pitch / theta angular speed + * @param yawspeed [rad/s] Body frame yaw / psi angular speed + * @param lat [degE7] Latitude + * @param lon [degE7] Longitude + * @param alt [mm] Altitude + * @param vx [cm/s] Ground X Speed (Latitude) + * @param vy [cm/s] Ground Y Speed (Longitude) + * @param vz [cm/s] Ground Z Speed (Altitude) + * @param ind_airspeed [cm/s] Indicated airspeed + * @param true_airspeed [cm/s] True airspeed + * @param xacc [mG] X acceleration + * @param yacc [mG] Y acceleration + * @param zacc [mG] Z acceleration */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -390,7 +390,7 @@ static inline void mavlink_msg_hil_state_quaternion_send_buf(mavlink_message_t * /** * @brief Get field time_usec from hil_state_quaternion message * - * @return Timestamp (microseconds since UNIX epoch or microseconds since system boot) + * @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. */ static inline uint64_t mavlink_msg_hil_state_quaternion_get_time_usec(const mavlink_message_t* msg) { @@ -400,7 +400,7 @@ static inline uint64_t mavlink_msg_hil_state_quaternion_get_time_usec(const mavl /** * @brief Get field attitude_quaternion from hil_state_quaternion message * - * @return Vehicle attitude expressed as normalized quaternion in w, x, y, z order (with 1 0 0 0 being the null-rotation) + * @return Vehicle attitude expressed as normalized quaternion in w, x, y, z order (with 1 0 0 0 being the null-rotation) */ static inline uint16_t mavlink_msg_hil_state_quaternion_get_attitude_quaternion(const mavlink_message_t* msg, float *attitude_quaternion) { @@ -410,7 +410,7 @@ static inline uint16_t mavlink_msg_hil_state_quaternion_get_attitude_quaternion( /** * @brief Get field rollspeed from hil_state_quaternion message * - * @return Body frame roll / phi angular speed (rad/s) + * @return [rad/s] Body frame roll / phi angular speed */ static inline float mavlink_msg_hil_state_quaternion_get_rollspeed(const mavlink_message_t* msg) { @@ -420,7 +420,7 @@ static inline float mavlink_msg_hil_state_quaternion_get_rollspeed(const mavlink /** * @brief Get field pitchspeed from hil_state_quaternion message * - * @return Body frame pitch / theta angular speed (rad/s) + * @return [rad/s] Body frame pitch / theta angular speed */ static inline float mavlink_msg_hil_state_quaternion_get_pitchspeed(const mavlink_message_t* msg) { @@ -430,7 +430,7 @@ static inline float mavlink_msg_hil_state_quaternion_get_pitchspeed(const mavlin /** * @brief Get field yawspeed from hil_state_quaternion message * - * @return Body frame yaw / psi angular speed (rad/s) + * @return [rad/s] Body frame yaw / psi angular speed */ static inline float mavlink_msg_hil_state_quaternion_get_yawspeed(const mavlink_message_t* msg) { @@ -440,7 +440,7 @@ static inline float mavlink_msg_hil_state_quaternion_get_yawspeed(const mavlink_ /** * @brief Get field lat from hil_state_quaternion message * - * @return Latitude, expressed as * 1E7 + * @return [degE7] Latitude */ static inline int32_t mavlink_msg_hil_state_quaternion_get_lat(const mavlink_message_t* msg) { @@ -450,7 +450,7 @@ static inline int32_t mavlink_msg_hil_state_quaternion_get_lat(const mavlink_mes /** * @brief Get field lon from hil_state_quaternion message * - * @return Longitude, expressed as * 1E7 + * @return [degE7] Longitude */ static inline int32_t mavlink_msg_hil_state_quaternion_get_lon(const mavlink_message_t* msg) { @@ -460,7 +460,7 @@ static inline int32_t mavlink_msg_hil_state_quaternion_get_lon(const mavlink_mes /** * @brief Get field alt from hil_state_quaternion message * - * @return Altitude in meters, expressed as * 1000 (millimeters) + * @return [mm] Altitude */ static inline int32_t mavlink_msg_hil_state_quaternion_get_alt(const mavlink_message_t* msg) { @@ -470,7 +470,7 @@ static inline int32_t mavlink_msg_hil_state_quaternion_get_alt(const mavlink_mes /** * @brief Get field vx from hil_state_quaternion message * - * @return Ground X Speed (Latitude), expressed as m/s * 100 + * @return [cm/s] Ground X Speed (Latitude) */ static inline int16_t mavlink_msg_hil_state_quaternion_get_vx(const mavlink_message_t* msg) { @@ -480,7 +480,7 @@ static inline int16_t mavlink_msg_hil_state_quaternion_get_vx(const mavlink_mess /** * @brief Get field vy from hil_state_quaternion message * - * @return Ground Y Speed (Longitude), expressed as m/s * 100 + * @return [cm/s] Ground Y Speed (Longitude) */ static inline int16_t mavlink_msg_hil_state_quaternion_get_vy(const mavlink_message_t* msg) { @@ -490,7 +490,7 @@ static inline int16_t mavlink_msg_hil_state_quaternion_get_vy(const mavlink_mess /** * @brief Get field vz from hil_state_quaternion message * - * @return Ground Z Speed (Altitude), expressed as m/s * 100 + * @return [cm/s] Ground Z Speed (Altitude) */ static inline int16_t mavlink_msg_hil_state_quaternion_get_vz(const mavlink_message_t* msg) { @@ -500,7 +500,7 @@ static inline int16_t mavlink_msg_hil_state_quaternion_get_vz(const mavlink_mess /** * @brief Get field ind_airspeed from hil_state_quaternion message * - * @return Indicated airspeed, expressed as m/s * 100 + * @return [cm/s] Indicated airspeed */ static inline uint16_t mavlink_msg_hil_state_quaternion_get_ind_airspeed(const mavlink_message_t* msg) { @@ -510,7 +510,7 @@ static inline uint16_t mavlink_msg_hil_state_quaternion_get_ind_airspeed(const m /** * @brief Get field true_airspeed from hil_state_quaternion message * - * @return True airspeed, expressed as m/s * 100 + * @return [cm/s] True airspeed */ static inline uint16_t mavlink_msg_hil_state_quaternion_get_true_airspeed(const mavlink_message_t* msg) { @@ -520,7 +520,7 @@ static inline uint16_t mavlink_msg_hil_state_quaternion_get_true_airspeed(const /** * @brief Get field xacc from hil_state_quaternion message * - * @return X acceleration (mg) + * @return [mG] X acceleration */ static inline int16_t mavlink_msg_hil_state_quaternion_get_xacc(const mavlink_message_t* msg) { @@ -530,7 +530,7 @@ static inline int16_t mavlink_msg_hil_state_quaternion_get_xacc(const mavlink_me /** * @brief Get field yacc from hil_state_quaternion message * - * @return Y acceleration (mg) + * @return [mG] Y acceleration */ static inline int16_t mavlink_msg_hil_state_quaternion_get_yacc(const mavlink_message_t* msg) { @@ -540,7 +540,7 @@ static inline int16_t mavlink_msg_hil_state_quaternion_get_yacc(const mavlink_me /** * @brief Get field zacc from hil_state_quaternion message * - * @return Z acceleration (mg) + * @return [mG] Z acceleration */ static inline int16_t mavlink_msg_hil_state_quaternion_get_zacc(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_home_position.h b/lib/main/MAVLink/common/mavlink_msg_home_position.h index d5ac5e5fa6..d275d1d630 100755 --- a/lib/main/MAVLink/common/mavlink_msg_home_position.h +++ b/lib/main/MAVLink/common/mavlink_msg_home_position.h @@ -3,19 +3,19 @@ #define MAVLINK_MSG_ID_HOME_POSITION 242 -MAVPACKED( + typedef struct __mavlink_home_position_t { - int32_t latitude; /*< Latitude (WGS84), in degrees * 1E7*/ - int32_t longitude; /*< Longitude (WGS84, in degrees * 1E7*/ - int32_t altitude; /*< Altitude (AMSL), in meters * 1000 (positive for up)*/ - float x; /*< Local X position of this position in the local coordinate frame*/ - float y; /*< Local Y position of this position in the local coordinate frame*/ - float z; /*< Local Z position of this position in the local coordinate frame*/ - float q[4]; /*< World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground*/ - float approach_x; /*< Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.*/ - float approach_y; /*< Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.*/ - float approach_z; /*< Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.*/ -}) mavlink_home_position_t; + int32_t latitude; /*< [degE7] Latitude (WGS84)*/ + int32_t longitude; /*< [degE7] Longitude (WGS84)*/ + int32_t altitude; /*< [mm] Altitude (MSL). Positive for up.*/ + float x; /*< [m] Local X position of this position in the local coordinate frame*/ + float y; /*< [m] Local Y position of this position in the local coordinate frame*/ + float z; /*< [m] Local Z position of this position in the local coordinate frame*/ + float q[4]; /*< World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground*/ + float approach_x; /*< [m] Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.*/ + float approach_y; /*< [m] Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.*/ + float approach_z; /*< [m] Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.*/ +} mavlink_home_position_t; #define MAVLINK_MSG_ID_HOME_POSITION_LEN 52 #define MAVLINK_MSG_ID_HOME_POSITION_MIN_LEN 52 @@ -68,16 +68,16 @@ typedef struct __mavlink_home_position_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param latitude Latitude (WGS84), in degrees * 1E7 - * @param longitude Longitude (WGS84, in degrees * 1E7 - * @param altitude Altitude (AMSL), in meters * 1000 (positive for up) - * @param x Local X position of this position in the local coordinate frame - * @param y Local Y position of this position in the local coordinate frame - * @param z Local Z position of this position in the local coordinate frame - * @param q World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground - * @param approach_x Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. - * @param approach_y Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. - * @param approach_z Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. + * @param latitude [degE7] Latitude (WGS84) + * @param longitude [degE7] Longitude (WGS84) + * @param altitude [mm] Altitude (MSL). Positive for up. + * @param x [m] Local X position of this position in the local coordinate frame + * @param y [m] Local Y position of this position in the local coordinate frame + * @param z [m] Local Z position of this position in the local coordinate frame + * @param q World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground + * @param approach_x [m] Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. + * @param approach_y [m] Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. + * @param approach_z [m] Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_home_position_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -121,16 +121,16 @@ static inline uint16_t mavlink_msg_home_position_pack(uint8_t system_id, uint8_t * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param latitude Latitude (WGS84), in degrees * 1E7 - * @param longitude Longitude (WGS84, in degrees * 1E7 - * @param altitude Altitude (AMSL), in meters * 1000 (positive for up) - * @param x Local X position of this position in the local coordinate frame - * @param y Local Y position of this position in the local coordinate frame - * @param z Local Z position of this position in the local coordinate frame - * @param q World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground - * @param approach_x Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. - * @param approach_y Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. - * @param approach_z Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. + * @param latitude [degE7] Latitude (WGS84) + * @param longitude [degE7] Longitude (WGS84) + * @param altitude [mm] Altitude (MSL). Positive for up. + * @param x [m] Local X position of this position in the local coordinate frame + * @param y [m] Local Y position of this position in the local coordinate frame + * @param z [m] Local Z position of this position in the local coordinate frame + * @param q World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground + * @param approach_x [m] Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. + * @param approach_y [m] Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. + * @param approach_z [m] Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_home_position_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -200,16 +200,16 @@ static inline uint16_t mavlink_msg_home_position_encode_chan(uint8_t system_id, * @brief Send a home_position message * @param chan MAVLink channel to send the message * - * @param latitude Latitude (WGS84), in degrees * 1E7 - * @param longitude Longitude (WGS84, in degrees * 1E7 - * @param altitude Altitude (AMSL), in meters * 1000 (positive for up) - * @param x Local X position of this position in the local coordinate frame - * @param y Local Y position of this position in the local coordinate frame - * @param z Local Z position of this position in the local coordinate frame - * @param q World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground - * @param approach_x Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. - * @param approach_y Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. - * @param approach_z Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. + * @param latitude [degE7] Latitude (WGS84) + * @param longitude [degE7] Longitude (WGS84) + * @param altitude [mm] Altitude (MSL). Positive for up. + * @param x [m] Local X position of this position in the local coordinate frame + * @param y [m] Local Y position of this position in the local coordinate frame + * @param z [m] Local Z position of this position in the local coordinate frame + * @param q World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground + * @param approach_x [m] Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. + * @param approach_y [m] Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. + * @param approach_z [m] Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -306,7 +306,7 @@ static inline void mavlink_msg_home_position_send_buf(mavlink_message_t *msgbuf, /** * @brief Get field latitude from home_position message * - * @return Latitude (WGS84), in degrees * 1E7 + * @return [degE7] Latitude (WGS84) */ static inline int32_t mavlink_msg_home_position_get_latitude(const mavlink_message_t* msg) { @@ -316,7 +316,7 @@ static inline int32_t mavlink_msg_home_position_get_latitude(const mavlink_messa /** * @brief Get field longitude from home_position message * - * @return Longitude (WGS84, in degrees * 1E7 + * @return [degE7] Longitude (WGS84) */ static inline int32_t mavlink_msg_home_position_get_longitude(const mavlink_message_t* msg) { @@ -326,7 +326,7 @@ static inline int32_t mavlink_msg_home_position_get_longitude(const mavlink_mess /** * @brief Get field altitude from home_position message * - * @return Altitude (AMSL), in meters * 1000 (positive for up) + * @return [mm] Altitude (MSL). Positive for up. */ static inline int32_t mavlink_msg_home_position_get_altitude(const mavlink_message_t* msg) { @@ -336,7 +336,7 @@ static inline int32_t mavlink_msg_home_position_get_altitude(const mavlink_messa /** * @brief Get field x from home_position message * - * @return Local X position of this position in the local coordinate frame + * @return [m] Local X position of this position in the local coordinate frame */ static inline float mavlink_msg_home_position_get_x(const mavlink_message_t* msg) { @@ -346,7 +346,7 @@ static inline float mavlink_msg_home_position_get_x(const mavlink_message_t* msg /** * @brief Get field y from home_position message * - * @return Local Y position of this position in the local coordinate frame + * @return [m] Local Y position of this position in the local coordinate frame */ static inline float mavlink_msg_home_position_get_y(const mavlink_message_t* msg) { @@ -356,7 +356,7 @@ static inline float mavlink_msg_home_position_get_y(const mavlink_message_t* msg /** * @brief Get field z from home_position message * - * @return Local Z position of this position in the local coordinate frame + * @return [m] Local Z position of this position in the local coordinate frame */ static inline float mavlink_msg_home_position_get_z(const mavlink_message_t* msg) { @@ -366,7 +366,7 @@ static inline float mavlink_msg_home_position_get_z(const mavlink_message_t* msg /** * @brief Get field q from home_position message * - * @return World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground + * @return World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground */ static inline uint16_t mavlink_msg_home_position_get_q(const mavlink_message_t* msg, float *q) { @@ -376,7 +376,7 @@ static inline uint16_t mavlink_msg_home_position_get_q(const mavlink_message_t* /** * @brief Get field approach_x from home_position message * - * @return Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. + * @return [m] Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. */ static inline float mavlink_msg_home_position_get_approach_x(const mavlink_message_t* msg) { @@ -386,7 +386,7 @@ static inline float mavlink_msg_home_position_get_approach_x(const mavlink_messa /** * @brief Get field approach_y from home_position message * - * @return Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. + * @return [m] Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. */ static inline float mavlink_msg_home_position_get_approach_y(const mavlink_message_t* msg) { @@ -396,7 +396,7 @@ static inline float mavlink_msg_home_position_get_approach_y(const mavlink_messa /** * @brief Get field approach_z from home_position message * - * @return Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. + * @return [m] Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. */ static inline float mavlink_msg_home_position_get_approach_z(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_landing_target.h b/lib/main/MAVLink/common/mavlink_msg_landing_target.h index c79dc667c4..b591cb3cfe 100755 --- a/lib/main/MAVLink/common/mavlink_msg_landing_target.h +++ b/lib/main/MAVLink/common/mavlink_msg_landing_target.h @@ -3,17 +3,17 @@ #define MAVLINK_MSG_ID_LANDING_TARGET 149 -MAVPACKED( + typedef struct __mavlink_landing_target_t { - uint64_t time_usec; /*< Timestamp (micros since boot or Unix epoch)*/ - float angle_x; /*< X-axis angular offset (in radians) of the target from the center of the image*/ - float angle_y; /*< Y-axis angular offset (in radians) of the target from the center of the image*/ - float distance; /*< Distance to the target from the vehicle in meters*/ - float size_x; /*< Size in radians of target along x-axis*/ - float size_y; /*< Size in radians of target along y-axis*/ - uint8_t target_num; /*< The ID of the target if multiple targets are present*/ - uint8_t frame; /*< MAV_FRAME enum specifying the whether the following feilds are earth-frame, body-frame, etc.*/ -}) mavlink_landing_target_t; + uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.*/ + float angle_x; /*< [rad] X-axis angular offset of the target from the center of the image*/ + float angle_y; /*< [rad] Y-axis angular offset of the target from the center of the image*/ + float distance; /*< [m] Distance to the target from the vehicle*/ + float size_x; /*< [rad] Size of target along x-axis*/ + float size_y; /*< [rad] Size of target along y-axis*/ + uint8_t target_num; /*< The ID of the target if multiple targets are present*/ + uint8_t frame; /*< Coordinate frame used for following fields.*/ +} mavlink_landing_target_t; #define MAVLINK_MSG_ID_LANDING_TARGET_LEN 30 #define MAVLINK_MSG_ID_LANDING_TARGET_MIN_LEN 30 @@ -31,13 +31,13 @@ typedef struct __mavlink_landing_target_t { "LANDING_TARGET", \ 8, \ { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_landing_target_t, time_usec) }, \ + { "target_num", NULL, MAVLINK_TYPE_UINT8_T, 0, 28, offsetof(mavlink_landing_target_t, target_num) }, \ + { "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 29, offsetof(mavlink_landing_target_t, frame) }, \ { "angle_x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_landing_target_t, angle_x) }, \ { "angle_y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_landing_target_t, angle_y) }, \ { "distance", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_landing_target_t, distance) }, \ { "size_x", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_landing_target_t, size_x) }, \ { "size_y", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_landing_target_t, size_y) }, \ - { "target_num", NULL, MAVLINK_TYPE_UINT8_T, 0, 28, offsetof(mavlink_landing_target_t, target_num) }, \ - { "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 29, offsetof(mavlink_landing_target_t, frame) }, \ } \ } #else @@ -45,13 +45,13 @@ typedef struct __mavlink_landing_target_t { "LANDING_TARGET", \ 8, \ { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_landing_target_t, time_usec) }, \ + { "target_num", NULL, MAVLINK_TYPE_UINT8_T, 0, 28, offsetof(mavlink_landing_target_t, target_num) }, \ + { "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 29, offsetof(mavlink_landing_target_t, frame) }, \ { "angle_x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_landing_target_t, angle_x) }, \ { "angle_y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_landing_target_t, angle_y) }, \ { "distance", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_landing_target_t, distance) }, \ { "size_x", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_landing_target_t, size_x) }, \ { "size_y", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_landing_target_t, size_y) }, \ - { "target_num", NULL, MAVLINK_TYPE_UINT8_T, 0, 28, offsetof(mavlink_landing_target_t, target_num) }, \ - { "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 29, offsetof(mavlink_landing_target_t, frame) }, \ } \ } #endif @@ -62,14 +62,14 @@ typedef struct __mavlink_landing_target_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param time_usec Timestamp (micros since boot or Unix epoch) - * @param target_num The ID of the target if multiple targets are present - * @param frame MAV_FRAME enum specifying the whether the following feilds are earth-frame, body-frame, etc. - * @param angle_x X-axis angular offset (in radians) of the target from the center of the image - * @param angle_y Y-axis angular offset (in radians) of the target from the center of the image - * @param distance Distance to the target from the vehicle in meters - * @param size_x Size in radians of target along x-axis - * @param size_y Size in radians of target along y-axis + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param target_num The ID of the target if multiple targets are present + * @param frame Coordinate frame used for following fields. + * @param angle_x [rad] X-axis angular offset of the target from the center of the image + * @param angle_y [rad] Y-axis angular offset of the target from the center of the image + * @param distance [m] Distance to the target from the vehicle + * @param size_x [rad] Size of target along x-axis + * @param size_y [rad] Size of target along y-axis * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_landing_target_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -111,14 +111,14 @@ static inline uint16_t mavlink_msg_landing_target_pack(uint8_t system_id, uint8_ * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param time_usec Timestamp (micros since boot or Unix epoch) - * @param target_num The ID of the target if multiple targets are present - * @param frame MAV_FRAME enum specifying the whether the following feilds are earth-frame, body-frame, etc. - * @param angle_x X-axis angular offset (in radians) of the target from the center of the image - * @param angle_y Y-axis angular offset (in radians) of the target from the center of the image - * @param distance Distance to the target from the vehicle in meters - * @param size_x Size in radians of target along x-axis - * @param size_y Size in radians of target along y-axis + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param target_num The ID of the target if multiple targets are present + * @param frame Coordinate frame used for following fields. + * @param angle_x [rad] X-axis angular offset of the target from the center of the image + * @param angle_y [rad] Y-axis angular offset of the target from the center of the image + * @param distance [m] Distance to the target from the vehicle + * @param size_x [rad] Size of target along x-axis + * @param size_y [rad] Size of target along y-axis * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_landing_target_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -186,14 +186,14 @@ static inline uint16_t mavlink_msg_landing_target_encode_chan(uint8_t system_id, * @brief Send a landing_target message * @param chan MAVLink channel to send the message * - * @param time_usec Timestamp (micros since boot or Unix epoch) - * @param target_num The ID of the target if multiple targets are present - * @param frame MAV_FRAME enum specifying the whether the following feilds are earth-frame, body-frame, etc. - * @param angle_x X-axis angular offset (in radians) of the target from the center of the image - * @param angle_y Y-axis angular offset (in radians) of the target from the center of the image - * @param distance Distance to the target from the vehicle in meters - * @param size_x Size in radians of target along x-axis - * @param size_y Size in radians of target along y-axis + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param target_num The ID of the target if multiple targets are present + * @param frame Coordinate frame used for following fields. + * @param angle_x [rad] X-axis angular offset of the target from the center of the image + * @param angle_y [rad] Y-axis angular offset of the target from the center of the image + * @param distance [m] Distance to the target from the vehicle + * @param size_x [rad] Size of target along x-axis + * @param size_y [rad] Size of target along y-axis */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -286,7 +286,7 @@ static inline void mavlink_msg_landing_target_send_buf(mavlink_message_t *msgbuf /** * @brief Get field time_usec from landing_target message * - * @return Timestamp (micros since boot or Unix epoch) + * @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. */ static inline uint64_t mavlink_msg_landing_target_get_time_usec(const mavlink_message_t* msg) { @@ -296,7 +296,7 @@ static inline uint64_t mavlink_msg_landing_target_get_time_usec(const mavlink_me /** * @brief Get field target_num from landing_target message * - * @return The ID of the target if multiple targets are present + * @return The ID of the target if multiple targets are present */ static inline uint8_t mavlink_msg_landing_target_get_target_num(const mavlink_message_t* msg) { @@ -306,7 +306,7 @@ static inline uint8_t mavlink_msg_landing_target_get_target_num(const mavlink_me /** * @brief Get field frame from landing_target message * - * @return MAV_FRAME enum specifying the whether the following feilds are earth-frame, body-frame, etc. + * @return Coordinate frame used for following fields. */ static inline uint8_t mavlink_msg_landing_target_get_frame(const mavlink_message_t* msg) { @@ -316,7 +316,7 @@ static inline uint8_t mavlink_msg_landing_target_get_frame(const mavlink_message /** * @brief Get field angle_x from landing_target message * - * @return X-axis angular offset (in radians) of the target from the center of the image + * @return [rad] X-axis angular offset of the target from the center of the image */ static inline float mavlink_msg_landing_target_get_angle_x(const mavlink_message_t* msg) { @@ -326,7 +326,7 @@ static inline float mavlink_msg_landing_target_get_angle_x(const mavlink_message /** * @brief Get field angle_y from landing_target message * - * @return Y-axis angular offset (in radians) of the target from the center of the image + * @return [rad] Y-axis angular offset of the target from the center of the image */ static inline float mavlink_msg_landing_target_get_angle_y(const mavlink_message_t* msg) { @@ -336,7 +336,7 @@ static inline float mavlink_msg_landing_target_get_angle_y(const mavlink_message /** * @brief Get field distance from landing_target message * - * @return Distance to the target from the vehicle in meters + * @return [m] Distance to the target from the vehicle */ static inline float mavlink_msg_landing_target_get_distance(const mavlink_message_t* msg) { @@ -346,7 +346,7 @@ static inline float mavlink_msg_landing_target_get_distance(const mavlink_messag /** * @brief Get field size_x from landing_target message * - * @return Size in radians of target along x-axis + * @return [rad] Size of target along x-axis */ static inline float mavlink_msg_landing_target_get_size_x(const mavlink_message_t* msg) { @@ -356,7 +356,7 @@ static inline float mavlink_msg_landing_target_get_size_x(const mavlink_message_ /** * @brief Get field size_y from landing_target message * - * @return Size in radians of target along y-axis + * @return [rad] Size of target along y-axis */ static inline float mavlink_msg_landing_target_get_size_y(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_link_node_status.h b/lib/main/MAVLink/common/mavlink_msg_link_node_status.h new file mode 100644 index 0000000000..8da7b71d9e --- /dev/null +++ b/lib/main/MAVLink/common/mavlink_msg_link_node_status.h @@ -0,0 +1,463 @@ +#pragma once +// MESSAGE LINK_NODE_STATUS PACKING + +#define MAVLINK_MSG_ID_LINK_NODE_STATUS 8 + + +typedef struct __mavlink_link_node_status_t { + uint64_t timestamp; /*< [ms] Timestamp (time since system boot).*/ + uint32_t tx_rate; /*< [bytes/s] Transmit rate*/ + uint32_t rx_rate; /*< [bytes/s] Receive rate*/ + uint32_t messages_sent; /*< Messages sent*/ + uint32_t messages_received; /*< Messages received (estimated from counting seq)*/ + uint32_t messages_lost; /*< Messages lost (estimated from counting seq)*/ + uint16_t rx_parse_err; /*< [bytes] Number of bytes that could not be parsed correctly.*/ + uint16_t tx_overflows; /*< [bytes] Transmit buffer overflows. This number wraps around as it reaches UINT16_MAX*/ + uint16_t rx_overflows; /*< [bytes] Receive buffer overflows. This number wraps around as it reaches UINT16_MAX*/ + uint8_t tx_buf; /*< [%] Remaining free transmit buffer space*/ + uint8_t rx_buf; /*< [%] Remaining free receive buffer space*/ +} mavlink_link_node_status_t; + +#define MAVLINK_MSG_ID_LINK_NODE_STATUS_LEN 36 +#define MAVLINK_MSG_ID_LINK_NODE_STATUS_MIN_LEN 36 +#define MAVLINK_MSG_ID_8_LEN 36 +#define MAVLINK_MSG_ID_8_MIN_LEN 36 + +#define MAVLINK_MSG_ID_LINK_NODE_STATUS_CRC 117 +#define MAVLINK_MSG_ID_8_CRC 117 + + + +#if MAVLINK_COMMAND_24BIT +#define MAVLINK_MESSAGE_INFO_LINK_NODE_STATUS { \ + 8, \ + "LINK_NODE_STATUS", \ + 11, \ + { { "timestamp", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_link_node_status_t, timestamp) }, \ + { "tx_buf", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_link_node_status_t, tx_buf) }, \ + { "rx_buf", NULL, MAVLINK_TYPE_UINT8_T, 0, 35, offsetof(mavlink_link_node_status_t, rx_buf) }, \ + { "tx_rate", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_link_node_status_t, tx_rate) }, \ + { "rx_rate", NULL, MAVLINK_TYPE_UINT32_T, 0, 12, offsetof(mavlink_link_node_status_t, rx_rate) }, \ + { "rx_parse_err", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_link_node_status_t, rx_parse_err) }, \ + { "tx_overflows", NULL, MAVLINK_TYPE_UINT16_T, 0, 30, offsetof(mavlink_link_node_status_t, tx_overflows) }, \ + { "rx_overflows", NULL, MAVLINK_TYPE_UINT16_T, 0, 32, offsetof(mavlink_link_node_status_t, rx_overflows) }, \ + { "messages_sent", NULL, MAVLINK_TYPE_UINT32_T, 0, 16, offsetof(mavlink_link_node_status_t, messages_sent) }, \ + { "messages_received", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_link_node_status_t, messages_received) }, \ + { "messages_lost", NULL, MAVLINK_TYPE_UINT32_T, 0, 24, offsetof(mavlink_link_node_status_t, messages_lost) }, \ + } \ +} +#else +#define MAVLINK_MESSAGE_INFO_LINK_NODE_STATUS { \ + "LINK_NODE_STATUS", \ + 11, \ + { { "timestamp", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_link_node_status_t, timestamp) }, \ + { "tx_buf", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_link_node_status_t, tx_buf) }, \ + { "rx_buf", NULL, MAVLINK_TYPE_UINT8_T, 0, 35, offsetof(mavlink_link_node_status_t, rx_buf) }, \ + { "tx_rate", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_link_node_status_t, tx_rate) }, \ + { "rx_rate", NULL, MAVLINK_TYPE_UINT32_T, 0, 12, offsetof(mavlink_link_node_status_t, rx_rate) }, \ + { "rx_parse_err", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_link_node_status_t, rx_parse_err) }, \ + { "tx_overflows", NULL, MAVLINK_TYPE_UINT16_T, 0, 30, offsetof(mavlink_link_node_status_t, tx_overflows) }, \ + { "rx_overflows", NULL, MAVLINK_TYPE_UINT16_T, 0, 32, offsetof(mavlink_link_node_status_t, rx_overflows) }, \ + { "messages_sent", NULL, MAVLINK_TYPE_UINT32_T, 0, 16, offsetof(mavlink_link_node_status_t, messages_sent) }, \ + { "messages_received", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_link_node_status_t, messages_received) }, \ + { "messages_lost", NULL, MAVLINK_TYPE_UINT32_T, 0, 24, offsetof(mavlink_link_node_status_t, messages_lost) }, \ + } \ +} +#endif + +/** + * @brief Pack a link_node_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 timestamp [ms] Timestamp (time since system boot). + * @param tx_buf [%] Remaining free transmit buffer space + * @param rx_buf [%] Remaining free receive buffer space + * @param tx_rate [bytes/s] Transmit rate + * @param rx_rate [bytes/s] Receive rate + * @param rx_parse_err [bytes] Number of bytes that could not be parsed correctly. + * @param tx_overflows [bytes] Transmit buffer overflows. This number wraps around as it reaches UINT16_MAX + * @param rx_overflows [bytes] Receive buffer overflows. This number wraps around as it reaches UINT16_MAX + * @param messages_sent Messages sent + * @param messages_received Messages received (estimated from counting seq) + * @param messages_lost Messages lost (estimated from counting seq) + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_link_node_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, + uint64_t timestamp, uint8_t tx_buf, uint8_t rx_buf, uint32_t tx_rate, uint32_t rx_rate, uint16_t rx_parse_err, uint16_t tx_overflows, uint16_t rx_overflows, uint32_t messages_sent, uint32_t messages_received, uint32_t messages_lost) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[MAVLINK_MSG_ID_LINK_NODE_STATUS_LEN]; + _mav_put_uint64_t(buf, 0, timestamp); + _mav_put_uint32_t(buf, 8, tx_rate); + _mav_put_uint32_t(buf, 12, rx_rate); + _mav_put_uint32_t(buf, 16, messages_sent); + _mav_put_uint32_t(buf, 20, messages_received); + _mav_put_uint32_t(buf, 24, messages_lost); + _mav_put_uint16_t(buf, 28, rx_parse_err); + _mav_put_uint16_t(buf, 30, tx_overflows); + _mav_put_uint16_t(buf, 32, rx_overflows); + _mav_put_uint8_t(buf, 34, tx_buf); + _mav_put_uint8_t(buf, 35, rx_buf); + + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LINK_NODE_STATUS_LEN); +#else + mavlink_link_node_status_t packet; + packet.timestamp = timestamp; + packet.tx_rate = tx_rate; + packet.rx_rate = rx_rate; + packet.messages_sent = messages_sent; + packet.messages_received = messages_received; + packet.messages_lost = messages_lost; + packet.rx_parse_err = rx_parse_err; + packet.tx_overflows = tx_overflows; + packet.rx_overflows = rx_overflows; + packet.tx_buf = tx_buf; + packet.rx_buf = rx_buf; + + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LINK_NODE_STATUS_LEN); +#endif + + msg->msgid = MAVLINK_MSG_ID_LINK_NODE_STATUS; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LINK_NODE_STATUS_MIN_LEN, MAVLINK_MSG_ID_LINK_NODE_STATUS_LEN, MAVLINK_MSG_ID_LINK_NODE_STATUS_CRC); +} + +/** + * @brief Pack a link_node_status message on a channel + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param chan The MAVLink channel this message will be sent over + * @param msg The MAVLink message to compress the data into + * @param timestamp [ms] Timestamp (time since system boot). + * @param tx_buf [%] Remaining free transmit buffer space + * @param rx_buf [%] Remaining free receive buffer space + * @param tx_rate [bytes/s] Transmit rate + * @param rx_rate [bytes/s] Receive rate + * @param rx_parse_err [bytes] Number of bytes that could not be parsed correctly. + * @param tx_overflows [bytes] Transmit buffer overflows. This number wraps around as it reaches UINT16_MAX + * @param rx_overflows [bytes] Receive buffer overflows. This number wraps around as it reaches UINT16_MAX + * @param messages_sent Messages sent + * @param messages_received Messages received (estimated from counting seq) + * @param messages_lost Messages lost (estimated from counting seq) + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_link_node_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, + mavlink_message_t* msg, + uint64_t timestamp,uint8_t tx_buf,uint8_t rx_buf,uint32_t tx_rate,uint32_t rx_rate,uint16_t rx_parse_err,uint16_t tx_overflows,uint16_t rx_overflows,uint32_t messages_sent,uint32_t messages_received,uint32_t messages_lost) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[MAVLINK_MSG_ID_LINK_NODE_STATUS_LEN]; + _mav_put_uint64_t(buf, 0, timestamp); + _mav_put_uint32_t(buf, 8, tx_rate); + _mav_put_uint32_t(buf, 12, rx_rate); + _mav_put_uint32_t(buf, 16, messages_sent); + _mav_put_uint32_t(buf, 20, messages_received); + _mav_put_uint32_t(buf, 24, messages_lost); + _mav_put_uint16_t(buf, 28, rx_parse_err); + _mav_put_uint16_t(buf, 30, tx_overflows); + _mav_put_uint16_t(buf, 32, rx_overflows); + _mav_put_uint8_t(buf, 34, tx_buf); + _mav_put_uint8_t(buf, 35, rx_buf); + + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LINK_NODE_STATUS_LEN); +#else + mavlink_link_node_status_t packet; + packet.timestamp = timestamp; + packet.tx_rate = tx_rate; + packet.rx_rate = rx_rate; + packet.messages_sent = messages_sent; + packet.messages_received = messages_received; + packet.messages_lost = messages_lost; + packet.rx_parse_err = rx_parse_err; + packet.tx_overflows = tx_overflows; + packet.rx_overflows = rx_overflows; + packet.tx_buf = tx_buf; + packet.rx_buf = rx_buf; + + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LINK_NODE_STATUS_LEN); +#endif + + msg->msgid = MAVLINK_MSG_ID_LINK_NODE_STATUS; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LINK_NODE_STATUS_MIN_LEN, MAVLINK_MSG_ID_LINK_NODE_STATUS_LEN, MAVLINK_MSG_ID_LINK_NODE_STATUS_CRC); +} + +/** + * @brief Encode a link_node_status struct + * + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param msg The MAVLink message to compress the data into + * @param link_node_status C-struct to read the message contents from + */ +static inline uint16_t mavlink_msg_link_node_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_link_node_status_t* link_node_status) +{ + return mavlink_msg_link_node_status_pack(system_id, component_id, msg, link_node_status->timestamp, link_node_status->tx_buf, link_node_status->rx_buf, link_node_status->tx_rate, link_node_status->rx_rate, link_node_status->rx_parse_err, link_node_status->tx_overflows, link_node_status->rx_overflows, link_node_status->messages_sent, link_node_status->messages_received, link_node_status->messages_lost); +} + +/** + * @brief Encode a link_node_status struct on a channel + * + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param chan The MAVLink channel this message will be sent over + * @param msg The MAVLink message to compress the data into + * @param link_node_status C-struct to read the message contents from + */ +static inline uint16_t mavlink_msg_link_node_status_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_link_node_status_t* link_node_status) +{ + return mavlink_msg_link_node_status_pack_chan(system_id, component_id, chan, msg, link_node_status->timestamp, link_node_status->tx_buf, link_node_status->rx_buf, link_node_status->tx_rate, link_node_status->rx_rate, link_node_status->rx_parse_err, link_node_status->tx_overflows, link_node_status->rx_overflows, link_node_status->messages_sent, link_node_status->messages_received, link_node_status->messages_lost); +} + +/** + * @brief Send a link_node_status message + * @param chan MAVLink channel to send the message + * + * @param timestamp [ms] Timestamp (time since system boot). + * @param tx_buf [%] Remaining free transmit buffer space + * @param rx_buf [%] Remaining free receive buffer space + * @param tx_rate [bytes/s] Transmit rate + * @param rx_rate [bytes/s] Receive rate + * @param rx_parse_err [bytes] Number of bytes that could not be parsed correctly. + * @param tx_overflows [bytes] Transmit buffer overflows. This number wraps around as it reaches UINT16_MAX + * @param rx_overflows [bytes] Receive buffer overflows. This number wraps around as it reaches UINT16_MAX + * @param messages_sent Messages sent + * @param messages_received Messages received (estimated from counting seq) + * @param messages_lost Messages lost (estimated from counting seq) + */ +#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS + +static inline void mavlink_msg_link_node_status_send(mavlink_channel_t chan, uint64_t timestamp, uint8_t tx_buf, uint8_t rx_buf, uint32_t tx_rate, uint32_t rx_rate, uint16_t rx_parse_err, uint16_t tx_overflows, uint16_t rx_overflows, uint32_t messages_sent, uint32_t messages_received, uint32_t messages_lost) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[MAVLINK_MSG_ID_LINK_NODE_STATUS_LEN]; + _mav_put_uint64_t(buf, 0, timestamp); + _mav_put_uint32_t(buf, 8, tx_rate); + _mav_put_uint32_t(buf, 12, rx_rate); + _mav_put_uint32_t(buf, 16, messages_sent); + _mav_put_uint32_t(buf, 20, messages_received); + _mav_put_uint32_t(buf, 24, messages_lost); + _mav_put_uint16_t(buf, 28, rx_parse_err); + _mav_put_uint16_t(buf, 30, tx_overflows); + _mav_put_uint16_t(buf, 32, rx_overflows); + _mav_put_uint8_t(buf, 34, tx_buf); + _mav_put_uint8_t(buf, 35, rx_buf); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LINK_NODE_STATUS, buf, MAVLINK_MSG_ID_LINK_NODE_STATUS_MIN_LEN, MAVLINK_MSG_ID_LINK_NODE_STATUS_LEN, MAVLINK_MSG_ID_LINK_NODE_STATUS_CRC); +#else + mavlink_link_node_status_t packet; + packet.timestamp = timestamp; + packet.tx_rate = tx_rate; + packet.rx_rate = rx_rate; + packet.messages_sent = messages_sent; + packet.messages_received = messages_received; + packet.messages_lost = messages_lost; + packet.rx_parse_err = rx_parse_err; + packet.tx_overflows = tx_overflows; + packet.rx_overflows = rx_overflows; + packet.tx_buf = tx_buf; + packet.rx_buf = rx_buf; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LINK_NODE_STATUS, (const char *)&packet, MAVLINK_MSG_ID_LINK_NODE_STATUS_MIN_LEN, MAVLINK_MSG_ID_LINK_NODE_STATUS_LEN, MAVLINK_MSG_ID_LINK_NODE_STATUS_CRC); +#endif +} + +/** + * @brief Send a link_node_status message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_link_node_status_send_struct(mavlink_channel_t chan, const mavlink_link_node_status_t* link_node_status) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_link_node_status_send(chan, link_node_status->timestamp, link_node_status->tx_buf, link_node_status->rx_buf, link_node_status->tx_rate, link_node_status->rx_rate, link_node_status->rx_parse_err, link_node_status->tx_overflows, link_node_status->rx_overflows, link_node_status->messages_sent, link_node_status->messages_received, link_node_status->messages_lost); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LINK_NODE_STATUS, (const char *)link_node_status, MAVLINK_MSG_ID_LINK_NODE_STATUS_MIN_LEN, MAVLINK_MSG_ID_LINK_NODE_STATUS_LEN, MAVLINK_MSG_ID_LINK_NODE_STATUS_CRC); +#endif +} + +#if MAVLINK_MSG_ID_LINK_NODE_STATUS_LEN <= MAVLINK_MAX_PAYLOAD_LEN +/* + This varient of _send() can be used to save stack space by re-using + memory from the receive buffer. The caller provides a + mavlink_message_t which is the size of a full mavlink message. This + is usually the receive buffer for the channel, and allows a reply to an + incoming message with minimum stack space usage. + */ +static inline void mavlink_msg_link_node_status_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t timestamp, uint8_t tx_buf, uint8_t rx_buf, uint32_t tx_rate, uint32_t rx_rate, uint16_t rx_parse_err, uint16_t tx_overflows, uint16_t rx_overflows, uint32_t messages_sent, uint32_t messages_received, uint32_t messages_lost) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char *buf = (char *)msgbuf; + _mav_put_uint64_t(buf, 0, timestamp); + _mav_put_uint32_t(buf, 8, tx_rate); + _mav_put_uint32_t(buf, 12, rx_rate); + _mav_put_uint32_t(buf, 16, messages_sent); + _mav_put_uint32_t(buf, 20, messages_received); + _mav_put_uint32_t(buf, 24, messages_lost); + _mav_put_uint16_t(buf, 28, rx_parse_err); + _mav_put_uint16_t(buf, 30, tx_overflows); + _mav_put_uint16_t(buf, 32, rx_overflows); + _mav_put_uint8_t(buf, 34, tx_buf); + _mav_put_uint8_t(buf, 35, rx_buf); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LINK_NODE_STATUS, buf, MAVLINK_MSG_ID_LINK_NODE_STATUS_MIN_LEN, MAVLINK_MSG_ID_LINK_NODE_STATUS_LEN, MAVLINK_MSG_ID_LINK_NODE_STATUS_CRC); +#else + mavlink_link_node_status_t *packet = (mavlink_link_node_status_t *)msgbuf; + packet->timestamp = timestamp; + packet->tx_rate = tx_rate; + packet->rx_rate = rx_rate; + packet->messages_sent = messages_sent; + packet->messages_received = messages_received; + packet->messages_lost = messages_lost; + packet->rx_parse_err = rx_parse_err; + packet->tx_overflows = tx_overflows; + packet->rx_overflows = rx_overflows; + packet->tx_buf = tx_buf; + packet->rx_buf = rx_buf; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LINK_NODE_STATUS, (const char *)packet, MAVLINK_MSG_ID_LINK_NODE_STATUS_MIN_LEN, MAVLINK_MSG_ID_LINK_NODE_STATUS_LEN, MAVLINK_MSG_ID_LINK_NODE_STATUS_CRC); +#endif +} +#endif + +#endif + +// MESSAGE LINK_NODE_STATUS UNPACKING + + +/** + * @brief Get field timestamp from link_node_status message + * + * @return [ms] Timestamp (time since system boot). + */ +static inline uint64_t mavlink_msg_link_node_status_get_timestamp(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint64_t(msg, 0); +} + +/** + * @brief Get field tx_buf from link_node_status message + * + * @return [%] Remaining free transmit buffer space + */ +static inline uint8_t mavlink_msg_link_node_status_get_tx_buf(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint8_t(msg, 34); +} + +/** + * @brief Get field rx_buf from link_node_status message + * + * @return [%] Remaining free receive buffer space + */ +static inline uint8_t mavlink_msg_link_node_status_get_rx_buf(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint8_t(msg, 35); +} + +/** + * @brief Get field tx_rate from link_node_status message + * + * @return [bytes/s] Transmit rate + */ +static inline uint32_t mavlink_msg_link_node_status_get_tx_rate(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint32_t(msg, 8); +} + +/** + * @brief Get field rx_rate from link_node_status message + * + * @return [bytes/s] Receive rate + */ +static inline uint32_t mavlink_msg_link_node_status_get_rx_rate(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint32_t(msg, 12); +} + +/** + * @brief Get field rx_parse_err from link_node_status message + * + * @return [bytes] Number of bytes that could not be parsed correctly. + */ +static inline uint16_t mavlink_msg_link_node_status_get_rx_parse_err(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint16_t(msg, 28); +} + +/** + * @brief Get field tx_overflows from link_node_status message + * + * @return [bytes] Transmit buffer overflows. This number wraps around as it reaches UINT16_MAX + */ +static inline uint16_t mavlink_msg_link_node_status_get_tx_overflows(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint16_t(msg, 30); +} + +/** + * @brief Get field rx_overflows from link_node_status message + * + * @return [bytes] Receive buffer overflows. This number wraps around as it reaches UINT16_MAX + */ +static inline uint16_t mavlink_msg_link_node_status_get_rx_overflows(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint16_t(msg, 32); +} + +/** + * @brief Get field messages_sent from link_node_status message + * + * @return Messages sent + */ +static inline uint32_t mavlink_msg_link_node_status_get_messages_sent(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint32_t(msg, 16); +} + +/** + * @brief Get field messages_received from link_node_status message + * + * @return Messages received (estimated from counting seq) + */ +static inline uint32_t mavlink_msg_link_node_status_get_messages_received(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint32_t(msg, 20); +} + +/** + * @brief Get field messages_lost from link_node_status message + * + * @return Messages lost (estimated from counting seq) + */ +static inline uint32_t mavlink_msg_link_node_status_get_messages_lost(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint32_t(msg, 24); +} + +/** + * @brief Decode a link_node_status message into a struct + * + * @param msg The message to decode + * @param link_node_status C-struct to decode the message contents into + */ +static inline void mavlink_msg_link_node_status_decode(const mavlink_message_t* msg, mavlink_link_node_status_t* link_node_status) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + link_node_status->timestamp = mavlink_msg_link_node_status_get_timestamp(msg); + link_node_status->tx_rate = mavlink_msg_link_node_status_get_tx_rate(msg); + link_node_status->rx_rate = mavlink_msg_link_node_status_get_rx_rate(msg); + link_node_status->messages_sent = mavlink_msg_link_node_status_get_messages_sent(msg); + link_node_status->messages_received = mavlink_msg_link_node_status_get_messages_received(msg); + link_node_status->messages_lost = mavlink_msg_link_node_status_get_messages_lost(msg); + link_node_status->rx_parse_err = mavlink_msg_link_node_status_get_rx_parse_err(msg); + link_node_status->tx_overflows = mavlink_msg_link_node_status_get_tx_overflows(msg); + link_node_status->rx_overflows = mavlink_msg_link_node_status_get_rx_overflows(msg); + link_node_status->tx_buf = mavlink_msg_link_node_status_get_tx_buf(msg); + link_node_status->rx_buf = mavlink_msg_link_node_status_get_rx_buf(msg); +#else + uint8_t len = msg->len < MAVLINK_MSG_ID_LINK_NODE_STATUS_LEN? msg->len : MAVLINK_MSG_ID_LINK_NODE_STATUS_LEN; + memset(link_node_status, 0, MAVLINK_MSG_ID_LINK_NODE_STATUS_LEN); + memcpy(link_node_status, _MAV_PAYLOAD(msg), len); +#endif +} diff --git a/lib/main/MAVLink/common/mavlink_msg_local_position_ned.h b/lib/main/MAVLink/common/mavlink_msg_local_position_ned.h index 4634032dab..48c71d90d7 100755 --- a/lib/main/MAVLink/common/mavlink_msg_local_position_ned.h +++ b/lib/main/MAVLink/common/mavlink_msg_local_position_ned.h @@ -3,16 +3,16 @@ #define MAVLINK_MSG_ID_LOCAL_POSITION_NED 32 -MAVPACKED( + typedef struct __mavlink_local_position_ned_t { - uint32_t time_boot_ms; /*< Timestamp (milliseconds since system boot)*/ - float x; /*< X Position*/ - float y; /*< Y Position*/ - float z; /*< Z Position*/ - float vx; /*< X Speed*/ - float vy; /*< Y Speed*/ - float vz; /*< Z Speed*/ -}) mavlink_local_position_ned_t; + uint32_t time_boot_ms; /*< [ms] Timestamp (time since system boot).*/ + float x; /*< [m] X Position*/ + float y; /*< [m] Y Position*/ + float z; /*< [m] Z Position*/ + float vx; /*< [m/s] X Speed*/ + float vy; /*< [m/s] Y Speed*/ + float vz; /*< [m/s] Z Speed*/ +} mavlink_local_position_ned_t; #define MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN 28 #define MAVLINK_MSG_ID_LOCAL_POSITION_NED_MIN_LEN 28 @@ -59,13 +59,13 @@ typedef struct __mavlink_local_position_ned_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param time_boot_ms Timestamp (milliseconds since system boot) - * @param x X Position - * @param y Y Position - * @param z Z Position - * @param vx X Speed - * @param vy Y Speed - * @param vz Z Speed + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param x [m] X Position + * @param y [m] Y Position + * @param z [m] Z Position + * @param vx [m/s] X Speed + * @param vy [m/s] Y Speed + * @param vz [m/s] Z Speed * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_local_position_ned_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -105,13 +105,13 @@ static inline uint16_t mavlink_msg_local_position_ned_pack(uint8_t system_id, ui * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param time_boot_ms Timestamp (milliseconds since system boot) - * @param x X Position - * @param y Y Position - * @param z Z Position - * @param vx X Speed - * @param vy Y Speed - * @param vz Z Speed + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param x [m] X Position + * @param y [m] Y Position + * @param z [m] Z Position + * @param vx [m/s] X Speed + * @param vy [m/s] Y Speed + * @param vz [m/s] Z Speed * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_local_position_ned_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -177,13 +177,13 @@ static inline uint16_t mavlink_msg_local_position_ned_encode_chan(uint8_t system * @brief Send a local_position_ned message * @param chan MAVLink channel to send the message * - * @param time_boot_ms Timestamp (milliseconds since system boot) - * @param x X Position - * @param y Y Position - * @param z Z Position - * @param vx X Speed - * @param vy Y Speed - * @param vz Z Speed + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param x [m] X Position + * @param y [m] Y Position + * @param z [m] Z Position + * @param vx [m/s] X Speed + * @param vy [m/s] Y Speed + * @param vz [m/s] Z Speed */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -272,7 +272,7 @@ static inline void mavlink_msg_local_position_ned_send_buf(mavlink_message_t *ms /** * @brief Get field time_boot_ms from local_position_ned message * - * @return Timestamp (milliseconds since system boot) + * @return [ms] Timestamp (time since system boot). */ static inline uint32_t mavlink_msg_local_position_ned_get_time_boot_ms(const mavlink_message_t* msg) { @@ -282,7 +282,7 @@ static inline uint32_t mavlink_msg_local_position_ned_get_time_boot_ms(const mav /** * @brief Get field x from local_position_ned message * - * @return X Position + * @return [m] X Position */ static inline float mavlink_msg_local_position_ned_get_x(const mavlink_message_t* msg) { @@ -292,7 +292,7 @@ static inline float mavlink_msg_local_position_ned_get_x(const mavlink_message_t /** * @brief Get field y from local_position_ned message * - * @return Y Position + * @return [m] Y Position */ static inline float mavlink_msg_local_position_ned_get_y(const mavlink_message_t* msg) { @@ -302,7 +302,7 @@ static inline float mavlink_msg_local_position_ned_get_y(const mavlink_message_t /** * @brief Get field z from local_position_ned message * - * @return Z Position + * @return [m] Z Position */ static inline float mavlink_msg_local_position_ned_get_z(const mavlink_message_t* msg) { @@ -312,7 +312,7 @@ static inline float mavlink_msg_local_position_ned_get_z(const mavlink_message_t /** * @brief Get field vx from local_position_ned message * - * @return X Speed + * @return [m/s] X Speed */ static inline float mavlink_msg_local_position_ned_get_vx(const mavlink_message_t* msg) { @@ -322,7 +322,7 @@ static inline float mavlink_msg_local_position_ned_get_vx(const mavlink_message_ /** * @brief Get field vy from local_position_ned message * - * @return Y Speed + * @return [m/s] Y Speed */ static inline float mavlink_msg_local_position_ned_get_vy(const mavlink_message_t* msg) { @@ -332,7 +332,7 @@ static inline float mavlink_msg_local_position_ned_get_vy(const mavlink_message_ /** * @brief Get field vz from local_position_ned message * - * @return Z Speed + * @return [m/s] Z Speed */ static inline float mavlink_msg_local_position_ned_get_vz(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_local_position_ned_cov.h b/lib/main/MAVLink/common/mavlink_msg_local_position_ned_cov.h index e697e46ecf..8497c7d0af 100755 --- a/lib/main/MAVLink/common/mavlink_msg_local_position_ned_cov.h +++ b/lib/main/MAVLink/common/mavlink_msg_local_position_ned_cov.h @@ -3,21 +3,21 @@ #define MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV 64 -MAVPACKED( + typedef struct __mavlink_local_position_ned_cov_t { - uint64_t time_usec; /*< Timestamp (microseconds since system boot or since UNIX epoch)*/ - float x; /*< X Position*/ - float y; /*< Y Position*/ - float z; /*< Z Position*/ - float vx; /*< X Speed (m/s)*/ - float vy; /*< Y Speed (m/s)*/ - float vz; /*< Z Speed (m/s)*/ - float ax; /*< X Acceleration (m/s^2)*/ - float ay; /*< Y Acceleration (m/s^2)*/ - float az; /*< Z Acceleration (m/s^2)*/ - float covariance[45]; /*< Covariance matrix upper right triangular (first nine entries are the first ROW, next eight entries are the second row, etc.)*/ - uint8_t estimator_type; /*< Class id of the estimator this estimate originated from.*/ -}) mavlink_local_position_ned_cov_t; + uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.*/ + float x; /*< [m] X Position*/ + float y; /*< [m] Y Position*/ + float z; /*< [m] Z Position*/ + float vx; /*< [m/s] X Speed*/ + float vy; /*< [m/s] Y Speed*/ + float vz; /*< [m/s] Z Speed*/ + float ax; /*< [m/s/s] X Acceleration*/ + float ay; /*< [m/s/s] Y Acceleration*/ + float az; /*< [m/s/s] Z Acceleration*/ + float covariance[45]; /*< Row-major representation of position, velocity and acceleration 9x9 cross-covariance matrix upper right triangle (states: x, y, z, vx, vy, vz, ax, ay, az; first nine entries are the first ROW, next eight entries are the second row, etc.). If unknown, assign NaN value to first element in the array.*/ + uint8_t estimator_type; /*< Class id of the estimator this estimate originated from.*/ +} mavlink_local_position_ned_cov_t; #define MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN 225 #define MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_MIN_LEN 225 @@ -35,6 +35,7 @@ typedef struct __mavlink_local_position_ned_cov_t { "LOCAL_POSITION_NED_COV", \ 12, \ { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_local_position_ned_cov_t, time_usec) }, \ + { "estimator_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 224, offsetof(mavlink_local_position_ned_cov_t, estimator_type) }, \ { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_local_position_ned_cov_t, x) }, \ { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_local_position_ned_cov_t, y) }, \ { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_local_position_ned_cov_t, z) }, \ @@ -45,7 +46,6 @@ typedef struct __mavlink_local_position_ned_cov_t { { "ay", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_local_position_ned_cov_t, ay) }, \ { "az", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_local_position_ned_cov_t, az) }, \ { "covariance", NULL, MAVLINK_TYPE_FLOAT, 45, 44, offsetof(mavlink_local_position_ned_cov_t, covariance) }, \ - { "estimator_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 224, offsetof(mavlink_local_position_ned_cov_t, estimator_type) }, \ } \ } #else @@ -53,6 +53,7 @@ typedef struct __mavlink_local_position_ned_cov_t { "LOCAL_POSITION_NED_COV", \ 12, \ { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_local_position_ned_cov_t, time_usec) }, \ + { "estimator_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 224, offsetof(mavlink_local_position_ned_cov_t, estimator_type) }, \ { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_local_position_ned_cov_t, x) }, \ { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_local_position_ned_cov_t, y) }, \ { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_local_position_ned_cov_t, z) }, \ @@ -63,7 +64,6 @@ typedef struct __mavlink_local_position_ned_cov_t { { "ay", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_local_position_ned_cov_t, ay) }, \ { "az", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_local_position_ned_cov_t, az) }, \ { "covariance", NULL, MAVLINK_TYPE_FLOAT, 45, 44, offsetof(mavlink_local_position_ned_cov_t, covariance) }, \ - { "estimator_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 224, offsetof(mavlink_local_position_ned_cov_t, estimator_type) }, \ } \ } #endif @@ -74,18 +74,18 @@ typedef struct __mavlink_local_position_ned_cov_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param time_usec Timestamp (microseconds since system boot or since UNIX epoch) - * @param estimator_type Class id of the estimator this estimate originated from. - * @param x X Position - * @param y Y Position - * @param z Z Position - * @param vx X Speed (m/s) - * @param vy Y Speed (m/s) - * @param vz Z Speed (m/s) - * @param ax X Acceleration (m/s^2) - * @param ay Y Acceleration (m/s^2) - * @param az Z Acceleration (m/s^2) - * @param covariance Covariance matrix upper right triangular (first nine entries are the first ROW, next eight entries are the second row, etc.) + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param estimator_type Class id of the estimator this estimate originated from. + * @param x [m] X Position + * @param y [m] Y Position + * @param z [m] Z Position + * @param vx [m/s] X Speed + * @param vy [m/s] Y Speed + * @param vz [m/s] Z Speed + * @param ax [m/s/s] X Acceleration + * @param ay [m/s/s] Y Acceleration + * @param az [m/s/s] Z Acceleration + * @param covariance Row-major representation of position, velocity and acceleration 9x9 cross-covariance matrix upper right triangle (states: x, y, z, vx, vy, vz, ax, ay, az; first nine entries are the first ROW, next eight entries are the second row, etc.). If unknown, assign NaN value to first element in the array. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_local_position_ned_cov_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -133,18 +133,18 @@ static inline uint16_t mavlink_msg_local_position_ned_cov_pack(uint8_t system_id * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param time_usec Timestamp (microseconds since system boot or since UNIX epoch) - * @param estimator_type Class id of the estimator this estimate originated from. - * @param x X Position - * @param y Y Position - * @param z Z Position - * @param vx X Speed (m/s) - * @param vy Y Speed (m/s) - * @param vz Z Speed (m/s) - * @param ax X Acceleration (m/s^2) - * @param ay Y Acceleration (m/s^2) - * @param az Z Acceleration (m/s^2) - * @param covariance Covariance matrix upper right triangular (first nine entries are the first ROW, next eight entries are the second row, etc.) + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param estimator_type Class id of the estimator this estimate originated from. + * @param x [m] X Position + * @param y [m] Y Position + * @param z [m] Z Position + * @param vx [m/s] X Speed + * @param vy [m/s] Y Speed + * @param vz [m/s] Z Speed + * @param ax [m/s/s] X Acceleration + * @param ay [m/s/s] Y Acceleration + * @param az [m/s/s] Z Acceleration + * @param covariance Row-major representation of position, velocity and acceleration 9x9 cross-covariance matrix upper right triangle (states: x, y, z, vx, vy, vz, ax, ay, az; first nine entries are the first ROW, next eight entries are the second row, etc.). If unknown, assign NaN value to first element in the array. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_local_position_ned_cov_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -218,18 +218,18 @@ static inline uint16_t mavlink_msg_local_position_ned_cov_encode_chan(uint8_t sy * @brief Send a local_position_ned_cov message * @param chan MAVLink channel to send the message * - * @param time_usec Timestamp (microseconds since system boot or since UNIX epoch) - * @param estimator_type Class id of the estimator this estimate originated from. - * @param x X Position - * @param y Y Position - * @param z Z Position - * @param vx X Speed (m/s) - * @param vy Y Speed (m/s) - * @param vz Z Speed (m/s) - * @param ax X Acceleration (m/s^2) - * @param ay Y Acceleration (m/s^2) - * @param az Z Acceleration (m/s^2) - * @param covariance Covariance matrix upper right triangular (first nine entries are the first ROW, next eight entries are the second row, etc.) + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param estimator_type Class id of the estimator this estimate originated from. + * @param x [m] X Position + * @param y [m] Y Position + * @param z [m] Z Position + * @param vx [m/s] X Speed + * @param vy [m/s] Y Speed + * @param vz [m/s] Z Speed + * @param ax [m/s/s] X Acceleration + * @param ay [m/s/s] Y Acceleration + * @param az [m/s/s] Z Acceleration + * @param covariance Row-major representation of position, velocity and acceleration 9x9 cross-covariance matrix upper right triangle (states: x, y, z, vx, vy, vz, ax, ay, az; first nine entries are the first ROW, next eight entries are the second row, etc.). If unknown, assign NaN value to first element in the array. */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -334,7 +334,7 @@ static inline void mavlink_msg_local_position_ned_cov_send_buf(mavlink_message_t /** * @brief Get field time_usec from local_position_ned_cov message * - * @return Timestamp (microseconds since system boot or since UNIX epoch) + * @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. */ static inline uint64_t mavlink_msg_local_position_ned_cov_get_time_usec(const mavlink_message_t* msg) { @@ -344,7 +344,7 @@ static inline uint64_t mavlink_msg_local_position_ned_cov_get_time_usec(const ma /** * @brief Get field estimator_type from local_position_ned_cov message * - * @return Class id of the estimator this estimate originated from. + * @return Class id of the estimator this estimate originated from. */ static inline uint8_t mavlink_msg_local_position_ned_cov_get_estimator_type(const mavlink_message_t* msg) { @@ -354,7 +354,7 @@ static inline uint8_t mavlink_msg_local_position_ned_cov_get_estimator_type(cons /** * @brief Get field x from local_position_ned_cov message * - * @return X Position + * @return [m] X Position */ static inline float mavlink_msg_local_position_ned_cov_get_x(const mavlink_message_t* msg) { @@ -364,7 +364,7 @@ static inline float mavlink_msg_local_position_ned_cov_get_x(const mavlink_messa /** * @brief Get field y from local_position_ned_cov message * - * @return Y Position + * @return [m] Y Position */ static inline float mavlink_msg_local_position_ned_cov_get_y(const mavlink_message_t* msg) { @@ -374,7 +374,7 @@ static inline float mavlink_msg_local_position_ned_cov_get_y(const mavlink_messa /** * @brief Get field z from local_position_ned_cov message * - * @return Z Position + * @return [m] Z Position */ static inline float mavlink_msg_local_position_ned_cov_get_z(const mavlink_message_t* msg) { @@ -384,7 +384,7 @@ static inline float mavlink_msg_local_position_ned_cov_get_z(const mavlink_messa /** * @brief Get field vx from local_position_ned_cov message * - * @return X Speed (m/s) + * @return [m/s] X Speed */ static inline float mavlink_msg_local_position_ned_cov_get_vx(const mavlink_message_t* msg) { @@ -394,7 +394,7 @@ static inline float mavlink_msg_local_position_ned_cov_get_vx(const mavlink_mess /** * @brief Get field vy from local_position_ned_cov message * - * @return Y Speed (m/s) + * @return [m/s] Y Speed */ static inline float mavlink_msg_local_position_ned_cov_get_vy(const mavlink_message_t* msg) { @@ -404,7 +404,7 @@ static inline float mavlink_msg_local_position_ned_cov_get_vy(const mavlink_mess /** * @brief Get field vz from local_position_ned_cov message * - * @return Z Speed (m/s) + * @return [m/s] Z Speed */ static inline float mavlink_msg_local_position_ned_cov_get_vz(const mavlink_message_t* msg) { @@ -414,7 +414,7 @@ static inline float mavlink_msg_local_position_ned_cov_get_vz(const mavlink_mess /** * @brief Get field ax from local_position_ned_cov message * - * @return X Acceleration (m/s^2) + * @return [m/s/s] X Acceleration */ static inline float mavlink_msg_local_position_ned_cov_get_ax(const mavlink_message_t* msg) { @@ -424,7 +424,7 @@ static inline float mavlink_msg_local_position_ned_cov_get_ax(const mavlink_mess /** * @brief Get field ay from local_position_ned_cov message * - * @return Y Acceleration (m/s^2) + * @return [m/s/s] Y Acceleration */ static inline float mavlink_msg_local_position_ned_cov_get_ay(const mavlink_message_t* msg) { @@ -434,7 +434,7 @@ static inline float mavlink_msg_local_position_ned_cov_get_ay(const mavlink_mess /** * @brief Get field az from local_position_ned_cov message * - * @return Z Acceleration (m/s^2) + * @return [m/s/s] Z Acceleration */ static inline float mavlink_msg_local_position_ned_cov_get_az(const mavlink_message_t* msg) { @@ -444,7 +444,7 @@ static inline float mavlink_msg_local_position_ned_cov_get_az(const mavlink_mess /** * @brief Get field covariance from local_position_ned_cov message * - * @return Covariance matrix upper right triangular (first nine entries are the first ROW, next eight entries are the second row, etc.) + * @return Row-major representation of position, velocity and acceleration 9x9 cross-covariance matrix upper right triangle (states: x, y, z, vx, vy, vz, ax, ay, az; first nine entries are the first ROW, next eight entries are the second row, etc.). If unknown, assign NaN value to first element in the array. */ static inline uint16_t mavlink_msg_local_position_ned_cov_get_covariance(const mavlink_message_t* msg, float *covariance) { diff --git a/lib/main/MAVLink/common/mavlink_msg_local_position_ned_system_global_offset.h b/lib/main/MAVLink/common/mavlink_msg_local_position_ned_system_global_offset.h index e87bcaac9d..8ff2ba6526 100755 --- a/lib/main/MAVLink/common/mavlink_msg_local_position_ned_system_global_offset.h +++ b/lib/main/MAVLink/common/mavlink_msg_local_position_ned_system_global_offset.h @@ -3,16 +3,16 @@ #define MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET 89 -MAVPACKED( + 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; + uint32_t time_boot_ms; /*< [ms] Timestamp (time since system boot).*/ + float x; /*< [m] X Position*/ + float y; /*< [m] Y Position*/ + float z; /*< [m] Z Position*/ + float roll; /*< [rad] Roll*/ + float pitch; /*< [rad] Pitch*/ + float yaw; /*< [rad] Yaw*/ +} mavlink_local_position_ned_system_global_offset_t; #define MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN 28 #define MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_MIN_LEN 28 @@ -59,13 +59,13 @@ typedef struct __mavlink_local_position_ned_system_global_offset_t { * @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 + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param x [m] X Position + * @param y [m] Y Position + * @param z [m] Z Position + * @param roll [rad] Roll + * @param pitch [rad] Pitch + * @param yaw [rad] 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, @@ -105,13 +105,13 @@ static inline uint16_t mavlink_msg_local_position_ned_system_global_offset_pack( * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param time_boot_ms Timestamp (milliseconds since system boot) - * @param x X Position - * @param y Y Position - * @param z Z Position - * @param roll Roll - * @param pitch Pitch - * @param yaw Yaw + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param x [m] X Position + * @param y [m] Y Position + * @param z [m] Z Position + * @param roll [rad] Roll + * @param pitch [rad] Pitch + * @param yaw [rad] 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, @@ -177,13 +177,13 @@ static inline uint16_t mavlink_msg_local_position_ned_system_global_offset_encod * @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 + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param x [m] X Position + * @param y [m] Y Position + * @param z [m] Z Position + * @param roll [rad] Roll + * @param pitch [rad] Pitch + * @param yaw [rad] Yaw */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -272,7 +272,7 @@ static inline void mavlink_msg_local_position_ned_system_global_offset_send_buf( /** * @brief Get field time_boot_ms from local_position_ned_system_global_offset message * - * @return Timestamp (milliseconds since system boot) + * @return [ms] Timestamp (time since system boot). */ static inline uint32_t mavlink_msg_local_position_ned_system_global_offset_get_time_boot_ms(const mavlink_message_t* msg) { @@ -282,7 +282,7 @@ static inline uint32_t mavlink_msg_local_position_ned_system_global_offset_get_t /** * @brief Get field x from local_position_ned_system_global_offset message * - * @return X Position + * @return [m] X Position */ static inline float mavlink_msg_local_position_ned_system_global_offset_get_x(const mavlink_message_t* msg) { @@ -292,7 +292,7 @@ static inline float mavlink_msg_local_position_ned_system_global_offset_get_x(co /** * @brief Get field y from local_position_ned_system_global_offset message * - * @return Y Position + * @return [m] Y Position */ static inline float mavlink_msg_local_position_ned_system_global_offset_get_y(const mavlink_message_t* msg) { @@ -302,7 +302,7 @@ static inline float mavlink_msg_local_position_ned_system_global_offset_get_y(co /** * @brief Get field z from local_position_ned_system_global_offset message * - * @return Z Position + * @return [m] Z Position */ static inline float mavlink_msg_local_position_ned_system_global_offset_get_z(const mavlink_message_t* msg) { @@ -312,7 +312,7 @@ static inline float mavlink_msg_local_position_ned_system_global_offset_get_z(co /** * @brief Get field roll from local_position_ned_system_global_offset message * - * @return Roll + * @return [rad] Roll */ static inline float mavlink_msg_local_position_ned_system_global_offset_get_roll(const mavlink_message_t* msg) { @@ -322,7 +322,7 @@ static inline float mavlink_msg_local_position_ned_system_global_offset_get_roll /** * @brief Get field pitch from local_position_ned_system_global_offset message * - * @return Pitch + * @return [rad] Pitch */ static inline float mavlink_msg_local_position_ned_system_global_offset_get_pitch(const mavlink_message_t* msg) { @@ -332,7 +332,7 @@ static inline float mavlink_msg_local_position_ned_system_global_offset_get_pitc /** * @brief Get field yaw from local_position_ned_system_global_offset message * - * @return Yaw + * @return [rad] Yaw */ static inline float mavlink_msg_local_position_ned_system_global_offset_get_yaw(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_log_data.h b/lib/main/MAVLink/common/mavlink_msg_log_data.h index f4adf2f096..37cd777770 100755 --- a/lib/main/MAVLink/common/mavlink_msg_log_data.h +++ b/lib/main/MAVLink/common/mavlink_msg_log_data.h @@ -3,13 +3,13 @@ #define MAVLINK_MSG_ID_LOG_DATA 120 -MAVPACKED( + typedef struct __mavlink_log_data_t { - uint32_t ofs; /*< Offset into the log*/ - uint16_t id; /*< Log id (from LOG_ENTRY reply)*/ - uint8_t count; /*< Number of bytes (zero for end of log)*/ - uint8_t data[90]; /*< log data*/ -}) mavlink_log_data_t; + uint32_t ofs; /*< Offset into the log*/ + uint16_t id; /*< Log id (from LOG_ENTRY reply)*/ + uint8_t count; /*< [bytes] Number of bytes (zero for end of log)*/ + uint8_t data[90]; /*< log data*/ +} mavlink_log_data_t; #define MAVLINK_MSG_ID_LOG_DATA_LEN 97 #define MAVLINK_MSG_ID_LOG_DATA_MIN_LEN 97 @@ -26,8 +26,8 @@ typedef struct __mavlink_log_data_t { 120, \ "LOG_DATA", \ 4, \ - { { "ofs", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_log_data_t, ofs) }, \ - { "id", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_log_data_t, id) }, \ + { { "id", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_log_data_t, id) }, \ + { "ofs", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_log_data_t, ofs) }, \ { "count", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_log_data_t, count) }, \ { "data", NULL, MAVLINK_TYPE_UINT8_T, 90, 7, offsetof(mavlink_log_data_t, data) }, \ } \ @@ -36,8 +36,8 @@ typedef struct __mavlink_log_data_t { #define MAVLINK_MESSAGE_INFO_LOG_DATA { \ "LOG_DATA", \ 4, \ - { { "ofs", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_log_data_t, ofs) }, \ - { "id", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_log_data_t, id) }, \ + { { "id", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_log_data_t, id) }, \ + { "ofs", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_log_data_t, ofs) }, \ { "count", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_log_data_t, count) }, \ { "data", NULL, MAVLINK_TYPE_UINT8_T, 90, 7, offsetof(mavlink_log_data_t, data) }, \ } \ @@ -50,10 +50,10 @@ typedef struct __mavlink_log_data_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param id Log id (from LOG_ENTRY reply) - * @param ofs Offset into the log - * @param count Number of bytes (zero for end of log) - * @param data log data + * @param id Log id (from LOG_ENTRY reply) + * @param ofs Offset into the log + * @param count [bytes] Number of bytes (zero for end of log) + * @param data log data * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_log_data_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -85,10 +85,10 @@ static inline uint16_t mavlink_msg_log_data_pack(uint8_t system_id, uint8_t comp * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param id Log id (from LOG_ENTRY reply) - * @param ofs Offset into the log - * @param count Number of bytes (zero for end of log) - * @param data log data + * @param id Log id (from LOG_ENTRY reply) + * @param ofs Offset into the log + * @param count [bytes] Number of bytes (zero for end of log) + * @param data log data * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_log_data_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -146,10 +146,10 @@ static inline uint16_t mavlink_msg_log_data_encode_chan(uint8_t system_id, uint8 * @brief Send a log_data message * @param chan MAVLink channel to send the message * - * @param id Log id (from LOG_ENTRY reply) - * @param ofs Offset into the log - * @param count Number of bytes (zero for end of log) - * @param data log data + * @param id Log id (from LOG_ENTRY reply) + * @param ofs Offset into the log + * @param count [bytes] Number of bytes (zero for end of log) + * @param data log data */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -222,7 +222,7 @@ static inline void mavlink_msg_log_data_send_buf(mavlink_message_t *msgbuf, mavl /** * @brief Get field id from log_data message * - * @return Log id (from LOG_ENTRY reply) + * @return Log id (from LOG_ENTRY reply) */ static inline uint16_t mavlink_msg_log_data_get_id(const mavlink_message_t* msg) { @@ -232,7 +232,7 @@ static inline uint16_t mavlink_msg_log_data_get_id(const mavlink_message_t* msg) /** * @brief Get field ofs from log_data message * - * @return Offset into the log + * @return Offset into the log */ static inline uint32_t mavlink_msg_log_data_get_ofs(const mavlink_message_t* msg) { @@ -242,7 +242,7 @@ static inline uint32_t mavlink_msg_log_data_get_ofs(const mavlink_message_t* msg /** * @brief Get field count from log_data message * - * @return Number of bytes (zero for end of log) + * @return [bytes] Number of bytes (zero for end of log) */ static inline uint8_t mavlink_msg_log_data_get_count(const mavlink_message_t* msg) { @@ -252,7 +252,7 @@ static inline uint8_t mavlink_msg_log_data_get_count(const mavlink_message_t* ms /** * @brief Get field data from log_data message * - * @return log data + * @return log data */ static inline uint16_t mavlink_msg_log_data_get_data(const mavlink_message_t* msg, uint8_t *data) { diff --git a/lib/main/MAVLink/common/mavlink_msg_log_entry.h b/lib/main/MAVLink/common/mavlink_msg_log_entry.h index 733e4e7f9e..3020dc74e6 100755 --- a/lib/main/MAVLink/common/mavlink_msg_log_entry.h +++ b/lib/main/MAVLink/common/mavlink_msg_log_entry.h @@ -3,14 +3,14 @@ #define MAVLINK_MSG_ID_LOG_ENTRY 118 -MAVPACKED( + typedef struct __mavlink_log_entry_t { - uint32_t time_utc; /*< UTC timestamp of log in seconds since 1970, or 0 if not available*/ - uint32_t size; /*< Size of the log (may be approximate) in bytes*/ - uint16_t id; /*< Log id*/ - uint16_t num_logs; /*< Total number of logs*/ - uint16_t last_log_num; /*< High log number*/ -}) mavlink_log_entry_t; + uint32_t time_utc; /*< [s] UTC timestamp of log since 1970, or 0 if not available*/ + uint32_t size; /*< [bytes] Size of the log (may be approximate)*/ + uint16_t id; /*< Log id*/ + uint16_t num_logs; /*< Total number of logs*/ + uint16_t last_log_num; /*< High log number*/ +} mavlink_log_entry_t; #define MAVLINK_MSG_ID_LOG_ENTRY_LEN 14 #define MAVLINK_MSG_ID_LOG_ENTRY_MIN_LEN 14 @@ -27,22 +27,22 @@ typedef struct __mavlink_log_entry_t { 118, \ "LOG_ENTRY", \ 5, \ - { { "time_utc", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_log_entry_t, time_utc) }, \ - { "size", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_log_entry_t, size) }, \ - { "id", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_log_entry_t, id) }, \ + { { "id", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_log_entry_t, id) }, \ { "num_logs", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_log_entry_t, num_logs) }, \ { "last_log_num", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_log_entry_t, last_log_num) }, \ + { "time_utc", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_log_entry_t, time_utc) }, \ + { "size", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_log_entry_t, size) }, \ } \ } #else #define MAVLINK_MESSAGE_INFO_LOG_ENTRY { \ "LOG_ENTRY", \ 5, \ - { { "time_utc", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_log_entry_t, time_utc) }, \ - { "size", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_log_entry_t, size) }, \ - { "id", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_log_entry_t, id) }, \ + { { "id", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_log_entry_t, id) }, \ { "num_logs", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_log_entry_t, num_logs) }, \ { "last_log_num", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_log_entry_t, last_log_num) }, \ + { "time_utc", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_log_entry_t, time_utc) }, \ + { "size", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_log_entry_t, size) }, \ } \ } #endif @@ -53,11 +53,11 @@ typedef struct __mavlink_log_entry_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param id Log id - * @param num_logs Total number of logs - * @param last_log_num High log number - * @param time_utc UTC timestamp of log in seconds since 1970, or 0 if not available - * @param size Size of the log (may be approximate) in bytes + * @param id Log id + * @param num_logs Total number of logs + * @param last_log_num High log number + * @param time_utc [s] UTC timestamp of log since 1970, or 0 if not available + * @param size [bytes] Size of the log (may be approximate) * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_log_entry_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -93,11 +93,11 @@ static inline uint16_t mavlink_msg_log_entry_pack(uint8_t system_id, uint8_t com * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param id Log id - * @param num_logs Total number of logs - * @param last_log_num High log number - * @param time_utc UTC timestamp of log in seconds since 1970, or 0 if not available - * @param size Size of the log (may be approximate) in bytes + * @param id Log id + * @param num_logs Total number of logs + * @param last_log_num High log number + * @param time_utc [s] UTC timestamp of log since 1970, or 0 if not available + * @param size [bytes] Size of the log (may be approximate) * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_log_entry_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -159,11 +159,11 @@ static inline uint16_t mavlink_msg_log_entry_encode_chan(uint8_t system_id, uint * @brief Send a log_entry message * @param chan MAVLink channel to send the message * - * @param id Log id - * @param num_logs Total number of logs - * @param last_log_num High log number - * @param time_utc UTC timestamp of log in seconds since 1970, or 0 if not available - * @param size Size of the log (may be approximate) in bytes + * @param id Log id + * @param num_logs Total number of logs + * @param last_log_num High log number + * @param time_utc [s] UTC timestamp of log since 1970, or 0 if not available + * @param size [bytes] Size of the log (may be approximate) */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -244,7 +244,7 @@ static inline void mavlink_msg_log_entry_send_buf(mavlink_message_t *msgbuf, mav /** * @brief Get field id from log_entry message * - * @return Log id + * @return Log id */ static inline uint16_t mavlink_msg_log_entry_get_id(const mavlink_message_t* msg) { @@ -254,7 +254,7 @@ static inline uint16_t mavlink_msg_log_entry_get_id(const mavlink_message_t* msg /** * @brief Get field num_logs from log_entry message * - * @return Total number of logs + * @return Total number of logs */ static inline uint16_t mavlink_msg_log_entry_get_num_logs(const mavlink_message_t* msg) { @@ -264,7 +264,7 @@ static inline uint16_t mavlink_msg_log_entry_get_num_logs(const mavlink_message_ /** * @brief Get field last_log_num from log_entry message * - * @return High log number + * @return High log number */ static inline uint16_t mavlink_msg_log_entry_get_last_log_num(const mavlink_message_t* msg) { @@ -274,7 +274,7 @@ static inline uint16_t mavlink_msg_log_entry_get_last_log_num(const mavlink_mess /** * @brief Get field time_utc from log_entry message * - * @return UTC timestamp of log in seconds since 1970, or 0 if not available + * @return [s] UTC timestamp of log since 1970, or 0 if not available */ static inline uint32_t mavlink_msg_log_entry_get_time_utc(const mavlink_message_t* msg) { @@ -284,7 +284,7 @@ static inline uint32_t mavlink_msg_log_entry_get_time_utc(const mavlink_message_ /** * @brief Get field size from log_entry message * - * @return Size of the log (may be approximate) in bytes + * @return [bytes] Size of the log (may be approximate) */ static inline uint32_t mavlink_msg_log_entry_get_size(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_log_erase.h b/lib/main/MAVLink/common/mavlink_msg_log_erase.h index d603771c94..c3e4263e09 100755 --- a/lib/main/MAVLink/common/mavlink_msg_log_erase.h +++ b/lib/main/MAVLink/common/mavlink_msg_log_erase.h @@ -3,11 +3,11 @@ #define MAVLINK_MSG_ID_LOG_ERASE 121 -MAVPACKED( + typedef struct __mavlink_log_erase_t { - uint8_t target_system; /*< System ID*/ - uint8_t target_component; /*< Component ID*/ -}) mavlink_log_erase_t; + uint8_t target_system; /*< System ID*/ + uint8_t target_component; /*< Component ID*/ +} mavlink_log_erase_t; #define MAVLINK_MSG_ID_LOG_ERASE_LEN 2 #define MAVLINK_MSG_ID_LOG_ERASE_MIN_LEN 2 @@ -44,8 +44,8 @@ typedef struct __mavlink_log_erase_t { * @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 target_system System ID + * @param target_component Component ID * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_log_erase_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -75,8 +75,8 @@ static inline uint16_t mavlink_msg_log_erase_pack(uint8_t system_id, uint8_t com * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param target_system System ID - * @param target_component Component ID + * @param target_system System ID + * @param target_component Component ID * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_log_erase_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -132,8 +132,8 @@ static inline uint16_t mavlink_msg_log_erase_encode_chan(uint8_t system_id, uint * @brief Send a log_erase message * @param chan MAVLink channel to send the message * - * @param target_system System ID - * @param target_component Component ID + * @param target_system System ID + * @param target_component Component ID */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -202,7 +202,7 @@ static inline void mavlink_msg_log_erase_send_buf(mavlink_message_t *msgbuf, mav /** * @brief Get field target_system from log_erase message * - * @return System ID + * @return System ID */ static inline uint8_t mavlink_msg_log_erase_get_target_system(const mavlink_message_t* msg) { @@ -212,7 +212,7 @@ static inline uint8_t mavlink_msg_log_erase_get_target_system(const mavlink_mess /** * @brief Get field target_component from log_erase message * - * @return Component ID + * @return Component ID */ static inline uint8_t mavlink_msg_log_erase_get_target_component(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_log_request_data.h b/lib/main/MAVLink/common/mavlink_msg_log_request_data.h index 3fb3d62e49..521b8522cf 100755 --- a/lib/main/MAVLink/common/mavlink_msg_log_request_data.h +++ b/lib/main/MAVLink/common/mavlink_msg_log_request_data.h @@ -3,14 +3,14 @@ #define MAVLINK_MSG_ID_LOG_REQUEST_DATA 119 -MAVPACKED( + typedef struct __mavlink_log_request_data_t { - uint32_t ofs; /*< Offset into the log*/ - uint32_t count; /*< Number of bytes*/ - uint16_t id; /*< Log id (from LOG_ENTRY reply)*/ - uint8_t target_system; /*< System ID*/ - uint8_t target_component; /*< Component ID*/ -}) mavlink_log_request_data_t; + uint32_t ofs; /*< Offset into the log*/ + uint32_t count; /*< [bytes] Number of bytes*/ + uint16_t id; /*< Log id (from LOG_ENTRY reply)*/ + uint8_t target_system; /*< System ID*/ + uint8_t target_component; /*< Component ID*/ +} mavlink_log_request_data_t; #define MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN 12 #define MAVLINK_MSG_ID_LOG_REQUEST_DATA_MIN_LEN 12 @@ -27,22 +27,22 @@ typedef struct __mavlink_log_request_data_t { 119, \ "LOG_REQUEST_DATA", \ 5, \ - { { "ofs", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_log_request_data_t, ofs) }, \ - { "count", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_log_request_data_t, count) }, \ - { "id", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_log_request_data_t, id) }, \ - { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_log_request_data_t, target_system) }, \ + { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_log_request_data_t, target_system) }, \ { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 11, offsetof(mavlink_log_request_data_t, target_component) }, \ + { "id", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_log_request_data_t, id) }, \ + { "ofs", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_log_request_data_t, ofs) }, \ + { "count", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_log_request_data_t, count) }, \ } \ } #else #define MAVLINK_MESSAGE_INFO_LOG_REQUEST_DATA { \ "LOG_REQUEST_DATA", \ 5, \ - { { "ofs", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_log_request_data_t, ofs) }, \ - { "count", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_log_request_data_t, count) }, \ - { "id", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_log_request_data_t, id) }, \ - { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_log_request_data_t, target_system) }, \ + { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_log_request_data_t, target_system) }, \ { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 11, offsetof(mavlink_log_request_data_t, target_component) }, \ + { "id", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_log_request_data_t, id) }, \ + { "ofs", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_log_request_data_t, ofs) }, \ + { "count", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_log_request_data_t, count) }, \ } \ } #endif @@ -53,11 +53,11 @@ typedef struct __mavlink_log_request_data_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param target_system System ID - * @param target_component Component ID - * @param id Log id (from LOG_ENTRY reply) - * @param ofs Offset into the log - * @param count Number of bytes + * @param target_system System ID + * @param target_component Component ID + * @param id Log id (from LOG_ENTRY reply) + * @param ofs Offset into the log + * @param count [bytes] Number of bytes * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_log_request_data_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -93,11 +93,11 @@ static inline uint16_t mavlink_msg_log_request_data_pack(uint8_t system_id, uint * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param target_system System ID - * @param target_component Component ID - * @param id Log id (from LOG_ENTRY reply) - * @param ofs Offset into the log - * @param count Number of bytes + * @param target_system System ID + * @param target_component Component ID + * @param id Log id (from LOG_ENTRY reply) + * @param ofs Offset into the log + * @param count [bytes] Number of bytes * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_log_request_data_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -159,11 +159,11 @@ static inline uint16_t mavlink_msg_log_request_data_encode_chan(uint8_t system_i * @brief Send a log_request_data message * @param chan MAVLink channel to send the message * - * @param target_system System ID - * @param target_component Component ID - * @param id Log id (from LOG_ENTRY reply) - * @param ofs Offset into the log - * @param count Number of bytes + * @param target_system System ID + * @param target_component Component ID + * @param id Log id (from LOG_ENTRY reply) + * @param ofs Offset into the log + * @param count [bytes] Number of bytes */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -244,7 +244,7 @@ static inline void mavlink_msg_log_request_data_send_buf(mavlink_message_t *msgb /** * @brief Get field target_system from log_request_data message * - * @return System ID + * @return System ID */ static inline uint8_t mavlink_msg_log_request_data_get_target_system(const mavlink_message_t* msg) { @@ -254,7 +254,7 @@ static inline uint8_t mavlink_msg_log_request_data_get_target_system(const mavli /** * @brief Get field target_component from log_request_data message * - * @return Component ID + * @return Component ID */ static inline uint8_t mavlink_msg_log_request_data_get_target_component(const mavlink_message_t* msg) { @@ -264,7 +264,7 @@ static inline uint8_t mavlink_msg_log_request_data_get_target_component(const ma /** * @brief Get field id from log_request_data message * - * @return Log id (from LOG_ENTRY reply) + * @return Log id (from LOG_ENTRY reply) */ static inline uint16_t mavlink_msg_log_request_data_get_id(const mavlink_message_t* msg) { @@ -274,7 +274,7 @@ static inline uint16_t mavlink_msg_log_request_data_get_id(const mavlink_message /** * @brief Get field ofs from log_request_data message * - * @return Offset into the log + * @return Offset into the log */ static inline uint32_t mavlink_msg_log_request_data_get_ofs(const mavlink_message_t* msg) { @@ -284,7 +284,7 @@ static inline uint32_t mavlink_msg_log_request_data_get_ofs(const mavlink_messag /** * @brief Get field count from log_request_data message * - * @return Number of bytes + * @return [bytes] Number of bytes */ static inline uint32_t mavlink_msg_log_request_data_get_count(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_log_request_end.h b/lib/main/MAVLink/common/mavlink_msg_log_request_end.h index dc0c1e59af..a2a7fe361b 100755 --- a/lib/main/MAVLink/common/mavlink_msg_log_request_end.h +++ b/lib/main/MAVLink/common/mavlink_msg_log_request_end.h @@ -3,11 +3,11 @@ #define MAVLINK_MSG_ID_LOG_REQUEST_END 122 -MAVPACKED( + typedef struct __mavlink_log_request_end_t { - uint8_t target_system; /*< System ID*/ - uint8_t target_component; /*< Component ID*/ -}) mavlink_log_request_end_t; + uint8_t target_system; /*< System ID*/ + uint8_t target_component; /*< Component ID*/ +} mavlink_log_request_end_t; #define MAVLINK_MSG_ID_LOG_REQUEST_END_LEN 2 #define MAVLINK_MSG_ID_LOG_REQUEST_END_MIN_LEN 2 @@ -44,8 +44,8 @@ typedef struct __mavlink_log_request_end_t { * @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 target_system System ID + * @param target_component Component ID * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_log_request_end_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -75,8 +75,8 @@ static inline uint16_t mavlink_msg_log_request_end_pack(uint8_t system_id, uint8 * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param target_system System ID - * @param target_component Component ID + * @param target_system System ID + * @param target_component Component ID * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_log_request_end_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -132,8 +132,8 @@ static inline uint16_t mavlink_msg_log_request_end_encode_chan(uint8_t system_id * @brief Send a log_request_end message * @param chan MAVLink channel to send the message * - * @param target_system System ID - * @param target_component Component ID + * @param target_system System ID + * @param target_component Component ID */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -202,7 +202,7 @@ static inline void mavlink_msg_log_request_end_send_buf(mavlink_message_t *msgbu /** * @brief Get field target_system from log_request_end message * - * @return System ID + * @return System ID */ static inline uint8_t mavlink_msg_log_request_end_get_target_system(const mavlink_message_t* msg) { @@ -212,7 +212,7 @@ static inline uint8_t mavlink_msg_log_request_end_get_target_system(const mavlin /** * @brief Get field target_component from log_request_end message * - * @return Component ID + * @return Component ID */ static inline uint8_t mavlink_msg_log_request_end_get_target_component(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_log_request_list.h b/lib/main/MAVLink/common/mavlink_msg_log_request_list.h index f4b00c9952..4a6dfaa4eb 100755 --- a/lib/main/MAVLink/common/mavlink_msg_log_request_list.h +++ b/lib/main/MAVLink/common/mavlink_msg_log_request_list.h @@ -3,13 +3,13 @@ #define MAVLINK_MSG_ID_LOG_REQUEST_LIST 117 -MAVPACKED( + typedef struct __mavlink_log_request_list_t { - uint16_t start; /*< First log id (0 for first available)*/ - uint16_t end; /*< Last log id (0xffff for last available)*/ - uint8_t target_system; /*< System ID*/ - uint8_t target_component; /*< Component ID*/ -}) mavlink_log_request_list_t; + uint16_t start; /*< First log id (0 for first available)*/ + uint16_t end; /*< Last log id (0xffff for last available)*/ + uint8_t target_system; /*< System ID*/ + uint8_t target_component; /*< Component ID*/ +} mavlink_log_request_list_t; #define MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN 6 #define MAVLINK_MSG_ID_LOG_REQUEST_LIST_MIN_LEN 6 @@ -26,20 +26,20 @@ typedef struct __mavlink_log_request_list_t { 117, \ "LOG_REQUEST_LIST", \ 4, \ - { { "start", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_log_request_list_t, start) }, \ - { "end", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_log_request_list_t, end) }, \ - { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_log_request_list_t, target_system) }, \ + { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_log_request_list_t, target_system) }, \ { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_log_request_list_t, target_component) }, \ + { "start", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_log_request_list_t, start) }, \ + { "end", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_log_request_list_t, end) }, \ } \ } #else #define MAVLINK_MESSAGE_INFO_LOG_REQUEST_LIST { \ "LOG_REQUEST_LIST", \ 4, \ - { { "start", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_log_request_list_t, start) }, \ - { "end", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_log_request_list_t, end) }, \ - { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_log_request_list_t, target_system) }, \ + { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_log_request_list_t, target_system) }, \ { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_log_request_list_t, target_component) }, \ + { "start", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_log_request_list_t, start) }, \ + { "end", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_log_request_list_t, end) }, \ } \ } #endif @@ -50,10 +50,10 @@ typedef struct __mavlink_log_request_list_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param target_system System ID - * @param target_component Component ID - * @param start First log id (0 for first available) - * @param end Last log id (0xffff for last available) + * @param target_system System ID + * @param target_component Component ID + * @param start First log id (0 for first available) + * @param end Last log id (0xffff for last available) * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_log_request_list_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -87,10 +87,10 @@ static inline uint16_t mavlink_msg_log_request_list_pack(uint8_t system_id, uint * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param target_system System ID - * @param target_component Component ID - * @param start First log id (0 for first available) - * @param end Last log id (0xffff for last available) + * @param target_system System ID + * @param target_component Component ID + * @param start First log id (0 for first available) + * @param end Last log id (0xffff for last available) * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_log_request_list_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -150,10 +150,10 @@ static inline uint16_t mavlink_msg_log_request_list_encode_chan(uint8_t system_i * @brief Send a log_request_list message * @param chan MAVLink channel to send the message * - * @param target_system System ID - * @param target_component Component ID - * @param start First log id (0 for first available) - * @param end Last log id (0xffff for last available) + * @param target_system System ID + * @param target_component Component ID + * @param start First log id (0 for first available) + * @param end Last log id (0xffff for last available) */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -230,7 +230,7 @@ static inline void mavlink_msg_log_request_list_send_buf(mavlink_message_t *msgb /** * @brief Get field target_system from log_request_list message * - * @return System ID + * @return System ID */ static inline uint8_t mavlink_msg_log_request_list_get_target_system(const mavlink_message_t* msg) { @@ -240,7 +240,7 @@ static inline uint8_t mavlink_msg_log_request_list_get_target_system(const mavli /** * @brief Get field target_component from log_request_list message * - * @return Component ID + * @return Component ID */ static inline uint8_t mavlink_msg_log_request_list_get_target_component(const mavlink_message_t* msg) { @@ -250,7 +250,7 @@ static inline uint8_t mavlink_msg_log_request_list_get_target_component(const ma /** * @brief Get field start from log_request_list message * - * @return First log id (0 for first available) + * @return First log id (0 for first available) */ static inline uint16_t mavlink_msg_log_request_list_get_start(const mavlink_message_t* msg) { @@ -260,7 +260,7 @@ static inline uint16_t mavlink_msg_log_request_list_get_start(const mavlink_mess /** * @brief Get field end from log_request_list message * - * @return Last log id (0xffff for last available) + * @return Last log id (0xffff for last available) */ static inline uint16_t mavlink_msg_log_request_list_get_end(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_manual_control.h b/lib/main/MAVLink/common/mavlink_msg_manual_control.h index 05a25665d4..14e7603a43 100755 --- a/lib/main/MAVLink/common/mavlink_msg_manual_control.h +++ b/lib/main/MAVLink/common/mavlink_msg_manual_control.h @@ -3,15 +3,15 @@ #define MAVLINK_MSG_ID_MANUAL_CONTROL 69 -MAVPACKED( + typedef struct __mavlink_manual_control_t { - int16_t x; /*< X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle.*/ - int16_t y; /*< Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle.*/ - int16_t z; /*< Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle. Positive values are positive thrust, negative values are negative thrust.*/ - int16_t r; /*< R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle.*/ - uint16_t buttons; /*< A bitfield corresponding to the joystick buttons' current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1.*/ - uint8_t target; /*< The system to be controlled.*/ -}) mavlink_manual_control_t; + int16_t x; /*< X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle.*/ + int16_t y; /*< Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle.*/ + int16_t z; /*< Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle. Positive values are positive thrust, negative values are negative thrust.*/ + int16_t r; /*< R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle.*/ + uint16_t buttons; /*< A bitfield corresponding to the joystick buttons' current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1.*/ + uint8_t target; /*< The system to be controlled.*/ +} mavlink_manual_control_t; #define MAVLINK_MSG_ID_MANUAL_CONTROL_LEN 11 #define MAVLINK_MSG_ID_MANUAL_CONTROL_MIN_LEN 11 @@ -28,24 +28,24 @@ typedef struct __mavlink_manual_control_t { 69, \ "MANUAL_CONTROL", \ 6, \ - { { "x", NULL, MAVLINK_TYPE_INT16_T, 0, 0, offsetof(mavlink_manual_control_t, x) }, \ + { { "target", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_manual_control_t, target) }, \ + { "x", NULL, MAVLINK_TYPE_INT16_T, 0, 0, offsetof(mavlink_manual_control_t, x) }, \ { "y", NULL, MAVLINK_TYPE_INT16_T, 0, 2, offsetof(mavlink_manual_control_t, y) }, \ { "z", NULL, MAVLINK_TYPE_INT16_T, 0, 4, offsetof(mavlink_manual_control_t, z) }, \ { "r", NULL, MAVLINK_TYPE_INT16_T, 0, 6, offsetof(mavlink_manual_control_t, r) }, \ { "buttons", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_manual_control_t, buttons) }, \ - { "target", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_manual_control_t, target) }, \ } \ } #else #define MAVLINK_MESSAGE_INFO_MANUAL_CONTROL { \ "MANUAL_CONTROL", \ 6, \ - { { "x", NULL, MAVLINK_TYPE_INT16_T, 0, 0, offsetof(mavlink_manual_control_t, x) }, \ + { { "target", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_manual_control_t, target) }, \ + { "x", NULL, MAVLINK_TYPE_INT16_T, 0, 0, offsetof(mavlink_manual_control_t, x) }, \ { "y", NULL, MAVLINK_TYPE_INT16_T, 0, 2, offsetof(mavlink_manual_control_t, y) }, \ { "z", NULL, MAVLINK_TYPE_INT16_T, 0, 4, offsetof(mavlink_manual_control_t, z) }, \ { "r", NULL, MAVLINK_TYPE_INT16_T, 0, 6, offsetof(mavlink_manual_control_t, r) }, \ { "buttons", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_manual_control_t, buttons) }, \ - { "target", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_manual_control_t, target) }, \ } \ } #endif @@ -56,12 +56,12 @@ typedef struct __mavlink_manual_control_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param target The system to be controlled. - * @param x X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle. - * @param y Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle. - * @param z Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle. Positive values are positive thrust, negative values are negative thrust. - * @param r R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle. - * @param buttons A bitfield corresponding to the joystick buttons' current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1. + * @param target The system to be controlled. + * @param x X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle. + * @param y Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle. + * @param z Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle. Positive values are positive thrust, negative values are negative thrust. + * @param r R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle. + * @param buttons A bitfield corresponding to the joystick buttons' current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_manual_control_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -99,12 +99,12 @@ static inline uint16_t mavlink_msg_manual_control_pack(uint8_t system_id, uint8_ * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param target The system to be controlled. - * @param x X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle. - * @param y Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle. - * @param z Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle. Positive values are positive thrust, negative values are negative thrust. - * @param r R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle. - * @param buttons A bitfield corresponding to the joystick buttons' current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1. + * @param target The system to be controlled. + * @param x X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle. + * @param y Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle. + * @param z Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle. Positive values are positive thrust, negative values are negative thrust. + * @param r R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle. + * @param buttons A bitfield corresponding to the joystick buttons' current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_manual_control_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -168,12 +168,12 @@ static inline uint16_t mavlink_msg_manual_control_encode_chan(uint8_t system_id, * @brief Send a manual_control message * @param chan MAVLink channel to send the message * - * @param target The system to be controlled. - * @param x X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle. - * @param y Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle. - * @param z Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle. Positive values are positive thrust, negative values are negative thrust. - * @param r R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle. - * @param buttons A bitfield corresponding to the joystick buttons' current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1. + * @param target The system to be controlled. + * @param x X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle. + * @param y Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle. + * @param z Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle. Positive values are positive thrust, negative values are negative thrust. + * @param r R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle. + * @param buttons A bitfield corresponding to the joystick buttons' current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1. */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -258,7 +258,7 @@ static inline void mavlink_msg_manual_control_send_buf(mavlink_message_t *msgbuf /** * @brief Get field target from manual_control message * - * @return The system to be controlled. + * @return The system to be controlled. */ static inline uint8_t mavlink_msg_manual_control_get_target(const mavlink_message_t* msg) { @@ -268,7 +268,7 @@ static inline uint8_t mavlink_msg_manual_control_get_target(const mavlink_messag /** * @brief Get field x from manual_control message * - * @return X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle. + * @return X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle. */ static inline int16_t mavlink_msg_manual_control_get_x(const mavlink_message_t* msg) { @@ -278,7 +278,7 @@ static inline int16_t mavlink_msg_manual_control_get_x(const mavlink_message_t* /** * @brief Get field y from manual_control message * - * @return Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle. + * @return Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle. */ static inline int16_t mavlink_msg_manual_control_get_y(const mavlink_message_t* msg) { @@ -288,7 +288,7 @@ static inline int16_t mavlink_msg_manual_control_get_y(const mavlink_message_t* /** * @brief Get field z from manual_control message * - * @return Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle. Positive values are positive thrust, negative values are negative thrust. + * @return Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle. Positive values are positive thrust, negative values are negative thrust. */ static inline int16_t mavlink_msg_manual_control_get_z(const mavlink_message_t* msg) { @@ -298,7 +298,7 @@ static inline int16_t mavlink_msg_manual_control_get_z(const mavlink_message_t* /** * @brief Get field r from manual_control message * - * @return R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle. + * @return R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle. */ static inline int16_t mavlink_msg_manual_control_get_r(const mavlink_message_t* msg) { @@ -308,7 +308,7 @@ static inline int16_t mavlink_msg_manual_control_get_r(const mavlink_message_t* /** * @brief Get field buttons from manual_control message * - * @return A bitfield corresponding to the joystick buttons' current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1. + * @return A bitfield corresponding to the joystick buttons' current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1. */ static inline uint16_t mavlink_msg_manual_control_get_buttons(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_manual_setpoint.h b/lib/main/MAVLink/common/mavlink_msg_manual_setpoint.h index 04d50a834a..4bc42b1400 100755 --- a/lib/main/MAVLink/common/mavlink_msg_manual_setpoint.h +++ b/lib/main/MAVLink/common/mavlink_msg_manual_setpoint.h @@ -3,16 +3,16 @@ #define MAVLINK_MSG_ID_MANUAL_SETPOINT 81 -MAVPACKED( + typedef struct __mavlink_manual_setpoint_t { - uint32_t time_boot_ms; /*< Timestamp in milliseconds since system boot*/ - float roll; /*< Desired roll rate in radians per second*/ - float pitch; /*< Desired pitch rate in radians per second*/ - float yaw; /*< Desired yaw rate in radians per second*/ - float thrust; /*< Collective thrust, normalized to 0 .. 1*/ - uint8_t mode_switch; /*< Flight mode switch position, 0.. 255*/ - uint8_t manual_override_switch; /*< Override mode switch position, 0.. 255*/ -}) mavlink_manual_setpoint_t; + uint32_t time_boot_ms; /*< [ms] Timestamp (time since system boot).*/ + float roll; /*< [rad/s] Desired roll rate*/ + float pitch; /*< [rad/s] Desired pitch rate*/ + float yaw; /*< [rad/s] Desired yaw rate*/ + float thrust; /*< Collective thrust, normalized to 0 .. 1*/ + uint8_t mode_switch; /*< Flight mode switch position, 0.. 255*/ + uint8_t manual_override_switch; /*< Override mode switch position, 0.. 255*/ +} mavlink_manual_setpoint_t; #define MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN 22 #define MAVLINK_MSG_ID_MANUAL_SETPOINT_MIN_LEN 22 @@ -59,13 +59,13 @@ typedef struct __mavlink_manual_setpoint_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param time_boot_ms Timestamp in milliseconds since system boot - * @param roll Desired roll rate in radians per second - * @param pitch Desired pitch rate in radians per second - * @param yaw Desired yaw rate in radians per second - * @param thrust Collective thrust, normalized to 0 .. 1 - * @param mode_switch Flight mode switch position, 0.. 255 - * @param manual_override_switch Override mode switch position, 0.. 255 + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param roll [rad/s] Desired roll rate + * @param pitch [rad/s] Desired pitch rate + * @param yaw [rad/s] Desired yaw rate + * @param thrust Collective thrust, normalized to 0 .. 1 + * @param mode_switch Flight mode switch position, 0.. 255 + * @param manual_override_switch Override mode switch position, 0.. 255 * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_manual_setpoint_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -105,13 +105,13 @@ static inline uint16_t mavlink_msg_manual_setpoint_pack(uint8_t system_id, uint8 * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param time_boot_ms Timestamp in milliseconds since system boot - * @param roll Desired roll rate in radians per second - * @param pitch Desired pitch rate in radians per second - * @param yaw Desired yaw rate in radians per second - * @param thrust Collective thrust, normalized to 0 .. 1 - * @param mode_switch Flight mode switch position, 0.. 255 - * @param manual_override_switch Override mode switch position, 0.. 255 + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param roll [rad/s] Desired roll rate + * @param pitch [rad/s] Desired pitch rate + * @param yaw [rad/s] Desired yaw rate + * @param thrust Collective thrust, normalized to 0 .. 1 + * @param mode_switch Flight mode switch position, 0.. 255 + * @param manual_override_switch Override mode switch position, 0.. 255 * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_manual_setpoint_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -177,13 +177,13 @@ static inline uint16_t mavlink_msg_manual_setpoint_encode_chan(uint8_t system_id * @brief Send a manual_setpoint message * @param chan MAVLink channel to send the message * - * @param time_boot_ms Timestamp in milliseconds since system boot - * @param roll Desired roll rate in radians per second - * @param pitch Desired pitch rate in radians per second - * @param yaw Desired yaw rate in radians per second - * @param thrust Collective thrust, normalized to 0 .. 1 - * @param mode_switch Flight mode switch position, 0.. 255 - * @param manual_override_switch Override mode switch position, 0.. 255 + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param roll [rad/s] Desired roll rate + * @param pitch [rad/s] Desired pitch rate + * @param yaw [rad/s] Desired yaw rate + * @param thrust Collective thrust, normalized to 0 .. 1 + * @param mode_switch Flight mode switch position, 0.. 255 + * @param manual_override_switch Override mode switch position, 0.. 255 */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -272,7 +272,7 @@ static inline void mavlink_msg_manual_setpoint_send_buf(mavlink_message_t *msgbu /** * @brief Get field time_boot_ms from manual_setpoint message * - * @return Timestamp in milliseconds since system boot + * @return [ms] Timestamp (time since system boot). */ static inline uint32_t mavlink_msg_manual_setpoint_get_time_boot_ms(const mavlink_message_t* msg) { @@ -282,7 +282,7 @@ static inline uint32_t mavlink_msg_manual_setpoint_get_time_boot_ms(const mavlin /** * @brief Get field roll from manual_setpoint message * - * @return Desired roll rate in radians per second + * @return [rad/s] Desired roll rate */ static inline float mavlink_msg_manual_setpoint_get_roll(const mavlink_message_t* msg) { @@ -292,7 +292,7 @@ static inline float mavlink_msg_manual_setpoint_get_roll(const mavlink_message_t /** * @brief Get field pitch from manual_setpoint message * - * @return Desired pitch rate in radians per second + * @return [rad/s] Desired pitch rate */ static inline float mavlink_msg_manual_setpoint_get_pitch(const mavlink_message_t* msg) { @@ -302,7 +302,7 @@ static inline float mavlink_msg_manual_setpoint_get_pitch(const mavlink_message_ /** * @brief Get field yaw from manual_setpoint message * - * @return Desired yaw rate in radians per second + * @return [rad/s] Desired yaw rate */ static inline float mavlink_msg_manual_setpoint_get_yaw(const mavlink_message_t* msg) { @@ -312,7 +312,7 @@ static inline float mavlink_msg_manual_setpoint_get_yaw(const mavlink_message_t* /** * @brief Get field thrust from manual_setpoint message * - * @return Collective thrust, normalized to 0 .. 1 + * @return Collective thrust, normalized to 0 .. 1 */ static inline float mavlink_msg_manual_setpoint_get_thrust(const mavlink_message_t* msg) { @@ -322,7 +322,7 @@ static inline float mavlink_msg_manual_setpoint_get_thrust(const mavlink_message /** * @brief Get field mode_switch from manual_setpoint message * - * @return Flight mode switch position, 0.. 255 + * @return Flight mode switch position, 0.. 255 */ static inline uint8_t mavlink_msg_manual_setpoint_get_mode_switch(const mavlink_message_t* msg) { @@ -332,7 +332,7 @@ static inline uint8_t mavlink_msg_manual_setpoint_get_mode_switch(const mavlink_ /** * @brief Get field manual_override_switch from manual_setpoint message * - * @return Override mode switch position, 0.. 255 + * @return Override mode switch position, 0.. 255 */ static inline uint8_t mavlink_msg_manual_setpoint_get_manual_override_switch(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_memory_vect.h b/lib/main/MAVLink/common/mavlink_msg_memory_vect.h index efc0e62393..c331547473 100755 --- a/lib/main/MAVLink/common/mavlink_msg_memory_vect.h +++ b/lib/main/MAVLink/common/mavlink_msg_memory_vect.h @@ -3,13 +3,13 @@ #define MAVLINK_MSG_ID_MEMORY_VECT 249 -MAVPACKED( + typedef struct __mavlink_memory_vect_t { - uint16_t address; /*< Starting address of the debug variables*/ - uint8_t ver; /*< Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below*/ - uint8_t type; /*< Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14*/ - int8_t value[32]; /*< Memory contents at specified address*/ -}) mavlink_memory_vect_t; + uint16_t address; /*< Starting address of the debug variables*/ + uint8_t ver; /*< Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below*/ + uint8_t type; /*< Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14*/ + int8_t value[32]; /*< Memory contents at specified address*/ +} mavlink_memory_vect_t; #define MAVLINK_MSG_ID_MEMORY_VECT_LEN 36 #define MAVLINK_MSG_ID_MEMORY_VECT_MIN_LEN 36 @@ -50,10 +50,10 @@ typedef struct __mavlink_memory_vect_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param address Starting address of the debug variables - * @param ver Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below - * @param type Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14 - * @param value Memory contents at specified address + * @param address Starting address of the debug variables + * @param ver Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below + * @param type Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14 + * @param value Memory contents at specified address * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_memory_vect_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -85,10 +85,10 @@ static inline uint16_t mavlink_msg_memory_vect_pack(uint8_t system_id, uint8_t c * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param address Starting address of the debug variables - * @param ver Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below - * @param type Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14 - * @param value Memory contents at specified address + * @param address Starting address of the debug variables + * @param ver Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below + * @param type Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14 + * @param value Memory contents at specified address * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_memory_vect_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -146,10 +146,10 @@ static inline uint16_t mavlink_msg_memory_vect_encode_chan(uint8_t system_id, ui * @brief Send a memory_vect message * @param chan MAVLink channel to send the message * - * @param address Starting address of the debug variables - * @param ver Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below - * @param type Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14 - * @param value Memory contents at specified address + * @param address Starting address of the debug variables + * @param ver Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below + * @param type Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14 + * @param value Memory contents at specified address */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -222,7 +222,7 @@ static inline void mavlink_msg_memory_vect_send_buf(mavlink_message_t *msgbuf, m /** * @brief Get field address from memory_vect message * - * @return Starting address of the debug variables + * @return Starting address of the debug variables */ static inline uint16_t mavlink_msg_memory_vect_get_address(const mavlink_message_t* msg) { @@ -232,7 +232,7 @@ static inline uint16_t mavlink_msg_memory_vect_get_address(const mavlink_message /** * @brief Get field ver from memory_vect message * - * @return Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below + * @return Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below */ static inline uint8_t mavlink_msg_memory_vect_get_ver(const mavlink_message_t* msg) { @@ -242,7 +242,7 @@ static inline uint8_t mavlink_msg_memory_vect_get_ver(const mavlink_message_t* m /** * @brief Get field type from memory_vect message * - * @return Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14 + * @return Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14 */ static inline uint8_t mavlink_msg_memory_vect_get_type(const mavlink_message_t* msg) { @@ -252,7 +252,7 @@ static inline uint8_t mavlink_msg_memory_vect_get_type(const mavlink_message_t* /** * @brief Get field value from memory_vect message * - * @return Memory contents at specified address + * @return Memory contents at specified address */ static inline uint16_t mavlink_msg_memory_vect_get_value(const mavlink_message_t* msg, int8_t *value) { diff --git a/lib/main/MAVLink/common/mavlink_msg_message_interval.h b/lib/main/MAVLink/common/mavlink_msg_message_interval.h index 95b501ffe5..a6a52b1fdc 100755 --- a/lib/main/MAVLink/common/mavlink_msg_message_interval.h +++ b/lib/main/MAVLink/common/mavlink_msg_message_interval.h @@ -3,11 +3,11 @@ #define MAVLINK_MSG_ID_MESSAGE_INTERVAL 244 -MAVPACKED( + typedef struct __mavlink_message_interval_t { - int32_t interval_us; /*< The interval between two messages, in microseconds. A value of -1 indicates this stream is disabled, 0 indicates it is not available, > 0 indicates the interval at which it is sent.*/ - uint16_t message_id; /*< The ID of the requested MAVLink message. v1.0 is limited to 254 messages.*/ -}) mavlink_message_interval_t; + int32_t interval_us; /*< [us] The interval between two messages. A value of -1 indicates this stream is disabled, 0 indicates it is not available, > 0 indicates the interval at which it is sent.*/ + uint16_t message_id; /*< The ID of the requested MAVLink message. v1.0 is limited to 254 messages.*/ +} mavlink_message_interval_t; #define MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN 6 #define MAVLINK_MSG_ID_MESSAGE_INTERVAL_MIN_LEN 6 @@ -24,16 +24,16 @@ typedef struct __mavlink_message_interval_t { 244, \ "MESSAGE_INTERVAL", \ 2, \ - { { "interval_us", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_message_interval_t, interval_us) }, \ - { "message_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_message_interval_t, message_id) }, \ + { { "message_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_message_interval_t, message_id) }, \ + { "interval_us", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_message_interval_t, interval_us) }, \ } \ } #else #define MAVLINK_MESSAGE_INFO_MESSAGE_INTERVAL { \ "MESSAGE_INTERVAL", \ 2, \ - { { "interval_us", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_message_interval_t, interval_us) }, \ - { "message_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_message_interval_t, message_id) }, \ + { { "message_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_message_interval_t, message_id) }, \ + { "interval_us", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_message_interval_t, interval_us) }, \ } \ } #endif @@ -44,8 +44,8 @@ typedef struct __mavlink_message_interval_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param message_id The ID of the requested MAVLink message. v1.0 is limited to 254 messages. - * @param interval_us The interval between two messages, in microseconds. A value of -1 indicates this stream is disabled, 0 indicates it is not available, > 0 indicates the interval at which it is sent. + * @param message_id The ID of the requested MAVLink message. v1.0 is limited to 254 messages. + * @param interval_us [us] The interval between two messages. A value of -1 indicates this stream is disabled, 0 indicates it is not available, > 0 indicates the interval at which it is sent. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_message_interval_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -75,8 +75,8 @@ static inline uint16_t mavlink_msg_message_interval_pack(uint8_t system_id, uint * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param message_id The ID of the requested MAVLink message. v1.0 is limited to 254 messages. - * @param interval_us The interval between two messages, in microseconds. A value of -1 indicates this stream is disabled, 0 indicates it is not available, > 0 indicates the interval at which it is sent. + * @param message_id The ID of the requested MAVLink message. v1.0 is limited to 254 messages. + * @param interval_us [us] The interval between two messages. A value of -1 indicates this stream is disabled, 0 indicates it is not available, > 0 indicates the interval at which it is sent. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_message_interval_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -132,8 +132,8 @@ static inline uint16_t mavlink_msg_message_interval_encode_chan(uint8_t system_i * @brief Send a message_interval message * @param chan MAVLink channel to send the message * - * @param message_id The ID of the requested MAVLink message. v1.0 is limited to 254 messages. - * @param interval_us The interval between two messages, in microseconds. A value of -1 indicates this stream is disabled, 0 indicates it is not available, > 0 indicates the interval at which it is sent. + * @param message_id The ID of the requested MAVLink message. v1.0 is limited to 254 messages. + * @param interval_us [us] The interval between two messages. A value of -1 indicates this stream is disabled, 0 indicates it is not available, > 0 indicates the interval at which it is sent. */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -202,7 +202,7 @@ static inline void mavlink_msg_message_interval_send_buf(mavlink_message_t *msgb /** * @brief Get field message_id from message_interval message * - * @return The ID of the requested MAVLink message. v1.0 is limited to 254 messages. + * @return The ID of the requested MAVLink message. v1.0 is limited to 254 messages. */ static inline uint16_t mavlink_msg_message_interval_get_message_id(const mavlink_message_t* msg) { @@ -212,7 +212,7 @@ static inline uint16_t mavlink_msg_message_interval_get_message_id(const mavlink /** * @brief Get field interval_us from message_interval message * - * @return The interval between two messages, in microseconds. A value of -1 indicates this stream is disabled, 0 indicates it is not available, > 0 indicates the interval at which it is sent. + * @return [us] The interval between two messages. A value of -1 indicates this stream is disabled, 0 indicates it is not available, > 0 indicates the interval at which it is sent. */ static inline int32_t mavlink_msg_message_interval_get_interval_us(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_mission_ack.h b/lib/main/MAVLink/common/mavlink_msg_mission_ack.h index 9616a0fe84..182825a5ea 100755 --- a/lib/main/MAVLink/common/mavlink_msg_mission_ack.h +++ b/lib/main/MAVLink/common/mavlink_msg_mission_ack.h @@ -3,12 +3,12 @@ #define MAVLINK_MSG_ID_MISSION_ACK 47 -MAVPACKED( + typedef struct __mavlink_mission_ack_t { - uint8_t target_system; /*< System ID*/ - uint8_t target_component; /*< Component ID*/ - uint8_t type; /*< See MAV_MISSION_RESULT enum*/ -}) mavlink_mission_ack_t; + uint8_t target_system; /*< System ID*/ + uint8_t target_component; /*< Component ID*/ + uint8_t type; /*< Mission result.*/ +} mavlink_mission_ack_t; #define MAVLINK_MSG_ID_MISSION_ACK_LEN 3 #define MAVLINK_MSG_ID_MISSION_ACK_MIN_LEN 3 @@ -47,9 +47,9 @@ typedef struct __mavlink_mission_ack_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param target_system System ID - * @param target_component Component ID - * @param type See MAV_MISSION_RESULT enum + * @param target_system System ID + * @param target_component Component ID + * @param type Mission result. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_mission_ack_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -81,9 +81,9 @@ static inline uint16_t mavlink_msg_mission_ack_pack(uint8_t system_id, uint8_t c * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param target_system System ID - * @param target_component Component ID - * @param type See MAV_MISSION_RESULT enum + * @param target_system System ID + * @param target_component Component ID + * @param type Mission result. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_mission_ack_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -141,9 +141,9 @@ static inline uint16_t mavlink_msg_mission_ack_encode_chan(uint8_t system_id, ui * @brief Send a mission_ack message * @param chan MAVLink channel to send the message * - * @param target_system System ID - * @param target_component Component ID - * @param type See MAV_MISSION_RESULT enum + * @param target_system System ID + * @param target_component Component ID + * @param type Mission result. */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -216,7 +216,7 @@ static inline void mavlink_msg_mission_ack_send_buf(mavlink_message_t *msgbuf, m /** * @brief Get field target_system from mission_ack message * - * @return System ID + * @return System ID */ static inline uint8_t mavlink_msg_mission_ack_get_target_system(const mavlink_message_t* msg) { @@ -226,7 +226,7 @@ static inline uint8_t mavlink_msg_mission_ack_get_target_system(const mavlink_me /** * @brief Get field target_component from mission_ack message * - * @return Component ID + * @return Component ID */ static inline uint8_t mavlink_msg_mission_ack_get_target_component(const mavlink_message_t* msg) { @@ -236,7 +236,7 @@ static inline uint8_t mavlink_msg_mission_ack_get_target_component(const mavlink /** * @brief Get field type from mission_ack message * - * @return See MAV_MISSION_RESULT enum + * @return Mission result. */ static inline uint8_t mavlink_msg_mission_ack_get_type(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_mission_changed.h b/lib/main/MAVLink/common/mavlink_msg_mission_changed.h new file mode 100644 index 0000000000..28f75098e4 --- /dev/null +++ b/lib/main/MAVLink/common/mavlink_msg_mission_changed.h @@ -0,0 +1,313 @@ +#pragma once +// MESSAGE MISSION_CHANGED PACKING + +#define MAVLINK_MSG_ID_MISSION_CHANGED 52 + + +typedef struct __mavlink_mission_changed_t { + int16_t start_index; /*< Start index for partial mission change (-1 for all items).*/ + int16_t end_index; /*< End index of a partial mission change. -1 is a synonym for the last mission item (i.e. selects all items from start_index). Ignore field if start_index=-1.*/ + uint8_t origin_sysid; /*< System ID of the author of the new mission.*/ + uint8_t origin_compid; /*< Compnent ID of the author of the new mission.*/ + uint8_t mission_type; /*< Mission type.*/ +} mavlink_mission_changed_t; + +#define MAVLINK_MSG_ID_MISSION_CHANGED_LEN 7 +#define MAVLINK_MSG_ID_MISSION_CHANGED_MIN_LEN 7 +#define MAVLINK_MSG_ID_52_LEN 7 +#define MAVLINK_MSG_ID_52_MIN_LEN 7 + +#define MAVLINK_MSG_ID_MISSION_CHANGED_CRC 132 +#define MAVLINK_MSG_ID_52_CRC 132 + + + +#if MAVLINK_COMMAND_24BIT +#define MAVLINK_MESSAGE_INFO_MISSION_CHANGED { \ + 52, \ + "MISSION_CHANGED", \ + 5, \ + { { "start_index", NULL, MAVLINK_TYPE_INT16_T, 0, 0, offsetof(mavlink_mission_changed_t, start_index) }, \ + { "end_index", NULL, MAVLINK_TYPE_INT16_T, 0, 2, offsetof(mavlink_mission_changed_t, end_index) }, \ + { "origin_sysid", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_mission_changed_t, origin_sysid) }, \ + { "origin_compid", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_mission_changed_t, origin_compid) }, \ + { "mission_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_mission_changed_t, mission_type) }, \ + } \ +} +#else +#define MAVLINK_MESSAGE_INFO_MISSION_CHANGED { \ + "MISSION_CHANGED", \ + 5, \ + { { "start_index", NULL, MAVLINK_TYPE_INT16_T, 0, 0, offsetof(mavlink_mission_changed_t, start_index) }, \ + { "end_index", NULL, MAVLINK_TYPE_INT16_T, 0, 2, offsetof(mavlink_mission_changed_t, end_index) }, \ + { "origin_sysid", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_mission_changed_t, origin_sysid) }, \ + { "origin_compid", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_mission_changed_t, origin_compid) }, \ + { "mission_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_mission_changed_t, mission_type) }, \ + } \ +} +#endif + +/** + * @brief Pack a mission_changed 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 start_index Start index for partial mission change (-1 for all items). + * @param end_index End index of a partial mission change. -1 is a synonym for the last mission item (i.e. selects all items from start_index). Ignore field if start_index=-1. + * @param origin_sysid System ID of the author of the new mission. + * @param origin_compid Compnent ID of the author of the new mission. + * @param mission_type Mission type. + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_mission_changed_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, + int16_t start_index, int16_t end_index, uint8_t origin_sysid, uint8_t origin_compid, uint8_t mission_type) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[MAVLINK_MSG_ID_MISSION_CHANGED_LEN]; + _mav_put_int16_t(buf, 0, start_index); + _mav_put_int16_t(buf, 2, end_index); + _mav_put_uint8_t(buf, 4, origin_sysid); + _mav_put_uint8_t(buf, 5, origin_compid); + _mav_put_uint8_t(buf, 6, mission_type); + + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_CHANGED_LEN); +#else + mavlink_mission_changed_t packet; + packet.start_index = start_index; + packet.end_index = end_index; + packet.origin_sysid = origin_sysid; + packet.origin_compid = origin_compid; + packet.mission_type = mission_type; + + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_CHANGED_LEN); +#endif + + msg->msgid = MAVLINK_MSG_ID_MISSION_CHANGED; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_CHANGED_MIN_LEN, MAVLINK_MSG_ID_MISSION_CHANGED_LEN, MAVLINK_MSG_ID_MISSION_CHANGED_CRC); +} + +/** + * @brief Pack a mission_changed message on a channel + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param chan The MAVLink channel this message will be sent over + * @param msg The MAVLink message to compress the data into + * @param start_index Start index for partial mission change (-1 for all items). + * @param end_index End index of a partial mission change. -1 is a synonym for the last mission item (i.e. selects all items from start_index). Ignore field if start_index=-1. + * @param origin_sysid System ID of the author of the new mission. + * @param origin_compid Compnent ID of the author of the new mission. + * @param mission_type Mission type. + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_mission_changed_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, + mavlink_message_t* msg, + int16_t start_index,int16_t end_index,uint8_t origin_sysid,uint8_t origin_compid,uint8_t mission_type) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[MAVLINK_MSG_ID_MISSION_CHANGED_LEN]; + _mav_put_int16_t(buf, 0, start_index); + _mav_put_int16_t(buf, 2, end_index); + _mav_put_uint8_t(buf, 4, origin_sysid); + _mav_put_uint8_t(buf, 5, origin_compid); + _mav_put_uint8_t(buf, 6, mission_type); + + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_CHANGED_LEN); +#else + mavlink_mission_changed_t packet; + packet.start_index = start_index; + packet.end_index = end_index; + packet.origin_sysid = origin_sysid; + packet.origin_compid = origin_compid; + packet.mission_type = mission_type; + + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_CHANGED_LEN); +#endif + + msg->msgid = MAVLINK_MSG_ID_MISSION_CHANGED; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_CHANGED_MIN_LEN, MAVLINK_MSG_ID_MISSION_CHANGED_LEN, MAVLINK_MSG_ID_MISSION_CHANGED_CRC); +} + +/** + * @brief Encode a mission_changed struct + * + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param msg The MAVLink message to compress the data into + * @param mission_changed C-struct to read the message contents from + */ +static inline uint16_t mavlink_msg_mission_changed_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mission_changed_t* mission_changed) +{ + return mavlink_msg_mission_changed_pack(system_id, component_id, msg, mission_changed->start_index, mission_changed->end_index, mission_changed->origin_sysid, mission_changed->origin_compid, mission_changed->mission_type); +} + +/** + * @brief Encode a mission_changed struct on a channel + * + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param chan The MAVLink channel this message will be sent over + * @param msg The MAVLink message to compress the data into + * @param mission_changed C-struct to read the message contents from + */ +static inline uint16_t mavlink_msg_mission_changed_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_mission_changed_t* mission_changed) +{ + return mavlink_msg_mission_changed_pack_chan(system_id, component_id, chan, msg, mission_changed->start_index, mission_changed->end_index, mission_changed->origin_sysid, mission_changed->origin_compid, mission_changed->mission_type); +} + +/** + * @brief Send a mission_changed message + * @param chan MAVLink channel to send the message + * + * @param start_index Start index for partial mission change (-1 for all items). + * @param end_index End index of a partial mission change. -1 is a synonym for the last mission item (i.e. selects all items from start_index). Ignore field if start_index=-1. + * @param origin_sysid System ID of the author of the new mission. + * @param origin_compid Compnent ID of the author of the new mission. + * @param mission_type Mission type. + */ +#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS + +static inline void mavlink_msg_mission_changed_send(mavlink_channel_t chan, int16_t start_index, int16_t end_index, uint8_t origin_sysid, uint8_t origin_compid, uint8_t mission_type) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[MAVLINK_MSG_ID_MISSION_CHANGED_LEN]; + _mav_put_int16_t(buf, 0, start_index); + _mav_put_int16_t(buf, 2, end_index); + _mav_put_uint8_t(buf, 4, origin_sysid); + _mav_put_uint8_t(buf, 5, origin_compid); + _mav_put_uint8_t(buf, 6, mission_type); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CHANGED, buf, MAVLINK_MSG_ID_MISSION_CHANGED_MIN_LEN, MAVLINK_MSG_ID_MISSION_CHANGED_LEN, MAVLINK_MSG_ID_MISSION_CHANGED_CRC); +#else + mavlink_mission_changed_t packet; + packet.start_index = start_index; + packet.end_index = end_index; + packet.origin_sysid = origin_sysid; + packet.origin_compid = origin_compid; + packet.mission_type = mission_type; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CHANGED, (const char *)&packet, MAVLINK_MSG_ID_MISSION_CHANGED_MIN_LEN, MAVLINK_MSG_ID_MISSION_CHANGED_LEN, MAVLINK_MSG_ID_MISSION_CHANGED_CRC); +#endif +} + +/** + * @brief Send a mission_changed message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_mission_changed_send_struct(mavlink_channel_t chan, const mavlink_mission_changed_t* mission_changed) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_mission_changed_send(chan, mission_changed->start_index, mission_changed->end_index, mission_changed->origin_sysid, mission_changed->origin_compid, mission_changed->mission_type); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CHANGED, (const char *)mission_changed, MAVLINK_MSG_ID_MISSION_CHANGED_MIN_LEN, MAVLINK_MSG_ID_MISSION_CHANGED_LEN, MAVLINK_MSG_ID_MISSION_CHANGED_CRC); +#endif +} + +#if MAVLINK_MSG_ID_MISSION_CHANGED_LEN <= MAVLINK_MAX_PAYLOAD_LEN +/* + This varient of _send() can be used to save stack space by re-using + memory from the receive buffer. The caller provides a + mavlink_message_t which is the size of a full mavlink message. This + is usually the receive buffer for the channel, and allows a reply to an + incoming message with minimum stack space usage. + */ +static inline void mavlink_msg_mission_changed_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, int16_t start_index, int16_t end_index, uint8_t origin_sysid, uint8_t origin_compid, uint8_t mission_type) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char *buf = (char *)msgbuf; + _mav_put_int16_t(buf, 0, start_index); + _mav_put_int16_t(buf, 2, end_index); + _mav_put_uint8_t(buf, 4, origin_sysid); + _mav_put_uint8_t(buf, 5, origin_compid); + _mav_put_uint8_t(buf, 6, mission_type); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CHANGED, buf, MAVLINK_MSG_ID_MISSION_CHANGED_MIN_LEN, MAVLINK_MSG_ID_MISSION_CHANGED_LEN, MAVLINK_MSG_ID_MISSION_CHANGED_CRC); +#else + mavlink_mission_changed_t *packet = (mavlink_mission_changed_t *)msgbuf; + packet->start_index = start_index; + packet->end_index = end_index; + packet->origin_sysid = origin_sysid; + packet->origin_compid = origin_compid; + packet->mission_type = mission_type; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CHANGED, (const char *)packet, MAVLINK_MSG_ID_MISSION_CHANGED_MIN_LEN, MAVLINK_MSG_ID_MISSION_CHANGED_LEN, MAVLINK_MSG_ID_MISSION_CHANGED_CRC); +#endif +} +#endif + +#endif + +// MESSAGE MISSION_CHANGED UNPACKING + + +/** + * @brief Get field start_index from mission_changed message + * + * @return Start index for partial mission change (-1 for all items). + */ +static inline int16_t mavlink_msg_mission_changed_get_start_index(const mavlink_message_t* msg) +{ + return _MAV_RETURN_int16_t(msg, 0); +} + +/** + * @brief Get field end_index from mission_changed message + * + * @return End index of a partial mission change. -1 is a synonym for the last mission item (i.e. selects all items from start_index). Ignore field if start_index=-1. + */ +static inline int16_t mavlink_msg_mission_changed_get_end_index(const mavlink_message_t* msg) +{ + return _MAV_RETURN_int16_t(msg, 2); +} + +/** + * @brief Get field origin_sysid from mission_changed message + * + * @return System ID of the author of the new mission. + */ +static inline uint8_t mavlink_msg_mission_changed_get_origin_sysid(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint8_t(msg, 4); +} + +/** + * @brief Get field origin_compid from mission_changed message + * + * @return Compnent ID of the author of the new mission. + */ +static inline uint8_t mavlink_msg_mission_changed_get_origin_compid(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint8_t(msg, 5); +} + +/** + * @brief Get field mission_type from mission_changed message + * + * @return Mission type. + */ +static inline uint8_t mavlink_msg_mission_changed_get_mission_type(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint8_t(msg, 6); +} + +/** + * @brief Decode a mission_changed message into a struct + * + * @param msg The message to decode + * @param mission_changed C-struct to decode the message contents into + */ +static inline void mavlink_msg_mission_changed_decode(const mavlink_message_t* msg, mavlink_mission_changed_t* mission_changed) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mission_changed->start_index = mavlink_msg_mission_changed_get_start_index(msg); + mission_changed->end_index = mavlink_msg_mission_changed_get_end_index(msg); + mission_changed->origin_sysid = mavlink_msg_mission_changed_get_origin_sysid(msg); + mission_changed->origin_compid = mavlink_msg_mission_changed_get_origin_compid(msg); + mission_changed->mission_type = mavlink_msg_mission_changed_get_mission_type(msg); +#else + uint8_t len = msg->len < MAVLINK_MSG_ID_MISSION_CHANGED_LEN? msg->len : MAVLINK_MSG_ID_MISSION_CHANGED_LEN; + memset(mission_changed, 0, MAVLINK_MSG_ID_MISSION_CHANGED_LEN); + memcpy(mission_changed, _MAV_PAYLOAD(msg), len); +#endif +} diff --git a/lib/main/MAVLink/common/mavlink_msg_mission_clear_all.h b/lib/main/MAVLink/common/mavlink_msg_mission_clear_all.h index fa7e20e43c..bfed2d3fc2 100755 --- a/lib/main/MAVLink/common/mavlink_msg_mission_clear_all.h +++ b/lib/main/MAVLink/common/mavlink_msg_mission_clear_all.h @@ -3,11 +3,11 @@ #define MAVLINK_MSG_ID_MISSION_CLEAR_ALL 45 -MAVPACKED( + typedef struct __mavlink_mission_clear_all_t { - uint8_t target_system; /*< System ID*/ - uint8_t target_component; /*< Component ID*/ -}) mavlink_mission_clear_all_t; + uint8_t target_system; /*< System ID*/ + uint8_t target_component; /*< Component ID*/ +} mavlink_mission_clear_all_t; #define MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN 2 #define MAVLINK_MSG_ID_MISSION_CLEAR_ALL_MIN_LEN 2 @@ -44,8 +44,8 @@ typedef struct __mavlink_mission_clear_all_t { * @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 target_system System ID + * @param target_component Component ID * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_mission_clear_all_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -75,8 +75,8 @@ static inline uint16_t mavlink_msg_mission_clear_all_pack(uint8_t system_id, uin * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param target_system System ID - * @param target_component Component ID + * @param target_system System ID + * @param target_component Component ID * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_mission_clear_all_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -132,8 +132,8 @@ static inline uint16_t mavlink_msg_mission_clear_all_encode_chan(uint8_t system_ * @brief Send a mission_clear_all message * @param chan MAVLink channel to send the message * - * @param target_system System ID - * @param target_component Component ID + * @param target_system System ID + * @param target_component Component ID */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -202,7 +202,7 @@ static inline void mavlink_msg_mission_clear_all_send_buf(mavlink_message_t *msg /** * @brief Get field target_system from mission_clear_all message * - * @return System ID + * @return System ID */ static inline uint8_t mavlink_msg_mission_clear_all_get_target_system(const mavlink_message_t* msg) { @@ -212,7 +212,7 @@ static inline uint8_t mavlink_msg_mission_clear_all_get_target_system(const mavl /** * @brief Get field target_component from mission_clear_all message * - * @return Component ID + * @return Component ID */ static inline uint8_t mavlink_msg_mission_clear_all_get_target_component(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_mission_count.h b/lib/main/MAVLink/common/mavlink_msg_mission_count.h index 6ba66ff6f4..8c0cd1c6d0 100755 --- a/lib/main/MAVLink/common/mavlink_msg_mission_count.h +++ b/lib/main/MAVLink/common/mavlink_msg_mission_count.h @@ -3,12 +3,12 @@ #define MAVLINK_MSG_ID_MISSION_COUNT 44 -MAVPACKED( + typedef struct __mavlink_mission_count_t { - uint16_t count; /*< Number of mission items in the sequence*/ - uint8_t target_system; /*< System ID*/ - uint8_t target_component; /*< Component ID*/ -}) mavlink_mission_count_t; + uint16_t count; /*< Number of mission items in the sequence*/ + uint8_t target_system; /*< System ID*/ + uint8_t target_component; /*< Component ID*/ +} mavlink_mission_count_t; #define MAVLINK_MSG_ID_MISSION_COUNT_LEN 4 #define MAVLINK_MSG_ID_MISSION_COUNT_MIN_LEN 4 @@ -25,18 +25,18 @@ typedef struct __mavlink_mission_count_t { 44, \ "MISSION_COUNT", \ 3, \ - { { "count", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_count_t, count) }, \ - { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_mission_count_t, target_system) }, \ + { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_mission_count_t, target_system) }, \ { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_mission_count_t, target_component) }, \ + { "count", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_count_t, count) }, \ } \ } #else #define MAVLINK_MESSAGE_INFO_MISSION_COUNT { \ "MISSION_COUNT", \ 3, \ - { { "count", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_count_t, count) }, \ - { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_mission_count_t, target_system) }, \ + { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_mission_count_t, target_system) }, \ { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_mission_count_t, target_component) }, \ + { "count", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_count_t, count) }, \ } \ } #endif @@ -47,9 +47,9 @@ typedef struct __mavlink_mission_count_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param target_system System ID - * @param target_component Component ID - * @param count Number of mission items in the sequence + * @param target_system System ID + * @param target_component Component ID + * @param count Number of mission items in the sequence * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_mission_count_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -81,9 +81,9 @@ static inline uint16_t mavlink_msg_mission_count_pack(uint8_t system_id, uint8_t * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param target_system System ID - * @param target_component Component ID - * @param count Number of mission items in the sequence + * @param target_system System ID + * @param target_component Component ID + * @param count Number of mission items in the sequence * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_mission_count_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -141,9 +141,9 @@ static inline uint16_t mavlink_msg_mission_count_encode_chan(uint8_t system_id, * @brief Send a mission_count message * @param chan MAVLink channel to send the message * - * @param target_system System ID - * @param target_component Component ID - * @param count Number of mission items in the sequence + * @param target_system System ID + * @param target_component Component ID + * @param count Number of mission items in the sequence */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -216,7 +216,7 @@ static inline void mavlink_msg_mission_count_send_buf(mavlink_message_t *msgbuf, /** * @brief Get field target_system from mission_count message * - * @return System ID + * @return System ID */ static inline uint8_t mavlink_msg_mission_count_get_target_system(const mavlink_message_t* msg) { @@ -226,7 +226,7 @@ static inline uint8_t mavlink_msg_mission_count_get_target_system(const mavlink_ /** * @brief Get field target_component from mission_count message * - * @return Component ID + * @return Component ID */ static inline uint8_t mavlink_msg_mission_count_get_target_component(const mavlink_message_t* msg) { @@ -236,7 +236,7 @@ static inline uint8_t mavlink_msg_mission_count_get_target_component(const mavli /** * @brief Get field count from mission_count message * - * @return Number of mission items in the sequence + * @return Number of mission items in the sequence */ static inline uint16_t mavlink_msg_mission_count_get_count(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_mission_current.h b/lib/main/MAVLink/common/mavlink_msg_mission_current.h index 802632d34d..13f0fb62bc 100755 --- a/lib/main/MAVLink/common/mavlink_msg_mission_current.h +++ b/lib/main/MAVLink/common/mavlink_msg_mission_current.h @@ -3,10 +3,10 @@ #define MAVLINK_MSG_ID_MISSION_CURRENT 42 -MAVPACKED( + typedef struct __mavlink_mission_current_t { - uint16_t seq; /*< Sequence*/ -}) mavlink_mission_current_t; + uint16_t seq; /*< Sequence*/ +} mavlink_mission_current_t; #define MAVLINK_MSG_ID_MISSION_CURRENT_LEN 2 #define MAVLINK_MSG_ID_MISSION_CURRENT_MIN_LEN 2 @@ -41,7 +41,7 @@ typedef struct __mavlink_mission_current_t { * @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 + * @param seq Sequence * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_mission_current_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -69,7 +69,7 @@ static inline uint16_t mavlink_msg_mission_current_pack(uint8_t system_id, uint8 * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param seq Sequence + * @param seq Sequence * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_mission_current_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -123,7 +123,7 @@ static inline uint16_t mavlink_msg_mission_current_encode_chan(uint8_t system_id * @brief Send a mission_current message * @param chan MAVLink channel to send the message * - * @param seq Sequence + * @param seq Sequence */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -188,7 +188,7 @@ static inline void mavlink_msg_mission_current_send_buf(mavlink_message_t *msgbu /** * @brief Get field seq from mission_current message * - * @return Sequence + * @return Sequence */ static inline uint16_t mavlink_msg_mission_current_get_seq(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_mission_item.h b/lib/main/MAVLink/common/mavlink_msg_mission_item.h index afcf519d41..0a50b542a5 100755 --- a/lib/main/MAVLink/common/mavlink_msg_mission_item.h +++ b/lib/main/MAVLink/common/mavlink_msg_mission_item.h @@ -3,23 +3,23 @@ #define MAVLINK_MSG_ID_MISSION_ITEM 39 -MAVPACKED( + typedef struct __mavlink_mission_item_t { - float param1; /*< PARAM1, see MAV_CMD enum*/ - float param2; /*< PARAM2, see MAV_CMD enum*/ - float param3; /*< PARAM3, see MAV_CMD enum*/ - float param4; /*< PARAM4, see MAV_CMD enum*/ - float x; /*< PARAM5 / local: x position, global: latitude*/ - float y; /*< PARAM6 / y position: global: longitude*/ - float z; /*< PARAM7 / z position: global: altitude (relative or absolute, depending on frame.*/ - uint16_t seq; /*< Sequence*/ - uint16_t command; /*< The scheduled action for the MISSION. see MAV_CMD in common.xml MAVLink specs*/ - uint8_t target_system; /*< System ID*/ - uint8_t target_component; /*< Component ID*/ - uint8_t frame; /*< The coordinate system of the MISSION. see MAV_FRAME in mavlink_types.h*/ - uint8_t current; /*< false:0, true:1*/ - uint8_t autocontinue; /*< autocontinue to next wp*/ -}) mavlink_mission_item_t; + float param1; /*< PARAM1, see MAV_CMD enum*/ + float param2; /*< PARAM2, see MAV_CMD enum*/ + float param3; /*< PARAM3, see MAV_CMD enum*/ + float param4; /*< PARAM4, see MAV_CMD enum*/ + float x; /*< PARAM5 / local: X coordinate, global: latitude*/ + float y; /*< PARAM6 / local: Y coordinate, global: longitude*/ + float z; /*< PARAM7 / local: Z coordinate, global: altitude (relative or absolute, depending on frame).*/ + uint16_t seq; /*< Sequence*/ + uint16_t command; /*< The scheduled action for the waypoint.*/ + uint8_t target_system; /*< System ID*/ + uint8_t target_component; /*< Component ID*/ + uint8_t frame; /*< The coordinate system of the waypoint.*/ + uint8_t current; /*< false:0, true:1*/ + uint8_t autocontinue; /*< Autocontinue to next waypoint*/ +} mavlink_mission_item_t; #define MAVLINK_MSG_ID_MISSION_ITEM_LEN 37 #define MAVLINK_MSG_ID_MISSION_ITEM_MIN_LEN 37 @@ -36,40 +36,40 @@ typedef struct __mavlink_mission_item_t { 39, \ "MISSION_ITEM", \ 14, \ - { { "param1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_mission_item_t, param1) }, \ + { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_mission_item_t, target_system) }, \ + { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_mission_item_t, target_component) }, \ + { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_mission_item_t, seq) }, \ + { "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_mission_item_t, frame) }, \ + { "command", NULL, MAVLINK_TYPE_UINT16_T, 0, 30, offsetof(mavlink_mission_item_t, command) }, \ + { "current", NULL, MAVLINK_TYPE_UINT8_T, 0, 35, offsetof(mavlink_mission_item_t, current) }, \ + { "autocontinue", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_mission_item_t, autocontinue) }, \ + { "param1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_mission_item_t, param1) }, \ { "param2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_mission_item_t, param2) }, \ { "param3", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_mission_item_t, param3) }, \ { "param4", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_mission_item_t, param4) }, \ { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_mission_item_t, x) }, \ { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_mission_item_t, y) }, \ { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_mission_item_t, z) }, \ - { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_mission_item_t, seq) }, \ - { "command", NULL, MAVLINK_TYPE_UINT16_T, 0, 30, offsetof(mavlink_mission_item_t, command) }, \ - { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_mission_item_t, target_system) }, \ - { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_mission_item_t, target_component) }, \ - { "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_mission_item_t, frame) }, \ - { "current", NULL, MAVLINK_TYPE_UINT8_T, 0, 35, offsetof(mavlink_mission_item_t, current) }, \ - { "autocontinue", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_mission_item_t, autocontinue) }, \ } \ } #else #define MAVLINK_MESSAGE_INFO_MISSION_ITEM { \ "MISSION_ITEM", \ 14, \ - { { "param1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_mission_item_t, param1) }, \ + { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_mission_item_t, target_system) }, \ + { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_mission_item_t, target_component) }, \ + { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_mission_item_t, seq) }, \ + { "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_mission_item_t, frame) }, \ + { "command", NULL, MAVLINK_TYPE_UINT16_T, 0, 30, offsetof(mavlink_mission_item_t, command) }, \ + { "current", NULL, MAVLINK_TYPE_UINT8_T, 0, 35, offsetof(mavlink_mission_item_t, current) }, \ + { "autocontinue", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_mission_item_t, autocontinue) }, \ + { "param1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_mission_item_t, param1) }, \ { "param2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_mission_item_t, param2) }, \ { "param3", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_mission_item_t, param3) }, \ { "param4", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_mission_item_t, param4) }, \ { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_mission_item_t, x) }, \ { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_mission_item_t, y) }, \ { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_mission_item_t, z) }, \ - { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_mission_item_t, seq) }, \ - { "command", NULL, MAVLINK_TYPE_UINT16_T, 0, 30, offsetof(mavlink_mission_item_t, command) }, \ - { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_mission_item_t, target_system) }, \ - { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_mission_item_t, target_component) }, \ - { "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_mission_item_t, frame) }, \ - { "current", NULL, MAVLINK_TYPE_UINT8_T, 0, 35, offsetof(mavlink_mission_item_t, current) }, \ - { "autocontinue", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_mission_item_t, autocontinue) }, \ } \ } #endif @@ -80,20 +80,20 @@ typedef struct __mavlink_mission_item_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param target_system System ID - * @param target_component Component ID - * @param seq Sequence - * @param frame The coordinate system of the MISSION. see MAV_FRAME in mavlink_types.h - * @param command The scheduled action for the MISSION. see MAV_CMD in common.xml MAVLink specs - * @param current false:0, true:1 - * @param autocontinue autocontinue to next wp - * @param param1 PARAM1, see MAV_CMD enum - * @param param2 PARAM2, see MAV_CMD enum - * @param param3 PARAM3, see MAV_CMD enum - * @param param4 PARAM4, see MAV_CMD enum - * @param x PARAM5 / local: x position, global: latitude - * @param y PARAM6 / y position: global: longitude - * @param z PARAM7 / z position: global: altitude (relative or absolute, depending on frame. + * @param target_system System ID + * @param target_component Component ID + * @param seq Sequence + * @param frame The coordinate system of the waypoint. + * @param command The scheduled action for the waypoint. + * @param current false:0, true:1 + * @param autocontinue Autocontinue to next waypoint + * @param param1 PARAM1, see MAV_CMD enum + * @param param2 PARAM2, see MAV_CMD enum + * @param param3 PARAM3, see MAV_CMD enum + * @param param4 PARAM4, see MAV_CMD enum + * @param x PARAM5 / local: X coordinate, global: latitude + * @param y PARAM6 / local: Y coordinate, global: longitude + * @param z PARAM7 / local: Z coordinate, global: altitude (relative or absolute, depending on frame). * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_mission_item_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -147,20 +147,20 @@ static inline uint16_t mavlink_msg_mission_item_pack(uint8_t system_id, uint8_t * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param target_system System ID - * @param target_component Component ID - * @param seq Sequence - * @param frame The coordinate system of the MISSION. see MAV_FRAME in mavlink_types.h - * @param command The scheduled action for the MISSION. see MAV_CMD in common.xml MAVLink specs - * @param current false:0, true:1 - * @param autocontinue autocontinue to next wp - * @param param1 PARAM1, see MAV_CMD enum - * @param param2 PARAM2, see MAV_CMD enum - * @param param3 PARAM3, see MAV_CMD enum - * @param param4 PARAM4, see MAV_CMD enum - * @param x PARAM5 / local: x position, global: latitude - * @param y PARAM6 / y position: global: longitude - * @param z PARAM7 / z position: global: altitude (relative or absolute, depending on frame. + * @param target_system System ID + * @param target_component Component ID + * @param seq Sequence + * @param frame The coordinate system of the waypoint. + * @param command The scheduled action for the waypoint. + * @param current false:0, true:1 + * @param autocontinue Autocontinue to next waypoint + * @param param1 PARAM1, see MAV_CMD enum + * @param param2 PARAM2, see MAV_CMD enum + * @param param3 PARAM3, see MAV_CMD enum + * @param param4 PARAM4, see MAV_CMD enum + * @param x PARAM5 / local: X coordinate, global: latitude + * @param y PARAM6 / local: Y coordinate, global: longitude + * @param z PARAM7 / local: Z coordinate, global: altitude (relative or absolute, depending on frame). * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_mission_item_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -240,20 +240,20 @@ static inline uint16_t mavlink_msg_mission_item_encode_chan(uint8_t system_id, u * @brief Send a mission_item message * @param chan MAVLink channel to send the message * - * @param target_system System ID - * @param target_component Component ID - * @param seq Sequence - * @param frame The coordinate system of the MISSION. see MAV_FRAME in mavlink_types.h - * @param command The scheduled action for the MISSION. see MAV_CMD in common.xml MAVLink specs - * @param current false:0, true:1 - * @param autocontinue autocontinue to next wp - * @param param1 PARAM1, see MAV_CMD enum - * @param param2 PARAM2, see MAV_CMD enum - * @param param3 PARAM3, see MAV_CMD enum - * @param param4 PARAM4, see MAV_CMD enum - * @param x PARAM5 / local: x position, global: latitude - * @param y PARAM6 / y position: global: longitude - * @param z PARAM7 / z position: global: altitude (relative or absolute, depending on frame. + * @param target_system System ID + * @param target_component Component ID + * @param seq Sequence + * @param frame The coordinate system of the waypoint. + * @param command The scheduled action for the waypoint. + * @param current false:0, true:1 + * @param autocontinue Autocontinue to next waypoint + * @param param1 PARAM1, see MAV_CMD enum + * @param param2 PARAM2, see MAV_CMD enum + * @param param3 PARAM3, see MAV_CMD enum + * @param param4 PARAM4, see MAV_CMD enum + * @param x PARAM5 / local: X coordinate, global: latitude + * @param y PARAM6 / local: Y coordinate, global: longitude + * @param z PARAM7 / local: Z coordinate, global: altitude (relative or absolute, depending on frame). */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -370,7 +370,7 @@ static inline void mavlink_msg_mission_item_send_buf(mavlink_message_t *msgbuf, /** * @brief Get field target_system from mission_item message * - * @return System ID + * @return System ID */ static inline uint8_t mavlink_msg_mission_item_get_target_system(const mavlink_message_t* msg) { @@ -380,7 +380,7 @@ static inline uint8_t mavlink_msg_mission_item_get_target_system(const mavlink_m /** * @brief Get field target_component from mission_item message * - * @return Component ID + * @return Component ID */ static inline uint8_t mavlink_msg_mission_item_get_target_component(const mavlink_message_t* msg) { @@ -390,7 +390,7 @@ static inline uint8_t mavlink_msg_mission_item_get_target_component(const mavlin /** * @brief Get field seq from mission_item message * - * @return Sequence + * @return Sequence */ static inline uint16_t mavlink_msg_mission_item_get_seq(const mavlink_message_t* msg) { @@ -400,7 +400,7 @@ static inline uint16_t mavlink_msg_mission_item_get_seq(const mavlink_message_t* /** * @brief Get field frame from mission_item message * - * @return The coordinate system of the MISSION. see MAV_FRAME in mavlink_types.h + * @return The coordinate system of the waypoint. */ static inline uint8_t mavlink_msg_mission_item_get_frame(const mavlink_message_t* msg) { @@ -410,7 +410,7 @@ static inline uint8_t mavlink_msg_mission_item_get_frame(const mavlink_message_t /** * @brief Get field command from mission_item message * - * @return The scheduled action for the MISSION. see MAV_CMD in common.xml MAVLink specs + * @return The scheduled action for the waypoint. */ static inline uint16_t mavlink_msg_mission_item_get_command(const mavlink_message_t* msg) { @@ -420,7 +420,7 @@ static inline uint16_t mavlink_msg_mission_item_get_command(const mavlink_messag /** * @brief Get field current from mission_item message * - * @return false:0, true:1 + * @return false:0, true:1 */ static inline uint8_t mavlink_msg_mission_item_get_current(const mavlink_message_t* msg) { @@ -430,7 +430,7 @@ static inline uint8_t mavlink_msg_mission_item_get_current(const mavlink_message /** * @brief Get field autocontinue from mission_item message * - * @return autocontinue to next wp + * @return Autocontinue to next waypoint */ static inline uint8_t mavlink_msg_mission_item_get_autocontinue(const mavlink_message_t* msg) { @@ -440,7 +440,7 @@ static inline uint8_t mavlink_msg_mission_item_get_autocontinue(const mavlink_me /** * @brief Get field param1 from mission_item message * - * @return PARAM1, see MAV_CMD enum + * @return PARAM1, see MAV_CMD enum */ static inline float mavlink_msg_mission_item_get_param1(const mavlink_message_t* msg) { @@ -450,7 +450,7 @@ static inline float mavlink_msg_mission_item_get_param1(const mavlink_message_t* /** * @brief Get field param2 from mission_item message * - * @return PARAM2, see MAV_CMD enum + * @return PARAM2, see MAV_CMD enum */ static inline float mavlink_msg_mission_item_get_param2(const mavlink_message_t* msg) { @@ -460,7 +460,7 @@ static inline float mavlink_msg_mission_item_get_param2(const mavlink_message_t* /** * @brief Get field param3 from mission_item message * - * @return PARAM3, see MAV_CMD enum + * @return PARAM3, see MAV_CMD enum */ static inline float mavlink_msg_mission_item_get_param3(const mavlink_message_t* msg) { @@ -470,7 +470,7 @@ static inline float mavlink_msg_mission_item_get_param3(const mavlink_message_t* /** * @brief Get field param4 from mission_item message * - * @return PARAM4, see MAV_CMD enum + * @return PARAM4, see MAV_CMD enum */ static inline float mavlink_msg_mission_item_get_param4(const mavlink_message_t* msg) { @@ -480,7 +480,7 @@ static inline float mavlink_msg_mission_item_get_param4(const mavlink_message_t* /** * @brief Get field x from mission_item message * - * @return PARAM5 / local: x position, global: latitude + * @return PARAM5 / local: X coordinate, global: latitude */ static inline float mavlink_msg_mission_item_get_x(const mavlink_message_t* msg) { @@ -490,7 +490,7 @@ static inline float mavlink_msg_mission_item_get_x(const mavlink_message_t* msg) /** * @brief Get field y from mission_item message * - * @return PARAM6 / y position: global: longitude + * @return PARAM6 / local: Y coordinate, global: longitude */ static inline float mavlink_msg_mission_item_get_y(const mavlink_message_t* msg) { @@ -500,7 +500,7 @@ static inline float mavlink_msg_mission_item_get_y(const mavlink_message_t* msg) /** * @brief Get field z from mission_item message * - * @return PARAM7 / z position: global: altitude (relative or absolute, depending on frame. + * @return PARAM7 / local: Z coordinate, global: altitude (relative or absolute, depending on frame). */ static inline float mavlink_msg_mission_item_get_z(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_mission_item_int.h b/lib/main/MAVLink/common/mavlink_msg_mission_item_int.h index 66847236f2..64572671c9 100755 --- a/lib/main/MAVLink/common/mavlink_msg_mission_item_int.h +++ b/lib/main/MAVLink/common/mavlink_msg_mission_item_int.h @@ -3,23 +3,23 @@ #define MAVLINK_MSG_ID_MISSION_ITEM_INT 73 -MAVPACKED( + typedef struct __mavlink_mission_item_int_t { - float param1; /*< PARAM1, see MAV_CMD enum*/ - float param2; /*< PARAM2, see MAV_CMD enum*/ - float param3; /*< PARAM3, see MAV_CMD enum*/ - float param4; /*< PARAM4, see MAV_CMD enum*/ - int32_t x; /*< PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7*/ - int32_t y; /*< PARAM6 / y position: local: x position in meters * 1e4, global: longitude in degrees *10^7*/ - float z; /*< PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame.*/ - uint16_t seq; /*< Waypoint ID (sequence number). Starts at zero. Increases monotonically for each waypoint, no gaps in the sequence (0,1,2,3,4).*/ - uint16_t command; /*< The scheduled action for the MISSION. see MAV_CMD in common.xml MAVLink specs*/ - uint8_t target_system; /*< System ID*/ - uint8_t target_component; /*< Component ID*/ - uint8_t frame; /*< The coordinate system of the MISSION. see MAV_FRAME in mavlink_types.h*/ - uint8_t current; /*< false:0, true:1*/ - uint8_t autocontinue; /*< autocontinue to next wp*/ -}) mavlink_mission_item_int_t; + float param1; /*< PARAM1, see MAV_CMD enum*/ + float param2; /*< PARAM2, see MAV_CMD enum*/ + float param3; /*< PARAM3, see MAV_CMD enum*/ + float param4; /*< PARAM4, see MAV_CMD enum*/ + int32_t x; /*< PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7*/ + int32_t y; /*< PARAM6 / y position: local: x position in meters * 1e4, global: longitude in degrees *10^7*/ + float z; /*< PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame.*/ + uint16_t seq; /*< Waypoint ID (sequence number). Starts at zero. Increases monotonically for each waypoint, no gaps in the sequence (0,1,2,3,4).*/ + uint16_t command; /*< The scheduled action for the waypoint.*/ + uint8_t target_system; /*< System ID*/ + uint8_t target_component; /*< Component ID*/ + uint8_t frame; /*< The coordinate system of the waypoint.*/ + uint8_t current; /*< false:0, true:1*/ + uint8_t autocontinue; /*< Autocontinue to next waypoint*/ +} mavlink_mission_item_int_t; #define MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN 37 #define MAVLINK_MSG_ID_MISSION_ITEM_INT_MIN_LEN 37 @@ -36,40 +36,40 @@ typedef struct __mavlink_mission_item_int_t { 73, \ "MISSION_ITEM_INT", \ 14, \ - { { "param1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_mission_item_int_t, param1) }, \ + { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_mission_item_int_t, target_system) }, \ + { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_mission_item_int_t, target_component) }, \ + { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_mission_item_int_t, seq) }, \ + { "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_mission_item_int_t, frame) }, \ + { "command", NULL, MAVLINK_TYPE_UINT16_T, 0, 30, offsetof(mavlink_mission_item_int_t, command) }, \ + { "current", NULL, MAVLINK_TYPE_UINT8_T, 0, 35, offsetof(mavlink_mission_item_int_t, current) }, \ + { "autocontinue", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_mission_item_int_t, autocontinue) }, \ + { "param1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_mission_item_int_t, param1) }, \ { "param2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_mission_item_int_t, param2) }, \ { "param3", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_mission_item_int_t, param3) }, \ { "param4", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_mission_item_int_t, param4) }, \ { "x", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_mission_item_int_t, x) }, \ { "y", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_mission_item_int_t, y) }, \ { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_mission_item_int_t, z) }, \ - { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_mission_item_int_t, seq) }, \ - { "command", NULL, MAVLINK_TYPE_UINT16_T, 0, 30, offsetof(mavlink_mission_item_int_t, command) }, \ - { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_mission_item_int_t, target_system) }, \ - { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_mission_item_int_t, target_component) }, \ - { "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_mission_item_int_t, frame) }, \ - { "current", NULL, MAVLINK_TYPE_UINT8_T, 0, 35, offsetof(mavlink_mission_item_int_t, current) }, \ - { "autocontinue", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_mission_item_int_t, autocontinue) }, \ } \ } #else #define MAVLINK_MESSAGE_INFO_MISSION_ITEM_INT { \ "MISSION_ITEM_INT", \ 14, \ - { { "param1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_mission_item_int_t, param1) }, \ + { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_mission_item_int_t, target_system) }, \ + { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_mission_item_int_t, target_component) }, \ + { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_mission_item_int_t, seq) }, \ + { "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_mission_item_int_t, frame) }, \ + { "command", NULL, MAVLINK_TYPE_UINT16_T, 0, 30, offsetof(mavlink_mission_item_int_t, command) }, \ + { "current", NULL, MAVLINK_TYPE_UINT8_T, 0, 35, offsetof(mavlink_mission_item_int_t, current) }, \ + { "autocontinue", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_mission_item_int_t, autocontinue) }, \ + { "param1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_mission_item_int_t, param1) }, \ { "param2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_mission_item_int_t, param2) }, \ { "param3", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_mission_item_int_t, param3) }, \ { "param4", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_mission_item_int_t, param4) }, \ { "x", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_mission_item_int_t, x) }, \ { "y", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_mission_item_int_t, y) }, \ { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_mission_item_int_t, z) }, \ - { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_mission_item_int_t, seq) }, \ - { "command", NULL, MAVLINK_TYPE_UINT16_T, 0, 30, offsetof(mavlink_mission_item_int_t, command) }, \ - { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_mission_item_int_t, target_system) }, \ - { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_mission_item_int_t, target_component) }, \ - { "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_mission_item_int_t, frame) }, \ - { "current", NULL, MAVLINK_TYPE_UINT8_T, 0, 35, offsetof(mavlink_mission_item_int_t, current) }, \ - { "autocontinue", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_mission_item_int_t, autocontinue) }, \ } \ } #endif @@ -80,20 +80,20 @@ typedef struct __mavlink_mission_item_int_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param target_system System ID - * @param target_component Component ID - * @param seq Waypoint ID (sequence number). Starts at zero. Increases monotonically for each waypoint, no gaps in the sequence (0,1,2,3,4). - * @param frame The coordinate system of the MISSION. see MAV_FRAME in mavlink_types.h - * @param command The scheduled action for the MISSION. see MAV_CMD in common.xml MAVLink specs - * @param current false:0, true:1 - * @param autocontinue autocontinue to next wp - * @param param1 PARAM1, see MAV_CMD enum - * @param param2 PARAM2, see MAV_CMD enum - * @param param3 PARAM3, see MAV_CMD enum - * @param param4 PARAM4, see MAV_CMD enum - * @param x PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7 - * @param y PARAM6 / y position: local: x position in meters * 1e4, global: longitude in degrees *10^7 - * @param z PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame. + * @param target_system System ID + * @param target_component Component ID + * @param seq Waypoint ID (sequence number). Starts at zero. Increases monotonically for each waypoint, no gaps in the sequence (0,1,2,3,4). + * @param frame The coordinate system of the waypoint. + * @param command The scheduled action for the waypoint. + * @param current false:0, true:1 + * @param autocontinue Autocontinue to next waypoint + * @param param1 PARAM1, see MAV_CMD enum + * @param param2 PARAM2, see MAV_CMD enum + * @param param3 PARAM3, see MAV_CMD enum + * @param param4 PARAM4, see MAV_CMD enum + * @param x PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7 + * @param y PARAM6 / y position: local: x position in meters * 1e4, global: longitude in degrees *10^7 + * @param z PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_mission_item_int_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -147,20 +147,20 @@ static inline uint16_t mavlink_msg_mission_item_int_pack(uint8_t system_id, uint * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param target_system System ID - * @param target_component Component ID - * @param seq Waypoint ID (sequence number). Starts at zero. Increases monotonically for each waypoint, no gaps in the sequence (0,1,2,3,4). - * @param frame The coordinate system of the MISSION. see MAV_FRAME in mavlink_types.h - * @param command The scheduled action for the MISSION. see MAV_CMD in common.xml MAVLink specs - * @param current false:0, true:1 - * @param autocontinue autocontinue to next wp - * @param param1 PARAM1, see MAV_CMD enum - * @param param2 PARAM2, see MAV_CMD enum - * @param param3 PARAM3, see MAV_CMD enum - * @param param4 PARAM4, see MAV_CMD enum - * @param x PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7 - * @param y PARAM6 / y position: local: x position in meters * 1e4, global: longitude in degrees *10^7 - * @param z PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame. + * @param target_system System ID + * @param target_component Component ID + * @param seq Waypoint ID (sequence number). Starts at zero. Increases monotonically for each waypoint, no gaps in the sequence (0,1,2,3,4). + * @param frame The coordinate system of the waypoint. + * @param command The scheduled action for the waypoint. + * @param current false:0, true:1 + * @param autocontinue Autocontinue to next waypoint + * @param param1 PARAM1, see MAV_CMD enum + * @param param2 PARAM2, see MAV_CMD enum + * @param param3 PARAM3, see MAV_CMD enum + * @param param4 PARAM4, see MAV_CMD enum + * @param x PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7 + * @param y PARAM6 / y position: local: x position in meters * 1e4, global: longitude in degrees *10^7 + * @param z PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_mission_item_int_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -240,20 +240,20 @@ static inline uint16_t mavlink_msg_mission_item_int_encode_chan(uint8_t system_i * @brief Send a mission_item_int message * @param chan MAVLink channel to send the message * - * @param target_system System ID - * @param target_component Component ID - * @param seq Waypoint ID (sequence number). Starts at zero. Increases monotonically for each waypoint, no gaps in the sequence (0,1,2,3,4). - * @param frame The coordinate system of the MISSION. see MAV_FRAME in mavlink_types.h - * @param command The scheduled action for the MISSION. see MAV_CMD in common.xml MAVLink specs - * @param current false:0, true:1 - * @param autocontinue autocontinue to next wp - * @param param1 PARAM1, see MAV_CMD enum - * @param param2 PARAM2, see MAV_CMD enum - * @param param3 PARAM3, see MAV_CMD enum - * @param param4 PARAM4, see MAV_CMD enum - * @param x PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7 - * @param y PARAM6 / y position: local: x position in meters * 1e4, global: longitude in degrees *10^7 - * @param z PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame. + * @param target_system System ID + * @param target_component Component ID + * @param seq Waypoint ID (sequence number). Starts at zero. Increases monotonically for each waypoint, no gaps in the sequence (0,1,2,3,4). + * @param frame The coordinate system of the waypoint. + * @param command The scheduled action for the waypoint. + * @param current false:0, true:1 + * @param autocontinue Autocontinue to next waypoint + * @param param1 PARAM1, see MAV_CMD enum + * @param param2 PARAM2, see MAV_CMD enum + * @param param3 PARAM3, see MAV_CMD enum + * @param param4 PARAM4, see MAV_CMD enum + * @param x PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7 + * @param y PARAM6 / y position: local: x position in meters * 1e4, global: longitude in degrees *10^7 + * @param z PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame. */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -370,7 +370,7 @@ static inline void mavlink_msg_mission_item_int_send_buf(mavlink_message_t *msgb /** * @brief Get field target_system from mission_item_int message * - * @return System ID + * @return System ID */ static inline uint8_t mavlink_msg_mission_item_int_get_target_system(const mavlink_message_t* msg) { @@ -380,7 +380,7 @@ static inline uint8_t mavlink_msg_mission_item_int_get_target_system(const mavli /** * @brief Get field target_component from mission_item_int message * - * @return Component ID + * @return Component ID */ static inline uint8_t mavlink_msg_mission_item_int_get_target_component(const mavlink_message_t* msg) { @@ -390,7 +390,7 @@ static inline uint8_t mavlink_msg_mission_item_int_get_target_component(const ma /** * @brief Get field seq from mission_item_int message * - * @return Waypoint ID (sequence number). Starts at zero. Increases monotonically for each waypoint, no gaps in the sequence (0,1,2,3,4). + * @return Waypoint ID (sequence number). Starts at zero. Increases monotonically for each waypoint, no gaps in the sequence (0,1,2,3,4). */ static inline uint16_t mavlink_msg_mission_item_int_get_seq(const mavlink_message_t* msg) { @@ -400,7 +400,7 @@ static inline uint16_t mavlink_msg_mission_item_int_get_seq(const mavlink_messag /** * @brief Get field frame from mission_item_int message * - * @return The coordinate system of the MISSION. see MAV_FRAME in mavlink_types.h + * @return The coordinate system of the waypoint. */ static inline uint8_t mavlink_msg_mission_item_int_get_frame(const mavlink_message_t* msg) { @@ -410,7 +410,7 @@ static inline uint8_t mavlink_msg_mission_item_int_get_frame(const mavlink_messa /** * @brief Get field command from mission_item_int message * - * @return The scheduled action for the MISSION. see MAV_CMD in common.xml MAVLink specs + * @return The scheduled action for the waypoint. */ static inline uint16_t mavlink_msg_mission_item_int_get_command(const mavlink_message_t* msg) { @@ -420,7 +420,7 @@ static inline uint16_t mavlink_msg_mission_item_int_get_command(const mavlink_me /** * @brief Get field current from mission_item_int message * - * @return false:0, true:1 + * @return false:0, true:1 */ static inline uint8_t mavlink_msg_mission_item_int_get_current(const mavlink_message_t* msg) { @@ -430,7 +430,7 @@ static inline uint8_t mavlink_msg_mission_item_int_get_current(const mavlink_mes /** * @brief Get field autocontinue from mission_item_int message * - * @return autocontinue to next wp + * @return Autocontinue to next waypoint */ static inline uint8_t mavlink_msg_mission_item_int_get_autocontinue(const mavlink_message_t* msg) { @@ -440,7 +440,7 @@ static inline uint8_t mavlink_msg_mission_item_int_get_autocontinue(const mavlin /** * @brief Get field param1 from mission_item_int message * - * @return PARAM1, see MAV_CMD enum + * @return PARAM1, see MAV_CMD enum */ static inline float mavlink_msg_mission_item_int_get_param1(const mavlink_message_t* msg) { @@ -450,7 +450,7 @@ static inline float mavlink_msg_mission_item_int_get_param1(const mavlink_messag /** * @brief Get field param2 from mission_item_int message * - * @return PARAM2, see MAV_CMD enum + * @return PARAM2, see MAV_CMD enum */ static inline float mavlink_msg_mission_item_int_get_param2(const mavlink_message_t* msg) { @@ -460,7 +460,7 @@ static inline float mavlink_msg_mission_item_int_get_param2(const mavlink_messag /** * @brief Get field param3 from mission_item_int message * - * @return PARAM3, see MAV_CMD enum + * @return PARAM3, see MAV_CMD enum */ static inline float mavlink_msg_mission_item_int_get_param3(const mavlink_message_t* msg) { @@ -470,7 +470,7 @@ static inline float mavlink_msg_mission_item_int_get_param3(const mavlink_messag /** * @brief Get field param4 from mission_item_int message * - * @return PARAM4, see MAV_CMD enum + * @return PARAM4, see MAV_CMD enum */ static inline float mavlink_msg_mission_item_int_get_param4(const mavlink_message_t* msg) { @@ -480,7 +480,7 @@ static inline float mavlink_msg_mission_item_int_get_param4(const mavlink_messag /** * @brief Get field x from mission_item_int message * - * @return PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7 + * @return PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7 */ static inline int32_t mavlink_msg_mission_item_int_get_x(const mavlink_message_t* msg) { @@ -490,7 +490,7 @@ static inline int32_t mavlink_msg_mission_item_int_get_x(const mavlink_message_t /** * @brief Get field y from mission_item_int message * - * @return PARAM6 / y position: local: x position in meters * 1e4, global: longitude in degrees *10^7 + * @return PARAM6 / y position: local: x position in meters * 1e4, global: longitude in degrees *10^7 */ static inline int32_t mavlink_msg_mission_item_int_get_y(const mavlink_message_t* msg) { @@ -500,7 +500,7 @@ static inline int32_t mavlink_msg_mission_item_int_get_y(const mavlink_message_t /** * @brief Get field z from mission_item_int message * - * @return PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame. + * @return PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame. */ static inline float mavlink_msg_mission_item_int_get_z(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_mission_item_reached.h b/lib/main/MAVLink/common/mavlink_msg_mission_item_reached.h index 1ad0e29cef..647176b9cd 100755 --- a/lib/main/MAVLink/common/mavlink_msg_mission_item_reached.h +++ b/lib/main/MAVLink/common/mavlink_msg_mission_item_reached.h @@ -3,10 +3,10 @@ #define MAVLINK_MSG_ID_MISSION_ITEM_REACHED 46 -MAVPACKED( + typedef struct __mavlink_mission_item_reached_t { - uint16_t seq; /*< Sequence*/ -}) mavlink_mission_item_reached_t; + uint16_t seq; /*< Sequence*/ +} mavlink_mission_item_reached_t; #define MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN 2 #define MAVLINK_MSG_ID_MISSION_ITEM_REACHED_MIN_LEN 2 @@ -41,7 +41,7 @@ typedef struct __mavlink_mission_item_reached_t { * @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 + * @param seq Sequence * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_mission_item_reached_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -69,7 +69,7 @@ static inline uint16_t mavlink_msg_mission_item_reached_pack(uint8_t system_id, * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param seq Sequence + * @param seq Sequence * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_mission_item_reached_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -123,7 +123,7 @@ static inline uint16_t mavlink_msg_mission_item_reached_encode_chan(uint8_t syst * @brief Send a mission_item_reached message * @param chan MAVLink channel to send the message * - * @param seq Sequence + * @param seq Sequence */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -188,7 +188,7 @@ static inline void mavlink_msg_mission_item_reached_send_buf(mavlink_message_t * /** * @brief Get field seq from mission_item_reached message * - * @return Sequence + * @return Sequence */ static inline uint16_t mavlink_msg_mission_item_reached_get_seq(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_mission_request.h b/lib/main/MAVLink/common/mavlink_msg_mission_request.h index 9d6d48ec34..e3b33cc3ec 100755 --- a/lib/main/MAVLink/common/mavlink_msg_mission_request.h +++ b/lib/main/MAVLink/common/mavlink_msg_mission_request.h @@ -3,12 +3,12 @@ #define MAVLINK_MSG_ID_MISSION_REQUEST 40 -MAVPACKED( + typedef struct __mavlink_mission_request_t { - uint16_t seq; /*< Sequence*/ - uint8_t target_system; /*< System ID*/ - uint8_t target_component; /*< Component ID*/ -}) mavlink_mission_request_t; + uint16_t seq; /*< Sequence*/ + uint8_t target_system; /*< System ID*/ + uint8_t target_component; /*< Component ID*/ +} mavlink_mission_request_t; #define MAVLINK_MSG_ID_MISSION_REQUEST_LEN 4 #define MAVLINK_MSG_ID_MISSION_REQUEST_MIN_LEN 4 @@ -25,18 +25,18 @@ typedef struct __mavlink_mission_request_t { 40, \ "MISSION_REQUEST", \ 3, \ - { { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_request_t, seq) }, \ - { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_mission_request_t, target_system) }, \ + { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_mission_request_t, target_system) }, \ { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_mission_request_t, target_component) }, \ + { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_request_t, seq) }, \ } \ } #else #define MAVLINK_MESSAGE_INFO_MISSION_REQUEST { \ "MISSION_REQUEST", \ 3, \ - { { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_request_t, seq) }, \ - { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_mission_request_t, target_system) }, \ + { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_mission_request_t, target_system) }, \ { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_mission_request_t, target_component) }, \ + { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_request_t, seq) }, \ } \ } #endif @@ -47,9 +47,9 @@ typedef struct __mavlink_mission_request_t { * @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 target_system System ID + * @param target_component Component ID + * @param seq Sequence * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_mission_request_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -81,9 +81,9 @@ static inline uint16_t mavlink_msg_mission_request_pack(uint8_t system_id, uint8 * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param target_system System ID - * @param target_component Component ID - * @param seq Sequence + * @param target_system System ID + * @param target_component Component ID + * @param seq Sequence * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_mission_request_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -141,9 +141,9 @@ static inline uint16_t mavlink_msg_mission_request_encode_chan(uint8_t system_id * @brief Send a mission_request message * @param chan MAVLink channel to send the message * - * @param target_system System ID - * @param target_component Component ID - * @param seq Sequence + * @param target_system System ID + * @param target_component Component ID + * @param seq Sequence */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -216,7 +216,7 @@ static inline void mavlink_msg_mission_request_send_buf(mavlink_message_t *msgbu /** * @brief Get field target_system from mission_request message * - * @return System ID + * @return System ID */ static inline uint8_t mavlink_msg_mission_request_get_target_system(const mavlink_message_t* msg) { @@ -226,7 +226,7 @@ static inline uint8_t mavlink_msg_mission_request_get_target_system(const mavlin /** * @brief Get field target_component from mission_request message * - * @return Component ID + * @return Component ID */ static inline uint8_t mavlink_msg_mission_request_get_target_component(const mavlink_message_t* msg) { @@ -236,7 +236,7 @@ static inline uint8_t mavlink_msg_mission_request_get_target_component(const mav /** * @brief Get field seq from mission_request message * - * @return Sequence + * @return Sequence */ static inline uint16_t mavlink_msg_mission_request_get_seq(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_mission_request_int.h b/lib/main/MAVLink/common/mavlink_msg_mission_request_int.h index 3257f94c07..a6c2df9119 100755 --- a/lib/main/MAVLink/common/mavlink_msg_mission_request_int.h +++ b/lib/main/MAVLink/common/mavlink_msg_mission_request_int.h @@ -3,12 +3,12 @@ #define MAVLINK_MSG_ID_MISSION_REQUEST_INT 51 -MAVPACKED( + typedef struct __mavlink_mission_request_int_t { - uint16_t seq; /*< Sequence*/ - uint8_t target_system; /*< System ID*/ - uint8_t target_component; /*< Component ID*/ -}) mavlink_mission_request_int_t; + uint16_t seq; /*< Sequence*/ + uint8_t target_system; /*< System ID*/ + uint8_t target_component; /*< Component ID*/ +} mavlink_mission_request_int_t; #define MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN 4 #define MAVLINK_MSG_ID_MISSION_REQUEST_INT_MIN_LEN 4 @@ -25,18 +25,18 @@ typedef struct __mavlink_mission_request_int_t { 51, \ "MISSION_REQUEST_INT", \ 3, \ - { { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_request_int_t, seq) }, \ - { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_mission_request_int_t, target_system) }, \ + { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_mission_request_int_t, target_system) }, \ { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_mission_request_int_t, target_component) }, \ + { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_request_int_t, seq) }, \ } \ } #else #define MAVLINK_MESSAGE_INFO_MISSION_REQUEST_INT { \ "MISSION_REQUEST_INT", \ 3, \ - { { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_request_int_t, seq) }, \ - { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_mission_request_int_t, target_system) }, \ + { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_mission_request_int_t, target_system) }, \ { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_mission_request_int_t, target_component) }, \ + { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_request_int_t, seq) }, \ } \ } #endif @@ -47,9 +47,9 @@ typedef struct __mavlink_mission_request_int_t { * @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 target_system System ID + * @param target_component Component ID + * @param seq Sequence * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_mission_request_int_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -81,9 +81,9 @@ static inline uint16_t mavlink_msg_mission_request_int_pack(uint8_t system_id, u * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param target_system System ID - * @param target_component Component ID - * @param seq Sequence + * @param target_system System ID + * @param target_component Component ID + * @param seq Sequence * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_mission_request_int_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -141,9 +141,9 @@ static inline uint16_t mavlink_msg_mission_request_int_encode_chan(uint8_t syste * @brief Send a mission_request_int message * @param chan MAVLink channel to send the message * - * @param target_system System ID - * @param target_component Component ID - * @param seq Sequence + * @param target_system System ID + * @param target_component Component ID + * @param seq Sequence */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -216,7 +216,7 @@ static inline void mavlink_msg_mission_request_int_send_buf(mavlink_message_t *m /** * @brief Get field target_system from mission_request_int message * - * @return System ID + * @return System ID */ static inline uint8_t mavlink_msg_mission_request_int_get_target_system(const mavlink_message_t* msg) { @@ -226,7 +226,7 @@ static inline uint8_t mavlink_msg_mission_request_int_get_target_system(const ma /** * @brief Get field target_component from mission_request_int message * - * @return Component ID + * @return Component ID */ static inline uint8_t mavlink_msg_mission_request_int_get_target_component(const mavlink_message_t* msg) { @@ -236,7 +236,7 @@ static inline uint8_t mavlink_msg_mission_request_int_get_target_component(const /** * @brief Get field seq from mission_request_int message * - * @return Sequence + * @return Sequence */ static inline uint16_t mavlink_msg_mission_request_int_get_seq(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_mission_request_list.h b/lib/main/MAVLink/common/mavlink_msg_mission_request_list.h index 64c211ba62..8b6659fde7 100755 --- a/lib/main/MAVLink/common/mavlink_msg_mission_request_list.h +++ b/lib/main/MAVLink/common/mavlink_msg_mission_request_list.h @@ -3,11 +3,11 @@ #define MAVLINK_MSG_ID_MISSION_REQUEST_LIST 43 -MAVPACKED( + typedef struct __mavlink_mission_request_list_t { - uint8_t target_system; /*< System ID*/ - uint8_t target_component; /*< Component ID*/ -}) mavlink_mission_request_list_t; + uint8_t target_system; /*< System ID*/ + uint8_t target_component; /*< Component ID*/ +} mavlink_mission_request_list_t; #define MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN 2 #define MAVLINK_MSG_ID_MISSION_REQUEST_LIST_MIN_LEN 2 @@ -44,8 +44,8 @@ typedef struct __mavlink_mission_request_list_t { * @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 target_system System ID + * @param target_component Component ID * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_mission_request_list_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -75,8 +75,8 @@ static inline uint16_t mavlink_msg_mission_request_list_pack(uint8_t system_id, * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param target_system System ID - * @param target_component Component ID + * @param target_system System ID + * @param target_component Component ID * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_mission_request_list_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -132,8 +132,8 @@ static inline uint16_t mavlink_msg_mission_request_list_encode_chan(uint8_t syst * @brief Send a mission_request_list message * @param chan MAVLink channel to send the message * - * @param target_system System ID - * @param target_component Component ID + * @param target_system System ID + * @param target_component Component ID */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -202,7 +202,7 @@ static inline void mavlink_msg_mission_request_list_send_buf(mavlink_message_t * /** * @brief Get field target_system from mission_request_list message * - * @return System ID + * @return System ID */ static inline uint8_t mavlink_msg_mission_request_list_get_target_system(const mavlink_message_t* msg) { @@ -212,7 +212,7 @@ static inline uint8_t mavlink_msg_mission_request_list_get_target_system(const m /** * @brief Get field target_component from mission_request_list message * - * @return Component ID + * @return Component ID */ static inline uint8_t mavlink_msg_mission_request_list_get_target_component(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_mission_request_partial_list.h b/lib/main/MAVLink/common/mavlink_msg_mission_request_partial_list.h index aa7576321a..0eda74772e 100755 --- a/lib/main/MAVLink/common/mavlink_msg_mission_request_partial_list.h +++ b/lib/main/MAVLink/common/mavlink_msg_mission_request_partial_list.h @@ -3,13 +3,13 @@ #define MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST 37 -MAVPACKED( + typedef struct __mavlink_mission_request_partial_list_t { - int16_t start_index; /*< Start index, 0 by default*/ - int16_t end_index; /*< End index, -1 by default (-1: send list to end). Else a valid index of the list*/ - uint8_t target_system; /*< System ID*/ - uint8_t target_component; /*< Component ID*/ -}) mavlink_mission_request_partial_list_t; + int16_t start_index; /*< Start index*/ + int16_t end_index; /*< End index, -1 by default (-1: send list to end). Else a valid index of the list*/ + uint8_t target_system; /*< System ID*/ + uint8_t target_component; /*< Component ID*/ +} mavlink_mission_request_partial_list_t; #define MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN 6 #define MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_MIN_LEN 6 @@ -26,20 +26,20 @@ typedef struct __mavlink_mission_request_partial_list_t { 37, \ "MISSION_REQUEST_PARTIAL_LIST", \ 4, \ - { { "start_index", NULL, MAVLINK_TYPE_INT16_T, 0, 0, offsetof(mavlink_mission_request_partial_list_t, start_index) }, \ - { "end_index", NULL, MAVLINK_TYPE_INT16_T, 0, 2, offsetof(mavlink_mission_request_partial_list_t, end_index) }, \ - { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_mission_request_partial_list_t, target_system) }, \ + { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_mission_request_partial_list_t, target_system) }, \ { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_mission_request_partial_list_t, target_component) }, \ + { "start_index", NULL, MAVLINK_TYPE_INT16_T, 0, 0, offsetof(mavlink_mission_request_partial_list_t, start_index) }, \ + { "end_index", NULL, MAVLINK_TYPE_INT16_T, 0, 2, offsetof(mavlink_mission_request_partial_list_t, end_index) }, \ } \ } #else #define MAVLINK_MESSAGE_INFO_MISSION_REQUEST_PARTIAL_LIST { \ "MISSION_REQUEST_PARTIAL_LIST", \ 4, \ - { { "start_index", NULL, MAVLINK_TYPE_INT16_T, 0, 0, offsetof(mavlink_mission_request_partial_list_t, start_index) }, \ - { "end_index", NULL, MAVLINK_TYPE_INT16_T, 0, 2, offsetof(mavlink_mission_request_partial_list_t, end_index) }, \ - { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_mission_request_partial_list_t, target_system) }, \ + { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_mission_request_partial_list_t, target_system) }, \ { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_mission_request_partial_list_t, target_component) }, \ + { "start_index", NULL, MAVLINK_TYPE_INT16_T, 0, 0, offsetof(mavlink_mission_request_partial_list_t, start_index) }, \ + { "end_index", NULL, MAVLINK_TYPE_INT16_T, 0, 2, offsetof(mavlink_mission_request_partial_list_t, end_index) }, \ } \ } #endif @@ -50,10 +50,10 @@ typedef struct __mavlink_mission_request_partial_list_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param target_system System ID - * @param target_component Component ID - * @param start_index Start index, 0 by default - * @param end_index End index, -1 by default (-1: send list to end). Else a valid index of the list + * @param target_system System ID + * @param target_component Component ID + * @param start_index Start index + * @param end_index End index, -1 by default (-1: send list to end). Else a valid index of the list * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_mission_request_partial_list_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -87,10 +87,10 @@ static inline uint16_t mavlink_msg_mission_request_partial_list_pack(uint8_t sys * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param target_system System ID - * @param target_component Component ID - * @param start_index Start index, 0 by default - * @param end_index End index, -1 by default (-1: send list to end). Else a valid index of the list + * @param target_system System ID + * @param target_component Component ID + * @param start_index Start index + * @param end_index End index, -1 by default (-1: send list to end). Else a valid index of the list * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_mission_request_partial_list_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -150,10 +150,10 @@ static inline uint16_t mavlink_msg_mission_request_partial_list_encode_chan(uint * @brief Send a mission_request_partial_list message * @param chan MAVLink channel to send the message * - * @param target_system System ID - * @param target_component Component ID - * @param start_index Start index, 0 by default - * @param end_index End index, -1 by default (-1: send list to end). Else a valid index of the list + * @param target_system System ID + * @param target_component Component ID + * @param start_index Start index + * @param end_index End index, -1 by default (-1: send list to end). Else a valid index of the list */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -230,7 +230,7 @@ static inline void mavlink_msg_mission_request_partial_list_send_buf(mavlink_mes /** * @brief Get field target_system from mission_request_partial_list message * - * @return System ID + * @return System ID */ static inline uint8_t mavlink_msg_mission_request_partial_list_get_target_system(const mavlink_message_t* msg) { @@ -240,7 +240,7 @@ static inline uint8_t mavlink_msg_mission_request_partial_list_get_target_system /** * @brief Get field target_component from mission_request_partial_list message * - * @return Component ID + * @return Component ID */ static inline uint8_t mavlink_msg_mission_request_partial_list_get_target_component(const mavlink_message_t* msg) { @@ -250,7 +250,7 @@ static inline uint8_t mavlink_msg_mission_request_partial_list_get_target_compon /** * @brief Get field start_index from mission_request_partial_list message * - * @return Start index, 0 by default + * @return Start index */ static inline int16_t mavlink_msg_mission_request_partial_list_get_start_index(const mavlink_message_t* msg) { @@ -260,7 +260,7 @@ static inline int16_t mavlink_msg_mission_request_partial_list_get_start_index(c /** * @brief Get field end_index from mission_request_partial_list message * - * @return End index, -1 by default (-1: send list to end). Else a valid index of the list + * @return End index, -1 by default (-1: send list to end). Else a valid index of the list */ static inline int16_t mavlink_msg_mission_request_partial_list_get_end_index(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_mission_set_current.h b/lib/main/MAVLink/common/mavlink_msg_mission_set_current.h index 50942fc443..41eeba3f58 100755 --- a/lib/main/MAVLink/common/mavlink_msg_mission_set_current.h +++ b/lib/main/MAVLink/common/mavlink_msg_mission_set_current.h @@ -3,12 +3,12 @@ #define MAVLINK_MSG_ID_MISSION_SET_CURRENT 41 -MAVPACKED( + typedef struct __mavlink_mission_set_current_t { - uint16_t seq; /*< Sequence*/ - uint8_t target_system; /*< System ID*/ - uint8_t target_component; /*< Component ID*/ -}) mavlink_mission_set_current_t; + uint16_t seq; /*< Sequence*/ + uint8_t target_system; /*< System ID*/ + uint8_t target_component; /*< Component ID*/ +} mavlink_mission_set_current_t; #define MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN 4 #define MAVLINK_MSG_ID_MISSION_SET_CURRENT_MIN_LEN 4 @@ -25,18 +25,18 @@ typedef struct __mavlink_mission_set_current_t { 41, \ "MISSION_SET_CURRENT", \ 3, \ - { { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_set_current_t, seq) }, \ - { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_mission_set_current_t, target_system) }, \ + { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_mission_set_current_t, target_system) }, \ { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_mission_set_current_t, target_component) }, \ + { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_set_current_t, seq) }, \ } \ } #else #define MAVLINK_MESSAGE_INFO_MISSION_SET_CURRENT { \ "MISSION_SET_CURRENT", \ 3, \ - { { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_set_current_t, seq) }, \ - { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_mission_set_current_t, target_system) }, \ + { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_mission_set_current_t, target_system) }, \ { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_mission_set_current_t, target_component) }, \ + { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_set_current_t, seq) }, \ } \ } #endif @@ -47,9 +47,9 @@ typedef struct __mavlink_mission_set_current_t { * @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 target_system System ID + * @param target_component Component ID + * @param seq Sequence * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_mission_set_current_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -81,9 +81,9 @@ static inline uint16_t mavlink_msg_mission_set_current_pack(uint8_t system_id, u * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param target_system System ID - * @param target_component Component ID - * @param seq Sequence + * @param target_system System ID + * @param target_component Component ID + * @param seq Sequence * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_mission_set_current_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -141,9 +141,9 @@ static inline uint16_t mavlink_msg_mission_set_current_encode_chan(uint8_t syste * @brief Send a mission_set_current message * @param chan MAVLink channel to send the message * - * @param target_system System ID - * @param target_component Component ID - * @param seq Sequence + * @param target_system System ID + * @param target_component Component ID + * @param seq Sequence */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -216,7 +216,7 @@ static inline void mavlink_msg_mission_set_current_send_buf(mavlink_message_t *m /** * @brief Get field target_system from mission_set_current message * - * @return System ID + * @return System ID */ static inline uint8_t mavlink_msg_mission_set_current_get_target_system(const mavlink_message_t* msg) { @@ -226,7 +226,7 @@ static inline uint8_t mavlink_msg_mission_set_current_get_target_system(const ma /** * @brief Get field target_component from mission_set_current message * - * @return Component ID + * @return Component ID */ static inline uint8_t mavlink_msg_mission_set_current_get_target_component(const mavlink_message_t* msg) { @@ -236,7 +236,7 @@ static inline uint8_t mavlink_msg_mission_set_current_get_target_component(const /** * @brief Get field seq from mission_set_current message * - * @return Sequence + * @return Sequence */ static inline uint16_t mavlink_msg_mission_set_current_get_seq(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_mission_write_partial_list.h b/lib/main/MAVLink/common/mavlink_msg_mission_write_partial_list.h index 756941b408..c1ede1b215 100755 --- a/lib/main/MAVLink/common/mavlink_msg_mission_write_partial_list.h +++ b/lib/main/MAVLink/common/mavlink_msg_mission_write_partial_list.h @@ -3,13 +3,13 @@ #define MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST 38 -MAVPACKED( + typedef struct __mavlink_mission_write_partial_list_t { - int16_t start_index; /*< Start index, 0 by default and smaller / equal to the largest index of the current onboard list.*/ - int16_t end_index; /*< End index, equal or greater than start index.*/ - uint8_t target_system; /*< System ID*/ - uint8_t target_component; /*< Component ID*/ -}) mavlink_mission_write_partial_list_t; + int16_t start_index; /*< Start index. Must be smaller / equal to the largest index of the current onboard list.*/ + int16_t end_index; /*< End index, equal or greater than start index.*/ + uint8_t target_system; /*< System ID*/ + uint8_t target_component; /*< Component ID*/ +} mavlink_mission_write_partial_list_t; #define MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN 6 #define MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_MIN_LEN 6 @@ -26,20 +26,20 @@ typedef struct __mavlink_mission_write_partial_list_t { 38, \ "MISSION_WRITE_PARTIAL_LIST", \ 4, \ - { { "start_index", NULL, MAVLINK_TYPE_INT16_T, 0, 0, offsetof(mavlink_mission_write_partial_list_t, start_index) }, \ - { "end_index", NULL, MAVLINK_TYPE_INT16_T, 0, 2, offsetof(mavlink_mission_write_partial_list_t, end_index) }, \ - { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_mission_write_partial_list_t, target_system) }, \ + { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_mission_write_partial_list_t, target_system) }, \ { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_mission_write_partial_list_t, target_component) }, \ + { "start_index", NULL, MAVLINK_TYPE_INT16_T, 0, 0, offsetof(mavlink_mission_write_partial_list_t, start_index) }, \ + { "end_index", NULL, MAVLINK_TYPE_INT16_T, 0, 2, offsetof(mavlink_mission_write_partial_list_t, end_index) }, \ } \ } #else #define MAVLINK_MESSAGE_INFO_MISSION_WRITE_PARTIAL_LIST { \ "MISSION_WRITE_PARTIAL_LIST", \ 4, \ - { { "start_index", NULL, MAVLINK_TYPE_INT16_T, 0, 0, offsetof(mavlink_mission_write_partial_list_t, start_index) }, \ - { "end_index", NULL, MAVLINK_TYPE_INT16_T, 0, 2, offsetof(mavlink_mission_write_partial_list_t, end_index) }, \ - { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_mission_write_partial_list_t, target_system) }, \ + { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_mission_write_partial_list_t, target_system) }, \ { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_mission_write_partial_list_t, target_component) }, \ + { "start_index", NULL, MAVLINK_TYPE_INT16_T, 0, 0, offsetof(mavlink_mission_write_partial_list_t, start_index) }, \ + { "end_index", NULL, MAVLINK_TYPE_INT16_T, 0, 2, offsetof(mavlink_mission_write_partial_list_t, end_index) }, \ } \ } #endif @@ -50,10 +50,10 @@ typedef struct __mavlink_mission_write_partial_list_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param target_system System ID - * @param target_component Component ID - * @param start_index Start index, 0 by default and smaller / equal to the largest index of the current onboard list. - * @param end_index End index, equal or greater than start index. + * @param target_system System ID + * @param target_component Component ID + * @param start_index Start index. Must be smaller / equal to the largest index of the current onboard list. + * @param end_index End index, equal or greater than start index. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_mission_write_partial_list_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -87,10 +87,10 @@ static inline uint16_t mavlink_msg_mission_write_partial_list_pack(uint8_t syste * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param target_system System ID - * @param target_component Component ID - * @param start_index Start index, 0 by default and smaller / equal to the largest index of the current onboard list. - * @param end_index End index, equal or greater than start index. + * @param target_system System ID + * @param target_component Component ID + * @param start_index Start index. Must be smaller / equal to the largest index of the current onboard list. + * @param end_index End index, equal or greater than start index. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_mission_write_partial_list_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -150,10 +150,10 @@ static inline uint16_t mavlink_msg_mission_write_partial_list_encode_chan(uint8_ * @brief Send a mission_write_partial_list message * @param chan MAVLink channel to send the message * - * @param target_system System ID - * @param target_component Component ID - * @param start_index Start index, 0 by default and smaller / equal to the largest index of the current onboard list. - * @param end_index End index, equal or greater than start index. + * @param target_system System ID + * @param target_component Component ID + * @param start_index Start index. Must be smaller / equal to the largest index of the current onboard list. + * @param end_index End index, equal or greater than start index. */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -230,7 +230,7 @@ static inline void mavlink_msg_mission_write_partial_list_send_buf(mavlink_messa /** * @brief Get field target_system from mission_write_partial_list message * - * @return System ID + * @return System ID */ static inline uint8_t mavlink_msg_mission_write_partial_list_get_target_system(const mavlink_message_t* msg) { @@ -240,7 +240,7 @@ static inline uint8_t mavlink_msg_mission_write_partial_list_get_target_system(c /** * @brief Get field target_component from mission_write_partial_list message * - * @return Component ID + * @return Component ID */ static inline uint8_t mavlink_msg_mission_write_partial_list_get_target_component(const mavlink_message_t* msg) { @@ -250,7 +250,7 @@ static inline uint8_t mavlink_msg_mission_write_partial_list_get_target_componen /** * @brief Get field start_index from mission_write_partial_list message * - * @return Start index, 0 by default and smaller / equal to the largest index of the current onboard list. + * @return Start index. Must be smaller / equal to the largest index of the current onboard list. */ static inline int16_t mavlink_msg_mission_write_partial_list_get_start_index(const mavlink_message_t* msg) { @@ -260,7 +260,7 @@ static inline int16_t mavlink_msg_mission_write_partial_list_get_start_index(con /** * @brief Get field end_index from mission_write_partial_list message * - * @return End index, equal or greater than start index. + * @return End index, equal or greater than start index. */ static inline int16_t mavlink_msg_mission_write_partial_list_get_end_index(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_named_value_float.h b/lib/main/MAVLink/common/mavlink_msg_named_value_float.h index 99cf094940..ac3e8382ff 100755 --- a/lib/main/MAVLink/common/mavlink_msg_named_value_float.h +++ b/lib/main/MAVLink/common/mavlink_msg_named_value_float.h @@ -3,12 +3,12 @@ #define MAVLINK_MSG_ID_NAMED_VALUE_FLOAT 251 -MAVPACKED( + typedef struct __mavlink_named_value_float_t { - uint32_t time_boot_ms; /*< Timestamp (milliseconds since system boot)*/ - float value; /*< Floating point value*/ - char name[10]; /*< Name of the debug variable*/ -}) mavlink_named_value_float_t; + uint32_t time_boot_ms; /*< [ms] Timestamp (time since system boot).*/ + float value; /*< Floating point value*/ + char name[10]; /*< Name of the debug variable*/ +} mavlink_named_value_float_t; #define MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN 18 #define MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_MIN_LEN 18 @@ -26,8 +26,8 @@ typedef struct __mavlink_named_value_float_t { "NAMED_VALUE_FLOAT", \ 3, \ { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_named_value_float_t, time_boot_ms) }, \ - { "value", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_named_value_float_t, value) }, \ { "name", NULL, MAVLINK_TYPE_CHAR, 10, 8, offsetof(mavlink_named_value_float_t, name) }, \ + { "value", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_named_value_float_t, value) }, \ } \ } #else @@ -35,8 +35,8 @@ typedef struct __mavlink_named_value_float_t { "NAMED_VALUE_FLOAT", \ 3, \ { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_named_value_float_t, time_boot_ms) }, \ - { "value", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_named_value_float_t, value) }, \ { "name", NULL, MAVLINK_TYPE_CHAR, 10, 8, offsetof(mavlink_named_value_float_t, name) }, \ + { "value", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_named_value_float_t, value) }, \ } \ } #endif @@ -47,9 +47,9 @@ typedef struct __mavlink_named_value_float_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param time_boot_ms Timestamp (milliseconds since system boot) - * @param name Name of the debug variable - * @param value Floating point value + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param name Name of the debug variable + * @param value Floating point value * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_named_value_float_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -79,9 +79,9 @@ static inline uint16_t mavlink_msg_named_value_float_pack(uint8_t system_id, uin * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param time_boot_ms Timestamp (milliseconds since system boot) - * @param name Name of the debug variable - * @param value Floating point value + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param name Name of the debug variable + * @param value Floating point value * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_named_value_float_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -137,9 +137,9 @@ static inline uint16_t mavlink_msg_named_value_float_encode_chan(uint8_t system_ * @brief Send a named_value_float message * @param chan MAVLink channel to send the message * - * @param time_boot_ms Timestamp (milliseconds since system boot) - * @param name Name of the debug variable - * @param value Floating point value + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param name Name of the debug variable + * @param value Floating point value */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -208,7 +208,7 @@ static inline void mavlink_msg_named_value_float_send_buf(mavlink_message_t *msg /** * @brief Get field time_boot_ms from named_value_float message * - * @return Timestamp (milliseconds since system boot) + * @return [ms] Timestamp (time since system boot). */ static inline uint32_t mavlink_msg_named_value_float_get_time_boot_ms(const mavlink_message_t* msg) { @@ -218,7 +218,7 @@ static inline uint32_t mavlink_msg_named_value_float_get_time_boot_ms(const mavl /** * @brief Get field name from named_value_float message * - * @return Name of the debug variable + * @return Name of the debug variable */ static inline uint16_t mavlink_msg_named_value_float_get_name(const mavlink_message_t* msg, char *name) { @@ -228,7 +228,7 @@ static inline uint16_t mavlink_msg_named_value_float_get_name(const mavlink_mess /** * @brief Get field value from named_value_float message * - * @return Floating point value + * @return Floating point value */ static inline float mavlink_msg_named_value_float_get_value(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_named_value_int.h b/lib/main/MAVLink/common/mavlink_msg_named_value_int.h index b0b3b96603..32dbdc91ce 100755 --- a/lib/main/MAVLink/common/mavlink_msg_named_value_int.h +++ b/lib/main/MAVLink/common/mavlink_msg_named_value_int.h @@ -3,12 +3,12 @@ #define MAVLINK_MSG_ID_NAMED_VALUE_INT 252 -MAVPACKED( + typedef struct __mavlink_named_value_int_t { - uint32_t time_boot_ms; /*< Timestamp (milliseconds since system boot)*/ - int32_t value; /*< Signed integer value*/ - char name[10]; /*< Name of the debug variable*/ -}) mavlink_named_value_int_t; + uint32_t time_boot_ms; /*< [ms] Timestamp (time since system boot).*/ + int32_t value; /*< Signed integer value*/ + char name[10]; /*< Name of the debug variable*/ +} mavlink_named_value_int_t; #define MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN 18 #define MAVLINK_MSG_ID_NAMED_VALUE_INT_MIN_LEN 18 @@ -26,8 +26,8 @@ typedef struct __mavlink_named_value_int_t { "NAMED_VALUE_INT", \ 3, \ { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_named_value_int_t, time_boot_ms) }, \ - { "value", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_named_value_int_t, value) }, \ { "name", NULL, MAVLINK_TYPE_CHAR, 10, 8, offsetof(mavlink_named_value_int_t, name) }, \ + { "value", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_named_value_int_t, value) }, \ } \ } #else @@ -35,8 +35,8 @@ typedef struct __mavlink_named_value_int_t { "NAMED_VALUE_INT", \ 3, \ { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_named_value_int_t, time_boot_ms) }, \ - { "value", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_named_value_int_t, value) }, \ { "name", NULL, MAVLINK_TYPE_CHAR, 10, 8, offsetof(mavlink_named_value_int_t, name) }, \ + { "value", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_named_value_int_t, value) }, \ } \ } #endif @@ -47,9 +47,9 @@ typedef struct __mavlink_named_value_int_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param time_boot_ms Timestamp (milliseconds since system boot) - * @param name Name of the debug variable - * @param value Signed integer value + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param name Name of the debug variable + * @param value Signed integer value * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_named_value_int_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -79,9 +79,9 @@ static inline uint16_t mavlink_msg_named_value_int_pack(uint8_t system_id, uint8 * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param time_boot_ms Timestamp (milliseconds since system boot) - * @param name Name of the debug variable - * @param value Signed integer value + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param name Name of the debug variable + * @param value Signed integer value * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_named_value_int_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -137,9 +137,9 @@ static inline uint16_t mavlink_msg_named_value_int_encode_chan(uint8_t system_id * @brief Send a named_value_int message * @param chan MAVLink channel to send the message * - * @param time_boot_ms Timestamp (milliseconds since system boot) - * @param name Name of the debug variable - * @param value Signed integer value + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param name Name of the debug variable + * @param value Signed integer value */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -208,7 +208,7 @@ static inline void mavlink_msg_named_value_int_send_buf(mavlink_message_t *msgbu /** * @brief Get field time_boot_ms from named_value_int message * - * @return Timestamp (milliseconds since system boot) + * @return [ms] Timestamp (time since system boot). */ static inline uint32_t mavlink_msg_named_value_int_get_time_boot_ms(const mavlink_message_t* msg) { @@ -218,7 +218,7 @@ static inline uint32_t mavlink_msg_named_value_int_get_time_boot_ms(const mavlin /** * @brief Get field name from named_value_int message * - * @return Name of the debug variable + * @return Name of the debug variable */ static inline uint16_t mavlink_msg_named_value_int_get_name(const mavlink_message_t* msg, char *name) { @@ -228,7 +228,7 @@ static inline uint16_t mavlink_msg_named_value_int_get_name(const mavlink_messag /** * @brief Get field value from named_value_int message * - * @return Signed integer value + * @return Signed integer value */ static inline int32_t mavlink_msg_named_value_int_get_value(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_nav_controller_output.h b/lib/main/MAVLink/common/mavlink_msg_nav_controller_output.h index 5f2d40f60d..2d9e8c0c5c 100755 --- a/lib/main/MAVLink/common/mavlink_msg_nav_controller_output.h +++ b/lib/main/MAVLink/common/mavlink_msg_nav_controller_output.h @@ -3,17 +3,17 @@ #define MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT 62 -MAVPACKED( + typedef struct __mavlink_nav_controller_output_t { - float nav_roll; /*< Current desired roll in degrees*/ - float nav_pitch; /*< Current desired pitch in degrees*/ - float alt_error; /*< Current altitude error in meters*/ - float aspd_error; /*< Current airspeed error in meters/second*/ - float xtrack_error; /*< Current crosstrack error on x-y plane in meters*/ - int16_t nav_bearing; /*< Current desired heading in degrees*/ - int16_t target_bearing; /*< Bearing to current MISSION/target in degrees*/ - uint16_t wp_dist; /*< Distance to active MISSION in meters*/ -}) mavlink_nav_controller_output_t; + float nav_roll; /*< [deg] Current desired roll*/ + float nav_pitch; /*< [deg] Current desired pitch*/ + float alt_error; /*< [m] Current altitude error*/ + float aspd_error; /*< [m/s] Current airspeed error*/ + float xtrack_error; /*< [m] Current crosstrack error on x-y plane*/ + int16_t nav_bearing; /*< [deg] Current desired heading*/ + int16_t target_bearing; /*< [deg] Bearing to current waypoint/target*/ + uint16_t wp_dist; /*< [m] Distance to active waypoint*/ +} mavlink_nav_controller_output_t; #define MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN 26 #define MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_MIN_LEN 26 @@ -32,12 +32,12 @@ typedef struct __mavlink_nav_controller_output_t { 8, \ { { "nav_roll", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_nav_controller_output_t, nav_roll) }, \ { "nav_pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_nav_controller_output_t, nav_pitch) }, \ - { "alt_error", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_nav_controller_output_t, alt_error) }, \ - { "aspd_error", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_nav_controller_output_t, aspd_error) }, \ - { "xtrack_error", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_nav_controller_output_t, xtrack_error) }, \ { "nav_bearing", NULL, MAVLINK_TYPE_INT16_T, 0, 20, offsetof(mavlink_nav_controller_output_t, nav_bearing) }, \ { "target_bearing", NULL, MAVLINK_TYPE_INT16_T, 0, 22, offsetof(mavlink_nav_controller_output_t, target_bearing) }, \ { "wp_dist", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_nav_controller_output_t, wp_dist) }, \ + { "alt_error", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_nav_controller_output_t, alt_error) }, \ + { "aspd_error", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_nav_controller_output_t, aspd_error) }, \ + { "xtrack_error", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_nav_controller_output_t, xtrack_error) }, \ } \ } #else @@ -46,12 +46,12 @@ typedef struct __mavlink_nav_controller_output_t { 8, \ { { "nav_roll", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_nav_controller_output_t, nav_roll) }, \ { "nav_pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_nav_controller_output_t, nav_pitch) }, \ - { "alt_error", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_nav_controller_output_t, alt_error) }, \ - { "aspd_error", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_nav_controller_output_t, aspd_error) }, \ - { "xtrack_error", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_nav_controller_output_t, xtrack_error) }, \ { "nav_bearing", NULL, MAVLINK_TYPE_INT16_T, 0, 20, offsetof(mavlink_nav_controller_output_t, nav_bearing) }, \ { "target_bearing", NULL, MAVLINK_TYPE_INT16_T, 0, 22, offsetof(mavlink_nav_controller_output_t, target_bearing) }, \ { "wp_dist", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_nav_controller_output_t, wp_dist) }, \ + { "alt_error", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_nav_controller_output_t, alt_error) }, \ + { "aspd_error", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_nav_controller_output_t, aspd_error) }, \ + { "xtrack_error", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_nav_controller_output_t, xtrack_error) }, \ } \ } #endif @@ -62,14 +62,14 @@ typedef struct __mavlink_nav_controller_output_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param nav_roll Current desired roll in degrees - * @param nav_pitch Current desired pitch in degrees - * @param nav_bearing Current desired heading in degrees - * @param target_bearing Bearing to current MISSION/target in degrees - * @param wp_dist Distance to active MISSION in meters - * @param alt_error Current altitude error in meters - * @param aspd_error Current airspeed error in meters/second - * @param xtrack_error Current crosstrack error on x-y plane in meters + * @param nav_roll [deg] Current desired roll + * @param nav_pitch [deg] Current desired pitch + * @param nav_bearing [deg] Current desired heading + * @param target_bearing [deg] Bearing to current waypoint/target + * @param wp_dist [m] Distance to active waypoint + * @param alt_error [m] Current altitude error + * @param aspd_error [m/s] Current airspeed error + * @param xtrack_error [m] Current crosstrack error on x-y plane * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_nav_controller_output_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -111,14 +111,14 @@ static inline uint16_t mavlink_msg_nav_controller_output_pack(uint8_t system_id, * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param nav_roll Current desired roll in degrees - * @param nav_pitch Current desired pitch in degrees - * @param nav_bearing Current desired heading in degrees - * @param target_bearing Bearing to current MISSION/target in degrees - * @param wp_dist Distance to active MISSION in meters - * @param alt_error Current altitude error in meters - * @param aspd_error Current airspeed error in meters/second - * @param xtrack_error Current crosstrack error on x-y plane in meters + * @param nav_roll [deg] Current desired roll + * @param nav_pitch [deg] Current desired pitch + * @param nav_bearing [deg] Current desired heading + * @param target_bearing [deg] Bearing to current waypoint/target + * @param wp_dist [m] Distance to active waypoint + * @param alt_error [m] Current altitude error + * @param aspd_error [m/s] Current airspeed error + * @param xtrack_error [m] Current crosstrack error on x-y plane * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_nav_controller_output_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -186,14 +186,14 @@ static inline uint16_t mavlink_msg_nav_controller_output_encode_chan(uint8_t sys * @brief Send a nav_controller_output message * @param chan MAVLink channel to send the message * - * @param nav_roll Current desired roll in degrees - * @param nav_pitch Current desired pitch in degrees - * @param nav_bearing Current desired heading in degrees - * @param target_bearing Bearing to current MISSION/target in degrees - * @param wp_dist Distance to active MISSION in meters - * @param alt_error Current altitude error in meters - * @param aspd_error Current airspeed error in meters/second - * @param xtrack_error Current crosstrack error on x-y plane in meters + * @param nav_roll [deg] Current desired roll + * @param nav_pitch [deg] Current desired pitch + * @param nav_bearing [deg] Current desired heading + * @param target_bearing [deg] Bearing to current waypoint/target + * @param wp_dist [m] Distance to active waypoint + * @param alt_error [m] Current altitude error + * @param aspd_error [m/s] Current airspeed error + * @param xtrack_error [m] Current crosstrack error on x-y plane */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -286,7 +286,7 @@ static inline void mavlink_msg_nav_controller_output_send_buf(mavlink_message_t /** * @brief Get field nav_roll from nav_controller_output message * - * @return Current desired roll in degrees + * @return [deg] Current desired roll */ static inline float mavlink_msg_nav_controller_output_get_nav_roll(const mavlink_message_t* msg) { @@ -296,7 +296,7 @@ static inline float mavlink_msg_nav_controller_output_get_nav_roll(const mavlink /** * @brief Get field nav_pitch from nav_controller_output message * - * @return Current desired pitch in degrees + * @return [deg] Current desired pitch */ static inline float mavlink_msg_nav_controller_output_get_nav_pitch(const mavlink_message_t* msg) { @@ -306,7 +306,7 @@ static inline float mavlink_msg_nav_controller_output_get_nav_pitch(const mavlin /** * @brief Get field nav_bearing from nav_controller_output message * - * @return Current desired heading in degrees + * @return [deg] Current desired heading */ static inline int16_t mavlink_msg_nav_controller_output_get_nav_bearing(const mavlink_message_t* msg) { @@ -316,7 +316,7 @@ static inline int16_t mavlink_msg_nav_controller_output_get_nav_bearing(const ma /** * @brief Get field target_bearing from nav_controller_output message * - * @return Bearing to current MISSION/target in degrees + * @return [deg] Bearing to current waypoint/target */ static inline int16_t mavlink_msg_nav_controller_output_get_target_bearing(const mavlink_message_t* msg) { @@ -326,7 +326,7 @@ static inline int16_t mavlink_msg_nav_controller_output_get_target_bearing(const /** * @brief Get field wp_dist from nav_controller_output message * - * @return Distance to active MISSION in meters + * @return [m] Distance to active waypoint */ static inline uint16_t mavlink_msg_nav_controller_output_get_wp_dist(const mavlink_message_t* msg) { @@ -336,7 +336,7 @@ static inline uint16_t mavlink_msg_nav_controller_output_get_wp_dist(const mavli /** * @brief Get field alt_error from nav_controller_output message * - * @return Current altitude error in meters + * @return [m] Current altitude error */ static inline float mavlink_msg_nav_controller_output_get_alt_error(const mavlink_message_t* msg) { @@ -346,7 +346,7 @@ static inline float mavlink_msg_nav_controller_output_get_alt_error(const mavlin /** * @brief Get field aspd_error from nav_controller_output message * - * @return Current airspeed error in meters/second + * @return [m/s] Current airspeed error */ static inline float mavlink_msg_nav_controller_output_get_aspd_error(const mavlink_message_t* msg) { @@ -356,7 +356,7 @@ static inline float mavlink_msg_nav_controller_output_get_aspd_error(const mavli /** * @brief Get field xtrack_error from nav_controller_output message * - * @return Current crosstrack error on x-y plane in meters + * @return [m] Current crosstrack error on x-y plane */ static inline float mavlink_msg_nav_controller_output_get_xtrack_error(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_optical_flow.h b/lib/main/MAVLink/common/mavlink_msg_optical_flow.h index 56b9a3c676..56082216f9 100755 --- a/lib/main/MAVLink/common/mavlink_msg_optical_flow.h +++ b/lib/main/MAVLink/common/mavlink_msg_optical_flow.h @@ -3,17 +3,17 @@ #define MAVLINK_MSG_ID_OPTICAL_FLOW 100 -MAVPACKED( + typedef struct __mavlink_optical_flow_t { - uint64_t time_usec; /*< Timestamp (UNIX)*/ - float flow_comp_m_x; /*< Flow in meters in x-sensor direction, angular-speed compensated*/ - float flow_comp_m_y; /*< Flow in meters in y-sensor direction, angular-speed compensated*/ - float ground_distance; /*< Ground distance in meters. Positive value: distance known. Negative value: Unknown distance*/ - int16_t flow_x; /*< Flow in pixels * 10 in x-sensor direction (dezi-pixels)*/ - int16_t flow_y; /*< Flow in pixels * 10 in y-sensor direction (dezi-pixels)*/ - uint8_t sensor_id; /*< Sensor ID*/ - uint8_t quality; /*< Optical flow quality / confidence. 0: bad, 255: maximum quality*/ -}) mavlink_optical_flow_t; + uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.*/ + float flow_comp_m_x; /*< [m/s] Flow in x-sensor direction, angular-speed compensated*/ + float flow_comp_m_y; /*< [m/s] Flow in y-sensor direction, angular-speed compensated*/ + float ground_distance; /*< [m] Ground distance. Positive value: distance known. Negative value: Unknown distance*/ + int16_t flow_x; /*< [dpix] Flow in x-sensor direction*/ + int16_t flow_y; /*< [dpix] Flow 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 26 #define MAVLINK_MSG_ID_OPTICAL_FLOW_MIN_LEN 26 @@ -31,13 +31,13 @@ typedef struct __mavlink_optical_flow_t { "OPTICAL_FLOW", \ 8, \ { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_optical_flow_t, time_usec) }, \ - { "flow_comp_m_x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_optical_flow_t, flow_comp_m_x) }, \ - { "flow_comp_m_y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_optical_flow_t, flow_comp_m_y) }, \ - { "ground_distance", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_optical_flow_t, ground_distance) }, \ + { "sensor_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 24, offsetof(mavlink_optical_flow_t, sensor_id) }, \ { "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) }, \ + { "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) }, \ { "quality", NULL, MAVLINK_TYPE_UINT8_T, 0, 25, offsetof(mavlink_optical_flow_t, quality) }, \ + { "ground_distance", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_optical_flow_t, ground_distance) }, \ } \ } #else @@ -45,13 +45,13 @@ typedef struct __mavlink_optical_flow_t { "OPTICAL_FLOW", \ 8, \ { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_optical_flow_t, time_usec) }, \ - { "flow_comp_m_x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_optical_flow_t, flow_comp_m_x) }, \ - { "flow_comp_m_y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_optical_flow_t, flow_comp_m_y) }, \ - { "ground_distance", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_optical_flow_t, ground_distance) }, \ + { "sensor_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 24, offsetof(mavlink_optical_flow_t, sensor_id) }, \ { "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) }, \ + { "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) }, \ { "quality", NULL, MAVLINK_TYPE_UINT8_T, 0, 25, offsetof(mavlink_optical_flow_t, quality) }, \ + { "ground_distance", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_optical_flow_t, ground_distance) }, \ } \ } #endif @@ -62,14 +62,14 @@ typedef struct __mavlink_optical_flow_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param time_usec Timestamp (UNIX) - * @param sensor_id Sensor ID - * @param flow_x Flow in pixels * 10 in x-sensor direction (dezi-pixels) - * @param flow_y Flow in pixels * 10 in y-sensor direction (dezi-pixels) - * @param flow_comp_m_x Flow in meters in x-sensor direction, angular-speed compensated - * @param flow_comp_m_y Flow in meters in y-sensor direction, angular-speed compensated - * @param quality Optical flow quality / confidence. 0: bad, 255: maximum quality - * @param ground_distance Ground distance in meters. Positive value: distance known. Negative value: Unknown distance + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param sensor_id Sensor ID + * @param flow_x [dpix] Flow in x-sensor direction + * @param flow_y [dpix] Flow in y-sensor direction + * @param flow_comp_m_x [m/s] Flow in x-sensor direction, angular-speed compensated + * @param flow_comp_m_y [m/s] Flow in y-sensor direction, angular-speed compensated + * @param quality Optical flow quality / confidence. 0: bad, 255: maximum quality + * @param ground_distance [m] Ground distance. 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, @@ -111,14 +111,14 @@ static inline uint16_t mavlink_msg_optical_flow_pack(uint8_t system_id, uint8_t * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param time_usec Timestamp (UNIX) - * @param sensor_id Sensor ID - * @param flow_x Flow in pixels * 10 in x-sensor direction (dezi-pixels) - * @param flow_y Flow in pixels * 10 in y-sensor direction (dezi-pixels) - * @param flow_comp_m_x Flow in meters in x-sensor direction, angular-speed compensated - * @param flow_comp_m_y Flow in meters in y-sensor direction, angular-speed compensated - * @param quality Optical flow quality / confidence. 0: bad, 255: maximum quality - * @param ground_distance Ground distance in meters. Positive value: distance known. Negative value: Unknown distance + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param sensor_id Sensor ID + * @param flow_x [dpix] Flow in x-sensor direction + * @param flow_y [dpix] Flow in y-sensor direction + * @param flow_comp_m_x [m/s] Flow in x-sensor direction, angular-speed compensated + * @param flow_comp_m_y [m/s] Flow in y-sensor direction, angular-speed compensated + * @param quality Optical flow quality / confidence. 0: bad, 255: maximum quality + * @param ground_distance [m] Ground distance. 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, @@ -186,14 +186,14 @@ static inline uint16_t mavlink_msg_optical_flow_encode_chan(uint8_t system_id, u * @brief Send a optical_flow message * @param chan MAVLink channel to send the message * - * @param time_usec Timestamp (UNIX) - * @param sensor_id Sensor ID - * @param flow_x Flow in pixels * 10 in x-sensor direction (dezi-pixels) - * @param flow_y Flow in pixels * 10 in y-sensor direction (dezi-pixels) - * @param flow_comp_m_x Flow in meters in x-sensor direction, angular-speed compensated - * @param flow_comp_m_y Flow in meters in y-sensor direction, angular-speed compensated - * @param quality Optical flow quality / confidence. 0: bad, 255: maximum quality - * @param ground_distance Ground distance in meters. Positive value: distance known. Negative value: Unknown distance + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param sensor_id Sensor ID + * @param flow_x [dpix] Flow in x-sensor direction + * @param flow_y [dpix] Flow in y-sensor direction + * @param flow_comp_m_x [m/s] Flow in x-sensor direction, angular-speed compensated + * @param flow_comp_m_y [m/s] Flow in y-sensor direction, angular-speed compensated + * @param quality Optical flow quality / confidence. 0: bad, 255: maximum quality + * @param ground_distance [m] Ground distance. Positive value: distance known. Negative value: Unknown distance */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -286,7 +286,7 @@ static inline void mavlink_msg_optical_flow_send_buf(mavlink_message_t *msgbuf, /** * @brief Get field time_usec from optical_flow message * - * @return Timestamp (UNIX) + * @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. */ static inline uint64_t mavlink_msg_optical_flow_get_time_usec(const mavlink_message_t* msg) { @@ -296,7 +296,7 @@ static inline uint64_t mavlink_msg_optical_flow_get_time_usec(const mavlink_mess /** * @brief Get field sensor_id from optical_flow message * - * @return Sensor ID + * @return Sensor ID */ static inline uint8_t mavlink_msg_optical_flow_get_sensor_id(const mavlink_message_t* msg) { @@ -306,7 +306,7 @@ static inline uint8_t mavlink_msg_optical_flow_get_sensor_id(const mavlink_messa /** * @brief Get field flow_x from optical_flow message * - * @return Flow in pixels * 10 in x-sensor direction (dezi-pixels) + * @return [dpix] Flow in x-sensor direction */ static inline int16_t mavlink_msg_optical_flow_get_flow_x(const mavlink_message_t* msg) { @@ -316,7 +316,7 @@ static inline int16_t mavlink_msg_optical_flow_get_flow_x(const mavlink_message_ /** * @brief Get field flow_y from optical_flow message * - * @return Flow in pixels * 10 in y-sensor direction (dezi-pixels) + * @return [dpix] Flow in y-sensor direction */ static inline int16_t mavlink_msg_optical_flow_get_flow_y(const mavlink_message_t* msg) { @@ -326,7 +326,7 @@ static inline int16_t mavlink_msg_optical_flow_get_flow_y(const mavlink_message_ /** * @brief Get field flow_comp_m_x from optical_flow message * - * @return Flow in meters in x-sensor direction, angular-speed compensated + * @return [m/s] Flow in x-sensor direction, angular-speed compensated */ static inline float mavlink_msg_optical_flow_get_flow_comp_m_x(const mavlink_message_t* msg) { @@ -336,7 +336,7 @@ static inline float mavlink_msg_optical_flow_get_flow_comp_m_x(const mavlink_mes /** * @brief Get field flow_comp_m_y from optical_flow message * - * @return Flow in meters in y-sensor direction, angular-speed compensated + * @return [m/s] Flow in y-sensor direction, angular-speed compensated */ static inline float mavlink_msg_optical_flow_get_flow_comp_m_y(const mavlink_message_t* msg) { @@ -346,7 +346,7 @@ static inline float mavlink_msg_optical_flow_get_flow_comp_m_y(const mavlink_mes /** * @brief Get field quality from optical_flow message * - * @return Optical flow quality / confidence. 0: bad, 255: maximum quality + * @return Optical flow quality / confidence. 0: bad, 255: maximum quality */ static inline uint8_t mavlink_msg_optical_flow_get_quality(const mavlink_message_t* msg) { @@ -356,7 +356,7 @@ static inline uint8_t mavlink_msg_optical_flow_get_quality(const mavlink_message /** * @brief Get field ground_distance from optical_flow message * - * @return Ground distance in meters. Positive value: distance known. Negative value: Unknown distance + * @return [m] Ground distance. Positive value: distance known. Negative value: Unknown distance */ static inline float mavlink_msg_optical_flow_get_ground_distance(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_optical_flow_rad.h b/lib/main/MAVLink/common/mavlink_msg_optical_flow_rad.h index c4326eb046..593533bf66 100755 --- a/lib/main/MAVLink/common/mavlink_msg_optical_flow_rad.h +++ b/lib/main/MAVLink/common/mavlink_msg_optical_flow_rad.h @@ -3,21 +3,21 @@ #define MAVLINK_MSG_ID_OPTICAL_FLOW_RAD 106 -MAVPACKED( + typedef struct __mavlink_optical_flow_rad_t { - uint64_t time_usec; /*< Timestamp (microseconds, synced to UNIX time or since system boot)*/ - uint32_t integration_time_us; /*< Integration time in microseconds. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the.*/ - float integrated_x; /*< Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)*/ - float integrated_y; /*< Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)*/ - float integrated_xgyro; /*< RH rotation around X axis (rad)*/ - float integrated_ygyro; /*< RH rotation around Y axis (rad)*/ - float integrated_zgyro; /*< RH rotation around Z axis (rad)*/ - uint32_t time_delta_distance_us; /*< Time in microseconds since the distance was sampled.*/ - float distance; /*< Distance to the center of the flow field in meters. Positive value (including zero): distance known. Negative value: Unknown distance.*/ - int16_t temperature; /*< Temperature * 100 in centi-degrees Celsius*/ - uint8_t sensor_id; /*< Sensor ID*/ - uint8_t quality; /*< Optical flow quality / confidence. 0: no valid flow, 255: maximum quality*/ -}) mavlink_optical_flow_rad_t; + uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.*/ + uint32_t integration_time_us; /*< [us] Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the.*/ + float integrated_x; /*< [rad] Flow around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)*/ + float integrated_y; /*< [rad] Flow around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)*/ + float integrated_xgyro; /*< [rad] RH rotation around X axis*/ + float integrated_ygyro; /*< [rad] RH rotation around Y axis*/ + float integrated_zgyro; /*< [rad] RH rotation around Z axis*/ + uint32_t time_delta_distance_us; /*< [us] Time since the distance was sampled.*/ + float distance; /*< [m] Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance.*/ + int16_t temperature; /*< [cdegC] Temperature*/ + uint8_t sensor_id; /*< Sensor ID*/ + uint8_t quality; /*< Optical flow quality / confidence. 0: no valid flow, 255: maximum quality*/ +} mavlink_optical_flow_rad_t; #define MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN 44 #define MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_MIN_LEN 44 @@ -35,17 +35,17 @@ typedef struct __mavlink_optical_flow_rad_t { "OPTICAL_FLOW_RAD", \ 12, \ { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_optical_flow_rad_t, time_usec) }, \ + { "sensor_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 42, offsetof(mavlink_optical_flow_rad_t, sensor_id) }, \ { "integration_time_us", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_optical_flow_rad_t, integration_time_us) }, \ { "integrated_x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_optical_flow_rad_t, integrated_x) }, \ { "integrated_y", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_optical_flow_rad_t, integrated_y) }, \ { "integrated_xgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_optical_flow_rad_t, integrated_xgyro) }, \ { "integrated_ygyro", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_optical_flow_rad_t, integrated_ygyro) }, \ { "integrated_zgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_optical_flow_rad_t, integrated_zgyro) }, \ + { "temperature", NULL, MAVLINK_TYPE_INT16_T, 0, 40, offsetof(mavlink_optical_flow_rad_t, temperature) }, \ + { "quality", NULL, MAVLINK_TYPE_UINT8_T, 0, 43, offsetof(mavlink_optical_flow_rad_t, quality) }, \ { "time_delta_distance_us", NULL, MAVLINK_TYPE_UINT32_T, 0, 32, offsetof(mavlink_optical_flow_rad_t, time_delta_distance_us) }, \ { "distance", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_optical_flow_rad_t, distance) }, \ - { "temperature", NULL, MAVLINK_TYPE_INT16_T, 0, 40, offsetof(mavlink_optical_flow_rad_t, temperature) }, \ - { "sensor_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 42, offsetof(mavlink_optical_flow_rad_t, sensor_id) }, \ - { "quality", NULL, MAVLINK_TYPE_UINT8_T, 0, 43, offsetof(mavlink_optical_flow_rad_t, quality) }, \ } \ } #else @@ -53,17 +53,17 @@ typedef struct __mavlink_optical_flow_rad_t { "OPTICAL_FLOW_RAD", \ 12, \ { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_optical_flow_rad_t, time_usec) }, \ + { "sensor_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 42, offsetof(mavlink_optical_flow_rad_t, sensor_id) }, \ { "integration_time_us", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_optical_flow_rad_t, integration_time_us) }, \ { "integrated_x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_optical_flow_rad_t, integrated_x) }, \ { "integrated_y", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_optical_flow_rad_t, integrated_y) }, \ { "integrated_xgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_optical_flow_rad_t, integrated_xgyro) }, \ { "integrated_ygyro", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_optical_flow_rad_t, integrated_ygyro) }, \ { "integrated_zgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_optical_flow_rad_t, integrated_zgyro) }, \ + { "temperature", NULL, MAVLINK_TYPE_INT16_T, 0, 40, offsetof(mavlink_optical_flow_rad_t, temperature) }, \ + { "quality", NULL, MAVLINK_TYPE_UINT8_T, 0, 43, offsetof(mavlink_optical_flow_rad_t, quality) }, \ { "time_delta_distance_us", NULL, MAVLINK_TYPE_UINT32_T, 0, 32, offsetof(mavlink_optical_flow_rad_t, time_delta_distance_us) }, \ { "distance", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_optical_flow_rad_t, distance) }, \ - { "temperature", NULL, MAVLINK_TYPE_INT16_T, 0, 40, offsetof(mavlink_optical_flow_rad_t, temperature) }, \ - { "sensor_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 42, offsetof(mavlink_optical_flow_rad_t, sensor_id) }, \ - { "quality", NULL, MAVLINK_TYPE_UINT8_T, 0, 43, offsetof(mavlink_optical_flow_rad_t, quality) }, \ } \ } #endif @@ -74,18 +74,18 @@ typedef struct __mavlink_optical_flow_rad_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param time_usec Timestamp (microseconds, synced to UNIX time or since system boot) - * @param sensor_id Sensor ID - * @param integration_time_us Integration time in microseconds. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the. - * @param integrated_x Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.) - * @param integrated_y Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.) - * @param integrated_xgyro RH rotation around X axis (rad) - * @param integrated_ygyro RH rotation around Y axis (rad) - * @param integrated_zgyro RH rotation around Z axis (rad) - * @param temperature Temperature * 100 in centi-degrees Celsius - * @param quality Optical flow quality / confidence. 0: no valid flow, 255: maximum quality - * @param time_delta_distance_us Time in microseconds since the distance was sampled. - * @param distance Distance to the center of the flow field in meters. Positive value (including zero): distance known. Negative value: Unknown distance. + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param sensor_id Sensor ID + * @param integration_time_us [us] Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the. + * @param integrated_x [rad] Flow around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.) + * @param integrated_y [rad] Flow around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.) + * @param integrated_xgyro [rad] RH rotation around X axis + * @param integrated_ygyro [rad] RH rotation around Y axis + * @param integrated_zgyro [rad] RH rotation around Z axis + * @param temperature [cdegC] Temperature + * @param quality Optical flow quality / confidence. 0: no valid flow, 255: maximum quality + * @param time_delta_distance_us [us] Time since the distance was sampled. + * @param distance [m] Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_optical_flow_rad_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -135,18 +135,18 @@ static inline uint16_t mavlink_msg_optical_flow_rad_pack(uint8_t system_id, uint * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param time_usec Timestamp (microseconds, synced to UNIX time or since system boot) - * @param sensor_id Sensor ID - * @param integration_time_us Integration time in microseconds. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the. - * @param integrated_x Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.) - * @param integrated_y Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.) - * @param integrated_xgyro RH rotation around X axis (rad) - * @param integrated_ygyro RH rotation around Y axis (rad) - * @param integrated_zgyro RH rotation around Z axis (rad) - * @param temperature Temperature * 100 in centi-degrees Celsius - * @param quality Optical flow quality / confidence. 0: no valid flow, 255: maximum quality - * @param time_delta_distance_us Time in microseconds since the distance was sampled. - * @param distance Distance to the center of the flow field in meters. Positive value (including zero): distance known. Negative value: Unknown distance. + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param sensor_id Sensor ID + * @param integration_time_us [us] Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the. + * @param integrated_x [rad] Flow around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.) + * @param integrated_y [rad] Flow around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.) + * @param integrated_xgyro [rad] RH rotation around X axis + * @param integrated_ygyro [rad] RH rotation around Y axis + * @param integrated_zgyro [rad] RH rotation around Z axis + * @param temperature [cdegC] Temperature + * @param quality Optical flow quality / confidence. 0: no valid flow, 255: maximum quality + * @param time_delta_distance_us [us] Time since the distance was sampled. + * @param distance [m] Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_optical_flow_rad_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -222,18 +222,18 @@ static inline uint16_t mavlink_msg_optical_flow_rad_encode_chan(uint8_t system_i * @brief Send a optical_flow_rad message * @param chan MAVLink channel to send the message * - * @param time_usec Timestamp (microseconds, synced to UNIX time or since system boot) - * @param sensor_id Sensor ID - * @param integration_time_us Integration time in microseconds. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the. - * @param integrated_x Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.) - * @param integrated_y Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.) - * @param integrated_xgyro RH rotation around X axis (rad) - * @param integrated_ygyro RH rotation around Y axis (rad) - * @param integrated_zgyro RH rotation around Z axis (rad) - * @param temperature Temperature * 100 in centi-degrees Celsius - * @param quality Optical flow quality / confidence. 0: no valid flow, 255: maximum quality - * @param time_delta_distance_us Time in microseconds since the distance was sampled. - * @param distance Distance to the center of the flow field in meters. Positive value (including zero): distance known. Negative value: Unknown distance. + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param sensor_id Sensor ID + * @param integration_time_us [us] Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the. + * @param integrated_x [rad] Flow around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.) + * @param integrated_y [rad] Flow around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.) + * @param integrated_xgyro [rad] RH rotation around X axis + * @param integrated_ygyro [rad] RH rotation around Y axis + * @param integrated_zgyro [rad] RH rotation around Z axis + * @param temperature [cdegC] Temperature + * @param quality Optical flow quality / confidence. 0: no valid flow, 255: maximum quality + * @param time_delta_distance_us [us] Time since the distance was sampled. + * @param distance [m] Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance. */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -342,7 +342,7 @@ static inline void mavlink_msg_optical_flow_rad_send_buf(mavlink_message_t *msgb /** * @brief Get field time_usec from optical_flow_rad message * - * @return Timestamp (microseconds, synced to UNIX time or since system boot) + * @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. */ static inline uint64_t mavlink_msg_optical_flow_rad_get_time_usec(const mavlink_message_t* msg) { @@ -352,7 +352,7 @@ static inline uint64_t mavlink_msg_optical_flow_rad_get_time_usec(const mavlink_ /** * @brief Get field sensor_id from optical_flow_rad message * - * @return Sensor ID + * @return Sensor ID */ static inline uint8_t mavlink_msg_optical_flow_rad_get_sensor_id(const mavlink_message_t* msg) { @@ -362,7 +362,7 @@ static inline uint8_t mavlink_msg_optical_flow_rad_get_sensor_id(const mavlink_m /** * @brief Get field integration_time_us from optical_flow_rad message * - * @return Integration time in microseconds. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the. + * @return [us] Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the. */ static inline uint32_t mavlink_msg_optical_flow_rad_get_integration_time_us(const mavlink_message_t* msg) { @@ -372,7 +372,7 @@ static inline uint32_t mavlink_msg_optical_flow_rad_get_integration_time_us(cons /** * @brief Get field integrated_x from optical_flow_rad message * - * @return Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.) + * @return [rad] Flow around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.) */ static inline float mavlink_msg_optical_flow_rad_get_integrated_x(const mavlink_message_t* msg) { @@ -382,7 +382,7 @@ static inline float mavlink_msg_optical_flow_rad_get_integrated_x(const mavlink_ /** * @brief Get field integrated_y from optical_flow_rad message * - * @return Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.) + * @return [rad] Flow around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.) */ static inline float mavlink_msg_optical_flow_rad_get_integrated_y(const mavlink_message_t* msg) { @@ -392,7 +392,7 @@ static inline float mavlink_msg_optical_flow_rad_get_integrated_y(const mavlink_ /** * @brief Get field integrated_xgyro from optical_flow_rad message * - * @return RH rotation around X axis (rad) + * @return [rad] RH rotation around X axis */ static inline float mavlink_msg_optical_flow_rad_get_integrated_xgyro(const mavlink_message_t* msg) { @@ -402,7 +402,7 @@ static inline float mavlink_msg_optical_flow_rad_get_integrated_xgyro(const mavl /** * @brief Get field integrated_ygyro from optical_flow_rad message * - * @return RH rotation around Y axis (rad) + * @return [rad] RH rotation around Y axis */ static inline float mavlink_msg_optical_flow_rad_get_integrated_ygyro(const mavlink_message_t* msg) { @@ -412,7 +412,7 @@ static inline float mavlink_msg_optical_flow_rad_get_integrated_ygyro(const mavl /** * @brief Get field integrated_zgyro from optical_flow_rad message * - * @return RH rotation around Z axis (rad) + * @return [rad] RH rotation around Z axis */ static inline float mavlink_msg_optical_flow_rad_get_integrated_zgyro(const mavlink_message_t* msg) { @@ -422,7 +422,7 @@ static inline float mavlink_msg_optical_flow_rad_get_integrated_zgyro(const mavl /** * @brief Get field temperature from optical_flow_rad message * - * @return Temperature * 100 in centi-degrees Celsius + * @return [cdegC] Temperature */ static inline int16_t mavlink_msg_optical_flow_rad_get_temperature(const mavlink_message_t* msg) { @@ -432,7 +432,7 @@ static inline int16_t mavlink_msg_optical_flow_rad_get_temperature(const mavlink /** * @brief Get field quality from optical_flow_rad message * - * @return Optical flow quality / confidence. 0: no valid flow, 255: maximum quality + * @return Optical flow quality / confidence. 0: no valid flow, 255: maximum quality */ static inline uint8_t mavlink_msg_optical_flow_rad_get_quality(const mavlink_message_t* msg) { @@ -442,7 +442,7 @@ static inline uint8_t mavlink_msg_optical_flow_rad_get_quality(const mavlink_mes /** * @brief Get field time_delta_distance_us from optical_flow_rad message * - * @return Time in microseconds since the distance was sampled. + * @return [us] Time since the distance was sampled. */ static inline uint32_t mavlink_msg_optical_flow_rad_get_time_delta_distance_us(const mavlink_message_t* msg) { @@ -452,7 +452,7 @@ static inline uint32_t mavlink_msg_optical_flow_rad_get_time_delta_distance_us(c /** * @brief Get field distance from optical_flow_rad message * - * @return Distance to the center of the flow field in meters. Positive value (including zero): distance known. Negative value: Unknown distance. + * @return [m] Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance. */ static inline float mavlink_msg_optical_flow_rad_get_distance(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_param_ack_transaction.h b/lib/main/MAVLink/common/mavlink_msg_param_ack_transaction.h new file mode 100644 index 0000000000..404b084ab9 --- /dev/null +++ b/lib/main/MAVLink/common/mavlink_msg_param_ack_transaction.h @@ -0,0 +1,330 @@ +#pragma once +// MESSAGE PARAM_ACK_TRANSACTION PACKING + +#define MAVLINK_MSG_ID_PARAM_ACK_TRANSACTION 19 + + +typedef struct __mavlink_param_ack_transaction_t { + float param_value; /*< Parameter value (new value if PARAM_ACCEPTED, current value otherwise)*/ + uint8_t target_system; /*< Id of system that sent PARAM_SET message.*/ + uint8_t target_component; /*< Id of system that sent PARAM_SET message.*/ + char param_id[16]; /*< Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string*/ + uint8_t param_type; /*< Parameter type.*/ + uint8_t param_result; /*< Result code.*/ +} mavlink_param_ack_transaction_t; + +#define MAVLINK_MSG_ID_PARAM_ACK_TRANSACTION_LEN 24 +#define MAVLINK_MSG_ID_PARAM_ACK_TRANSACTION_MIN_LEN 24 +#define MAVLINK_MSG_ID_19_LEN 24 +#define MAVLINK_MSG_ID_19_MIN_LEN 24 + +#define MAVLINK_MSG_ID_PARAM_ACK_TRANSACTION_CRC 137 +#define MAVLINK_MSG_ID_19_CRC 137 + +#define MAVLINK_MSG_PARAM_ACK_TRANSACTION_FIELD_PARAM_ID_LEN 16 + +#if MAVLINK_COMMAND_24BIT +#define MAVLINK_MESSAGE_INFO_PARAM_ACK_TRANSACTION { \ + 19, \ + "PARAM_ACK_TRANSACTION", \ + 6, \ + { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_param_ack_transaction_t, target_system) }, \ + { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_param_ack_transaction_t, target_component) }, \ + { "param_id", NULL, MAVLINK_TYPE_CHAR, 16, 6, offsetof(mavlink_param_ack_transaction_t, param_id) }, \ + { "param_value", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_param_ack_transaction_t, param_value) }, \ + { "param_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 22, offsetof(mavlink_param_ack_transaction_t, param_type) }, \ + { "param_result", NULL, MAVLINK_TYPE_UINT8_T, 0, 23, offsetof(mavlink_param_ack_transaction_t, param_result) }, \ + } \ +} +#else +#define MAVLINK_MESSAGE_INFO_PARAM_ACK_TRANSACTION { \ + "PARAM_ACK_TRANSACTION", \ + 6, \ + { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_param_ack_transaction_t, target_system) }, \ + { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_param_ack_transaction_t, target_component) }, \ + { "param_id", NULL, MAVLINK_TYPE_CHAR, 16, 6, offsetof(mavlink_param_ack_transaction_t, param_id) }, \ + { "param_value", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_param_ack_transaction_t, param_value) }, \ + { "param_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 22, offsetof(mavlink_param_ack_transaction_t, param_type) }, \ + { "param_result", NULL, MAVLINK_TYPE_UINT8_T, 0, 23, offsetof(mavlink_param_ack_transaction_t, param_result) }, \ + } \ +} +#endif + +/** + * @brief Pack a param_ack_transaction 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 Id of system that sent PARAM_SET message. + * @param target_component Id of system that sent PARAM_SET message. + * @param param_id Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string + * @param param_value Parameter value (new value if PARAM_ACCEPTED, current value otherwise) + * @param param_type Parameter type. + * @param param_result Result code. + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_param_ack_transaction_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, + uint8_t target_system, uint8_t target_component, const char *param_id, float param_value, uint8_t param_type, uint8_t param_result) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[MAVLINK_MSG_ID_PARAM_ACK_TRANSACTION_LEN]; + _mav_put_float(buf, 0, param_value); + _mav_put_uint8_t(buf, 4, target_system); + _mav_put_uint8_t(buf, 5, target_component); + _mav_put_uint8_t(buf, 22, param_type); + _mav_put_uint8_t(buf, 23, param_result); + _mav_put_char_array(buf, 6, param_id, 16); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_PARAM_ACK_TRANSACTION_LEN); +#else + mavlink_param_ack_transaction_t packet; + packet.param_value = param_value; + packet.target_system = target_system; + packet.target_component = target_component; + packet.param_type = param_type; + packet.param_result = param_result; + mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PARAM_ACK_TRANSACTION_LEN); +#endif + + msg->msgid = MAVLINK_MSG_ID_PARAM_ACK_TRANSACTION; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_PARAM_ACK_TRANSACTION_MIN_LEN, MAVLINK_MSG_ID_PARAM_ACK_TRANSACTION_LEN, MAVLINK_MSG_ID_PARAM_ACK_TRANSACTION_CRC); +} + +/** + * @brief Pack a param_ack_transaction message on a channel + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param chan The MAVLink channel this message will be sent over + * @param msg The MAVLink message to compress the data into + * @param target_system Id of system that sent PARAM_SET message. + * @param target_component Id of system that sent PARAM_SET message. + * @param param_id Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string + * @param param_value Parameter value (new value if PARAM_ACCEPTED, current value otherwise) + * @param param_type Parameter type. + * @param param_result Result code. + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_param_ack_transaction_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, + mavlink_message_t* msg, + uint8_t target_system,uint8_t target_component,const char *param_id,float param_value,uint8_t param_type,uint8_t param_result) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[MAVLINK_MSG_ID_PARAM_ACK_TRANSACTION_LEN]; + _mav_put_float(buf, 0, param_value); + _mav_put_uint8_t(buf, 4, target_system); + _mav_put_uint8_t(buf, 5, target_component); + _mav_put_uint8_t(buf, 22, param_type); + _mav_put_uint8_t(buf, 23, param_result); + _mav_put_char_array(buf, 6, param_id, 16); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_PARAM_ACK_TRANSACTION_LEN); +#else + mavlink_param_ack_transaction_t packet; + packet.param_value = param_value; + packet.target_system = target_system; + packet.target_component = target_component; + packet.param_type = param_type; + packet.param_result = param_result; + mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PARAM_ACK_TRANSACTION_LEN); +#endif + + msg->msgid = MAVLINK_MSG_ID_PARAM_ACK_TRANSACTION; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_PARAM_ACK_TRANSACTION_MIN_LEN, MAVLINK_MSG_ID_PARAM_ACK_TRANSACTION_LEN, MAVLINK_MSG_ID_PARAM_ACK_TRANSACTION_CRC); +} + +/** + * @brief Encode a param_ack_transaction struct + * + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param msg The MAVLink message to compress the data into + * @param param_ack_transaction C-struct to read the message contents from + */ +static inline uint16_t mavlink_msg_param_ack_transaction_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_param_ack_transaction_t* param_ack_transaction) +{ + return mavlink_msg_param_ack_transaction_pack(system_id, component_id, msg, param_ack_transaction->target_system, param_ack_transaction->target_component, param_ack_transaction->param_id, param_ack_transaction->param_value, param_ack_transaction->param_type, param_ack_transaction->param_result); +} + +/** + * @brief Encode a param_ack_transaction struct on a channel + * + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param chan The MAVLink channel this message will be sent over + * @param msg The MAVLink message to compress the data into + * @param param_ack_transaction C-struct to read the message contents from + */ +static inline uint16_t mavlink_msg_param_ack_transaction_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_param_ack_transaction_t* param_ack_transaction) +{ + return mavlink_msg_param_ack_transaction_pack_chan(system_id, component_id, chan, msg, param_ack_transaction->target_system, param_ack_transaction->target_component, param_ack_transaction->param_id, param_ack_transaction->param_value, param_ack_transaction->param_type, param_ack_transaction->param_result); +} + +/** + * @brief Send a param_ack_transaction message + * @param chan MAVLink channel to send the message + * + * @param target_system Id of system that sent PARAM_SET message. + * @param target_component Id of system that sent PARAM_SET message. + * @param param_id Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string + * @param param_value Parameter value (new value if PARAM_ACCEPTED, current value otherwise) + * @param param_type Parameter type. + * @param param_result Result code. + */ +#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS + +static inline void mavlink_msg_param_ack_transaction_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, const char *param_id, float param_value, uint8_t param_type, uint8_t param_result) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[MAVLINK_MSG_ID_PARAM_ACK_TRANSACTION_LEN]; + _mav_put_float(buf, 0, param_value); + _mav_put_uint8_t(buf, 4, target_system); + _mav_put_uint8_t(buf, 5, target_component); + _mav_put_uint8_t(buf, 22, param_type); + _mav_put_uint8_t(buf, 23, param_result); + _mav_put_char_array(buf, 6, param_id, 16); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_ACK_TRANSACTION, buf, MAVLINK_MSG_ID_PARAM_ACK_TRANSACTION_MIN_LEN, MAVLINK_MSG_ID_PARAM_ACK_TRANSACTION_LEN, MAVLINK_MSG_ID_PARAM_ACK_TRANSACTION_CRC); +#else + mavlink_param_ack_transaction_t packet; + packet.param_value = param_value; + packet.target_system = target_system; + packet.target_component = target_component; + packet.param_type = param_type; + packet.param_result = param_result; + mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_ACK_TRANSACTION, (const char *)&packet, MAVLINK_MSG_ID_PARAM_ACK_TRANSACTION_MIN_LEN, MAVLINK_MSG_ID_PARAM_ACK_TRANSACTION_LEN, MAVLINK_MSG_ID_PARAM_ACK_TRANSACTION_CRC); +#endif +} + +/** + * @brief Send a param_ack_transaction message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_param_ack_transaction_send_struct(mavlink_channel_t chan, const mavlink_param_ack_transaction_t* param_ack_transaction) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_param_ack_transaction_send(chan, param_ack_transaction->target_system, param_ack_transaction->target_component, param_ack_transaction->param_id, param_ack_transaction->param_value, param_ack_transaction->param_type, param_ack_transaction->param_result); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_ACK_TRANSACTION, (const char *)param_ack_transaction, MAVLINK_MSG_ID_PARAM_ACK_TRANSACTION_MIN_LEN, MAVLINK_MSG_ID_PARAM_ACK_TRANSACTION_LEN, MAVLINK_MSG_ID_PARAM_ACK_TRANSACTION_CRC); +#endif +} + +#if MAVLINK_MSG_ID_PARAM_ACK_TRANSACTION_LEN <= MAVLINK_MAX_PAYLOAD_LEN +/* + This varient of _send() can be used to save stack space by re-using + memory from the receive buffer. The caller provides a + mavlink_message_t which is the size of a full mavlink message. This + is usually the receive buffer for the channel, and allows a reply to an + incoming message with minimum stack space usage. + */ +static inline void mavlink_msg_param_ack_transaction_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, const char *param_id, float param_value, uint8_t param_type, uint8_t param_result) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char *buf = (char *)msgbuf; + _mav_put_float(buf, 0, param_value); + _mav_put_uint8_t(buf, 4, target_system); + _mav_put_uint8_t(buf, 5, target_component); + _mav_put_uint8_t(buf, 22, param_type); + _mav_put_uint8_t(buf, 23, param_result); + _mav_put_char_array(buf, 6, param_id, 16); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_ACK_TRANSACTION, buf, MAVLINK_MSG_ID_PARAM_ACK_TRANSACTION_MIN_LEN, MAVLINK_MSG_ID_PARAM_ACK_TRANSACTION_LEN, MAVLINK_MSG_ID_PARAM_ACK_TRANSACTION_CRC); +#else + mavlink_param_ack_transaction_t *packet = (mavlink_param_ack_transaction_t *)msgbuf; + packet->param_value = param_value; + packet->target_system = target_system; + packet->target_component = target_component; + packet->param_type = param_type; + packet->param_result = param_result; + mav_array_memcpy(packet->param_id, param_id, sizeof(char)*16); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_ACK_TRANSACTION, (const char *)packet, MAVLINK_MSG_ID_PARAM_ACK_TRANSACTION_MIN_LEN, MAVLINK_MSG_ID_PARAM_ACK_TRANSACTION_LEN, MAVLINK_MSG_ID_PARAM_ACK_TRANSACTION_CRC); +#endif +} +#endif + +#endif + +// MESSAGE PARAM_ACK_TRANSACTION UNPACKING + + +/** + * @brief Get field target_system from param_ack_transaction message + * + * @return Id of system that sent PARAM_SET message. + */ +static inline uint8_t mavlink_msg_param_ack_transaction_get_target_system(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint8_t(msg, 4); +} + +/** + * @brief Get field target_component from param_ack_transaction message + * + * @return Id of system that sent PARAM_SET message. + */ +static inline uint8_t mavlink_msg_param_ack_transaction_get_target_component(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint8_t(msg, 5); +} + +/** + * @brief Get field param_id from param_ack_transaction message + * + * @return Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string + */ +static inline uint16_t mavlink_msg_param_ack_transaction_get_param_id(const mavlink_message_t* msg, char *param_id) +{ + return _MAV_RETURN_char_array(msg, param_id, 16, 6); +} + +/** + * @brief Get field param_value from param_ack_transaction message + * + * @return Parameter value (new value if PARAM_ACCEPTED, current value otherwise) + */ +static inline float mavlink_msg_param_ack_transaction_get_param_value(const mavlink_message_t* msg) +{ + return _MAV_RETURN_float(msg, 0); +} + +/** + * @brief Get field param_type from param_ack_transaction message + * + * @return Parameter type. + */ +static inline uint8_t mavlink_msg_param_ack_transaction_get_param_type(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint8_t(msg, 22); +} + +/** + * @brief Get field param_result from param_ack_transaction message + * + * @return Result code. + */ +static inline uint8_t mavlink_msg_param_ack_transaction_get_param_result(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint8_t(msg, 23); +} + +/** + * @brief Decode a param_ack_transaction message into a struct + * + * @param msg The message to decode + * @param param_ack_transaction C-struct to decode the message contents into + */ +static inline void mavlink_msg_param_ack_transaction_decode(const mavlink_message_t* msg, mavlink_param_ack_transaction_t* param_ack_transaction) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + param_ack_transaction->param_value = mavlink_msg_param_ack_transaction_get_param_value(msg); + param_ack_transaction->target_system = mavlink_msg_param_ack_transaction_get_target_system(msg); + param_ack_transaction->target_component = mavlink_msg_param_ack_transaction_get_target_component(msg); + mavlink_msg_param_ack_transaction_get_param_id(msg, param_ack_transaction->param_id); + param_ack_transaction->param_type = mavlink_msg_param_ack_transaction_get_param_type(msg); + param_ack_transaction->param_result = mavlink_msg_param_ack_transaction_get_param_result(msg); +#else + uint8_t len = msg->len < MAVLINK_MSG_ID_PARAM_ACK_TRANSACTION_LEN? msg->len : MAVLINK_MSG_ID_PARAM_ACK_TRANSACTION_LEN; + memset(param_ack_transaction, 0, MAVLINK_MSG_ID_PARAM_ACK_TRANSACTION_LEN); + memcpy(param_ack_transaction, _MAV_PAYLOAD(msg), len); +#endif +} diff --git a/lib/main/MAVLink/common/mavlink_msg_param_map_rc.h b/lib/main/MAVLink/common/mavlink_msg_param_map_rc.h index 5b64b7f890..5bea16c7ce 100755 --- a/lib/main/MAVLink/common/mavlink_msg_param_map_rc.h +++ b/lib/main/MAVLink/common/mavlink_msg_param_map_rc.h @@ -3,18 +3,18 @@ #define MAVLINK_MSG_ID_PARAM_MAP_RC 50 -MAVPACKED( + typedef struct __mavlink_param_map_rc_t { - float param_value0; /*< Initial parameter value*/ - float scale; /*< Scale, maps the RC range [-1, 1] to a parameter value*/ - float param_value_min; /*< Minimum param value. The protocol does not define if this overwrites an onboard minimum value. (Depends on implementation)*/ - float param_value_max; /*< Maximum param value. The protocol does not define if this overwrites an onboard maximum value. (Depends on implementation)*/ - int16_t param_index; /*< Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored), send -2 to disable any existing map for this rc_channel_index.*/ - uint8_t target_system; /*< System ID*/ - uint8_t target_component; /*< Component ID*/ - char param_id[16]; /*< Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string*/ - uint8_t parameter_rc_channel_index; /*< Index of parameter RC channel. Not equal to the RC channel id. Typically correpsonds to a potentiometer-knob on the RC.*/ -}) mavlink_param_map_rc_t; + float param_value0; /*< Initial parameter value*/ + float scale; /*< Scale, maps the RC range [-1, 1] to a parameter value*/ + float param_value_min; /*< Minimum param value. The protocol does not define if this overwrites an onboard minimum value. (Depends on implementation)*/ + float param_value_max; /*< Maximum param value. The protocol does not define if this overwrites an onboard maximum value. (Depends on implementation)*/ + int16_t param_index; /*< Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored), send -2 to disable any existing map for this rc_channel_index.*/ + uint8_t target_system; /*< System ID*/ + uint8_t target_component; /*< Component ID*/ + char param_id[16]; /*< Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string*/ + uint8_t parameter_rc_channel_index; /*< Index of parameter RC channel. Not equal to the RC channel id. Typically corresponds to a potentiometer-knob on the RC.*/ +} mavlink_param_map_rc_t; #define MAVLINK_MSG_ID_PARAM_MAP_RC_LEN 37 #define MAVLINK_MSG_ID_PARAM_MAP_RC_MIN_LEN 37 @@ -31,30 +31,30 @@ typedef struct __mavlink_param_map_rc_t { 50, \ "PARAM_MAP_RC", \ 9, \ - { { "param_value0", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_param_map_rc_t, param_value0) }, \ + { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 18, offsetof(mavlink_param_map_rc_t, target_system) }, \ + { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 19, offsetof(mavlink_param_map_rc_t, target_component) }, \ + { "param_id", NULL, MAVLINK_TYPE_CHAR, 16, 20, offsetof(mavlink_param_map_rc_t, param_id) }, \ + { "param_index", NULL, MAVLINK_TYPE_INT16_T, 0, 16, offsetof(mavlink_param_map_rc_t, param_index) }, \ + { "parameter_rc_channel_index", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_param_map_rc_t, parameter_rc_channel_index) }, \ + { "param_value0", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_param_map_rc_t, param_value0) }, \ { "scale", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_param_map_rc_t, scale) }, \ { "param_value_min", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_param_map_rc_t, param_value_min) }, \ { "param_value_max", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_param_map_rc_t, param_value_max) }, \ - { "param_index", NULL, MAVLINK_TYPE_INT16_T, 0, 16, offsetof(mavlink_param_map_rc_t, param_index) }, \ - { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 18, offsetof(mavlink_param_map_rc_t, target_system) }, \ - { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 19, offsetof(mavlink_param_map_rc_t, target_component) }, \ - { "param_id", NULL, MAVLINK_TYPE_CHAR, 16, 20, offsetof(mavlink_param_map_rc_t, param_id) }, \ - { "parameter_rc_channel_index", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_param_map_rc_t, parameter_rc_channel_index) }, \ } \ } #else #define MAVLINK_MESSAGE_INFO_PARAM_MAP_RC { \ "PARAM_MAP_RC", \ 9, \ - { { "param_value0", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_param_map_rc_t, param_value0) }, \ + { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 18, offsetof(mavlink_param_map_rc_t, target_system) }, \ + { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 19, offsetof(mavlink_param_map_rc_t, target_component) }, \ + { "param_id", NULL, MAVLINK_TYPE_CHAR, 16, 20, offsetof(mavlink_param_map_rc_t, param_id) }, \ + { "param_index", NULL, MAVLINK_TYPE_INT16_T, 0, 16, offsetof(mavlink_param_map_rc_t, param_index) }, \ + { "parameter_rc_channel_index", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_param_map_rc_t, parameter_rc_channel_index) }, \ + { "param_value0", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_param_map_rc_t, param_value0) }, \ { "scale", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_param_map_rc_t, scale) }, \ { "param_value_min", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_param_map_rc_t, param_value_min) }, \ { "param_value_max", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_param_map_rc_t, param_value_max) }, \ - { "param_index", NULL, MAVLINK_TYPE_INT16_T, 0, 16, offsetof(mavlink_param_map_rc_t, param_index) }, \ - { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 18, offsetof(mavlink_param_map_rc_t, target_system) }, \ - { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 19, offsetof(mavlink_param_map_rc_t, target_component) }, \ - { "param_id", NULL, MAVLINK_TYPE_CHAR, 16, 20, offsetof(mavlink_param_map_rc_t, param_id) }, \ - { "parameter_rc_channel_index", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_param_map_rc_t, parameter_rc_channel_index) }, \ } \ } #endif @@ -65,15 +65,15 @@ typedef struct __mavlink_param_map_rc_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param target_system System ID - * @param target_component Component ID - * @param param_id Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string - * @param param_index Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored), send -2 to disable any existing map for this rc_channel_index. - * @param parameter_rc_channel_index Index of parameter RC channel. Not equal to the RC channel id. Typically correpsonds to a potentiometer-knob on the RC. - * @param param_value0 Initial parameter value - * @param scale Scale, maps the RC range [-1, 1] to a parameter value - * @param param_value_min Minimum param value. The protocol does not define if this overwrites an onboard minimum value. (Depends on implementation) - * @param param_value_max Maximum param value. The protocol does not define if this overwrites an onboard maximum value. (Depends on implementation) + * @param target_system System ID + * @param target_component Component ID + * @param param_id Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string + * @param param_index Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored), send -2 to disable any existing map for this rc_channel_index. + * @param parameter_rc_channel_index Index of parameter RC channel. Not equal to the RC channel id. Typically corresponds to a potentiometer-knob on the RC. + * @param param_value0 Initial parameter value + * @param scale Scale, maps the RC range [-1, 1] to a parameter value + * @param param_value_min Minimum param value. The protocol does not define if this overwrites an onboard minimum value. (Depends on implementation) + * @param param_value_max Maximum param value. The protocol does not define if this overwrites an onboard maximum value. (Depends on implementation) * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_param_map_rc_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -115,15 +115,15 @@ static inline uint16_t mavlink_msg_param_map_rc_pack(uint8_t system_id, uint8_t * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param target_system System ID - * @param target_component Component ID - * @param param_id Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string - * @param param_index Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored), send -2 to disable any existing map for this rc_channel_index. - * @param parameter_rc_channel_index Index of parameter RC channel. Not equal to the RC channel id. Typically correpsonds to a potentiometer-knob on the RC. - * @param param_value0 Initial parameter value - * @param scale Scale, maps the RC range [-1, 1] to a parameter value - * @param param_value_min Minimum param value. The protocol does not define if this overwrites an onboard minimum value. (Depends on implementation) - * @param param_value_max Maximum param value. The protocol does not define if this overwrites an onboard maximum value. (Depends on implementation) + * @param target_system System ID + * @param target_component Component ID + * @param param_id Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string + * @param param_index Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored), send -2 to disable any existing map for this rc_channel_index. + * @param parameter_rc_channel_index Index of parameter RC channel. Not equal to the RC channel id. Typically corresponds to a potentiometer-knob on the RC. + * @param param_value0 Initial parameter value + * @param scale Scale, maps the RC range [-1, 1] to a parameter value + * @param param_value_min Minimum param value. The protocol does not define if this overwrites an onboard minimum value. (Depends on implementation) + * @param param_value_max Maximum param value. The protocol does not define if this overwrites an onboard maximum value. (Depends on implementation) * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_param_map_rc_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -191,15 +191,15 @@ static inline uint16_t mavlink_msg_param_map_rc_encode_chan(uint8_t system_id, u * @brief Send a param_map_rc message * @param chan MAVLink channel to send the message * - * @param target_system System ID - * @param target_component Component ID - * @param param_id Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string - * @param param_index Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored), send -2 to disable any existing map for this rc_channel_index. - * @param parameter_rc_channel_index Index of parameter RC channel. Not equal to the RC channel id. Typically correpsonds to a potentiometer-knob on the RC. - * @param param_value0 Initial parameter value - * @param scale Scale, maps the RC range [-1, 1] to a parameter value - * @param param_value_min Minimum param value. The protocol does not define if this overwrites an onboard minimum value. (Depends on implementation) - * @param param_value_max Maximum param value. The protocol does not define if this overwrites an onboard maximum value. (Depends on implementation) + * @param target_system System ID + * @param target_component Component ID + * @param param_id Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string + * @param param_index Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored), send -2 to disable any existing map for this rc_channel_index. + * @param parameter_rc_channel_index Index of parameter RC channel. Not equal to the RC channel id. Typically corresponds to a potentiometer-knob on the RC. + * @param param_value0 Initial parameter value + * @param scale Scale, maps the RC range [-1, 1] to a parameter value + * @param param_value_min Minimum param value. The protocol does not define if this overwrites an onboard minimum value. (Depends on implementation) + * @param param_value_max Maximum param value. The protocol does not define if this overwrites an onboard maximum value. (Depends on implementation) */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -292,7 +292,7 @@ static inline void mavlink_msg_param_map_rc_send_buf(mavlink_message_t *msgbuf, /** * @brief Get field target_system from param_map_rc message * - * @return System ID + * @return System ID */ static inline uint8_t mavlink_msg_param_map_rc_get_target_system(const mavlink_message_t* msg) { @@ -302,7 +302,7 @@ static inline uint8_t mavlink_msg_param_map_rc_get_target_system(const mavlink_m /** * @brief Get field target_component from param_map_rc message * - * @return Component ID + * @return Component ID */ static inline uint8_t mavlink_msg_param_map_rc_get_target_component(const mavlink_message_t* msg) { @@ -312,7 +312,7 @@ static inline uint8_t mavlink_msg_param_map_rc_get_target_component(const mavlin /** * @brief Get field param_id from param_map_rc message * - * @return Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string + * @return Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string */ static inline uint16_t mavlink_msg_param_map_rc_get_param_id(const mavlink_message_t* msg, char *param_id) { @@ -322,7 +322,7 @@ static inline uint16_t mavlink_msg_param_map_rc_get_param_id(const mavlink_messa /** * @brief Get field param_index from param_map_rc message * - * @return Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored), send -2 to disable any existing map for this rc_channel_index. + * @return Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored), send -2 to disable any existing map for this rc_channel_index. */ static inline int16_t mavlink_msg_param_map_rc_get_param_index(const mavlink_message_t* msg) { @@ -332,7 +332,7 @@ static inline int16_t mavlink_msg_param_map_rc_get_param_index(const mavlink_mes /** * @brief Get field parameter_rc_channel_index from param_map_rc message * - * @return Index of parameter RC channel. Not equal to the RC channel id. Typically correpsonds to a potentiometer-knob on the RC. + * @return Index of parameter RC channel. Not equal to the RC channel id. Typically corresponds to a potentiometer-knob on the RC. */ static inline uint8_t mavlink_msg_param_map_rc_get_parameter_rc_channel_index(const mavlink_message_t* msg) { @@ -342,7 +342,7 @@ static inline uint8_t mavlink_msg_param_map_rc_get_parameter_rc_channel_index(co /** * @brief Get field param_value0 from param_map_rc message * - * @return Initial parameter value + * @return Initial parameter value */ static inline float mavlink_msg_param_map_rc_get_param_value0(const mavlink_message_t* msg) { @@ -352,7 +352,7 @@ static inline float mavlink_msg_param_map_rc_get_param_value0(const mavlink_mess /** * @brief Get field scale from param_map_rc message * - * @return Scale, maps the RC range [-1, 1] to a parameter value + * @return Scale, maps the RC range [-1, 1] to a parameter value */ static inline float mavlink_msg_param_map_rc_get_scale(const mavlink_message_t* msg) { @@ -362,7 +362,7 @@ static inline float mavlink_msg_param_map_rc_get_scale(const mavlink_message_t* /** * @brief Get field param_value_min from param_map_rc message * - * @return Minimum param value. The protocol does not define if this overwrites an onboard minimum value. (Depends on implementation) + * @return Minimum param value. The protocol does not define if this overwrites an onboard minimum value. (Depends on implementation) */ static inline float mavlink_msg_param_map_rc_get_param_value_min(const mavlink_message_t* msg) { @@ -372,7 +372,7 @@ static inline float mavlink_msg_param_map_rc_get_param_value_min(const mavlink_m /** * @brief Get field param_value_max from param_map_rc message * - * @return Maximum param value. The protocol does not define if this overwrites an onboard maximum value. (Depends on implementation) + * @return Maximum param value. The protocol does not define if this overwrites an onboard maximum value. (Depends on implementation) */ static inline float mavlink_msg_param_map_rc_get_param_value_max(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_param_request_list.h b/lib/main/MAVLink/common/mavlink_msg_param_request_list.h index 2c5da24bc6..e8ad2157d4 100755 --- a/lib/main/MAVLink/common/mavlink_msg_param_request_list.h +++ b/lib/main/MAVLink/common/mavlink_msg_param_request_list.h @@ -3,11 +3,11 @@ #define MAVLINK_MSG_ID_PARAM_REQUEST_LIST 21 -MAVPACKED( + typedef struct __mavlink_param_request_list_t { - uint8_t target_system; /*< System ID*/ - uint8_t target_component; /*< Component ID*/ -}) mavlink_param_request_list_t; + uint8_t target_system; /*< System ID*/ + uint8_t target_component; /*< Component ID*/ +} mavlink_param_request_list_t; #define MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN 2 #define MAVLINK_MSG_ID_PARAM_REQUEST_LIST_MIN_LEN 2 @@ -44,8 +44,8 @@ typedef struct __mavlink_param_request_list_t { * @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 target_system System ID + * @param target_component Component ID * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_param_request_list_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -75,8 +75,8 @@ static inline uint16_t mavlink_msg_param_request_list_pack(uint8_t system_id, ui * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param target_system System ID - * @param target_component Component ID + * @param target_system System ID + * @param target_component Component ID * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_param_request_list_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -132,8 +132,8 @@ static inline uint16_t mavlink_msg_param_request_list_encode_chan(uint8_t system * @brief Send a param_request_list message * @param chan MAVLink channel to send the message * - * @param target_system System ID - * @param target_component Component ID + * @param target_system System ID + * @param target_component Component ID */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -202,7 +202,7 @@ static inline void mavlink_msg_param_request_list_send_buf(mavlink_message_t *ms /** * @brief Get field target_system from param_request_list message * - * @return System ID + * @return System ID */ static inline uint8_t mavlink_msg_param_request_list_get_target_system(const mavlink_message_t* msg) { @@ -212,7 +212,7 @@ static inline uint8_t mavlink_msg_param_request_list_get_target_system(const mav /** * @brief Get field target_component from param_request_list message * - * @return Component ID + * @return Component ID */ static inline uint8_t mavlink_msg_param_request_list_get_target_component(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_param_request_read.h b/lib/main/MAVLink/common/mavlink_msg_param_request_read.h index 5381596727..92a3e86685 100755 --- a/lib/main/MAVLink/common/mavlink_msg_param_request_read.h +++ b/lib/main/MAVLink/common/mavlink_msg_param_request_read.h @@ -3,13 +3,13 @@ #define MAVLINK_MSG_ID_PARAM_REQUEST_READ 20 -MAVPACKED( + typedef struct __mavlink_param_request_read_t { - int16_t param_index; /*< Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored)*/ - uint8_t target_system; /*< System ID*/ - uint8_t target_component; /*< Component ID*/ - char param_id[16]; /*< Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string*/ -}) mavlink_param_request_read_t; + int16_t param_index; /*< Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored)*/ + uint8_t target_system; /*< System ID*/ + uint8_t target_component; /*< Component ID*/ + char param_id[16]; /*< Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string*/ +} mavlink_param_request_read_t; #define MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN 20 #define MAVLINK_MSG_ID_PARAM_REQUEST_READ_MIN_LEN 20 @@ -26,20 +26,20 @@ typedef struct __mavlink_param_request_read_t { 20, \ "PARAM_REQUEST_READ", \ 4, \ - { { "param_index", NULL, MAVLINK_TYPE_INT16_T, 0, 0, offsetof(mavlink_param_request_read_t, param_index) }, \ - { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_param_request_read_t, target_system) }, \ + { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_param_request_read_t, target_system) }, \ { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_param_request_read_t, target_component) }, \ { "param_id", NULL, MAVLINK_TYPE_CHAR, 16, 4, offsetof(mavlink_param_request_read_t, param_id) }, \ + { "param_index", NULL, MAVLINK_TYPE_INT16_T, 0, 0, offsetof(mavlink_param_request_read_t, param_index) }, \ } \ } #else #define MAVLINK_MESSAGE_INFO_PARAM_REQUEST_READ { \ "PARAM_REQUEST_READ", \ 4, \ - { { "param_index", NULL, MAVLINK_TYPE_INT16_T, 0, 0, offsetof(mavlink_param_request_read_t, param_index) }, \ - { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_param_request_read_t, target_system) }, \ + { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_param_request_read_t, target_system) }, \ { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_param_request_read_t, target_component) }, \ { "param_id", NULL, MAVLINK_TYPE_CHAR, 16, 4, offsetof(mavlink_param_request_read_t, param_id) }, \ + { "param_index", NULL, MAVLINK_TYPE_INT16_T, 0, 0, offsetof(mavlink_param_request_read_t, param_index) }, \ } \ } #endif @@ -50,10 +50,10 @@ typedef struct __mavlink_param_request_read_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param target_system System ID - * @param target_component Component ID - * @param param_id Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string - * @param param_index Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored) + * @param target_system System ID + * @param target_component Component ID + * @param param_id Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string + * @param param_index Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored) * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_param_request_read_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -85,10 +85,10 @@ static inline uint16_t mavlink_msg_param_request_read_pack(uint8_t system_id, ui * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param target_system System ID - * @param target_component Component ID - * @param param_id Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string - * @param param_index Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored) + * @param target_system System ID + * @param target_component Component ID + * @param param_id Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string + * @param param_index Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored) * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_param_request_read_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -146,10 +146,10 @@ static inline uint16_t mavlink_msg_param_request_read_encode_chan(uint8_t system * @brief Send a param_request_read message * @param chan MAVLink channel to send the message * - * @param target_system System ID - * @param target_component Component ID - * @param param_id Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string - * @param param_index Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored) + * @param target_system System ID + * @param target_component Component ID + * @param param_id Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string + * @param param_index Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored) */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -222,7 +222,7 @@ static inline void mavlink_msg_param_request_read_send_buf(mavlink_message_t *ms /** * @brief Get field target_system from param_request_read message * - * @return System ID + * @return System ID */ static inline uint8_t mavlink_msg_param_request_read_get_target_system(const mavlink_message_t* msg) { @@ -232,7 +232,7 @@ static inline uint8_t mavlink_msg_param_request_read_get_target_system(const mav /** * @brief Get field target_component from param_request_read message * - * @return Component ID + * @return Component ID */ static inline uint8_t mavlink_msg_param_request_read_get_target_component(const mavlink_message_t* msg) { @@ -242,7 +242,7 @@ static inline uint8_t mavlink_msg_param_request_read_get_target_component(const /** * @brief Get field param_id from param_request_read message * - * @return Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string + * @return Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string */ static inline uint16_t mavlink_msg_param_request_read_get_param_id(const mavlink_message_t* msg, char *param_id) { @@ -252,7 +252,7 @@ static inline uint16_t mavlink_msg_param_request_read_get_param_id(const mavlink /** * @brief Get field param_index from param_request_read message * - * @return Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored) + * @return Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored) */ static inline int16_t mavlink_msg_param_request_read_get_param_index(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_param_set.h b/lib/main/MAVLink/common/mavlink_msg_param_set.h index cc73109bce..72039bca9a 100755 --- a/lib/main/MAVLink/common/mavlink_msg_param_set.h +++ b/lib/main/MAVLink/common/mavlink_msg_param_set.h @@ -3,14 +3,14 @@ #define MAVLINK_MSG_ID_PARAM_SET 23 -MAVPACKED( + typedef struct __mavlink_param_set_t { - float param_value; /*< Onboard parameter value*/ - uint8_t target_system; /*< System ID*/ - uint8_t target_component; /*< Component ID*/ - char param_id[16]; /*< Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string*/ - uint8_t param_type; /*< Onboard parameter type: see the MAV_PARAM_TYPE enum for supported data types.*/ -}) mavlink_param_set_t; + float param_value; /*< Onboard parameter value*/ + uint8_t target_system; /*< System ID*/ + uint8_t target_component; /*< Component ID*/ + char param_id[16]; /*< Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string*/ + uint8_t param_type; /*< Onboard parameter type.*/ +} mavlink_param_set_t; #define MAVLINK_MSG_ID_PARAM_SET_LEN 23 #define MAVLINK_MSG_ID_PARAM_SET_MIN_LEN 23 @@ -27,10 +27,10 @@ typedef struct __mavlink_param_set_t { 23, \ "PARAM_SET", \ 5, \ - { { "param_value", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_param_set_t, param_value) }, \ - { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_param_set_t, target_system) }, \ + { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_param_set_t, target_system) }, \ { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_param_set_t, target_component) }, \ { "param_id", NULL, MAVLINK_TYPE_CHAR, 16, 6, offsetof(mavlink_param_set_t, param_id) }, \ + { "param_value", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_param_set_t, param_value) }, \ { "param_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 22, offsetof(mavlink_param_set_t, param_type) }, \ } \ } @@ -38,10 +38,10 @@ typedef struct __mavlink_param_set_t { #define MAVLINK_MESSAGE_INFO_PARAM_SET { \ "PARAM_SET", \ 5, \ - { { "param_value", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_param_set_t, param_value) }, \ - { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_param_set_t, target_system) }, \ + { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_param_set_t, target_system) }, \ { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_param_set_t, target_component) }, \ { "param_id", NULL, MAVLINK_TYPE_CHAR, 16, 6, offsetof(mavlink_param_set_t, param_id) }, \ + { "param_value", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_param_set_t, param_value) }, \ { "param_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 22, offsetof(mavlink_param_set_t, param_type) }, \ } \ } @@ -53,11 +53,11 @@ typedef struct __mavlink_param_set_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param target_system System ID - * @param target_component Component ID - * @param param_id Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string - * @param param_value Onboard parameter value - * @param param_type Onboard parameter type: see the MAV_PARAM_TYPE enum for supported data types. + * @param target_system System ID + * @param target_component Component ID + * @param param_id Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string + * @param param_value Onboard parameter value + * @param param_type Onboard parameter type. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_param_set_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -91,11 +91,11 @@ static inline uint16_t mavlink_msg_param_set_pack(uint8_t system_id, uint8_t com * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param target_system System ID - * @param target_component Component ID - * @param param_id Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string - * @param param_value Onboard parameter value - * @param param_type Onboard parameter type: see the MAV_PARAM_TYPE enum for supported data types. + * @param target_system System ID + * @param target_component Component ID + * @param param_id Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string + * @param param_value Onboard parameter value + * @param param_type Onboard parameter type. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_param_set_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -155,11 +155,11 @@ static inline uint16_t mavlink_msg_param_set_encode_chan(uint8_t system_id, uint * @brief Send a param_set message * @param chan MAVLink channel to send the message * - * @param target_system System ID - * @param target_component Component ID - * @param param_id Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string - * @param param_value Onboard parameter value - * @param param_type Onboard parameter type: see the MAV_PARAM_TYPE enum for supported data types. + * @param target_system System ID + * @param target_component Component ID + * @param param_id Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string + * @param param_value Onboard parameter value + * @param param_type Onboard parameter type. */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -236,7 +236,7 @@ static inline void mavlink_msg_param_set_send_buf(mavlink_message_t *msgbuf, mav /** * @brief Get field target_system from param_set message * - * @return System ID + * @return System ID */ static inline uint8_t mavlink_msg_param_set_get_target_system(const mavlink_message_t* msg) { @@ -246,7 +246,7 @@ static inline uint8_t mavlink_msg_param_set_get_target_system(const mavlink_mess /** * @brief Get field target_component from param_set message * - * @return Component ID + * @return Component ID */ static inline uint8_t mavlink_msg_param_set_get_target_component(const mavlink_message_t* msg) { @@ -256,7 +256,7 @@ static inline uint8_t mavlink_msg_param_set_get_target_component(const mavlink_m /** * @brief Get field param_id from param_set message * - * @return Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string + * @return Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string */ static inline uint16_t mavlink_msg_param_set_get_param_id(const mavlink_message_t* msg, char *param_id) { @@ -266,7 +266,7 @@ static inline uint16_t mavlink_msg_param_set_get_param_id(const mavlink_message_ /** * @brief Get field param_value from param_set message * - * @return Onboard parameter value + * @return Onboard parameter value */ static inline float mavlink_msg_param_set_get_param_value(const mavlink_message_t* msg) { @@ -276,7 +276,7 @@ static inline float mavlink_msg_param_set_get_param_value(const mavlink_message_ /** * @brief Get field param_type from param_set message * - * @return Onboard parameter type: see the MAV_PARAM_TYPE enum for supported data types. + * @return Onboard parameter type. */ static inline uint8_t mavlink_msg_param_set_get_param_type(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_param_value.h b/lib/main/MAVLink/common/mavlink_msg_param_value.h index e2cb891d02..e487917cc0 100755 --- a/lib/main/MAVLink/common/mavlink_msg_param_value.h +++ b/lib/main/MAVLink/common/mavlink_msg_param_value.h @@ -3,14 +3,14 @@ #define MAVLINK_MSG_ID_PARAM_VALUE 22 -MAVPACKED( + typedef struct __mavlink_param_value_t { - float param_value; /*< Onboard parameter value*/ - uint16_t param_count; /*< Total number of onboard parameters*/ - uint16_t param_index; /*< Index of this onboard parameter*/ - char param_id[16]; /*< Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string*/ - uint8_t param_type; /*< Onboard parameter type: see the MAV_PARAM_TYPE enum for supported data types.*/ -}) mavlink_param_value_t; + float param_value; /*< Onboard parameter value*/ + uint16_t param_count; /*< Total number of onboard parameters*/ + uint16_t param_index; /*< Index of this onboard parameter*/ + char param_id[16]; /*< Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string*/ + uint8_t param_type; /*< Onboard parameter type.*/ +} mavlink_param_value_t; #define MAVLINK_MSG_ID_PARAM_VALUE_LEN 25 #define MAVLINK_MSG_ID_PARAM_VALUE_MIN_LEN 25 @@ -27,22 +27,22 @@ typedef struct __mavlink_param_value_t { 22, \ "PARAM_VALUE", \ 5, \ - { { "param_value", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_param_value_t, param_value) }, \ + { { "param_id", NULL, MAVLINK_TYPE_CHAR, 16, 8, offsetof(mavlink_param_value_t, param_id) }, \ + { "param_value", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_param_value_t, param_value) }, \ + { "param_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 24, offsetof(mavlink_param_value_t, param_type) }, \ { "param_count", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_param_value_t, param_count) }, \ { "param_index", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_param_value_t, param_index) }, \ - { "param_id", NULL, MAVLINK_TYPE_CHAR, 16, 8, offsetof(mavlink_param_value_t, param_id) }, \ - { "param_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 24, offsetof(mavlink_param_value_t, param_type) }, \ } \ } #else #define MAVLINK_MESSAGE_INFO_PARAM_VALUE { \ "PARAM_VALUE", \ 5, \ - { { "param_value", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_param_value_t, param_value) }, \ + { { "param_id", NULL, MAVLINK_TYPE_CHAR, 16, 8, offsetof(mavlink_param_value_t, param_id) }, \ + { "param_value", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_param_value_t, param_value) }, \ + { "param_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 24, offsetof(mavlink_param_value_t, param_type) }, \ { "param_count", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_param_value_t, param_count) }, \ { "param_index", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_param_value_t, param_index) }, \ - { "param_id", NULL, MAVLINK_TYPE_CHAR, 16, 8, offsetof(mavlink_param_value_t, param_id) }, \ - { "param_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 24, offsetof(mavlink_param_value_t, param_type) }, \ } \ } #endif @@ -53,11 +53,11 @@ typedef struct __mavlink_param_value_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param param_id Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string - * @param param_value Onboard parameter value - * @param param_type Onboard parameter type: see the MAV_PARAM_TYPE enum for supported data types. - * @param param_count Total number of onboard parameters - * @param param_index Index of this onboard parameter + * @param param_id Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string + * @param param_value Onboard parameter value + * @param param_type Onboard parameter type. + * @param param_count Total number of onboard parameters + * @param param_index Index of this onboard parameter * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_param_value_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -91,11 +91,11 @@ static inline uint16_t mavlink_msg_param_value_pack(uint8_t system_id, uint8_t c * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param param_id Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string - * @param param_value Onboard parameter value - * @param param_type Onboard parameter type: see the MAV_PARAM_TYPE enum for supported data types. - * @param param_count Total number of onboard parameters - * @param param_index Index of this onboard parameter + * @param param_id Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string + * @param param_value Onboard parameter value + * @param param_type Onboard parameter type. + * @param param_count Total number of onboard parameters + * @param param_index Index of this onboard parameter * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_param_value_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -155,11 +155,11 @@ static inline uint16_t mavlink_msg_param_value_encode_chan(uint8_t system_id, ui * @brief Send a param_value message * @param chan MAVLink channel to send the message * - * @param param_id Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string - * @param param_value Onboard parameter value - * @param param_type Onboard parameter type: see the MAV_PARAM_TYPE enum for supported data types. - * @param param_count Total number of onboard parameters - * @param param_index Index of this onboard parameter + * @param param_id Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string + * @param param_value Onboard parameter value + * @param param_type Onboard parameter type. + * @param param_count Total number of onboard parameters + * @param param_index Index of this onboard parameter */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -236,7 +236,7 @@ static inline void mavlink_msg_param_value_send_buf(mavlink_message_t *msgbuf, m /** * @brief Get field param_id from param_value message * - * @return Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string + * @return Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string */ static inline uint16_t mavlink_msg_param_value_get_param_id(const mavlink_message_t* msg, char *param_id) { @@ -246,7 +246,7 @@ static inline uint16_t mavlink_msg_param_value_get_param_id(const mavlink_messag /** * @brief Get field param_value from param_value message * - * @return Onboard parameter value + * @return Onboard parameter value */ static inline float mavlink_msg_param_value_get_param_value(const mavlink_message_t* msg) { @@ -256,7 +256,7 @@ static inline float mavlink_msg_param_value_get_param_value(const mavlink_messag /** * @brief Get field param_type from param_value message * - * @return Onboard parameter type: see the MAV_PARAM_TYPE enum for supported data types. + * @return Onboard parameter type. */ static inline uint8_t mavlink_msg_param_value_get_param_type(const mavlink_message_t* msg) { @@ -266,7 +266,7 @@ static inline uint8_t mavlink_msg_param_value_get_param_type(const mavlink_messa /** * @brief Get field param_count from param_value message * - * @return Total number of onboard parameters + * @return Total number of onboard parameters */ static inline uint16_t mavlink_msg_param_value_get_param_count(const mavlink_message_t* msg) { @@ -276,7 +276,7 @@ static inline uint16_t mavlink_msg_param_value_get_param_count(const mavlink_mes /** * @brief Get field param_index from param_value message * - * @return Index of this onboard parameter + * @return Index of this onboard parameter */ static inline uint16_t mavlink_msg_param_value_get_param_index(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_ping.h b/lib/main/MAVLink/common/mavlink_msg_ping.h index 1e18bc6726..1e5508d442 100755 --- a/lib/main/MAVLink/common/mavlink_msg_ping.h +++ b/lib/main/MAVLink/common/mavlink_msg_ping.h @@ -3,13 +3,13 @@ #define MAVLINK_MSG_ID_PING 4 -MAVPACKED( + typedef struct __mavlink_ping_t { - uint64_t time_usec; /*< Unix timestamp in microseconds or since system boot if smaller than MAVLink epoch (1.1.2009)*/ - uint32_t seq; /*< PING sequence*/ - uint8_t target_system; /*< 0: request ping from all receiving systems, if greater than 0: message is a ping response and number is the system id of the requesting system*/ - uint8_t target_component; /*< 0: request ping from all receiving components, if greater than 0: message is a ping response and number is the system id of the requesting system*/ -}) mavlink_ping_t; + uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.*/ + uint32_t seq; /*< PING sequence*/ + uint8_t target_system; /*< 0: request ping from all receiving systems. If greater than 0: message is a ping response and number is the system id of the requesting system*/ + uint8_t target_component; /*< 0: request ping from all receiving components. If greater than 0: message is a ping response and number is the component id of the requesting component.*/ +} mavlink_ping_t; #define MAVLINK_MSG_ID_PING_LEN 14 #define MAVLINK_MSG_ID_PING_MIN_LEN 14 @@ -50,10 +50,10 @@ typedef struct __mavlink_ping_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param time_usec Unix timestamp in microseconds or since system boot if smaller than MAVLink epoch (1.1.2009) - * @param seq PING sequence - * @param target_system 0: request ping from all receiving systems, if greater than 0: message is a ping response and number is the system id of the requesting system - * @param target_component 0: request ping from all receiving components, if greater than 0: message is a ping response and number is the system id of the requesting system + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param seq PING sequence + * @param target_system 0: request ping from all receiving systems. If greater than 0: message is a ping response and number is the system id of the requesting system + * @param target_component 0: request ping from all receiving components. If greater than 0: message is a ping response and number is the component id of the requesting component. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_ping_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -87,10 +87,10 @@ static inline uint16_t mavlink_msg_ping_pack(uint8_t system_id, uint8_t componen * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param time_usec Unix timestamp in microseconds or since system boot if smaller than MAVLink epoch (1.1.2009) - * @param seq PING sequence - * @param target_system 0: request ping from all receiving systems, if greater than 0: message is a ping response and number is the system id of the requesting system - * @param target_component 0: request ping from all receiving components, if greater than 0: message is a ping response and number is the system id of the requesting system + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param seq PING sequence + * @param target_system 0: request ping from all receiving systems. If greater than 0: message is a ping response and number is the system id of the requesting system + * @param target_component 0: request ping from all receiving components. If greater than 0: message is a ping response and number is the component id of the requesting component. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_ping_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -150,10 +150,10 @@ static inline uint16_t mavlink_msg_ping_encode_chan(uint8_t system_id, uint8_t c * @brief Send a ping message * @param chan MAVLink channel to send the message * - * @param time_usec Unix timestamp in microseconds or since system boot if smaller than MAVLink epoch (1.1.2009) - * @param seq PING sequence - * @param target_system 0: request ping from all receiving systems, if greater than 0: message is a ping response and number is the system id of the requesting system - * @param target_component 0: request ping from all receiving components, if greater than 0: message is a ping response and number is the system id of the requesting system + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param seq PING sequence + * @param target_system 0: request ping from all receiving systems. If greater than 0: message is a ping response and number is the system id of the requesting system + * @param target_component 0: request ping from all receiving components. If greater than 0: message is a ping response and number is the component id of the requesting component. */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -230,7 +230,7 @@ static inline void mavlink_msg_ping_send_buf(mavlink_message_t *msgbuf, mavlink_ /** * @brief Get field time_usec from ping message * - * @return Unix timestamp in microseconds or since system boot if smaller than MAVLink epoch (1.1.2009) + * @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. */ static inline uint64_t mavlink_msg_ping_get_time_usec(const mavlink_message_t* msg) { @@ -240,7 +240,7 @@ static inline uint64_t mavlink_msg_ping_get_time_usec(const mavlink_message_t* m /** * @brief Get field seq from ping message * - * @return PING sequence + * @return PING sequence */ static inline uint32_t mavlink_msg_ping_get_seq(const mavlink_message_t* msg) { @@ -250,7 +250,7 @@ static inline uint32_t mavlink_msg_ping_get_seq(const mavlink_message_t* msg) /** * @brief Get field target_system from ping message * - * @return 0: request ping from all receiving systems, if greater than 0: message is a ping response and number is the system id of the requesting system + * @return 0: request ping from all receiving systems. If greater than 0: message is a ping response and number is the system id of the requesting system */ static inline uint8_t mavlink_msg_ping_get_target_system(const mavlink_message_t* msg) { @@ -260,7 +260,7 @@ static inline uint8_t mavlink_msg_ping_get_target_system(const mavlink_message_t /** * @brief Get field target_component from ping message * - * @return 0: request ping from all receiving components, if greater than 0: message is a ping response and number is the system id of the requesting system + * @return 0: request ping from all receiving components. If greater than 0: message is a ping response and number is the component id of the requesting component. */ static inline uint8_t mavlink_msg_ping_get_target_component(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_position_target_global_int.h b/lib/main/MAVLink/common/mavlink_msg_position_target_global_int.h index 160a5fa4f0..93386fab75 100755 --- a/lib/main/MAVLink/common/mavlink_msg_position_target_global_int.h +++ b/lib/main/MAVLink/common/mavlink_msg_position_target_global_int.h @@ -3,23 +3,23 @@ #define MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT 87 -MAVPACKED( + typedef struct __mavlink_position_target_global_int_t { - uint32_t time_boot_ms; /*< Timestamp in milliseconds since system boot. The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency.*/ - int32_t lat_int; /*< X Position in WGS84 frame in 1e7 * meters*/ - int32_t lon_int; /*< Y Position in WGS84 frame in 1e7 * meters*/ - float alt; /*< Altitude in meters in AMSL altitude, not WGS84 if absolute or relative, above terrain if GLOBAL_TERRAIN_ALT_INT*/ - float vx; /*< X velocity in NED frame in meter / s*/ - float vy; /*< Y velocity in NED frame in meter / s*/ - float vz; /*< Z velocity in NED frame in meter / s*/ - float afx; /*< X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N*/ - float afy; /*< Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N*/ - float afz; /*< Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N*/ - float yaw; /*< yaw setpoint in rad*/ - float yaw_rate; /*< yaw rate setpoint in rad/s*/ - uint16_t type_mask; /*< Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate*/ - uint8_t coordinate_frame; /*< Valid options are: MAV_FRAME_GLOBAL_INT = 5, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11*/ -}) mavlink_position_target_global_int_t; + uint32_t time_boot_ms; /*< [ms] Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency.*/ + int32_t lat_int; /*< [degE7] X Position in WGS84 frame*/ + int32_t lon_int; /*< [degE7] Y Position in WGS84 frame*/ + float alt; /*< [m] Altitude (MSL, AGL or relative to home altitude, depending on frame)*/ + float vx; /*< [m/s] X velocity in NED frame*/ + float vy; /*< [m/s] Y velocity in NED frame*/ + float vz; /*< [m/s] Z velocity in NED frame*/ + float afx; /*< [m/s/s] X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N*/ + float afy; /*< [m/s/s] Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N*/ + float afz; /*< [m/s/s] Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N*/ + float yaw; /*< [rad] yaw setpoint*/ + float yaw_rate; /*< [rad/s] yaw rate setpoint*/ + uint16_t type_mask; /*< Bitmap to indicate which dimensions should be ignored by the vehicle.*/ + uint8_t coordinate_frame; /*< Valid options are: MAV_FRAME_GLOBAL_INT = 5, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11*/ +} mavlink_position_target_global_int_t; #define MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN 51 #define MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_MIN_LEN 51 @@ -37,6 +37,8 @@ typedef struct __mavlink_position_target_global_int_t { "POSITION_TARGET_GLOBAL_INT", \ 14, \ { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_position_target_global_int_t, time_boot_ms) }, \ + { "coordinate_frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 50, offsetof(mavlink_position_target_global_int_t, coordinate_frame) }, \ + { "type_mask", NULL, MAVLINK_TYPE_UINT16_T, 0, 48, offsetof(mavlink_position_target_global_int_t, type_mask) }, \ { "lat_int", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_position_target_global_int_t, lat_int) }, \ { "lon_int", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_position_target_global_int_t, lon_int) }, \ { "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_position_target_global_int_t, alt) }, \ @@ -48,8 +50,6 @@ typedef struct __mavlink_position_target_global_int_t { { "afz", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_position_target_global_int_t, afz) }, \ { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_position_target_global_int_t, yaw) }, \ { "yaw_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_position_target_global_int_t, yaw_rate) }, \ - { "type_mask", NULL, MAVLINK_TYPE_UINT16_T, 0, 48, offsetof(mavlink_position_target_global_int_t, type_mask) }, \ - { "coordinate_frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 50, offsetof(mavlink_position_target_global_int_t, coordinate_frame) }, \ } \ } #else @@ -57,6 +57,8 @@ typedef struct __mavlink_position_target_global_int_t { "POSITION_TARGET_GLOBAL_INT", \ 14, \ { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_position_target_global_int_t, time_boot_ms) }, \ + { "coordinate_frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 50, offsetof(mavlink_position_target_global_int_t, coordinate_frame) }, \ + { "type_mask", NULL, MAVLINK_TYPE_UINT16_T, 0, 48, offsetof(mavlink_position_target_global_int_t, type_mask) }, \ { "lat_int", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_position_target_global_int_t, lat_int) }, \ { "lon_int", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_position_target_global_int_t, lon_int) }, \ { "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_position_target_global_int_t, alt) }, \ @@ -68,8 +70,6 @@ typedef struct __mavlink_position_target_global_int_t { { "afz", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_position_target_global_int_t, afz) }, \ { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_position_target_global_int_t, yaw) }, \ { "yaw_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_position_target_global_int_t, yaw_rate) }, \ - { "type_mask", NULL, MAVLINK_TYPE_UINT16_T, 0, 48, offsetof(mavlink_position_target_global_int_t, type_mask) }, \ - { "coordinate_frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 50, offsetof(mavlink_position_target_global_int_t, coordinate_frame) }, \ } \ } #endif @@ -80,20 +80,20 @@ typedef struct __mavlink_position_target_global_int_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param time_boot_ms Timestamp in milliseconds since system boot. The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency. - * @param coordinate_frame Valid options are: MAV_FRAME_GLOBAL_INT = 5, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11 - * @param type_mask Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate - * @param lat_int X Position in WGS84 frame in 1e7 * meters - * @param lon_int Y Position in WGS84 frame in 1e7 * meters - * @param alt Altitude in meters in AMSL altitude, not WGS84 if absolute or relative, above terrain if GLOBAL_TERRAIN_ALT_INT - * @param vx X velocity in NED frame in meter / s - * @param vy Y velocity in NED frame in meter / s - * @param vz Z velocity in NED frame in meter / s - * @param afx X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N - * @param afy Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N - * @param afz Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N - * @param yaw yaw setpoint in rad - * @param yaw_rate yaw rate setpoint in rad/s + * @param time_boot_ms [ms] Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency. + * @param coordinate_frame Valid options are: MAV_FRAME_GLOBAL_INT = 5, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11 + * @param type_mask Bitmap to indicate which dimensions should be ignored by the vehicle. + * @param lat_int [degE7] X Position in WGS84 frame + * @param lon_int [degE7] Y Position in WGS84 frame + * @param alt [m] Altitude (MSL, AGL or relative to home altitude, depending on frame) + * @param vx [m/s] X velocity in NED frame + * @param vy [m/s] Y velocity in NED frame + * @param vz [m/s] Z velocity in NED frame + * @param afx [m/s/s] X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + * @param afy [m/s/s] Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + * @param afz [m/s/s] Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + * @param yaw [rad] yaw setpoint + * @param yaw_rate [rad/s] yaw rate setpoint * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_position_target_global_int_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -147,20 +147,20 @@ static inline uint16_t mavlink_msg_position_target_global_int_pack(uint8_t syste * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param time_boot_ms Timestamp in milliseconds since system boot. The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency. - * @param coordinate_frame Valid options are: MAV_FRAME_GLOBAL_INT = 5, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11 - * @param type_mask Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate - * @param lat_int X Position in WGS84 frame in 1e7 * meters - * @param lon_int Y Position in WGS84 frame in 1e7 * meters - * @param alt Altitude in meters in AMSL altitude, not WGS84 if absolute or relative, above terrain if GLOBAL_TERRAIN_ALT_INT - * @param vx X velocity in NED frame in meter / s - * @param vy Y velocity in NED frame in meter / s - * @param vz Z velocity in NED frame in meter / s - * @param afx X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N - * @param afy Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N - * @param afz Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N - * @param yaw yaw setpoint in rad - * @param yaw_rate yaw rate setpoint in rad/s + * @param time_boot_ms [ms] Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency. + * @param coordinate_frame Valid options are: MAV_FRAME_GLOBAL_INT = 5, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11 + * @param type_mask Bitmap to indicate which dimensions should be ignored by the vehicle. + * @param lat_int [degE7] X Position in WGS84 frame + * @param lon_int [degE7] Y Position in WGS84 frame + * @param alt [m] Altitude (MSL, AGL or relative to home altitude, depending on frame) + * @param vx [m/s] X velocity in NED frame + * @param vy [m/s] Y velocity in NED frame + * @param vz [m/s] Z velocity in NED frame + * @param afx [m/s/s] X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + * @param afy [m/s/s] Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + * @param afz [m/s/s] Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + * @param yaw [rad] yaw setpoint + * @param yaw_rate [rad/s] yaw rate setpoint * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_position_target_global_int_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -240,20 +240,20 @@ static inline uint16_t mavlink_msg_position_target_global_int_encode_chan(uint8_ * @brief Send a position_target_global_int message * @param chan MAVLink channel to send the message * - * @param time_boot_ms Timestamp in milliseconds since system boot. The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency. - * @param coordinate_frame Valid options are: MAV_FRAME_GLOBAL_INT = 5, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11 - * @param type_mask Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate - * @param lat_int X Position in WGS84 frame in 1e7 * meters - * @param lon_int Y Position in WGS84 frame in 1e7 * meters - * @param alt Altitude in meters in AMSL altitude, not WGS84 if absolute or relative, above terrain if GLOBAL_TERRAIN_ALT_INT - * @param vx X velocity in NED frame in meter / s - * @param vy Y velocity in NED frame in meter / s - * @param vz Z velocity in NED frame in meter / s - * @param afx X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N - * @param afy Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N - * @param afz Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N - * @param yaw yaw setpoint in rad - * @param yaw_rate yaw rate setpoint in rad/s + * @param time_boot_ms [ms] Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency. + * @param coordinate_frame Valid options are: MAV_FRAME_GLOBAL_INT = 5, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11 + * @param type_mask Bitmap to indicate which dimensions should be ignored by the vehicle. + * @param lat_int [degE7] X Position in WGS84 frame + * @param lon_int [degE7] Y Position in WGS84 frame + * @param alt [m] Altitude (MSL, AGL or relative to home altitude, depending on frame) + * @param vx [m/s] X velocity in NED frame + * @param vy [m/s] Y velocity in NED frame + * @param vz [m/s] Z velocity in NED frame + * @param afx [m/s/s] X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + * @param afy [m/s/s] Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + * @param afz [m/s/s] Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + * @param yaw [rad] yaw setpoint + * @param yaw_rate [rad/s] yaw rate setpoint */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -370,7 +370,7 @@ static inline void mavlink_msg_position_target_global_int_send_buf(mavlink_messa /** * @brief Get field time_boot_ms from position_target_global_int message * - * @return Timestamp in milliseconds since system boot. The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency. + * @return [ms] Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency. */ static inline uint32_t mavlink_msg_position_target_global_int_get_time_boot_ms(const mavlink_message_t* msg) { @@ -380,7 +380,7 @@ static inline uint32_t mavlink_msg_position_target_global_int_get_time_boot_ms(c /** * @brief Get field coordinate_frame from position_target_global_int message * - * @return Valid options are: MAV_FRAME_GLOBAL_INT = 5, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11 + * @return Valid options are: MAV_FRAME_GLOBAL_INT = 5, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11 */ static inline uint8_t mavlink_msg_position_target_global_int_get_coordinate_frame(const mavlink_message_t* msg) { @@ -390,7 +390,7 @@ static inline uint8_t mavlink_msg_position_target_global_int_get_coordinate_fram /** * @brief Get field type_mask from position_target_global_int message * - * @return Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate + * @return Bitmap to indicate which dimensions should be ignored by the vehicle. */ static inline uint16_t mavlink_msg_position_target_global_int_get_type_mask(const mavlink_message_t* msg) { @@ -400,7 +400,7 @@ static inline uint16_t mavlink_msg_position_target_global_int_get_type_mask(cons /** * @brief Get field lat_int from position_target_global_int message * - * @return X Position in WGS84 frame in 1e7 * meters + * @return [degE7] X Position in WGS84 frame */ static inline int32_t mavlink_msg_position_target_global_int_get_lat_int(const mavlink_message_t* msg) { @@ -410,7 +410,7 @@ static inline int32_t mavlink_msg_position_target_global_int_get_lat_int(const m /** * @brief Get field lon_int from position_target_global_int message * - * @return Y Position in WGS84 frame in 1e7 * meters + * @return [degE7] Y Position in WGS84 frame */ static inline int32_t mavlink_msg_position_target_global_int_get_lon_int(const mavlink_message_t* msg) { @@ -420,7 +420,7 @@ static inline int32_t mavlink_msg_position_target_global_int_get_lon_int(const m /** * @brief Get field alt from position_target_global_int message * - * @return Altitude in meters in AMSL altitude, not WGS84 if absolute or relative, above terrain if GLOBAL_TERRAIN_ALT_INT + * @return [m] Altitude (MSL, AGL or relative to home altitude, depending on frame) */ static inline float mavlink_msg_position_target_global_int_get_alt(const mavlink_message_t* msg) { @@ -430,7 +430,7 @@ static inline float mavlink_msg_position_target_global_int_get_alt(const mavlink /** * @brief Get field vx from position_target_global_int message * - * @return X velocity in NED frame in meter / s + * @return [m/s] X velocity in NED frame */ static inline float mavlink_msg_position_target_global_int_get_vx(const mavlink_message_t* msg) { @@ -440,7 +440,7 @@ static inline float mavlink_msg_position_target_global_int_get_vx(const mavlink_ /** * @brief Get field vy from position_target_global_int message * - * @return Y velocity in NED frame in meter / s + * @return [m/s] Y velocity in NED frame */ static inline float mavlink_msg_position_target_global_int_get_vy(const mavlink_message_t* msg) { @@ -450,7 +450,7 @@ static inline float mavlink_msg_position_target_global_int_get_vy(const mavlink_ /** * @brief Get field vz from position_target_global_int message * - * @return Z velocity in NED frame in meter / s + * @return [m/s] Z velocity in NED frame */ static inline float mavlink_msg_position_target_global_int_get_vz(const mavlink_message_t* msg) { @@ -460,7 +460,7 @@ static inline float mavlink_msg_position_target_global_int_get_vz(const mavlink_ /** * @brief Get field afx from position_target_global_int message * - * @return X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + * @return [m/s/s] X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N */ static inline float mavlink_msg_position_target_global_int_get_afx(const mavlink_message_t* msg) { @@ -470,7 +470,7 @@ static inline float mavlink_msg_position_target_global_int_get_afx(const mavlink /** * @brief Get field afy from position_target_global_int message * - * @return Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + * @return [m/s/s] Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N */ static inline float mavlink_msg_position_target_global_int_get_afy(const mavlink_message_t* msg) { @@ -480,7 +480,7 @@ static inline float mavlink_msg_position_target_global_int_get_afy(const mavlink /** * @brief Get field afz from position_target_global_int message * - * @return Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + * @return [m/s/s] Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N */ static inline float mavlink_msg_position_target_global_int_get_afz(const mavlink_message_t* msg) { @@ -490,7 +490,7 @@ static inline float mavlink_msg_position_target_global_int_get_afz(const mavlink /** * @brief Get field yaw from position_target_global_int message * - * @return yaw setpoint in rad + * @return [rad] yaw setpoint */ static inline float mavlink_msg_position_target_global_int_get_yaw(const mavlink_message_t* msg) { @@ -500,7 +500,7 @@ static inline float mavlink_msg_position_target_global_int_get_yaw(const mavlink /** * @brief Get field yaw_rate from position_target_global_int message * - * @return yaw rate setpoint in rad/s + * @return [rad/s] yaw rate setpoint */ static inline float mavlink_msg_position_target_global_int_get_yaw_rate(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_position_target_local_ned.h b/lib/main/MAVLink/common/mavlink_msg_position_target_local_ned.h index 3464e9aad8..f3cfde26e3 100755 --- a/lib/main/MAVLink/common/mavlink_msg_position_target_local_ned.h +++ b/lib/main/MAVLink/common/mavlink_msg_position_target_local_ned.h @@ -3,23 +3,23 @@ #define MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED 85 -MAVPACKED( + typedef struct __mavlink_position_target_local_ned_t { - uint32_t time_boot_ms; /*< Timestamp in milliseconds since system boot*/ - float x; /*< X Position in NED frame in meters*/ - float y; /*< Y Position in NED frame in meters*/ - float z; /*< Z Position in NED frame in meters (note, altitude is negative in NED)*/ - float vx; /*< X velocity in NED frame in meter / s*/ - float vy; /*< Y velocity in NED frame in meter / s*/ - float vz; /*< Z velocity in NED frame in meter / s*/ - float afx; /*< X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N*/ - float afy; /*< Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N*/ - float afz; /*< Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N*/ - float yaw; /*< yaw setpoint in rad*/ - float yaw_rate; /*< yaw rate setpoint in rad/s*/ - uint16_t type_mask; /*< Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate*/ - uint8_t coordinate_frame; /*< Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9*/ -}) mavlink_position_target_local_ned_t; + uint32_t time_boot_ms; /*< [ms] Timestamp (time since system boot).*/ + float x; /*< [m] X Position in NED frame*/ + float y; /*< [m] Y Position in NED frame*/ + float z; /*< [m] Z Position in NED frame (note, altitude is negative in NED)*/ + float vx; /*< [m/s] X velocity in NED frame*/ + float vy; /*< [m/s] Y velocity in NED frame*/ + float vz; /*< [m/s] Z velocity in NED frame*/ + float afx; /*< [m/s/s] X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N*/ + float afy; /*< [m/s/s] Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N*/ + float afz; /*< [m/s/s] Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N*/ + float yaw; /*< [rad] yaw setpoint*/ + float yaw_rate; /*< [rad/s] yaw rate setpoint*/ + uint16_t type_mask; /*< Bitmap to indicate which dimensions should be ignored by the vehicle.*/ + uint8_t coordinate_frame; /*< Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9*/ +} mavlink_position_target_local_ned_t; #define MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN 51 #define MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_MIN_LEN 51 @@ -37,6 +37,8 @@ typedef struct __mavlink_position_target_local_ned_t { "POSITION_TARGET_LOCAL_NED", \ 14, \ { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_position_target_local_ned_t, time_boot_ms) }, \ + { "coordinate_frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 50, offsetof(mavlink_position_target_local_ned_t, coordinate_frame) }, \ + { "type_mask", NULL, MAVLINK_TYPE_UINT16_T, 0, 48, offsetof(mavlink_position_target_local_ned_t, type_mask) }, \ { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_position_target_local_ned_t, x) }, \ { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_position_target_local_ned_t, y) }, \ { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_position_target_local_ned_t, z) }, \ @@ -48,8 +50,6 @@ typedef struct __mavlink_position_target_local_ned_t { { "afz", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_position_target_local_ned_t, afz) }, \ { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_position_target_local_ned_t, yaw) }, \ { "yaw_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_position_target_local_ned_t, yaw_rate) }, \ - { "type_mask", NULL, MAVLINK_TYPE_UINT16_T, 0, 48, offsetof(mavlink_position_target_local_ned_t, type_mask) }, \ - { "coordinate_frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 50, offsetof(mavlink_position_target_local_ned_t, coordinate_frame) }, \ } \ } #else @@ -57,6 +57,8 @@ typedef struct __mavlink_position_target_local_ned_t { "POSITION_TARGET_LOCAL_NED", \ 14, \ { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_position_target_local_ned_t, time_boot_ms) }, \ + { "coordinate_frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 50, offsetof(mavlink_position_target_local_ned_t, coordinate_frame) }, \ + { "type_mask", NULL, MAVLINK_TYPE_UINT16_T, 0, 48, offsetof(mavlink_position_target_local_ned_t, type_mask) }, \ { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_position_target_local_ned_t, x) }, \ { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_position_target_local_ned_t, y) }, \ { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_position_target_local_ned_t, z) }, \ @@ -68,8 +70,6 @@ typedef struct __mavlink_position_target_local_ned_t { { "afz", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_position_target_local_ned_t, afz) }, \ { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_position_target_local_ned_t, yaw) }, \ { "yaw_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_position_target_local_ned_t, yaw_rate) }, \ - { "type_mask", NULL, MAVLINK_TYPE_UINT16_T, 0, 48, offsetof(mavlink_position_target_local_ned_t, type_mask) }, \ - { "coordinate_frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 50, offsetof(mavlink_position_target_local_ned_t, coordinate_frame) }, \ } \ } #endif @@ -80,20 +80,20 @@ typedef struct __mavlink_position_target_local_ned_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param time_boot_ms Timestamp in milliseconds since system boot - * @param coordinate_frame Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9 - * @param type_mask Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate - * @param x X Position in NED frame in meters - * @param y Y Position in NED frame in meters - * @param z Z Position in NED frame in meters (note, altitude is negative in NED) - * @param vx X velocity in NED frame in meter / s - * @param vy Y velocity in NED frame in meter / s - * @param vz Z velocity in NED frame in meter / s - * @param afx X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N - * @param afy Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N - * @param afz Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N - * @param yaw yaw setpoint in rad - * @param yaw_rate yaw rate setpoint in rad/s + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param coordinate_frame Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9 + * @param type_mask Bitmap to indicate which dimensions should be ignored by the vehicle. + * @param x [m] X Position in NED frame + * @param y [m] Y Position in NED frame + * @param z [m] Z Position in NED frame (note, altitude is negative in NED) + * @param vx [m/s] X velocity in NED frame + * @param vy [m/s] Y velocity in NED frame + * @param vz [m/s] Z velocity in NED frame + * @param afx [m/s/s] X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + * @param afy [m/s/s] Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + * @param afz [m/s/s] Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + * @param yaw [rad] yaw setpoint + * @param yaw_rate [rad/s] yaw rate setpoint * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_position_target_local_ned_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -147,20 +147,20 @@ static inline uint16_t mavlink_msg_position_target_local_ned_pack(uint8_t system * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param time_boot_ms Timestamp in milliseconds since system boot - * @param coordinate_frame Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9 - * @param type_mask Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate - * @param x X Position in NED frame in meters - * @param y Y Position in NED frame in meters - * @param z Z Position in NED frame in meters (note, altitude is negative in NED) - * @param vx X velocity in NED frame in meter / s - * @param vy Y velocity in NED frame in meter / s - * @param vz Z velocity in NED frame in meter / s - * @param afx X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N - * @param afy Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N - * @param afz Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N - * @param yaw yaw setpoint in rad - * @param yaw_rate yaw rate setpoint in rad/s + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param coordinate_frame Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9 + * @param type_mask Bitmap to indicate which dimensions should be ignored by the vehicle. + * @param x [m] X Position in NED frame + * @param y [m] Y Position in NED frame + * @param z [m] Z Position in NED frame (note, altitude is negative in NED) + * @param vx [m/s] X velocity in NED frame + * @param vy [m/s] Y velocity in NED frame + * @param vz [m/s] Z velocity in NED frame + * @param afx [m/s/s] X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + * @param afy [m/s/s] Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + * @param afz [m/s/s] Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + * @param yaw [rad] yaw setpoint + * @param yaw_rate [rad/s] yaw rate setpoint * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_position_target_local_ned_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -240,20 +240,20 @@ static inline uint16_t mavlink_msg_position_target_local_ned_encode_chan(uint8_t * @brief Send a position_target_local_ned message * @param chan MAVLink channel to send the message * - * @param time_boot_ms Timestamp in milliseconds since system boot - * @param coordinate_frame Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9 - * @param type_mask Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate - * @param x X Position in NED frame in meters - * @param y Y Position in NED frame in meters - * @param z Z Position in NED frame in meters (note, altitude is negative in NED) - * @param vx X velocity in NED frame in meter / s - * @param vy Y velocity in NED frame in meter / s - * @param vz Z velocity in NED frame in meter / s - * @param afx X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N - * @param afy Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N - * @param afz Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N - * @param yaw yaw setpoint in rad - * @param yaw_rate yaw rate setpoint in rad/s + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param coordinate_frame Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9 + * @param type_mask Bitmap to indicate which dimensions should be ignored by the vehicle. + * @param x [m] X Position in NED frame + * @param y [m] Y Position in NED frame + * @param z [m] Z Position in NED frame (note, altitude is negative in NED) + * @param vx [m/s] X velocity in NED frame + * @param vy [m/s] Y velocity in NED frame + * @param vz [m/s] Z velocity in NED frame + * @param afx [m/s/s] X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + * @param afy [m/s/s] Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + * @param afz [m/s/s] Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + * @param yaw [rad] yaw setpoint + * @param yaw_rate [rad/s] yaw rate setpoint */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -370,7 +370,7 @@ static inline void mavlink_msg_position_target_local_ned_send_buf(mavlink_messag /** * @brief Get field time_boot_ms from position_target_local_ned message * - * @return Timestamp in milliseconds since system boot + * @return [ms] Timestamp (time since system boot). */ static inline uint32_t mavlink_msg_position_target_local_ned_get_time_boot_ms(const mavlink_message_t* msg) { @@ -380,7 +380,7 @@ static inline uint32_t mavlink_msg_position_target_local_ned_get_time_boot_ms(co /** * @brief Get field coordinate_frame from position_target_local_ned message * - * @return Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9 + * @return Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9 */ static inline uint8_t mavlink_msg_position_target_local_ned_get_coordinate_frame(const mavlink_message_t* msg) { @@ -390,7 +390,7 @@ static inline uint8_t mavlink_msg_position_target_local_ned_get_coordinate_frame /** * @brief Get field type_mask from position_target_local_ned message * - * @return Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate + * @return Bitmap to indicate which dimensions should be ignored by the vehicle. */ static inline uint16_t mavlink_msg_position_target_local_ned_get_type_mask(const mavlink_message_t* msg) { @@ -400,7 +400,7 @@ static inline uint16_t mavlink_msg_position_target_local_ned_get_type_mask(const /** * @brief Get field x from position_target_local_ned message * - * @return X Position in NED frame in meters + * @return [m] X Position in NED frame */ static inline float mavlink_msg_position_target_local_ned_get_x(const mavlink_message_t* msg) { @@ -410,7 +410,7 @@ static inline float mavlink_msg_position_target_local_ned_get_x(const mavlink_me /** * @brief Get field y from position_target_local_ned message * - * @return Y Position in NED frame in meters + * @return [m] Y Position in NED frame */ static inline float mavlink_msg_position_target_local_ned_get_y(const mavlink_message_t* msg) { @@ -420,7 +420,7 @@ static inline float mavlink_msg_position_target_local_ned_get_y(const mavlink_me /** * @brief Get field z from position_target_local_ned message * - * @return Z Position in NED frame in meters (note, altitude is negative in NED) + * @return [m] Z Position in NED frame (note, altitude is negative in NED) */ static inline float mavlink_msg_position_target_local_ned_get_z(const mavlink_message_t* msg) { @@ -430,7 +430,7 @@ static inline float mavlink_msg_position_target_local_ned_get_z(const mavlink_me /** * @brief Get field vx from position_target_local_ned message * - * @return X velocity in NED frame in meter / s + * @return [m/s] X velocity in NED frame */ static inline float mavlink_msg_position_target_local_ned_get_vx(const mavlink_message_t* msg) { @@ -440,7 +440,7 @@ static inline float mavlink_msg_position_target_local_ned_get_vx(const mavlink_m /** * @brief Get field vy from position_target_local_ned message * - * @return Y velocity in NED frame in meter / s + * @return [m/s] Y velocity in NED frame */ static inline float mavlink_msg_position_target_local_ned_get_vy(const mavlink_message_t* msg) { @@ -450,7 +450,7 @@ static inline float mavlink_msg_position_target_local_ned_get_vy(const mavlink_m /** * @brief Get field vz from position_target_local_ned message * - * @return Z velocity in NED frame in meter / s + * @return [m/s] Z velocity in NED frame */ static inline float mavlink_msg_position_target_local_ned_get_vz(const mavlink_message_t* msg) { @@ -460,7 +460,7 @@ static inline float mavlink_msg_position_target_local_ned_get_vz(const mavlink_m /** * @brief Get field afx from position_target_local_ned message * - * @return X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + * @return [m/s/s] X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N */ static inline float mavlink_msg_position_target_local_ned_get_afx(const mavlink_message_t* msg) { @@ -470,7 +470,7 @@ static inline float mavlink_msg_position_target_local_ned_get_afx(const mavlink_ /** * @brief Get field afy from position_target_local_ned message * - * @return Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + * @return [m/s/s] Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N */ static inline float mavlink_msg_position_target_local_ned_get_afy(const mavlink_message_t* msg) { @@ -480,7 +480,7 @@ static inline float mavlink_msg_position_target_local_ned_get_afy(const mavlink_ /** * @brief Get field afz from position_target_local_ned message * - * @return Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + * @return [m/s/s] Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N */ static inline float mavlink_msg_position_target_local_ned_get_afz(const mavlink_message_t* msg) { @@ -490,7 +490,7 @@ static inline float mavlink_msg_position_target_local_ned_get_afz(const mavlink_ /** * @brief Get field yaw from position_target_local_ned message * - * @return yaw setpoint in rad + * @return [rad] yaw setpoint */ static inline float mavlink_msg_position_target_local_ned_get_yaw(const mavlink_message_t* msg) { @@ -500,7 +500,7 @@ static inline float mavlink_msg_position_target_local_ned_get_yaw(const mavlink_ /** * @brief Get field yaw_rate from position_target_local_ned message * - * @return yaw rate setpoint in rad/s + * @return [rad/s] yaw rate setpoint */ static inline float mavlink_msg_position_target_local_ned_get_yaw_rate(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_power_status.h b/lib/main/MAVLink/common/mavlink_msg_power_status.h index dca62b5868..67567680cd 100755 --- a/lib/main/MAVLink/common/mavlink_msg_power_status.h +++ b/lib/main/MAVLink/common/mavlink_msg_power_status.h @@ -3,12 +3,12 @@ #define MAVLINK_MSG_ID_POWER_STATUS 125 -MAVPACKED( + typedef struct __mavlink_power_status_t { - uint16_t Vcc; /*< 5V rail voltage in millivolts*/ - uint16_t Vservo; /*< servo rail voltage in millivolts*/ - uint16_t flags; /*< power supply status flags (see MAV_POWER_STATUS enum)*/ -}) mavlink_power_status_t; + uint16_t Vcc; /*< [mV] 5V rail voltage.*/ + uint16_t Vservo; /*< [mV] Servo rail voltage.*/ + uint16_t flags; /*< Bitmap of power supply status flags.*/ +} mavlink_power_status_t; #define MAVLINK_MSG_ID_POWER_STATUS_LEN 6 #define MAVLINK_MSG_ID_POWER_STATUS_MIN_LEN 6 @@ -47,9 +47,9 @@ typedef struct __mavlink_power_status_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param Vcc 5V rail voltage in millivolts - * @param Vservo servo rail voltage in millivolts - * @param flags power supply status flags (see MAV_POWER_STATUS enum) + * @param Vcc [mV] 5V rail voltage. + * @param Vservo [mV] Servo rail voltage. + * @param flags Bitmap of power supply status flags. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_power_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -81,9 +81,9 @@ static inline uint16_t mavlink_msg_power_status_pack(uint8_t system_id, uint8_t * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param Vcc 5V rail voltage in millivolts - * @param Vservo servo rail voltage in millivolts - * @param flags power supply status flags (see MAV_POWER_STATUS enum) + * @param Vcc [mV] 5V rail voltage. + * @param Vservo [mV] Servo rail voltage. + * @param flags Bitmap of power supply status flags. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_power_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -141,9 +141,9 @@ static inline uint16_t mavlink_msg_power_status_encode_chan(uint8_t system_id, u * @brief Send a power_status message * @param chan MAVLink channel to send the message * - * @param Vcc 5V rail voltage in millivolts - * @param Vservo servo rail voltage in millivolts - * @param flags power supply status flags (see MAV_POWER_STATUS enum) + * @param Vcc [mV] 5V rail voltage. + * @param Vservo [mV] Servo rail voltage. + * @param flags Bitmap of power supply status flags. */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -216,7 +216,7 @@ static inline void mavlink_msg_power_status_send_buf(mavlink_message_t *msgbuf, /** * @brief Get field Vcc from power_status message * - * @return 5V rail voltage in millivolts + * @return [mV] 5V rail voltage. */ static inline uint16_t mavlink_msg_power_status_get_Vcc(const mavlink_message_t* msg) { @@ -226,7 +226,7 @@ static inline uint16_t mavlink_msg_power_status_get_Vcc(const mavlink_message_t* /** * @brief Get field Vservo from power_status message * - * @return servo rail voltage in millivolts + * @return [mV] Servo rail voltage. */ static inline uint16_t mavlink_msg_power_status_get_Vservo(const mavlink_message_t* msg) { @@ -236,7 +236,7 @@ static inline uint16_t mavlink_msg_power_status_get_Vservo(const mavlink_message /** * @brief Get field flags from power_status message * - * @return power supply status flags (see MAV_POWER_STATUS enum) + * @return Bitmap of power supply status flags. */ static inline uint16_t mavlink_msg_power_status_get_flags(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_radio_status.h b/lib/main/MAVLink/common/mavlink_msg_radio_status.h index 8d266bb4e8..8983a20a4c 100755 --- a/lib/main/MAVLink/common/mavlink_msg_radio_status.h +++ b/lib/main/MAVLink/common/mavlink_msg_radio_status.h @@ -3,16 +3,16 @@ #define MAVLINK_MSG_ID_RADIO_STATUS 109 -MAVPACKED( + typedef struct __mavlink_radio_status_t { - uint16_t rxerrors; /*< Receive errors*/ - uint16_t fixed; /*< Count of error corrected packets*/ - uint8_t rssi; /*< Local signal strength*/ - uint8_t remrssi; /*< Remote signal strength*/ - uint8_t txbuf; /*< Remaining free buffer space in percent.*/ - uint8_t noise; /*< Background noise level*/ - uint8_t remnoise; /*< Remote background noise level*/ -}) mavlink_radio_status_t; + uint16_t rxerrors; /*< Count of radio packet receive errors (since boot).*/ + uint16_t fixed; /*< Count of error corrected radio packets (since boot).*/ + uint8_t rssi; /*< Local (message sender) recieved signal strength indication in device-dependent units/scale. Values: [0-254], 255: invalid/unknown.*/ + uint8_t remrssi; /*< Remote (message receiver) signal strength indication in device-dependent units/scale. Values: [0-254], 255: invalid/unknown.*/ + uint8_t txbuf; /*< [%] Remaining free transmitter buffer space.*/ + uint8_t noise; /*< Local background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], 255: invalid/unknown.*/ + uint8_t remnoise; /*< Remote background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], 255: invalid/unknown.*/ +} mavlink_radio_status_t; #define MAVLINK_MSG_ID_RADIO_STATUS_LEN 9 #define MAVLINK_MSG_ID_RADIO_STATUS_MIN_LEN 9 @@ -29,26 +29,26 @@ typedef struct __mavlink_radio_status_t { 109, \ "RADIO_STATUS", \ 7, \ - { { "rxerrors", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_radio_status_t, rxerrors) }, \ - { "fixed", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_radio_status_t, fixed) }, \ - { "rssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_radio_status_t, rssi) }, \ + { { "rssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_radio_status_t, rssi) }, \ { "remrssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_radio_status_t, remrssi) }, \ { "txbuf", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_radio_status_t, txbuf) }, \ { "noise", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_radio_status_t, noise) }, \ { "remnoise", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_radio_status_t, remnoise) }, \ + { "rxerrors", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_radio_status_t, rxerrors) }, \ + { "fixed", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_radio_status_t, fixed) }, \ } \ } #else #define MAVLINK_MESSAGE_INFO_RADIO_STATUS { \ "RADIO_STATUS", \ 7, \ - { { "rxerrors", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_radio_status_t, rxerrors) }, \ - { "fixed", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_radio_status_t, fixed) }, \ - { "rssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_radio_status_t, rssi) }, \ + { { "rssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_radio_status_t, rssi) }, \ { "remrssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_radio_status_t, remrssi) }, \ { "txbuf", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_radio_status_t, txbuf) }, \ { "noise", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_radio_status_t, noise) }, \ { "remnoise", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_radio_status_t, remnoise) }, \ + { "rxerrors", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_radio_status_t, rxerrors) }, \ + { "fixed", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_radio_status_t, fixed) }, \ } \ } #endif @@ -59,13 +59,13 @@ typedef struct __mavlink_radio_status_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param rssi Local signal strength - * @param remrssi Remote signal strength - * @param txbuf Remaining free buffer space in percent. - * @param noise Background noise level - * @param remnoise Remote background noise level - * @param rxerrors Receive errors - * @param fixed Count of error corrected packets + * @param rssi Local (message sender) recieved signal strength indication in device-dependent units/scale. Values: [0-254], 255: invalid/unknown. + * @param remrssi Remote (message receiver) signal strength indication in device-dependent units/scale. Values: [0-254], 255: invalid/unknown. + * @param txbuf [%] Remaining free transmitter buffer space. + * @param noise Local background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], 255: invalid/unknown. + * @param remnoise Remote background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], 255: invalid/unknown. + * @param rxerrors Count of radio packet receive errors (since boot). + * @param fixed Count of error corrected radio packets (since boot). * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_radio_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -105,13 +105,13 @@ static inline uint16_t mavlink_msg_radio_status_pack(uint8_t system_id, uint8_t * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param rssi Local signal strength - * @param remrssi Remote signal strength - * @param txbuf Remaining free buffer space in percent. - * @param noise Background noise level - * @param remnoise Remote background noise level - * @param rxerrors Receive errors - * @param fixed Count of error corrected packets + * @param rssi Local (message sender) recieved signal strength indication in device-dependent units/scale. Values: [0-254], 255: invalid/unknown. + * @param remrssi Remote (message receiver) signal strength indication in device-dependent units/scale. Values: [0-254], 255: invalid/unknown. + * @param txbuf [%] Remaining free transmitter buffer space. + * @param noise Local background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], 255: invalid/unknown. + * @param remnoise Remote background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], 255: invalid/unknown. + * @param rxerrors Count of radio packet receive errors (since boot). + * @param fixed Count of error corrected radio packets (since boot). * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_radio_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -177,13 +177,13 @@ static inline uint16_t mavlink_msg_radio_status_encode_chan(uint8_t system_id, u * @brief Send a radio_status message * @param chan MAVLink channel to send the message * - * @param rssi Local signal strength - * @param remrssi Remote signal strength - * @param txbuf Remaining free buffer space in percent. - * @param noise Background noise level - * @param remnoise Remote background noise level - * @param rxerrors Receive errors - * @param fixed Count of error corrected packets + * @param rssi Local (message sender) recieved signal strength indication in device-dependent units/scale. Values: [0-254], 255: invalid/unknown. + * @param remrssi Remote (message receiver) signal strength indication in device-dependent units/scale. Values: [0-254], 255: invalid/unknown. + * @param txbuf [%] Remaining free transmitter buffer space. + * @param noise Local background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], 255: invalid/unknown. + * @param remnoise Remote background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], 255: invalid/unknown. + * @param rxerrors Count of radio packet receive errors (since boot). + * @param fixed Count of error corrected radio packets (since boot). */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -272,7 +272,7 @@ static inline void mavlink_msg_radio_status_send_buf(mavlink_message_t *msgbuf, /** * @brief Get field rssi from radio_status message * - * @return Local signal strength + * @return Local (message sender) recieved signal strength indication in device-dependent units/scale. Values: [0-254], 255: invalid/unknown. */ static inline uint8_t mavlink_msg_radio_status_get_rssi(const mavlink_message_t* msg) { @@ -282,7 +282,7 @@ static inline uint8_t mavlink_msg_radio_status_get_rssi(const mavlink_message_t* /** * @brief Get field remrssi from radio_status message * - * @return Remote signal strength + * @return Remote (message receiver) signal strength indication in device-dependent units/scale. Values: [0-254], 255: invalid/unknown. */ static inline uint8_t mavlink_msg_radio_status_get_remrssi(const mavlink_message_t* msg) { @@ -292,7 +292,7 @@ static inline uint8_t mavlink_msg_radio_status_get_remrssi(const mavlink_message /** * @brief Get field txbuf from radio_status message * - * @return Remaining free buffer space in percent. + * @return [%] Remaining free transmitter buffer space. */ static inline uint8_t mavlink_msg_radio_status_get_txbuf(const mavlink_message_t* msg) { @@ -302,7 +302,7 @@ static inline uint8_t mavlink_msg_radio_status_get_txbuf(const mavlink_message_t /** * @brief Get field noise from radio_status message * - * @return Background noise level + * @return Local background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], 255: invalid/unknown. */ static inline uint8_t mavlink_msg_radio_status_get_noise(const mavlink_message_t* msg) { @@ -312,7 +312,7 @@ static inline uint8_t mavlink_msg_radio_status_get_noise(const mavlink_message_t /** * @brief Get field remnoise from radio_status message * - * @return Remote background noise level + * @return Remote background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], 255: invalid/unknown. */ static inline uint8_t mavlink_msg_radio_status_get_remnoise(const mavlink_message_t* msg) { @@ -322,7 +322,7 @@ static inline uint8_t mavlink_msg_radio_status_get_remnoise(const mavlink_messag /** * @brief Get field rxerrors from radio_status message * - * @return Receive errors + * @return Count of radio packet receive errors (since boot). */ static inline uint16_t mavlink_msg_radio_status_get_rxerrors(const mavlink_message_t* msg) { @@ -332,7 +332,7 @@ static inline uint16_t mavlink_msg_radio_status_get_rxerrors(const mavlink_messa /** * @brief Get field fixed from radio_status message * - * @return Count of error corrected packets + * @return Count of error corrected radio packets (since boot). */ static inline uint16_t mavlink_msg_radio_status_get_fixed(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_raw_imu.h b/lib/main/MAVLink/common/mavlink_msg_raw_imu.h index 23833bc8b3..0e0cf7141c 100755 --- a/lib/main/MAVLink/common/mavlink_msg_raw_imu.h +++ b/lib/main/MAVLink/common/mavlink_msg_raw_imu.h @@ -3,19 +3,19 @@ #define MAVLINK_MSG_ID_RAW_IMU 27 -MAVPACKED( + typedef struct __mavlink_raw_imu_t { - uint64_t time_usec; /*< Timestamp (microseconds since UNIX epoch or microseconds since system boot)*/ - int16_t xacc; /*< X acceleration (raw)*/ - int16_t yacc; /*< Y acceleration (raw)*/ - int16_t zacc; /*< Z acceleration (raw)*/ - int16_t xgyro; /*< Angular speed around X axis (raw)*/ - int16_t ygyro; /*< Angular speed around Y axis (raw)*/ - int16_t zgyro; /*< Angular speed around Z axis (raw)*/ - int16_t xmag; /*< X Magnetic field (raw)*/ - int16_t ymag; /*< Y Magnetic field (raw)*/ - int16_t zmag; /*< Z Magnetic field (raw)*/ -}) mavlink_raw_imu_t; + uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.*/ + int16_t xacc; /*< X acceleration (raw)*/ + int16_t yacc; /*< Y acceleration (raw)*/ + int16_t zacc; /*< Z acceleration (raw)*/ + int16_t xgyro; /*< Angular speed around X axis (raw)*/ + int16_t ygyro; /*< Angular speed around Y axis (raw)*/ + int16_t zgyro; /*< Angular speed around Z axis (raw)*/ + int16_t xmag; /*< X Magnetic field (raw)*/ + int16_t ymag; /*< Y Magnetic field (raw)*/ + int16_t zmag; /*< Z Magnetic field (raw)*/ +} mavlink_raw_imu_t; #define MAVLINK_MSG_ID_RAW_IMU_LEN 26 #define MAVLINK_MSG_ID_RAW_IMU_MIN_LEN 26 @@ -68,16 +68,16 @@ typedef struct __mavlink_raw_imu_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot) - * @param xacc X acceleration (raw) - * @param yacc Y acceleration (raw) - * @param zacc Z acceleration (raw) - * @param xgyro Angular speed around X axis (raw) - * @param ygyro Angular speed around Y axis (raw) - * @param zgyro Angular speed around Z axis (raw) - * @param xmag X Magnetic field (raw) - * @param ymag Y Magnetic field (raw) - * @param zmag Z Magnetic field (raw) + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param xacc X acceleration (raw) + * @param yacc Y acceleration (raw) + * @param zacc Z acceleration (raw) + * @param xgyro Angular speed around X axis (raw) + * @param ygyro Angular speed around Y axis (raw) + * @param zgyro Angular speed around Z axis (raw) + * @param xmag X Magnetic field (raw) + * @param ymag Y Magnetic field (raw) + * @param zmag Z Magnetic field (raw) * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_raw_imu_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -123,16 +123,16 @@ static inline uint16_t mavlink_msg_raw_imu_pack(uint8_t system_id, uint8_t compo * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot) - * @param xacc X acceleration (raw) - * @param yacc Y acceleration (raw) - * @param zacc Z acceleration (raw) - * @param xgyro Angular speed around X axis (raw) - * @param ygyro Angular speed around Y axis (raw) - * @param zgyro Angular speed around Z axis (raw) - * @param xmag X Magnetic field (raw) - * @param ymag Y Magnetic field (raw) - * @param zmag Z Magnetic field (raw) + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param xacc X acceleration (raw) + * @param yacc Y acceleration (raw) + * @param zacc Z acceleration (raw) + * @param xgyro Angular speed around X axis (raw) + * @param ygyro Angular speed around Y axis (raw) + * @param zgyro Angular speed around Z axis (raw) + * @param xmag X Magnetic field (raw) + * @param ymag Y Magnetic field (raw) + * @param zmag Z Magnetic field (raw) * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_raw_imu_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -204,16 +204,16 @@ static inline uint16_t mavlink_msg_raw_imu_encode_chan(uint8_t system_id, uint8_ * @brief Send a raw_imu message * @param chan MAVLink channel to send the message * - * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot) - * @param xacc X acceleration (raw) - * @param yacc Y acceleration (raw) - * @param zacc Z acceleration (raw) - * @param xgyro Angular speed around X axis (raw) - * @param ygyro Angular speed around Y axis (raw) - * @param zgyro Angular speed around Z axis (raw) - * @param xmag X Magnetic field (raw) - * @param ymag Y Magnetic field (raw) - * @param zmag Z Magnetic field (raw) + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param xacc X acceleration (raw) + * @param yacc Y acceleration (raw) + * @param zacc Z acceleration (raw) + * @param xgyro Angular speed around X axis (raw) + * @param ygyro Angular speed around Y axis (raw) + * @param zgyro Angular speed around Z axis (raw) + * @param xmag X Magnetic field (raw) + * @param ymag Y Magnetic field (raw) + * @param zmag Z Magnetic field (raw) */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -314,7 +314,7 @@ static inline void mavlink_msg_raw_imu_send_buf(mavlink_message_t *msgbuf, mavli /** * @brief Get field time_usec from raw_imu message * - * @return Timestamp (microseconds since UNIX epoch or microseconds since system boot) + * @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. */ static inline uint64_t mavlink_msg_raw_imu_get_time_usec(const mavlink_message_t* msg) { @@ -324,7 +324,7 @@ static inline uint64_t mavlink_msg_raw_imu_get_time_usec(const mavlink_message_t /** * @brief Get field xacc from raw_imu message * - * @return X acceleration (raw) + * @return X acceleration (raw) */ static inline int16_t mavlink_msg_raw_imu_get_xacc(const mavlink_message_t* msg) { @@ -334,7 +334,7 @@ static inline int16_t mavlink_msg_raw_imu_get_xacc(const mavlink_message_t* msg) /** * @brief Get field yacc from raw_imu message * - * @return Y acceleration (raw) + * @return Y acceleration (raw) */ static inline int16_t mavlink_msg_raw_imu_get_yacc(const mavlink_message_t* msg) { @@ -344,7 +344,7 @@ static inline int16_t mavlink_msg_raw_imu_get_yacc(const mavlink_message_t* msg) /** * @brief Get field zacc from raw_imu message * - * @return Z acceleration (raw) + * @return Z acceleration (raw) */ static inline int16_t mavlink_msg_raw_imu_get_zacc(const mavlink_message_t* msg) { @@ -354,7 +354,7 @@ static inline int16_t mavlink_msg_raw_imu_get_zacc(const mavlink_message_t* msg) /** * @brief Get field xgyro from raw_imu message * - * @return Angular speed around X axis (raw) + * @return Angular speed around X axis (raw) */ static inline int16_t mavlink_msg_raw_imu_get_xgyro(const mavlink_message_t* msg) { @@ -364,7 +364,7 @@ static inline int16_t mavlink_msg_raw_imu_get_xgyro(const mavlink_message_t* msg /** * @brief Get field ygyro from raw_imu message * - * @return Angular speed around Y axis (raw) + * @return Angular speed around Y axis (raw) */ static inline int16_t mavlink_msg_raw_imu_get_ygyro(const mavlink_message_t* msg) { @@ -374,7 +374,7 @@ static inline int16_t mavlink_msg_raw_imu_get_ygyro(const mavlink_message_t* msg /** * @brief Get field zgyro from raw_imu message * - * @return Angular speed around Z axis (raw) + * @return Angular speed around Z axis (raw) */ static inline int16_t mavlink_msg_raw_imu_get_zgyro(const mavlink_message_t* msg) { @@ -384,7 +384,7 @@ static inline int16_t mavlink_msg_raw_imu_get_zgyro(const mavlink_message_t* msg /** * @brief Get field xmag from raw_imu message * - * @return X Magnetic field (raw) + * @return X Magnetic field (raw) */ static inline int16_t mavlink_msg_raw_imu_get_xmag(const mavlink_message_t* msg) { @@ -394,7 +394,7 @@ static inline int16_t mavlink_msg_raw_imu_get_xmag(const mavlink_message_t* msg) /** * @brief Get field ymag from raw_imu message * - * @return Y Magnetic field (raw) + * @return Y Magnetic field (raw) */ static inline int16_t mavlink_msg_raw_imu_get_ymag(const mavlink_message_t* msg) { @@ -404,7 +404,7 @@ static inline int16_t mavlink_msg_raw_imu_get_ymag(const mavlink_message_t* msg) /** * @brief Get field zmag from raw_imu message * - * @return Z Magnetic field (raw) + * @return Z Magnetic field (raw) */ static inline int16_t mavlink_msg_raw_imu_get_zmag(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_raw_pressure.h b/lib/main/MAVLink/common/mavlink_msg_raw_pressure.h index 2d2ead97ec..9b80a848e7 100755 --- a/lib/main/MAVLink/common/mavlink_msg_raw_pressure.h +++ b/lib/main/MAVLink/common/mavlink_msg_raw_pressure.h @@ -3,14 +3,14 @@ #define MAVLINK_MSG_ID_RAW_PRESSURE 28 -MAVPACKED( + typedef struct __mavlink_raw_pressure_t { - uint64_t time_usec; /*< Timestamp (microseconds since UNIX epoch or microseconds since system boot)*/ - int16_t press_abs; /*< Absolute pressure (raw)*/ - int16_t press_diff1; /*< Differential pressure 1 (raw, 0 if nonexistant)*/ - int16_t press_diff2; /*< Differential pressure 2 (raw, 0 if nonexistant)*/ - int16_t temperature; /*< Raw Temperature measurement (raw)*/ -}) mavlink_raw_pressure_t; + uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.*/ + int16_t press_abs; /*< Absolute pressure (raw)*/ + int16_t press_diff1; /*< Differential pressure 1 (raw, 0 if nonexistent)*/ + int16_t press_diff2; /*< Differential pressure 2 (raw, 0 if nonexistent)*/ + int16_t temperature; /*< Raw Temperature measurement (raw)*/ +} mavlink_raw_pressure_t; #define MAVLINK_MSG_ID_RAW_PRESSURE_LEN 16 #define MAVLINK_MSG_ID_RAW_PRESSURE_MIN_LEN 16 @@ -53,11 +53,11 @@ typedef struct __mavlink_raw_pressure_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot) - * @param press_abs Absolute pressure (raw) - * @param press_diff1 Differential pressure 1 (raw, 0 if nonexistant) - * @param press_diff2 Differential pressure 2 (raw, 0 if nonexistant) - * @param temperature Raw Temperature measurement (raw) + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param press_abs Absolute pressure (raw) + * @param press_diff1 Differential pressure 1 (raw, 0 if nonexistent) + * @param press_diff2 Differential pressure 2 (raw, 0 if nonexistent) + * @param temperature Raw Temperature measurement (raw) * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_raw_pressure_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -93,11 +93,11 @@ static inline uint16_t mavlink_msg_raw_pressure_pack(uint8_t system_id, uint8_t * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot) - * @param press_abs Absolute pressure (raw) - * @param press_diff1 Differential pressure 1 (raw, 0 if nonexistant) - * @param press_diff2 Differential pressure 2 (raw, 0 if nonexistant) - * @param temperature Raw Temperature measurement (raw) + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param press_abs Absolute pressure (raw) + * @param press_diff1 Differential pressure 1 (raw, 0 if nonexistent) + * @param press_diff2 Differential pressure 2 (raw, 0 if nonexistent) + * @param temperature Raw Temperature measurement (raw) * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_raw_pressure_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -159,11 +159,11 @@ static inline uint16_t mavlink_msg_raw_pressure_encode_chan(uint8_t system_id, u * @brief Send a raw_pressure message * @param chan MAVLink channel to send the message * - * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot) - * @param press_abs Absolute pressure (raw) - * @param press_diff1 Differential pressure 1 (raw, 0 if nonexistant) - * @param press_diff2 Differential pressure 2 (raw, 0 if nonexistant) - * @param temperature Raw Temperature measurement (raw) + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param press_abs Absolute pressure (raw) + * @param press_diff1 Differential pressure 1 (raw, 0 if nonexistent) + * @param press_diff2 Differential pressure 2 (raw, 0 if nonexistent) + * @param temperature Raw Temperature measurement (raw) */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -244,7 +244,7 @@ static inline void mavlink_msg_raw_pressure_send_buf(mavlink_message_t *msgbuf, /** * @brief Get field time_usec from raw_pressure message * - * @return Timestamp (microseconds since UNIX epoch or microseconds since system boot) + * @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. */ static inline uint64_t mavlink_msg_raw_pressure_get_time_usec(const mavlink_message_t* msg) { @@ -254,7 +254,7 @@ static inline uint64_t mavlink_msg_raw_pressure_get_time_usec(const mavlink_mess /** * @brief Get field press_abs from raw_pressure message * - * @return Absolute pressure (raw) + * @return Absolute pressure (raw) */ static inline int16_t mavlink_msg_raw_pressure_get_press_abs(const mavlink_message_t* msg) { @@ -264,7 +264,7 @@ static inline int16_t mavlink_msg_raw_pressure_get_press_abs(const mavlink_messa /** * @brief Get field press_diff1 from raw_pressure message * - * @return Differential pressure 1 (raw, 0 if nonexistant) + * @return Differential pressure 1 (raw, 0 if nonexistent) */ static inline int16_t mavlink_msg_raw_pressure_get_press_diff1(const mavlink_message_t* msg) { @@ -274,7 +274,7 @@ static inline int16_t mavlink_msg_raw_pressure_get_press_diff1(const mavlink_mes /** * @brief Get field press_diff2 from raw_pressure message * - * @return Differential pressure 2 (raw, 0 if nonexistant) + * @return Differential pressure 2 (raw, 0 if nonexistent) */ static inline int16_t mavlink_msg_raw_pressure_get_press_diff2(const mavlink_message_t* msg) { @@ -284,7 +284,7 @@ static inline int16_t mavlink_msg_raw_pressure_get_press_diff2(const mavlink_mes /** * @brief Get field temperature from raw_pressure message * - * @return Raw Temperature measurement (raw) + * @return Raw Temperature measurement (raw) */ static inline int16_t mavlink_msg_raw_pressure_get_temperature(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_rc_channels.h b/lib/main/MAVLink/common/mavlink_msg_rc_channels.h index f7637379b4..f4694f1b89 100755 --- a/lib/main/MAVLink/common/mavlink_msg_rc_channels.h +++ b/lib/main/MAVLink/common/mavlink_msg_rc_channels.h @@ -3,30 +3,30 @@ #define MAVLINK_MSG_ID_RC_CHANNELS 65 -MAVPACKED( + typedef struct __mavlink_rc_channels_t { - uint32_t time_boot_ms; /*< Timestamp (milliseconds since system boot)*/ - uint16_t chan1_raw; /*< RC channel 1 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/ - uint16_t chan2_raw; /*< RC channel 2 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/ - uint16_t chan3_raw; /*< RC channel 3 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/ - uint16_t chan4_raw; /*< RC channel 4 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/ - uint16_t chan5_raw; /*< RC channel 5 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/ - uint16_t chan6_raw; /*< RC channel 6 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/ - uint16_t chan7_raw; /*< RC channel 7 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/ - uint16_t chan8_raw; /*< RC channel 8 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/ - uint16_t chan9_raw; /*< RC channel 9 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/ - uint16_t chan10_raw; /*< RC channel 10 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/ - uint16_t chan11_raw; /*< RC channel 11 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/ - uint16_t chan12_raw; /*< RC channel 12 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/ - uint16_t chan13_raw; /*< RC channel 13 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/ - uint16_t chan14_raw; /*< RC channel 14 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/ - uint16_t chan15_raw; /*< RC channel 15 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/ - uint16_t chan16_raw; /*< RC channel 16 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/ - uint16_t chan17_raw; /*< RC channel 17 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/ - uint16_t chan18_raw; /*< RC channel 18 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/ - uint8_t chancount; /*< Total number of RC channels being received. This can be larger than 18, indicating that more channels are available but not given in this message. This value should be 0 when no RC channels are available.*/ - uint8_t rssi; /*< Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown.*/ -}) mavlink_rc_channels_t; + uint32_t time_boot_ms; /*< [ms] Timestamp (time since system boot).*/ + uint16_t chan1_raw; /*< [us] RC channel 1 value.*/ + uint16_t chan2_raw; /*< [us] RC channel 2 value.*/ + uint16_t chan3_raw; /*< [us] RC channel 3 value.*/ + uint16_t chan4_raw; /*< [us] RC channel 4 value.*/ + uint16_t chan5_raw; /*< [us] RC channel 5 value.*/ + uint16_t chan6_raw; /*< [us] RC channel 6 value.*/ + uint16_t chan7_raw; /*< [us] RC channel 7 value.*/ + uint16_t chan8_raw; /*< [us] RC channel 8 value.*/ + uint16_t chan9_raw; /*< [us] RC channel 9 value.*/ + uint16_t chan10_raw; /*< [us] RC channel 10 value.*/ + uint16_t chan11_raw; /*< [us] RC channel 11 value.*/ + uint16_t chan12_raw; /*< [us] RC channel 12 value.*/ + uint16_t chan13_raw; /*< [us] RC channel 13 value.*/ + uint16_t chan14_raw; /*< [us] RC channel 14 value.*/ + uint16_t chan15_raw; /*< [us] RC channel 15 value.*/ + uint16_t chan16_raw; /*< [us] RC channel 16 value.*/ + uint16_t chan17_raw; /*< [us] RC channel 17 value.*/ + uint16_t chan18_raw; /*< [us] RC channel 18 value.*/ + uint8_t chancount; /*< Total number of RC channels being received. This can be larger than 18, indicating that more channels are available but not given in this message. This value should be 0 when no RC channels are available.*/ + uint8_t rssi; /*< Receive signal strength indicator in device-dependent units/scale. Values: [0-254], 255: invalid/unknown.*/ +} mavlink_rc_channels_t; #define MAVLINK_MSG_ID_RC_CHANNELS_LEN 42 #define MAVLINK_MSG_ID_RC_CHANNELS_MIN_LEN 42 @@ -44,6 +44,7 @@ typedef struct __mavlink_rc_channels_t { "RC_CHANNELS", \ 21, \ { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_rc_channels_t, time_boot_ms) }, \ + { "chancount", NULL, MAVLINK_TYPE_UINT8_T, 0, 40, offsetof(mavlink_rc_channels_t, chancount) }, \ { "chan1_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_rc_channels_t, chan1_raw) }, \ { "chan2_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_rc_channels_t, chan2_raw) }, \ { "chan3_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_rc_channels_t, chan3_raw) }, \ @@ -62,7 +63,6 @@ typedef struct __mavlink_rc_channels_t { { "chan16_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 34, offsetof(mavlink_rc_channels_t, chan16_raw) }, \ { "chan17_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 36, offsetof(mavlink_rc_channels_t, chan17_raw) }, \ { "chan18_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 38, offsetof(mavlink_rc_channels_t, chan18_raw) }, \ - { "chancount", NULL, MAVLINK_TYPE_UINT8_T, 0, 40, offsetof(mavlink_rc_channels_t, chancount) }, \ { "rssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 41, offsetof(mavlink_rc_channels_t, rssi) }, \ } \ } @@ -71,6 +71,7 @@ typedef struct __mavlink_rc_channels_t { "RC_CHANNELS", \ 21, \ { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_rc_channels_t, time_boot_ms) }, \ + { "chancount", NULL, MAVLINK_TYPE_UINT8_T, 0, 40, offsetof(mavlink_rc_channels_t, chancount) }, \ { "chan1_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_rc_channels_t, chan1_raw) }, \ { "chan2_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_rc_channels_t, chan2_raw) }, \ { "chan3_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_rc_channels_t, chan3_raw) }, \ @@ -89,7 +90,6 @@ typedef struct __mavlink_rc_channels_t { { "chan16_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 34, offsetof(mavlink_rc_channels_t, chan16_raw) }, \ { "chan17_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 36, offsetof(mavlink_rc_channels_t, chan17_raw) }, \ { "chan18_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 38, offsetof(mavlink_rc_channels_t, chan18_raw) }, \ - { "chancount", NULL, MAVLINK_TYPE_UINT8_T, 0, 40, offsetof(mavlink_rc_channels_t, chancount) }, \ { "rssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 41, offsetof(mavlink_rc_channels_t, rssi) }, \ } \ } @@ -101,27 +101,27 @@ typedef struct __mavlink_rc_channels_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param time_boot_ms Timestamp (milliseconds since system boot) - * @param chancount Total number of RC channels being received. This can be larger than 18, indicating that more channels are available but not given in this message. This value should be 0 when no RC channels are available. - * @param chan1_raw RC channel 1 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan2_raw RC channel 2 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan3_raw RC channel 3 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan4_raw RC channel 4 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan5_raw RC channel 5 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan6_raw RC channel 6 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan7_raw RC channel 7 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan8_raw RC channel 8 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan9_raw RC channel 9 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan10_raw RC channel 10 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan11_raw RC channel 11 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan12_raw RC channel 12 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan13_raw RC channel 13 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan14_raw RC channel 14 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan15_raw RC channel 15 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan16_raw RC channel 16 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan17_raw RC channel 17 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan18_raw RC channel 18 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param rssi Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown. + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param chancount Total number of RC channels being received. This can be larger than 18, indicating that more channels are available but not given in this message. This value should be 0 when no RC channels are available. + * @param chan1_raw [us] RC channel 1 value. + * @param chan2_raw [us] RC channel 2 value. + * @param chan3_raw [us] RC channel 3 value. + * @param chan4_raw [us] RC channel 4 value. + * @param chan5_raw [us] RC channel 5 value. + * @param chan6_raw [us] RC channel 6 value. + * @param chan7_raw [us] RC channel 7 value. + * @param chan8_raw [us] RC channel 8 value. + * @param chan9_raw [us] RC channel 9 value. + * @param chan10_raw [us] RC channel 10 value. + * @param chan11_raw [us] RC channel 11 value. + * @param chan12_raw [us] RC channel 12 value. + * @param chan13_raw [us] RC channel 13 value. + * @param chan14_raw [us] RC channel 14 value. + * @param chan15_raw [us] RC channel 15 value. + * @param chan16_raw [us] RC channel 16 value. + * @param chan17_raw [us] RC channel 17 value. + * @param chan18_raw [us] RC channel 18 value. + * @param rssi Receive signal strength indicator in device-dependent units/scale. Values: [0-254], 255: invalid/unknown. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_rc_channels_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -189,27 +189,27 @@ static inline uint16_t mavlink_msg_rc_channels_pack(uint8_t system_id, uint8_t c * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param time_boot_ms Timestamp (milliseconds since system boot) - * @param chancount Total number of RC channels being received. This can be larger than 18, indicating that more channels are available but not given in this message. This value should be 0 when no RC channels are available. - * @param chan1_raw RC channel 1 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan2_raw RC channel 2 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan3_raw RC channel 3 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan4_raw RC channel 4 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan5_raw RC channel 5 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan6_raw RC channel 6 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan7_raw RC channel 7 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan8_raw RC channel 8 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan9_raw RC channel 9 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan10_raw RC channel 10 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan11_raw RC channel 11 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan12_raw RC channel 12 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan13_raw RC channel 13 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan14_raw RC channel 14 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan15_raw RC channel 15 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan16_raw RC channel 16 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan17_raw RC channel 17 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan18_raw RC channel 18 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param rssi Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown. + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param chancount Total number of RC channels being received. This can be larger than 18, indicating that more channels are available but not given in this message. This value should be 0 when no RC channels are available. + * @param chan1_raw [us] RC channel 1 value. + * @param chan2_raw [us] RC channel 2 value. + * @param chan3_raw [us] RC channel 3 value. + * @param chan4_raw [us] RC channel 4 value. + * @param chan5_raw [us] RC channel 5 value. + * @param chan6_raw [us] RC channel 6 value. + * @param chan7_raw [us] RC channel 7 value. + * @param chan8_raw [us] RC channel 8 value. + * @param chan9_raw [us] RC channel 9 value. + * @param chan10_raw [us] RC channel 10 value. + * @param chan11_raw [us] RC channel 11 value. + * @param chan12_raw [us] RC channel 12 value. + * @param chan13_raw [us] RC channel 13 value. + * @param chan14_raw [us] RC channel 14 value. + * @param chan15_raw [us] RC channel 15 value. + * @param chan16_raw [us] RC channel 16 value. + * @param chan17_raw [us] RC channel 17 value. + * @param chan18_raw [us] RC channel 18 value. + * @param rssi Receive signal strength indicator in device-dependent units/scale. Values: [0-254], 255: invalid/unknown. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_rc_channels_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -303,27 +303,27 @@ static inline uint16_t mavlink_msg_rc_channels_encode_chan(uint8_t system_id, ui * @brief Send a rc_channels message * @param chan MAVLink channel to send the message * - * @param time_boot_ms Timestamp (milliseconds since system boot) - * @param chancount Total number of RC channels being received. This can be larger than 18, indicating that more channels are available but not given in this message. This value should be 0 when no RC channels are available. - * @param chan1_raw RC channel 1 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan2_raw RC channel 2 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan3_raw RC channel 3 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan4_raw RC channel 4 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan5_raw RC channel 5 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan6_raw RC channel 6 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan7_raw RC channel 7 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan8_raw RC channel 8 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan9_raw RC channel 9 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan10_raw RC channel 10 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan11_raw RC channel 11 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan12_raw RC channel 12 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan13_raw RC channel 13 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan14_raw RC channel 14 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan15_raw RC channel 15 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan16_raw RC channel 16 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan17_raw RC channel 17 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan18_raw RC channel 18 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param rssi Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown. + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param chancount Total number of RC channels being received. This can be larger than 18, indicating that more channels are available but not given in this message. This value should be 0 when no RC channels are available. + * @param chan1_raw [us] RC channel 1 value. + * @param chan2_raw [us] RC channel 2 value. + * @param chan3_raw [us] RC channel 3 value. + * @param chan4_raw [us] RC channel 4 value. + * @param chan5_raw [us] RC channel 5 value. + * @param chan6_raw [us] RC channel 6 value. + * @param chan7_raw [us] RC channel 7 value. + * @param chan8_raw [us] RC channel 8 value. + * @param chan9_raw [us] RC channel 9 value. + * @param chan10_raw [us] RC channel 10 value. + * @param chan11_raw [us] RC channel 11 value. + * @param chan12_raw [us] RC channel 12 value. + * @param chan13_raw [us] RC channel 13 value. + * @param chan14_raw [us] RC channel 14 value. + * @param chan15_raw [us] RC channel 15 value. + * @param chan16_raw [us] RC channel 16 value. + * @param chan17_raw [us] RC channel 17 value. + * @param chan18_raw [us] RC channel 18 value. + * @param rssi Receive signal strength indicator in device-dependent units/scale. Values: [0-254], 255: invalid/unknown. */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -468,7 +468,7 @@ static inline void mavlink_msg_rc_channels_send_buf(mavlink_message_t *msgbuf, m /** * @brief Get field time_boot_ms from rc_channels message * - * @return Timestamp (milliseconds since system boot) + * @return [ms] Timestamp (time since system boot). */ static inline uint32_t mavlink_msg_rc_channels_get_time_boot_ms(const mavlink_message_t* msg) { @@ -478,7 +478,7 @@ static inline uint32_t mavlink_msg_rc_channels_get_time_boot_ms(const mavlink_me /** * @brief Get field chancount from rc_channels message * - * @return Total number of RC channels being received. This can be larger than 18, indicating that more channels are available but not given in this message. This value should be 0 when no RC channels are available. + * @return Total number of RC channels being received. This can be larger than 18, indicating that more channels are available but not given in this message. This value should be 0 when no RC channels are available. */ static inline uint8_t mavlink_msg_rc_channels_get_chancount(const mavlink_message_t* msg) { @@ -488,7 +488,7 @@ static inline uint8_t mavlink_msg_rc_channels_get_chancount(const mavlink_messag /** * @brief Get field chan1_raw from rc_channels message * - * @return RC channel 1 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + * @return [us] RC channel 1 value. */ static inline uint16_t mavlink_msg_rc_channels_get_chan1_raw(const mavlink_message_t* msg) { @@ -498,7 +498,7 @@ static inline uint16_t mavlink_msg_rc_channels_get_chan1_raw(const mavlink_messa /** * @brief Get field chan2_raw from rc_channels message * - * @return RC channel 2 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + * @return [us] RC channel 2 value. */ static inline uint16_t mavlink_msg_rc_channels_get_chan2_raw(const mavlink_message_t* msg) { @@ -508,7 +508,7 @@ static inline uint16_t mavlink_msg_rc_channels_get_chan2_raw(const mavlink_messa /** * @brief Get field chan3_raw from rc_channels message * - * @return RC channel 3 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + * @return [us] RC channel 3 value. */ static inline uint16_t mavlink_msg_rc_channels_get_chan3_raw(const mavlink_message_t* msg) { @@ -518,7 +518,7 @@ static inline uint16_t mavlink_msg_rc_channels_get_chan3_raw(const mavlink_messa /** * @brief Get field chan4_raw from rc_channels message * - * @return RC channel 4 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + * @return [us] RC channel 4 value. */ static inline uint16_t mavlink_msg_rc_channels_get_chan4_raw(const mavlink_message_t* msg) { @@ -528,7 +528,7 @@ static inline uint16_t mavlink_msg_rc_channels_get_chan4_raw(const mavlink_messa /** * @brief Get field chan5_raw from rc_channels message * - * @return RC channel 5 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + * @return [us] RC channel 5 value. */ static inline uint16_t mavlink_msg_rc_channels_get_chan5_raw(const mavlink_message_t* msg) { @@ -538,7 +538,7 @@ static inline uint16_t mavlink_msg_rc_channels_get_chan5_raw(const mavlink_messa /** * @brief Get field chan6_raw from rc_channels message * - * @return RC channel 6 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + * @return [us] RC channel 6 value. */ static inline uint16_t mavlink_msg_rc_channels_get_chan6_raw(const mavlink_message_t* msg) { @@ -548,7 +548,7 @@ static inline uint16_t mavlink_msg_rc_channels_get_chan6_raw(const mavlink_messa /** * @brief Get field chan7_raw from rc_channels message * - * @return RC channel 7 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + * @return [us] RC channel 7 value. */ static inline uint16_t mavlink_msg_rc_channels_get_chan7_raw(const mavlink_message_t* msg) { @@ -558,7 +558,7 @@ static inline uint16_t mavlink_msg_rc_channels_get_chan7_raw(const mavlink_messa /** * @brief Get field chan8_raw from rc_channels message * - * @return RC channel 8 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + * @return [us] RC channel 8 value. */ static inline uint16_t mavlink_msg_rc_channels_get_chan8_raw(const mavlink_message_t* msg) { @@ -568,7 +568,7 @@ static inline uint16_t mavlink_msg_rc_channels_get_chan8_raw(const mavlink_messa /** * @brief Get field chan9_raw from rc_channels message * - * @return RC channel 9 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + * @return [us] RC channel 9 value. */ static inline uint16_t mavlink_msg_rc_channels_get_chan9_raw(const mavlink_message_t* msg) { @@ -578,7 +578,7 @@ static inline uint16_t mavlink_msg_rc_channels_get_chan9_raw(const mavlink_messa /** * @brief Get field chan10_raw from rc_channels message * - * @return RC channel 10 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + * @return [us] RC channel 10 value. */ static inline uint16_t mavlink_msg_rc_channels_get_chan10_raw(const mavlink_message_t* msg) { @@ -588,7 +588,7 @@ static inline uint16_t mavlink_msg_rc_channels_get_chan10_raw(const mavlink_mess /** * @brief Get field chan11_raw from rc_channels message * - * @return RC channel 11 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + * @return [us] RC channel 11 value. */ static inline uint16_t mavlink_msg_rc_channels_get_chan11_raw(const mavlink_message_t* msg) { @@ -598,7 +598,7 @@ static inline uint16_t mavlink_msg_rc_channels_get_chan11_raw(const mavlink_mess /** * @brief Get field chan12_raw from rc_channels message * - * @return RC channel 12 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + * @return [us] RC channel 12 value. */ static inline uint16_t mavlink_msg_rc_channels_get_chan12_raw(const mavlink_message_t* msg) { @@ -608,7 +608,7 @@ static inline uint16_t mavlink_msg_rc_channels_get_chan12_raw(const mavlink_mess /** * @brief Get field chan13_raw from rc_channels message * - * @return RC channel 13 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + * @return [us] RC channel 13 value. */ static inline uint16_t mavlink_msg_rc_channels_get_chan13_raw(const mavlink_message_t* msg) { @@ -618,7 +618,7 @@ static inline uint16_t mavlink_msg_rc_channels_get_chan13_raw(const mavlink_mess /** * @brief Get field chan14_raw from rc_channels message * - * @return RC channel 14 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + * @return [us] RC channel 14 value. */ static inline uint16_t mavlink_msg_rc_channels_get_chan14_raw(const mavlink_message_t* msg) { @@ -628,7 +628,7 @@ static inline uint16_t mavlink_msg_rc_channels_get_chan14_raw(const mavlink_mess /** * @brief Get field chan15_raw from rc_channels message * - * @return RC channel 15 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + * @return [us] RC channel 15 value. */ static inline uint16_t mavlink_msg_rc_channels_get_chan15_raw(const mavlink_message_t* msg) { @@ -638,7 +638,7 @@ static inline uint16_t mavlink_msg_rc_channels_get_chan15_raw(const mavlink_mess /** * @brief Get field chan16_raw from rc_channels message * - * @return RC channel 16 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + * @return [us] RC channel 16 value. */ static inline uint16_t mavlink_msg_rc_channels_get_chan16_raw(const mavlink_message_t* msg) { @@ -648,7 +648,7 @@ static inline uint16_t mavlink_msg_rc_channels_get_chan16_raw(const mavlink_mess /** * @brief Get field chan17_raw from rc_channels message * - * @return RC channel 17 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + * @return [us] RC channel 17 value. */ static inline uint16_t mavlink_msg_rc_channels_get_chan17_raw(const mavlink_message_t* msg) { @@ -658,7 +658,7 @@ static inline uint16_t mavlink_msg_rc_channels_get_chan17_raw(const mavlink_mess /** * @brief Get field chan18_raw from rc_channels message * - * @return RC channel 18 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + * @return [us] RC channel 18 value. */ static inline uint16_t mavlink_msg_rc_channels_get_chan18_raw(const mavlink_message_t* msg) { @@ -668,7 +668,7 @@ static inline uint16_t mavlink_msg_rc_channels_get_chan18_raw(const mavlink_mess /** * @brief Get field rssi from rc_channels message * - * @return Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown. + * @return Receive signal strength indicator in device-dependent units/scale. Values: [0-254], 255: invalid/unknown. */ static inline uint8_t mavlink_msg_rc_channels_get_rssi(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_rc_channels_override.h b/lib/main/MAVLink/common/mavlink_msg_rc_channels_override.h index 970e926935..b45c6ae85b 100755 --- a/lib/main/MAVLink/common/mavlink_msg_rc_channels_override.h +++ b/lib/main/MAVLink/common/mavlink_msg_rc_channels_override.h @@ -3,19 +3,19 @@ #define MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE 70 -MAVPACKED( + typedef struct __mavlink_rc_channels_override_t { - uint16_t chan1_raw; /*< RC channel 1 value, in microseconds. A value of UINT16_MAX means to ignore this field.*/ - uint16_t chan2_raw; /*< RC channel 2 value, in microseconds. A value of UINT16_MAX means to ignore this field.*/ - uint16_t chan3_raw; /*< RC channel 3 value, in microseconds. A value of UINT16_MAX means to ignore this field.*/ - uint16_t chan4_raw; /*< RC channel 4 value, in microseconds. A value of UINT16_MAX means to ignore this field.*/ - uint16_t chan5_raw; /*< RC channel 5 value, in microseconds. A value of UINT16_MAX means to ignore this field.*/ - uint16_t chan6_raw; /*< RC channel 6 value, in microseconds. A value of UINT16_MAX means to ignore this field.*/ - uint16_t chan7_raw; /*< RC channel 7 value, in microseconds. A value of UINT16_MAX means to ignore this field.*/ - uint16_t chan8_raw; /*< RC channel 8 value, in microseconds. A value of UINT16_MAX means to ignore this field.*/ - uint8_t target_system; /*< System ID*/ - uint8_t target_component; /*< Component ID*/ -}) mavlink_rc_channels_override_t; + uint16_t chan1_raw; /*< [us] RC channel 1 value. A value of UINT16_MAX means to ignore this field.*/ + uint16_t chan2_raw; /*< [us] RC channel 2 value. A value of UINT16_MAX means to ignore this field.*/ + uint16_t chan3_raw; /*< [us] RC channel 3 value. A value of UINT16_MAX means to ignore this field.*/ + uint16_t chan4_raw; /*< [us] RC channel 4 value. A value of UINT16_MAX means to ignore this field.*/ + uint16_t chan5_raw; /*< [us] RC channel 5 value. A value of UINT16_MAX means to ignore this field.*/ + uint16_t chan6_raw; /*< [us] RC channel 6 value. A value of UINT16_MAX means to ignore this field.*/ + uint16_t chan7_raw; /*< [us] RC channel 7 value. A value of UINT16_MAX means to ignore this field.*/ + uint16_t chan8_raw; /*< [us] RC channel 8 value. A value of UINT16_MAX means to ignore this field.*/ + uint8_t target_system; /*< System ID*/ + uint8_t target_component; /*< Component ID*/ +} mavlink_rc_channels_override_t; #define MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN 18 #define MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_MIN_LEN 18 @@ -32,7 +32,9 @@ typedef struct __mavlink_rc_channels_override_t { 70, \ "RC_CHANNELS_OVERRIDE", \ 10, \ - { { "chan1_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_rc_channels_override_t, chan1_raw) }, \ + { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 16, offsetof(mavlink_rc_channels_override_t, target_system) }, \ + { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 17, offsetof(mavlink_rc_channels_override_t, target_component) }, \ + { "chan1_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_rc_channels_override_t, chan1_raw) }, \ { "chan2_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_rc_channels_override_t, chan2_raw) }, \ { "chan3_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_rc_channels_override_t, chan3_raw) }, \ { "chan4_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_rc_channels_override_t, chan4_raw) }, \ @@ -40,15 +42,15 @@ typedef struct __mavlink_rc_channels_override_t { { "chan6_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_rc_channels_override_t, chan6_raw) }, \ { "chan7_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_rc_channels_override_t, chan7_raw) }, \ { "chan8_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_rc_channels_override_t, chan8_raw) }, \ - { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 16, offsetof(mavlink_rc_channels_override_t, target_system) }, \ - { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 17, offsetof(mavlink_rc_channels_override_t, target_component) }, \ } \ } #else #define MAVLINK_MESSAGE_INFO_RC_CHANNELS_OVERRIDE { \ "RC_CHANNELS_OVERRIDE", \ 10, \ - { { "chan1_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_rc_channels_override_t, chan1_raw) }, \ + { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 16, offsetof(mavlink_rc_channels_override_t, target_system) }, \ + { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 17, offsetof(mavlink_rc_channels_override_t, target_component) }, \ + { "chan1_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_rc_channels_override_t, chan1_raw) }, \ { "chan2_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_rc_channels_override_t, chan2_raw) }, \ { "chan3_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_rc_channels_override_t, chan3_raw) }, \ { "chan4_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_rc_channels_override_t, chan4_raw) }, \ @@ -56,8 +58,6 @@ typedef struct __mavlink_rc_channels_override_t { { "chan6_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_rc_channels_override_t, chan6_raw) }, \ { "chan7_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_rc_channels_override_t, chan7_raw) }, \ { "chan8_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_rc_channels_override_t, chan8_raw) }, \ - { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 16, offsetof(mavlink_rc_channels_override_t, target_system) }, \ - { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 17, offsetof(mavlink_rc_channels_override_t, target_component) }, \ } \ } #endif @@ -68,16 +68,16 @@ typedef struct __mavlink_rc_channels_override_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param target_system System ID - * @param target_component Component ID - * @param chan1_raw RC channel 1 value, in microseconds. A value of UINT16_MAX means to ignore this field. - * @param chan2_raw RC channel 2 value, in microseconds. A value of UINT16_MAX means to ignore this field. - * @param chan3_raw RC channel 3 value, in microseconds. A value of UINT16_MAX means to ignore this field. - * @param chan4_raw RC channel 4 value, in microseconds. A value of UINT16_MAX means to ignore this field. - * @param chan5_raw RC channel 5 value, in microseconds. A value of UINT16_MAX means to ignore this field. - * @param chan6_raw RC channel 6 value, in microseconds. A value of UINT16_MAX means to ignore this field. - * @param chan7_raw RC channel 7 value, in microseconds. A value of UINT16_MAX means to ignore this field. - * @param chan8_raw RC channel 8 value, in microseconds. A value of UINT16_MAX means to ignore this field. + * @param target_system System ID + * @param target_component Component ID + * @param chan1_raw [us] RC channel 1 value. A value of UINT16_MAX means to ignore this field. + * @param chan2_raw [us] RC channel 2 value. A value of UINT16_MAX means to ignore this field. + * @param chan3_raw [us] RC channel 3 value. A value of UINT16_MAX means to ignore this field. + * @param chan4_raw [us] RC channel 4 value. A value of UINT16_MAX means to ignore this field. + * @param chan5_raw [us] RC channel 5 value. A value of UINT16_MAX means to ignore this field. + * @param chan6_raw [us] RC channel 6 value. A value of UINT16_MAX means to ignore this field. + * @param chan7_raw [us] RC channel 7 value. A value of UINT16_MAX means to ignore this field. + * @param chan8_raw [us] RC channel 8 value. A value of UINT16_MAX means to ignore this field. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_rc_channels_override_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -123,16 +123,16 @@ static inline uint16_t mavlink_msg_rc_channels_override_pack(uint8_t system_id, * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param target_system System ID - * @param target_component Component ID - * @param chan1_raw RC channel 1 value, in microseconds. A value of UINT16_MAX means to ignore this field. - * @param chan2_raw RC channel 2 value, in microseconds. A value of UINT16_MAX means to ignore this field. - * @param chan3_raw RC channel 3 value, in microseconds. A value of UINT16_MAX means to ignore this field. - * @param chan4_raw RC channel 4 value, in microseconds. A value of UINT16_MAX means to ignore this field. - * @param chan5_raw RC channel 5 value, in microseconds. A value of UINT16_MAX means to ignore this field. - * @param chan6_raw RC channel 6 value, in microseconds. A value of UINT16_MAX means to ignore this field. - * @param chan7_raw RC channel 7 value, in microseconds. A value of UINT16_MAX means to ignore this field. - * @param chan8_raw RC channel 8 value, in microseconds. A value of UINT16_MAX means to ignore this field. + * @param target_system System ID + * @param target_component Component ID + * @param chan1_raw [us] RC channel 1 value. A value of UINT16_MAX means to ignore this field. + * @param chan2_raw [us] RC channel 2 value. A value of UINT16_MAX means to ignore this field. + * @param chan3_raw [us] RC channel 3 value. A value of UINT16_MAX means to ignore this field. + * @param chan4_raw [us] RC channel 4 value. A value of UINT16_MAX means to ignore this field. + * @param chan5_raw [us] RC channel 5 value. A value of UINT16_MAX means to ignore this field. + * @param chan6_raw [us] RC channel 6 value. A value of UINT16_MAX means to ignore this field. + * @param chan7_raw [us] RC channel 7 value. A value of UINT16_MAX means to ignore this field. + * @param chan8_raw [us] RC channel 8 value. A value of UINT16_MAX means to ignore this field. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_rc_channels_override_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -204,16 +204,16 @@ static inline uint16_t mavlink_msg_rc_channels_override_encode_chan(uint8_t syst * @brief Send a rc_channels_override message * @param chan MAVLink channel to send the message * - * @param target_system System ID - * @param target_component Component ID - * @param chan1_raw RC channel 1 value, in microseconds. A value of UINT16_MAX means to ignore this field. - * @param chan2_raw RC channel 2 value, in microseconds. A value of UINT16_MAX means to ignore this field. - * @param chan3_raw RC channel 3 value, in microseconds. A value of UINT16_MAX means to ignore this field. - * @param chan4_raw RC channel 4 value, in microseconds. A value of UINT16_MAX means to ignore this field. - * @param chan5_raw RC channel 5 value, in microseconds. A value of UINT16_MAX means to ignore this field. - * @param chan6_raw RC channel 6 value, in microseconds. A value of UINT16_MAX means to ignore this field. - * @param chan7_raw RC channel 7 value, in microseconds. A value of UINT16_MAX means to ignore this field. - * @param chan8_raw RC channel 8 value, in microseconds. A value of UINT16_MAX means to ignore this field. + * @param target_system System ID + * @param target_component Component ID + * @param chan1_raw [us] RC channel 1 value. A value of UINT16_MAX means to ignore this field. + * @param chan2_raw [us] RC channel 2 value. A value of UINT16_MAX means to ignore this field. + * @param chan3_raw [us] RC channel 3 value. A value of UINT16_MAX means to ignore this field. + * @param chan4_raw [us] RC channel 4 value. A value of UINT16_MAX means to ignore this field. + * @param chan5_raw [us] RC channel 5 value. A value of UINT16_MAX means to ignore this field. + * @param chan6_raw [us] RC channel 6 value. A value of UINT16_MAX means to ignore this field. + * @param chan7_raw [us] RC channel 7 value. A value of UINT16_MAX means to ignore this field. + * @param chan8_raw [us] RC channel 8 value. A value of UINT16_MAX means to ignore this field. */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -314,7 +314,7 @@ static inline void mavlink_msg_rc_channels_override_send_buf(mavlink_message_t * /** * @brief Get field target_system from rc_channels_override message * - * @return System ID + * @return System ID */ static inline uint8_t mavlink_msg_rc_channels_override_get_target_system(const mavlink_message_t* msg) { @@ -324,7 +324,7 @@ static inline uint8_t mavlink_msg_rc_channels_override_get_target_system(const m /** * @brief Get field target_component from rc_channels_override message * - * @return Component ID + * @return Component ID */ static inline uint8_t mavlink_msg_rc_channels_override_get_target_component(const mavlink_message_t* msg) { @@ -334,7 +334,7 @@ static inline uint8_t mavlink_msg_rc_channels_override_get_target_component(cons /** * @brief Get field chan1_raw from rc_channels_override message * - * @return RC channel 1 value, in microseconds. A value of UINT16_MAX means to ignore this field. + * @return [us] RC channel 1 value. A value of UINT16_MAX means to ignore this field. */ static inline uint16_t mavlink_msg_rc_channels_override_get_chan1_raw(const mavlink_message_t* msg) { @@ -344,7 +344,7 @@ static inline uint16_t mavlink_msg_rc_channels_override_get_chan1_raw(const mavl /** * @brief Get field chan2_raw from rc_channels_override message * - * @return RC channel 2 value, in microseconds. A value of UINT16_MAX means to ignore this field. + * @return [us] RC channel 2 value. A value of UINT16_MAX means to ignore this field. */ static inline uint16_t mavlink_msg_rc_channels_override_get_chan2_raw(const mavlink_message_t* msg) { @@ -354,7 +354,7 @@ static inline uint16_t mavlink_msg_rc_channels_override_get_chan2_raw(const mavl /** * @brief Get field chan3_raw from rc_channels_override message * - * @return RC channel 3 value, in microseconds. A value of UINT16_MAX means to ignore this field. + * @return [us] RC channel 3 value. A value of UINT16_MAX means to ignore this field. */ static inline uint16_t mavlink_msg_rc_channels_override_get_chan3_raw(const mavlink_message_t* msg) { @@ -364,7 +364,7 @@ static inline uint16_t mavlink_msg_rc_channels_override_get_chan3_raw(const mavl /** * @brief Get field chan4_raw from rc_channels_override message * - * @return RC channel 4 value, in microseconds. A value of UINT16_MAX means to ignore this field. + * @return [us] RC channel 4 value. A value of UINT16_MAX means to ignore this field. */ static inline uint16_t mavlink_msg_rc_channels_override_get_chan4_raw(const mavlink_message_t* msg) { @@ -374,7 +374,7 @@ static inline uint16_t mavlink_msg_rc_channels_override_get_chan4_raw(const mavl /** * @brief Get field chan5_raw from rc_channels_override message * - * @return RC channel 5 value, in microseconds. A value of UINT16_MAX means to ignore this field. + * @return [us] RC channel 5 value. A value of UINT16_MAX means to ignore this field. */ static inline uint16_t mavlink_msg_rc_channels_override_get_chan5_raw(const mavlink_message_t* msg) { @@ -384,7 +384,7 @@ static inline uint16_t mavlink_msg_rc_channels_override_get_chan5_raw(const mavl /** * @brief Get field chan6_raw from rc_channels_override message * - * @return RC channel 6 value, in microseconds. A value of UINT16_MAX means to ignore this field. + * @return [us] RC channel 6 value. A value of UINT16_MAX means to ignore this field. */ static inline uint16_t mavlink_msg_rc_channels_override_get_chan6_raw(const mavlink_message_t* msg) { @@ -394,7 +394,7 @@ static inline uint16_t mavlink_msg_rc_channels_override_get_chan6_raw(const mavl /** * @brief Get field chan7_raw from rc_channels_override message * - * @return RC channel 7 value, in microseconds. A value of UINT16_MAX means to ignore this field. + * @return [us] RC channel 7 value. A value of UINT16_MAX means to ignore this field. */ static inline uint16_t mavlink_msg_rc_channels_override_get_chan7_raw(const mavlink_message_t* msg) { @@ -404,7 +404,7 @@ static inline uint16_t mavlink_msg_rc_channels_override_get_chan7_raw(const mavl /** * @brief Get field chan8_raw from rc_channels_override message * - * @return RC channel 8 value, in microseconds. A value of UINT16_MAX means to ignore this field. + * @return [us] RC channel 8 value. A value of UINT16_MAX means to ignore this field. */ static inline uint16_t mavlink_msg_rc_channels_override_get_chan8_raw(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_rc_channels_raw.h b/lib/main/MAVLink/common/mavlink_msg_rc_channels_raw.h index 87d1b4a82f..cbd7fd8428 100755 --- a/lib/main/MAVLink/common/mavlink_msg_rc_channels_raw.h +++ b/lib/main/MAVLink/common/mavlink_msg_rc_channels_raw.h @@ -3,20 +3,20 @@ #define MAVLINK_MSG_ID_RC_CHANNELS_RAW 35 -MAVPACKED( + typedef struct __mavlink_rc_channels_raw_t { - uint32_t time_boot_ms; /*< Timestamp (milliseconds since system boot)*/ - uint16_t chan1_raw; /*< RC channel 1 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/ - uint16_t chan2_raw; /*< RC channel 2 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/ - uint16_t chan3_raw; /*< RC channel 3 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/ - uint16_t chan4_raw; /*< RC channel 4 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/ - uint16_t chan5_raw; /*< RC channel 5 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/ - uint16_t chan6_raw; /*< RC channel 6 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/ - uint16_t chan7_raw; /*< RC channel 7 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/ - uint16_t chan8_raw; /*< RC channel 8 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/ - uint8_t port; /*< Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows for more than 8 servos.*/ - uint8_t rssi; /*< Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown.*/ -}) mavlink_rc_channels_raw_t; + uint32_t time_boot_ms; /*< [ms] Timestamp (time since system boot).*/ + uint16_t chan1_raw; /*< [us] RC channel 1 value.*/ + uint16_t chan2_raw; /*< [us] RC channel 2 value.*/ + uint16_t chan3_raw; /*< [us] RC channel 3 value.*/ + uint16_t chan4_raw; /*< [us] RC channel 4 value.*/ + uint16_t chan5_raw; /*< [us] RC channel 5 value.*/ + uint16_t chan6_raw; /*< [us] RC channel 6 value.*/ + uint16_t chan7_raw; /*< [us] RC channel 7 value.*/ + uint16_t chan8_raw; /*< [us] RC channel 8 value.*/ + uint8_t port; /*< Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX.*/ + uint8_t rssi; /*< Receive signal strength indicator in device-dependent units/scale. Values: [0-254], 255: invalid/unknown.*/ +} mavlink_rc_channels_raw_t; #define MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN 22 #define MAVLINK_MSG_ID_RC_CHANNELS_RAW_MIN_LEN 22 @@ -34,6 +34,7 @@ typedef struct __mavlink_rc_channels_raw_t { "RC_CHANNELS_RAW", \ 11, \ { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_rc_channels_raw_t, time_boot_ms) }, \ + { "port", NULL, MAVLINK_TYPE_UINT8_T, 0, 20, offsetof(mavlink_rc_channels_raw_t, port) }, \ { "chan1_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_rc_channels_raw_t, chan1_raw) }, \ { "chan2_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_rc_channels_raw_t, chan2_raw) }, \ { "chan3_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_rc_channels_raw_t, chan3_raw) }, \ @@ -42,7 +43,6 @@ typedef struct __mavlink_rc_channels_raw_t { { "chan6_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_rc_channels_raw_t, chan6_raw) }, \ { "chan7_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_rc_channels_raw_t, chan7_raw) }, \ { "chan8_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_rc_channels_raw_t, chan8_raw) }, \ - { "port", NULL, MAVLINK_TYPE_UINT8_T, 0, 20, offsetof(mavlink_rc_channels_raw_t, port) }, \ { "rssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 21, offsetof(mavlink_rc_channels_raw_t, rssi) }, \ } \ } @@ -51,6 +51,7 @@ typedef struct __mavlink_rc_channels_raw_t { "RC_CHANNELS_RAW", \ 11, \ { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_rc_channels_raw_t, time_boot_ms) }, \ + { "port", NULL, MAVLINK_TYPE_UINT8_T, 0, 20, offsetof(mavlink_rc_channels_raw_t, port) }, \ { "chan1_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_rc_channels_raw_t, chan1_raw) }, \ { "chan2_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_rc_channels_raw_t, chan2_raw) }, \ { "chan3_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_rc_channels_raw_t, chan3_raw) }, \ @@ -59,7 +60,6 @@ typedef struct __mavlink_rc_channels_raw_t { { "chan6_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_rc_channels_raw_t, chan6_raw) }, \ { "chan7_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_rc_channels_raw_t, chan7_raw) }, \ { "chan8_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_rc_channels_raw_t, chan8_raw) }, \ - { "port", NULL, MAVLINK_TYPE_UINT8_T, 0, 20, offsetof(mavlink_rc_channels_raw_t, port) }, \ { "rssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 21, offsetof(mavlink_rc_channels_raw_t, rssi) }, \ } \ } @@ -71,17 +71,17 @@ typedef struct __mavlink_rc_channels_raw_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param time_boot_ms Timestamp (milliseconds since system boot) - * @param port Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows for more than 8 servos. - * @param chan1_raw RC channel 1 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan2_raw RC channel 2 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan3_raw RC channel 3 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan4_raw RC channel 4 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan5_raw RC channel 5 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan6_raw RC channel 6 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan7_raw RC channel 7 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan8_raw RC channel 8 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param rssi Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown. + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param port Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX. + * @param chan1_raw [us] RC channel 1 value. + * @param chan2_raw [us] RC channel 2 value. + * @param chan3_raw [us] RC channel 3 value. + * @param chan4_raw [us] RC channel 4 value. + * @param chan5_raw [us] RC channel 5 value. + * @param chan6_raw [us] RC channel 6 value. + * @param chan7_raw [us] RC channel 7 value. + * @param chan8_raw [us] RC channel 8 value. + * @param rssi Receive signal strength indicator in device-dependent units/scale. Values: [0-254], 255: invalid/unknown. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_rc_channels_raw_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -129,17 +129,17 @@ static inline uint16_t mavlink_msg_rc_channels_raw_pack(uint8_t system_id, uint8 * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param time_boot_ms Timestamp (milliseconds since system boot) - * @param port Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows for more than 8 servos. - * @param chan1_raw RC channel 1 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan2_raw RC channel 2 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan3_raw RC channel 3 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan4_raw RC channel 4 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan5_raw RC channel 5 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan6_raw RC channel 6 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan7_raw RC channel 7 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan8_raw RC channel 8 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param rssi Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown. + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param port Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX. + * @param chan1_raw [us] RC channel 1 value. + * @param chan2_raw [us] RC channel 2 value. + * @param chan3_raw [us] RC channel 3 value. + * @param chan4_raw [us] RC channel 4 value. + * @param chan5_raw [us] RC channel 5 value. + * @param chan6_raw [us] RC channel 6 value. + * @param chan7_raw [us] RC channel 7 value. + * @param chan8_raw [us] RC channel 8 value. + * @param rssi Receive signal strength indicator in device-dependent units/scale. Values: [0-254], 255: invalid/unknown. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_rc_channels_raw_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -213,17 +213,17 @@ static inline uint16_t mavlink_msg_rc_channels_raw_encode_chan(uint8_t system_id * @brief Send a rc_channels_raw message * @param chan MAVLink channel to send the message * - * @param time_boot_ms Timestamp (milliseconds since system boot) - * @param port Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows for more than 8 servos. - * @param chan1_raw RC channel 1 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan2_raw RC channel 2 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan3_raw RC channel 3 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan4_raw RC channel 4 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan5_raw RC channel 5 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan6_raw RC channel 6 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan7_raw RC channel 7 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param chan8_raw RC channel 8 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - * @param rssi Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown. + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param port Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX. + * @param chan1_raw [us] RC channel 1 value. + * @param chan2_raw [us] RC channel 2 value. + * @param chan3_raw [us] RC channel 3 value. + * @param chan4_raw [us] RC channel 4 value. + * @param chan5_raw [us] RC channel 5 value. + * @param chan6_raw [us] RC channel 6 value. + * @param chan7_raw [us] RC channel 7 value. + * @param chan8_raw [us] RC channel 8 value. + * @param rssi Receive signal strength indicator in device-dependent units/scale. Values: [0-254], 255: invalid/unknown. */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -328,7 +328,7 @@ static inline void mavlink_msg_rc_channels_raw_send_buf(mavlink_message_t *msgbu /** * @brief Get field time_boot_ms from rc_channels_raw message * - * @return Timestamp (milliseconds since system boot) + * @return [ms] Timestamp (time since system boot). */ static inline uint32_t mavlink_msg_rc_channels_raw_get_time_boot_ms(const mavlink_message_t* msg) { @@ -338,7 +338,7 @@ static inline uint32_t mavlink_msg_rc_channels_raw_get_time_boot_ms(const mavlin /** * @brief Get field port from rc_channels_raw message * - * @return Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows for more than 8 servos. + * @return Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX. */ static inline uint8_t mavlink_msg_rc_channels_raw_get_port(const mavlink_message_t* msg) { @@ -348,7 +348,7 @@ static inline uint8_t mavlink_msg_rc_channels_raw_get_port(const mavlink_message /** * @brief Get field chan1_raw from rc_channels_raw message * - * @return RC channel 1 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + * @return [us] RC channel 1 value. */ static inline uint16_t mavlink_msg_rc_channels_raw_get_chan1_raw(const mavlink_message_t* msg) { @@ -358,7 +358,7 @@ static inline uint16_t mavlink_msg_rc_channels_raw_get_chan1_raw(const mavlink_m /** * @brief Get field chan2_raw from rc_channels_raw message * - * @return RC channel 2 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + * @return [us] RC channel 2 value. */ static inline uint16_t mavlink_msg_rc_channels_raw_get_chan2_raw(const mavlink_message_t* msg) { @@ -368,7 +368,7 @@ static inline uint16_t mavlink_msg_rc_channels_raw_get_chan2_raw(const mavlink_m /** * @brief Get field chan3_raw from rc_channels_raw message * - * @return RC channel 3 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + * @return [us] RC channel 3 value. */ static inline uint16_t mavlink_msg_rc_channels_raw_get_chan3_raw(const mavlink_message_t* msg) { @@ -378,7 +378,7 @@ static inline uint16_t mavlink_msg_rc_channels_raw_get_chan3_raw(const mavlink_m /** * @brief Get field chan4_raw from rc_channels_raw message * - * @return RC channel 4 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + * @return [us] RC channel 4 value. */ static inline uint16_t mavlink_msg_rc_channels_raw_get_chan4_raw(const mavlink_message_t* msg) { @@ -388,7 +388,7 @@ static inline uint16_t mavlink_msg_rc_channels_raw_get_chan4_raw(const mavlink_m /** * @brief Get field chan5_raw from rc_channels_raw message * - * @return RC channel 5 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + * @return [us] RC channel 5 value. */ static inline uint16_t mavlink_msg_rc_channels_raw_get_chan5_raw(const mavlink_message_t* msg) { @@ -398,7 +398,7 @@ static inline uint16_t mavlink_msg_rc_channels_raw_get_chan5_raw(const mavlink_m /** * @brief Get field chan6_raw from rc_channels_raw message * - * @return RC channel 6 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + * @return [us] RC channel 6 value. */ static inline uint16_t mavlink_msg_rc_channels_raw_get_chan6_raw(const mavlink_message_t* msg) { @@ -408,7 +408,7 @@ static inline uint16_t mavlink_msg_rc_channels_raw_get_chan6_raw(const mavlink_m /** * @brief Get field chan7_raw from rc_channels_raw message * - * @return RC channel 7 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + * @return [us] RC channel 7 value. */ static inline uint16_t mavlink_msg_rc_channels_raw_get_chan7_raw(const mavlink_message_t* msg) { @@ -418,7 +418,7 @@ static inline uint16_t mavlink_msg_rc_channels_raw_get_chan7_raw(const mavlink_m /** * @brief Get field chan8_raw from rc_channels_raw message * - * @return RC channel 8 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + * @return [us] RC channel 8 value. */ static inline uint16_t mavlink_msg_rc_channels_raw_get_chan8_raw(const mavlink_message_t* msg) { @@ -428,7 +428,7 @@ static inline uint16_t mavlink_msg_rc_channels_raw_get_chan8_raw(const mavlink_m /** * @brief Get field rssi from rc_channels_raw message * - * @return Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown. + * @return Receive signal strength indicator in device-dependent units/scale. Values: [0-254], 255: invalid/unknown. */ static inline uint8_t mavlink_msg_rc_channels_raw_get_rssi(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_rc_channels_scaled.h b/lib/main/MAVLink/common/mavlink_msg_rc_channels_scaled.h index 5b04333149..9d516d1ccc 100755 --- a/lib/main/MAVLink/common/mavlink_msg_rc_channels_scaled.h +++ b/lib/main/MAVLink/common/mavlink_msg_rc_channels_scaled.h @@ -3,20 +3,20 @@ #define MAVLINK_MSG_ID_RC_CHANNELS_SCALED 34 -MAVPACKED( + typedef struct __mavlink_rc_channels_scaled_t { - uint32_t time_boot_ms; /*< Timestamp (milliseconds since system boot)*/ - int16_t chan1_scaled; /*< RC channel 1 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.*/ - int16_t chan2_scaled; /*< RC channel 2 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.*/ - int16_t chan3_scaled; /*< RC channel 3 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.*/ - int16_t chan4_scaled; /*< RC channel 4 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.*/ - int16_t chan5_scaled; /*< RC channel 5 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.*/ - int16_t chan6_scaled; /*< RC channel 6 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.*/ - int16_t chan7_scaled; /*< RC channel 7 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.*/ - int16_t chan8_scaled; /*< RC channel 8 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.*/ - uint8_t port; /*< Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows for more than 8 servos.*/ - uint8_t rssi; /*< Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown.*/ -}) mavlink_rc_channels_scaled_t; + uint32_t time_boot_ms; /*< [ms] Timestamp (time since system boot).*/ + int16_t chan1_scaled; /*< RC channel 1 value scaled.*/ + int16_t chan2_scaled; /*< RC channel 2 value scaled.*/ + int16_t chan3_scaled; /*< RC channel 3 value scaled.*/ + int16_t chan4_scaled; /*< RC channel 4 value scaled.*/ + int16_t chan5_scaled; /*< RC channel 5 value scaled.*/ + int16_t chan6_scaled; /*< RC channel 6 value scaled.*/ + int16_t chan7_scaled; /*< RC channel 7 value scaled.*/ + int16_t chan8_scaled; /*< RC channel 8 value scaled.*/ + uint8_t port; /*< Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX.*/ + uint8_t rssi; /*< Receive signal strength indicator in device-dependent units/scale. Values: [0-254], 255: invalid/unknown.*/ +} mavlink_rc_channels_scaled_t; #define MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN 22 #define MAVLINK_MSG_ID_RC_CHANNELS_SCALED_MIN_LEN 22 @@ -34,6 +34,7 @@ typedef struct __mavlink_rc_channels_scaled_t { "RC_CHANNELS_SCALED", \ 11, \ { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_rc_channels_scaled_t, time_boot_ms) }, \ + { "port", NULL, MAVLINK_TYPE_UINT8_T, 0, 20, offsetof(mavlink_rc_channels_scaled_t, port) }, \ { "chan1_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 4, offsetof(mavlink_rc_channels_scaled_t, chan1_scaled) }, \ { "chan2_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 6, offsetof(mavlink_rc_channels_scaled_t, chan2_scaled) }, \ { "chan3_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 8, offsetof(mavlink_rc_channels_scaled_t, chan3_scaled) }, \ @@ -42,7 +43,6 @@ typedef struct __mavlink_rc_channels_scaled_t { { "chan6_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 14, offsetof(mavlink_rc_channels_scaled_t, chan6_scaled) }, \ { "chan7_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 16, offsetof(mavlink_rc_channels_scaled_t, chan7_scaled) }, \ { "chan8_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 18, offsetof(mavlink_rc_channels_scaled_t, chan8_scaled) }, \ - { "port", NULL, MAVLINK_TYPE_UINT8_T, 0, 20, offsetof(mavlink_rc_channels_scaled_t, port) }, \ { "rssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 21, offsetof(mavlink_rc_channels_scaled_t, rssi) }, \ } \ } @@ -51,6 +51,7 @@ typedef struct __mavlink_rc_channels_scaled_t { "RC_CHANNELS_SCALED", \ 11, \ { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_rc_channels_scaled_t, time_boot_ms) }, \ + { "port", NULL, MAVLINK_TYPE_UINT8_T, 0, 20, offsetof(mavlink_rc_channels_scaled_t, port) }, \ { "chan1_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 4, offsetof(mavlink_rc_channels_scaled_t, chan1_scaled) }, \ { "chan2_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 6, offsetof(mavlink_rc_channels_scaled_t, chan2_scaled) }, \ { "chan3_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 8, offsetof(mavlink_rc_channels_scaled_t, chan3_scaled) }, \ @@ -59,7 +60,6 @@ typedef struct __mavlink_rc_channels_scaled_t { { "chan6_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 14, offsetof(mavlink_rc_channels_scaled_t, chan6_scaled) }, \ { "chan7_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 16, offsetof(mavlink_rc_channels_scaled_t, chan7_scaled) }, \ { "chan8_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 18, offsetof(mavlink_rc_channels_scaled_t, chan8_scaled) }, \ - { "port", NULL, MAVLINK_TYPE_UINT8_T, 0, 20, offsetof(mavlink_rc_channels_scaled_t, port) }, \ { "rssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 21, offsetof(mavlink_rc_channels_scaled_t, rssi) }, \ } \ } @@ -71,17 +71,17 @@ typedef struct __mavlink_rc_channels_scaled_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param time_boot_ms Timestamp (milliseconds since system boot) - * @param port Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows for more than 8 servos. - * @param chan1_scaled RC channel 1 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. - * @param chan2_scaled RC channel 2 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. - * @param chan3_scaled RC channel 3 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. - * @param chan4_scaled RC channel 4 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. - * @param chan5_scaled RC channel 5 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. - * @param chan6_scaled RC channel 6 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. - * @param chan7_scaled RC channel 7 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. - * @param chan8_scaled RC channel 8 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. - * @param rssi Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown. + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param port Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX. + * @param chan1_scaled RC channel 1 value scaled. + * @param chan2_scaled RC channel 2 value scaled. + * @param chan3_scaled RC channel 3 value scaled. + * @param chan4_scaled RC channel 4 value scaled. + * @param chan5_scaled RC channel 5 value scaled. + * @param chan6_scaled RC channel 6 value scaled. + * @param chan7_scaled RC channel 7 value scaled. + * @param chan8_scaled RC channel 8 value scaled. + * @param rssi Receive signal strength indicator in device-dependent units/scale. Values: [0-254], 255: invalid/unknown. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_rc_channels_scaled_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -129,17 +129,17 @@ static inline uint16_t mavlink_msg_rc_channels_scaled_pack(uint8_t system_id, ui * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param time_boot_ms Timestamp (milliseconds since system boot) - * @param port Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows for more than 8 servos. - * @param chan1_scaled RC channel 1 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. - * @param chan2_scaled RC channel 2 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. - * @param chan3_scaled RC channel 3 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. - * @param chan4_scaled RC channel 4 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. - * @param chan5_scaled RC channel 5 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. - * @param chan6_scaled RC channel 6 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. - * @param chan7_scaled RC channel 7 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. - * @param chan8_scaled RC channel 8 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. - * @param rssi Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown. + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param port Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX. + * @param chan1_scaled RC channel 1 value scaled. + * @param chan2_scaled RC channel 2 value scaled. + * @param chan3_scaled RC channel 3 value scaled. + * @param chan4_scaled RC channel 4 value scaled. + * @param chan5_scaled RC channel 5 value scaled. + * @param chan6_scaled RC channel 6 value scaled. + * @param chan7_scaled RC channel 7 value scaled. + * @param chan8_scaled RC channel 8 value scaled. + * @param rssi Receive signal strength indicator in device-dependent units/scale. Values: [0-254], 255: invalid/unknown. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_rc_channels_scaled_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -213,17 +213,17 @@ static inline uint16_t mavlink_msg_rc_channels_scaled_encode_chan(uint8_t system * @brief Send a rc_channels_scaled message * @param chan MAVLink channel to send the message * - * @param time_boot_ms Timestamp (milliseconds since system boot) - * @param port Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows for more than 8 servos. - * @param chan1_scaled RC channel 1 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. - * @param chan2_scaled RC channel 2 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. - * @param chan3_scaled RC channel 3 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. - * @param chan4_scaled RC channel 4 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. - * @param chan5_scaled RC channel 5 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. - * @param chan6_scaled RC channel 6 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. - * @param chan7_scaled RC channel 7 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. - * @param chan8_scaled RC channel 8 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. - * @param rssi Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown. + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param port Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX. + * @param chan1_scaled RC channel 1 value scaled. + * @param chan2_scaled RC channel 2 value scaled. + * @param chan3_scaled RC channel 3 value scaled. + * @param chan4_scaled RC channel 4 value scaled. + * @param chan5_scaled RC channel 5 value scaled. + * @param chan6_scaled RC channel 6 value scaled. + * @param chan7_scaled RC channel 7 value scaled. + * @param chan8_scaled RC channel 8 value scaled. + * @param rssi Receive signal strength indicator in device-dependent units/scale. Values: [0-254], 255: invalid/unknown. */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -328,7 +328,7 @@ static inline void mavlink_msg_rc_channels_scaled_send_buf(mavlink_message_t *ms /** * @brief Get field time_boot_ms from rc_channels_scaled message * - * @return Timestamp (milliseconds since system boot) + * @return [ms] Timestamp (time since system boot). */ static inline uint32_t mavlink_msg_rc_channels_scaled_get_time_boot_ms(const mavlink_message_t* msg) { @@ -338,7 +338,7 @@ static inline uint32_t mavlink_msg_rc_channels_scaled_get_time_boot_ms(const mav /** * @brief Get field port from rc_channels_scaled message * - * @return Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows for more than 8 servos. + * @return Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX. */ static inline uint8_t mavlink_msg_rc_channels_scaled_get_port(const mavlink_message_t* msg) { @@ -348,7 +348,7 @@ static inline uint8_t mavlink_msg_rc_channels_scaled_get_port(const mavlink_mess /** * @brief Get field chan1_scaled from rc_channels_scaled message * - * @return RC channel 1 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. + * @return RC channel 1 value scaled. */ static inline int16_t mavlink_msg_rc_channels_scaled_get_chan1_scaled(const mavlink_message_t* msg) { @@ -358,7 +358,7 @@ static inline int16_t mavlink_msg_rc_channels_scaled_get_chan1_scaled(const mavl /** * @brief Get field chan2_scaled from rc_channels_scaled message * - * @return RC channel 2 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. + * @return RC channel 2 value scaled. */ static inline int16_t mavlink_msg_rc_channels_scaled_get_chan2_scaled(const mavlink_message_t* msg) { @@ -368,7 +368,7 @@ static inline int16_t mavlink_msg_rc_channels_scaled_get_chan2_scaled(const mavl /** * @brief Get field chan3_scaled from rc_channels_scaled message * - * @return RC channel 3 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. + * @return RC channel 3 value scaled. */ static inline int16_t mavlink_msg_rc_channels_scaled_get_chan3_scaled(const mavlink_message_t* msg) { @@ -378,7 +378,7 @@ static inline int16_t mavlink_msg_rc_channels_scaled_get_chan3_scaled(const mavl /** * @brief Get field chan4_scaled from rc_channels_scaled message * - * @return RC channel 4 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. + * @return RC channel 4 value scaled. */ static inline int16_t mavlink_msg_rc_channels_scaled_get_chan4_scaled(const mavlink_message_t* msg) { @@ -388,7 +388,7 @@ static inline int16_t mavlink_msg_rc_channels_scaled_get_chan4_scaled(const mavl /** * @brief Get field chan5_scaled from rc_channels_scaled message * - * @return RC channel 5 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. + * @return RC channel 5 value scaled. */ static inline int16_t mavlink_msg_rc_channels_scaled_get_chan5_scaled(const mavlink_message_t* msg) { @@ -398,7 +398,7 @@ static inline int16_t mavlink_msg_rc_channels_scaled_get_chan5_scaled(const mavl /** * @brief Get field chan6_scaled from rc_channels_scaled message * - * @return RC channel 6 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. + * @return RC channel 6 value scaled. */ static inline int16_t mavlink_msg_rc_channels_scaled_get_chan6_scaled(const mavlink_message_t* msg) { @@ -408,7 +408,7 @@ static inline int16_t mavlink_msg_rc_channels_scaled_get_chan6_scaled(const mavl /** * @brief Get field chan7_scaled from rc_channels_scaled message * - * @return RC channel 7 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. + * @return RC channel 7 value scaled. */ static inline int16_t mavlink_msg_rc_channels_scaled_get_chan7_scaled(const mavlink_message_t* msg) { @@ -418,7 +418,7 @@ static inline int16_t mavlink_msg_rc_channels_scaled_get_chan7_scaled(const mavl /** * @brief Get field chan8_scaled from rc_channels_scaled message * - * @return RC channel 8 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. + * @return RC channel 8 value scaled. */ static inline int16_t mavlink_msg_rc_channels_scaled_get_chan8_scaled(const mavlink_message_t* msg) { @@ -428,7 +428,7 @@ static inline int16_t mavlink_msg_rc_channels_scaled_get_chan8_scaled(const mavl /** * @brief Get field rssi from rc_channels_scaled message * - * @return Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown. + * @return Receive signal strength indicator in device-dependent units/scale. Values: [0-254], 255: invalid/unknown. */ static inline uint8_t mavlink_msg_rc_channels_scaled_get_rssi(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_request_data_stream.h b/lib/main/MAVLink/common/mavlink_msg_request_data_stream.h index 047c2c342f..f1d739588e 100755 --- a/lib/main/MAVLink/common/mavlink_msg_request_data_stream.h +++ b/lib/main/MAVLink/common/mavlink_msg_request_data_stream.h @@ -3,14 +3,14 @@ #define MAVLINK_MSG_ID_REQUEST_DATA_STREAM 66 -MAVPACKED( + typedef struct __mavlink_request_data_stream_t { - uint16_t req_message_rate; /*< The requested message rate*/ - uint8_t target_system; /*< The target requested to send the message stream.*/ - uint8_t target_component; /*< The target requested to send the message stream.*/ - uint8_t req_stream_id; /*< The ID of the requested data stream*/ - uint8_t start_stop; /*< 1 to start sending, 0 to stop sending.*/ -}) mavlink_request_data_stream_t; + uint16_t req_message_rate; /*< [Hz] The requested message rate*/ + uint8_t target_system; /*< The target requested to send the message stream.*/ + uint8_t target_component; /*< The target requested to send the message stream.*/ + uint8_t req_stream_id; /*< The ID of the requested data stream*/ + uint8_t start_stop; /*< 1 to start sending, 0 to stop sending.*/ +} mavlink_request_data_stream_t; #define MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN 6 #define MAVLINK_MSG_ID_REQUEST_DATA_STREAM_MIN_LEN 6 @@ -27,10 +27,10 @@ typedef struct __mavlink_request_data_stream_t { 66, \ "REQUEST_DATA_STREAM", \ 5, \ - { { "req_message_rate", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_request_data_stream_t, req_message_rate) }, \ - { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_request_data_stream_t, target_system) }, \ + { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_request_data_stream_t, target_system) }, \ { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_request_data_stream_t, target_component) }, \ { "req_stream_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_request_data_stream_t, req_stream_id) }, \ + { "req_message_rate", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_request_data_stream_t, req_message_rate) }, \ { "start_stop", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_request_data_stream_t, start_stop) }, \ } \ } @@ -38,10 +38,10 @@ typedef struct __mavlink_request_data_stream_t { #define MAVLINK_MESSAGE_INFO_REQUEST_DATA_STREAM { \ "REQUEST_DATA_STREAM", \ 5, \ - { { "req_message_rate", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_request_data_stream_t, req_message_rate) }, \ - { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_request_data_stream_t, target_system) }, \ + { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_request_data_stream_t, target_system) }, \ { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_request_data_stream_t, target_component) }, \ { "req_stream_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_request_data_stream_t, req_stream_id) }, \ + { "req_message_rate", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_request_data_stream_t, req_message_rate) }, \ { "start_stop", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_request_data_stream_t, start_stop) }, \ } \ } @@ -53,11 +53,11 @@ typedef struct __mavlink_request_data_stream_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param target_system The target requested to send the message stream. - * @param target_component The target requested to send the message stream. - * @param req_stream_id The ID of the requested data stream - * @param req_message_rate The requested message rate - * @param start_stop 1 to start sending, 0 to stop sending. + * @param target_system The target requested to send the message stream. + * @param target_component The target requested to send the message stream. + * @param req_stream_id The ID of the requested data stream + * @param req_message_rate [Hz] The requested message rate + * @param start_stop 1 to start sending, 0 to stop sending. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_request_data_stream_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -93,11 +93,11 @@ static inline uint16_t mavlink_msg_request_data_stream_pack(uint8_t system_id, u * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param target_system The target requested to send the message stream. - * @param target_component The target requested to send the message stream. - * @param req_stream_id The ID of the requested data stream - * @param req_message_rate The requested message rate - * @param start_stop 1 to start sending, 0 to stop sending. + * @param target_system The target requested to send the message stream. + * @param target_component The target requested to send the message stream. + * @param req_stream_id The ID of the requested data stream + * @param req_message_rate [Hz] The requested message rate + * @param start_stop 1 to start sending, 0 to stop sending. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_request_data_stream_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -159,11 +159,11 @@ static inline uint16_t mavlink_msg_request_data_stream_encode_chan(uint8_t syste * @brief Send a request_data_stream message * @param chan MAVLink channel to send the message * - * @param target_system The target requested to send the message stream. - * @param target_component The target requested to send the message stream. - * @param req_stream_id The ID of the requested data stream - * @param req_message_rate The requested message rate - * @param start_stop 1 to start sending, 0 to stop sending. + * @param target_system The target requested to send the message stream. + * @param target_component The target requested to send the message stream. + * @param req_stream_id The ID of the requested data stream + * @param req_message_rate [Hz] The requested message rate + * @param start_stop 1 to start sending, 0 to stop sending. */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -244,7 +244,7 @@ static inline void mavlink_msg_request_data_stream_send_buf(mavlink_message_t *m /** * @brief Get field target_system from request_data_stream message * - * @return The target requested to send the message stream. + * @return The target requested to send the message stream. */ static inline uint8_t mavlink_msg_request_data_stream_get_target_system(const mavlink_message_t* msg) { @@ -254,7 +254,7 @@ static inline uint8_t mavlink_msg_request_data_stream_get_target_system(const ma /** * @brief Get field target_component from request_data_stream message * - * @return The target requested to send the message stream. + * @return The target requested to send the message stream. */ static inline uint8_t mavlink_msg_request_data_stream_get_target_component(const mavlink_message_t* msg) { @@ -264,7 +264,7 @@ static inline uint8_t mavlink_msg_request_data_stream_get_target_component(const /** * @brief Get field req_stream_id from request_data_stream message * - * @return The ID of the requested data stream + * @return The ID of the requested data stream */ static inline uint8_t mavlink_msg_request_data_stream_get_req_stream_id(const mavlink_message_t* msg) { @@ -274,7 +274,7 @@ static inline uint8_t mavlink_msg_request_data_stream_get_req_stream_id(const ma /** * @brief Get field req_message_rate from request_data_stream message * - * @return The requested message rate + * @return [Hz] The requested message rate */ static inline uint16_t mavlink_msg_request_data_stream_get_req_message_rate(const mavlink_message_t* msg) { @@ -284,7 +284,7 @@ static inline uint16_t mavlink_msg_request_data_stream_get_req_message_rate(cons /** * @brief Get field start_stop from request_data_stream message * - * @return 1 to start sending, 0 to stop sending. + * @return 1 to start sending, 0 to stop sending. */ static inline uint8_t mavlink_msg_request_data_stream_get_start_stop(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_resource_request.h b/lib/main/MAVLink/common/mavlink_msg_resource_request.h index 69a11771f3..a8ee9a6398 100755 --- a/lib/main/MAVLink/common/mavlink_msg_resource_request.h +++ b/lib/main/MAVLink/common/mavlink_msg_resource_request.h @@ -3,14 +3,14 @@ #define MAVLINK_MSG_ID_RESOURCE_REQUEST 142 -MAVPACKED( + typedef struct __mavlink_resource_request_t { - uint8_t request_id; /*< Request ID. This ID should be re-used when sending back URI contents*/ - uint8_t uri_type; /*< The type of requested URI. 0 = a file via URL. 1 = a UAVCAN binary*/ - uint8_t uri[120]; /*< The requested unique resource identifier (URI). It is not necessarily a straight domain name (depends on the URI type enum)*/ - uint8_t transfer_type; /*< The way the autopilot wants to receive the URI. 0 = MAVLink FTP. 1 = binary stream.*/ - uint8_t storage[120]; /*< The storage path the autopilot wants the URI to be stored in. Will only be valid if the transfer_type has a storage associated (e.g. MAVLink FTP).*/ -}) mavlink_resource_request_t; + uint8_t request_id; /*< Request ID. This ID should be re-used when sending back URI contents*/ + uint8_t uri_type; /*< The type of requested URI. 0 = a file via URL. 1 = a UAVCAN binary*/ + uint8_t uri[120]; /*< The requested unique resource identifier (URI). It is not necessarily a straight domain name (depends on the URI type enum)*/ + uint8_t transfer_type; /*< The way the autopilot wants to receive the URI. 0 = MAVLink FTP. 1 = binary stream.*/ + uint8_t storage[120]; /*< The storage path the autopilot wants the URI to be stored in. Will only be valid if the transfer_type has a storage associated (e.g. MAVLink FTP).*/ +} mavlink_resource_request_t; #define MAVLINK_MSG_ID_RESOURCE_REQUEST_LEN 243 #define MAVLINK_MSG_ID_RESOURCE_REQUEST_MIN_LEN 243 @@ -54,11 +54,11 @@ typedef struct __mavlink_resource_request_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param request_id Request ID. This ID should be re-used when sending back URI contents - * @param uri_type The type of requested URI. 0 = a file via URL. 1 = a UAVCAN binary - * @param uri The requested unique resource identifier (URI). It is not necessarily a straight domain name (depends on the URI type enum) - * @param transfer_type The way the autopilot wants to receive the URI. 0 = MAVLink FTP. 1 = binary stream. - * @param storage The storage path the autopilot wants the URI to be stored in. Will only be valid if the transfer_type has a storage associated (e.g. MAVLink FTP). + * @param request_id Request ID. This ID should be re-used when sending back URI contents + * @param uri_type The type of requested URI. 0 = a file via URL. 1 = a UAVCAN binary + * @param uri The requested unique resource identifier (URI). It is not necessarily a straight domain name (depends on the URI type enum) + * @param transfer_type The way the autopilot wants to receive the URI. 0 = MAVLink FTP. 1 = binary stream. + * @param storage The storage path the autopilot wants the URI to be stored in. Will only be valid if the transfer_type has a storage associated (e.g. MAVLink FTP). * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_resource_request_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -92,11 +92,11 @@ static inline uint16_t mavlink_msg_resource_request_pack(uint8_t system_id, uint * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param request_id Request ID. This ID should be re-used when sending back URI contents - * @param uri_type The type of requested URI. 0 = a file via URL. 1 = a UAVCAN binary - * @param uri The requested unique resource identifier (URI). It is not necessarily a straight domain name (depends on the URI type enum) - * @param transfer_type The way the autopilot wants to receive the URI. 0 = MAVLink FTP. 1 = binary stream. - * @param storage The storage path the autopilot wants the URI to be stored in. Will only be valid if the transfer_type has a storage associated (e.g. MAVLink FTP). + * @param request_id Request ID. This ID should be re-used when sending back URI contents + * @param uri_type The type of requested URI. 0 = a file via URL. 1 = a UAVCAN binary + * @param uri The requested unique resource identifier (URI). It is not necessarily a straight domain name (depends on the URI type enum) + * @param transfer_type The way the autopilot wants to receive the URI. 0 = MAVLink FTP. 1 = binary stream. + * @param storage The storage path the autopilot wants the URI to be stored in. Will only be valid if the transfer_type has a storage associated (e.g. MAVLink FTP). * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_resource_request_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -156,11 +156,11 @@ static inline uint16_t mavlink_msg_resource_request_encode_chan(uint8_t system_i * @brief Send a resource_request message * @param chan MAVLink channel to send the message * - * @param request_id Request ID. This ID should be re-used when sending back URI contents - * @param uri_type The type of requested URI. 0 = a file via URL. 1 = a UAVCAN binary - * @param uri The requested unique resource identifier (URI). It is not necessarily a straight domain name (depends on the URI type enum) - * @param transfer_type The way the autopilot wants to receive the URI. 0 = MAVLink FTP. 1 = binary stream. - * @param storage The storage path the autopilot wants the URI to be stored in. Will only be valid if the transfer_type has a storage associated (e.g. MAVLink FTP). + * @param request_id Request ID. This ID should be re-used when sending back URI contents + * @param uri_type The type of requested URI. 0 = a file via URL. 1 = a UAVCAN binary + * @param uri The requested unique resource identifier (URI). It is not necessarily a straight domain name (depends on the URI type enum) + * @param transfer_type The way the autopilot wants to receive the URI. 0 = MAVLink FTP. 1 = binary stream. + * @param storage The storage path the autopilot wants the URI to be stored in. Will only be valid if the transfer_type has a storage associated (e.g. MAVLink FTP). */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -237,7 +237,7 @@ static inline void mavlink_msg_resource_request_send_buf(mavlink_message_t *msgb /** * @brief Get field request_id from resource_request message * - * @return Request ID. This ID should be re-used when sending back URI contents + * @return Request ID. This ID should be re-used when sending back URI contents */ static inline uint8_t mavlink_msg_resource_request_get_request_id(const mavlink_message_t* msg) { @@ -247,7 +247,7 @@ static inline uint8_t mavlink_msg_resource_request_get_request_id(const mavlink_ /** * @brief Get field uri_type from resource_request message * - * @return The type of requested URI. 0 = a file via URL. 1 = a UAVCAN binary + * @return The type of requested URI. 0 = a file via URL. 1 = a UAVCAN binary */ static inline uint8_t mavlink_msg_resource_request_get_uri_type(const mavlink_message_t* msg) { @@ -257,7 +257,7 @@ static inline uint8_t mavlink_msg_resource_request_get_uri_type(const mavlink_me /** * @brief Get field uri from resource_request message * - * @return The requested unique resource identifier (URI). It is not necessarily a straight domain name (depends on the URI type enum) + * @return The requested unique resource identifier (URI). It is not necessarily a straight domain name (depends on the URI type enum) */ static inline uint16_t mavlink_msg_resource_request_get_uri(const mavlink_message_t* msg, uint8_t *uri) { @@ -267,7 +267,7 @@ static inline uint16_t mavlink_msg_resource_request_get_uri(const mavlink_messag /** * @brief Get field transfer_type from resource_request message * - * @return The way the autopilot wants to receive the URI. 0 = MAVLink FTP. 1 = binary stream. + * @return The way the autopilot wants to receive the URI. 0 = MAVLink FTP. 1 = binary stream. */ static inline uint8_t mavlink_msg_resource_request_get_transfer_type(const mavlink_message_t* msg) { @@ -277,7 +277,7 @@ static inline uint8_t mavlink_msg_resource_request_get_transfer_type(const mavli /** * @brief Get field storage from resource_request message * - * @return The storage path the autopilot wants the URI to be stored in. Will only be valid if the transfer_type has a storage associated (e.g. MAVLink FTP). + * @return The storage path the autopilot wants the URI to be stored in. Will only be valid if the transfer_type has a storage associated (e.g. MAVLink FTP). */ static inline uint16_t mavlink_msg_resource_request_get_storage(const mavlink_message_t* msg, uint8_t *storage) { diff --git a/lib/main/MAVLink/common/mavlink_msg_safety_allowed_area.h b/lib/main/MAVLink/common/mavlink_msg_safety_allowed_area.h index cad1c198e4..bad669a0cb 100755 --- a/lib/main/MAVLink/common/mavlink_msg_safety_allowed_area.h +++ b/lib/main/MAVLink/common/mavlink_msg_safety_allowed_area.h @@ -3,16 +3,16 @@ #define MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA 55 -MAVPACKED( + typedef struct __mavlink_safety_allowed_area_t { - float p1x; /*< x position 1 / Latitude 1*/ - float p1y; /*< y position 1 / Longitude 1*/ - float p1z; /*< z position 1 / Altitude 1*/ - float p2x; /*< x position 2 / Latitude 2*/ - float p2y; /*< y position 2 / Longitude 2*/ - float p2z; /*< z position 2 / Altitude 2*/ - uint8_t frame; /*< Coordinate frame, as defined by MAV_FRAME enum in mavlink_types.h. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down.*/ -}) mavlink_safety_allowed_area_t; + float p1x; /*< [m] x position 1 / Latitude 1*/ + float p1y; /*< [m] y position 1 / Longitude 1*/ + float p1z; /*< [m] z position 1 / Altitude 1*/ + float p2x; /*< [m] x position 2 / Latitude 2*/ + float p2y; /*< [m] y position 2 / Longitude 2*/ + float p2z; /*< [m] z position 2 / Altitude 2*/ + uint8_t frame; /*< Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down.*/ +} mavlink_safety_allowed_area_t; #define MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN 25 #define MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_MIN_LEN 25 @@ -29,26 +29,26 @@ typedef struct __mavlink_safety_allowed_area_t { 55, \ "SAFETY_ALLOWED_AREA", \ 7, \ - { { "p1x", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_safety_allowed_area_t, p1x) }, \ + { { "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 24, offsetof(mavlink_safety_allowed_area_t, frame) }, \ + { "p1x", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_safety_allowed_area_t, p1x) }, \ { "p1y", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_safety_allowed_area_t, p1y) }, \ { "p1z", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_safety_allowed_area_t, p1z) }, \ { "p2x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_safety_allowed_area_t, p2x) }, \ { "p2y", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_safety_allowed_area_t, p2y) }, \ { "p2z", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_safety_allowed_area_t, p2z) }, \ - { "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 24, offsetof(mavlink_safety_allowed_area_t, frame) }, \ } \ } #else #define MAVLINK_MESSAGE_INFO_SAFETY_ALLOWED_AREA { \ "SAFETY_ALLOWED_AREA", \ 7, \ - { { "p1x", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_safety_allowed_area_t, p1x) }, \ + { { "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 24, offsetof(mavlink_safety_allowed_area_t, frame) }, \ + { "p1x", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_safety_allowed_area_t, p1x) }, \ { "p1y", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_safety_allowed_area_t, p1y) }, \ { "p1z", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_safety_allowed_area_t, p1z) }, \ { "p2x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_safety_allowed_area_t, p2x) }, \ { "p2y", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_safety_allowed_area_t, p2y) }, \ { "p2z", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_safety_allowed_area_t, p2z) }, \ - { "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 24, offsetof(mavlink_safety_allowed_area_t, frame) }, \ } \ } #endif @@ -59,13 +59,13 @@ typedef struct __mavlink_safety_allowed_area_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param frame Coordinate frame, as defined by MAV_FRAME enum in mavlink_types.h. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down. - * @param p1x x position 1 / Latitude 1 - * @param p1y y position 1 / Longitude 1 - * @param p1z z position 1 / Altitude 1 - * @param p2x x position 2 / Latitude 2 - * @param p2y y position 2 / Longitude 2 - * @param p2z z position 2 / Altitude 2 + * @param frame Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down. + * @param p1x [m] x position 1 / Latitude 1 + * @param p1y [m] y position 1 / Longitude 1 + * @param p1z [m] z position 1 / Altitude 1 + * @param p2x [m] x position 2 / Latitude 2 + * @param p2y [m] y position 2 / Longitude 2 + * @param p2z [m] z position 2 / Altitude 2 * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_safety_allowed_area_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -105,13 +105,13 @@ static inline uint16_t mavlink_msg_safety_allowed_area_pack(uint8_t system_id, u * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param frame Coordinate frame, as defined by MAV_FRAME enum in mavlink_types.h. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down. - * @param p1x x position 1 / Latitude 1 - * @param p1y y position 1 / Longitude 1 - * @param p1z z position 1 / Altitude 1 - * @param p2x x position 2 / Latitude 2 - * @param p2y y position 2 / Longitude 2 - * @param p2z z position 2 / Altitude 2 + * @param frame Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down. + * @param p1x [m] x position 1 / Latitude 1 + * @param p1y [m] y position 1 / Longitude 1 + * @param p1z [m] z position 1 / Altitude 1 + * @param p2x [m] x position 2 / Latitude 2 + * @param p2y [m] y position 2 / Longitude 2 + * @param p2z [m] z position 2 / Altitude 2 * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_safety_allowed_area_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -177,13 +177,13 @@ static inline uint16_t mavlink_msg_safety_allowed_area_encode_chan(uint8_t syste * @brief Send a safety_allowed_area message * @param chan MAVLink channel to send the message * - * @param frame Coordinate frame, as defined by MAV_FRAME enum in mavlink_types.h. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down. - * @param p1x x position 1 / Latitude 1 - * @param p1y y position 1 / Longitude 1 - * @param p1z z position 1 / Altitude 1 - * @param p2x x position 2 / Latitude 2 - * @param p2y y position 2 / Longitude 2 - * @param p2z z position 2 / Altitude 2 + * @param frame Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down. + * @param p1x [m] x position 1 / Latitude 1 + * @param p1y [m] y position 1 / Longitude 1 + * @param p1z [m] z position 1 / Altitude 1 + * @param p2x [m] x position 2 / Latitude 2 + * @param p2y [m] y position 2 / Longitude 2 + * @param p2z [m] z position 2 / Altitude 2 */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -272,7 +272,7 @@ static inline void mavlink_msg_safety_allowed_area_send_buf(mavlink_message_t *m /** * @brief Get field frame from safety_allowed_area message * - * @return Coordinate frame, as defined by MAV_FRAME enum in mavlink_types.h. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down. + * @return Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down. */ static inline uint8_t mavlink_msg_safety_allowed_area_get_frame(const mavlink_message_t* msg) { @@ -282,7 +282,7 @@ static inline uint8_t mavlink_msg_safety_allowed_area_get_frame(const mavlink_me /** * @brief Get field p1x from safety_allowed_area message * - * @return x position 1 / Latitude 1 + * @return [m] x position 1 / Latitude 1 */ static inline float mavlink_msg_safety_allowed_area_get_p1x(const mavlink_message_t* msg) { @@ -292,7 +292,7 @@ static inline float mavlink_msg_safety_allowed_area_get_p1x(const mavlink_messag /** * @brief Get field p1y from safety_allowed_area message * - * @return y position 1 / Longitude 1 + * @return [m] y position 1 / Longitude 1 */ static inline float mavlink_msg_safety_allowed_area_get_p1y(const mavlink_message_t* msg) { @@ -302,7 +302,7 @@ static inline float mavlink_msg_safety_allowed_area_get_p1y(const mavlink_messag /** * @brief Get field p1z from safety_allowed_area message * - * @return z position 1 / Altitude 1 + * @return [m] z position 1 / Altitude 1 */ static inline float mavlink_msg_safety_allowed_area_get_p1z(const mavlink_message_t* msg) { @@ -312,7 +312,7 @@ static inline float mavlink_msg_safety_allowed_area_get_p1z(const mavlink_messag /** * @brief Get field p2x from safety_allowed_area message * - * @return x position 2 / Latitude 2 + * @return [m] x position 2 / Latitude 2 */ static inline float mavlink_msg_safety_allowed_area_get_p2x(const mavlink_message_t* msg) { @@ -322,7 +322,7 @@ static inline float mavlink_msg_safety_allowed_area_get_p2x(const mavlink_messag /** * @brief Get field p2y from safety_allowed_area message * - * @return y position 2 / Longitude 2 + * @return [m] y position 2 / Longitude 2 */ static inline float mavlink_msg_safety_allowed_area_get_p2y(const mavlink_message_t* msg) { @@ -332,7 +332,7 @@ static inline float mavlink_msg_safety_allowed_area_get_p2y(const mavlink_messag /** * @brief Get field p2z from safety_allowed_area message * - * @return z position 2 / Altitude 2 + * @return [m] z position 2 / Altitude 2 */ static inline float mavlink_msg_safety_allowed_area_get_p2z(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_safety_set_allowed_area.h b/lib/main/MAVLink/common/mavlink_msg_safety_set_allowed_area.h index 293c1f002a..eca9b274f7 100755 --- a/lib/main/MAVLink/common/mavlink_msg_safety_set_allowed_area.h +++ b/lib/main/MAVLink/common/mavlink_msg_safety_set_allowed_area.h @@ -3,18 +3,18 @@ #define MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA 54 -MAVPACKED( + typedef struct __mavlink_safety_set_allowed_area_t { - float p1x; /*< x position 1 / Latitude 1*/ - float p1y; /*< y position 1 / Longitude 1*/ - float p1z; /*< z position 1 / Altitude 1*/ - float p2x; /*< x position 2 / Latitude 2*/ - float p2y; /*< y position 2 / Longitude 2*/ - float p2z; /*< z position 2 / Altitude 2*/ - uint8_t target_system; /*< System ID*/ - uint8_t target_component; /*< Component ID*/ - uint8_t frame; /*< Coordinate frame, as defined by MAV_FRAME enum in mavlink_types.h. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down.*/ -}) mavlink_safety_set_allowed_area_t; + float p1x; /*< [m] x position 1 / Latitude 1*/ + float p1y; /*< [m] y position 1 / Longitude 1*/ + float p1z; /*< [m] z position 1 / Altitude 1*/ + float p2x; /*< [m] x position 2 / Latitude 2*/ + float p2y; /*< [m] y position 2 / Longitude 2*/ + float p2z; /*< [m] z position 2 / Altitude 2*/ + uint8_t target_system; /*< System ID*/ + uint8_t target_component; /*< Component ID*/ + uint8_t frame; /*< Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down.*/ +} mavlink_safety_set_allowed_area_t; #define MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN 27 #define MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_MIN_LEN 27 @@ -31,30 +31,30 @@ typedef struct __mavlink_safety_set_allowed_area_t { 54, \ "SAFETY_SET_ALLOWED_AREA", \ 9, \ - { { "p1x", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_safety_set_allowed_area_t, p1x) }, \ + { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 24, offsetof(mavlink_safety_set_allowed_area_t, target_system) }, \ + { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 25, offsetof(mavlink_safety_set_allowed_area_t, target_component) }, \ + { "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 26, offsetof(mavlink_safety_set_allowed_area_t, frame) }, \ + { "p1x", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_safety_set_allowed_area_t, p1x) }, \ { "p1y", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_safety_set_allowed_area_t, p1y) }, \ { "p1z", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_safety_set_allowed_area_t, p1z) }, \ { "p2x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_safety_set_allowed_area_t, p2x) }, \ { "p2y", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_safety_set_allowed_area_t, p2y) }, \ { "p2z", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_safety_set_allowed_area_t, p2z) }, \ - { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 24, offsetof(mavlink_safety_set_allowed_area_t, target_system) }, \ - { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 25, offsetof(mavlink_safety_set_allowed_area_t, target_component) }, \ - { "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 26, offsetof(mavlink_safety_set_allowed_area_t, frame) }, \ } \ } #else #define MAVLINK_MESSAGE_INFO_SAFETY_SET_ALLOWED_AREA { \ "SAFETY_SET_ALLOWED_AREA", \ 9, \ - { { "p1x", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_safety_set_allowed_area_t, p1x) }, \ + { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 24, offsetof(mavlink_safety_set_allowed_area_t, target_system) }, \ + { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 25, offsetof(mavlink_safety_set_allowed_area_t, target_component) }, \ + { "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 26, offsetof(mavlink_safety_set_allowed_area_t, frame) }, \ + { "p1x", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_safety_set_allowed_area_t, p1x) }, \ { "p1y", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_safety_set_allowed_area_t, p1y) }, \ { "p1z", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_safety_set_allowed_area_t, p1z) }, \ { "p2x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_safety_set_allowed_area_t, p2x) }, \ { "p2y", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_safety_set_allowed_area_t, p2y) }, \ { "p2z", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_safety_set_allowed_area_t, p2z) }, \ - { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 24, offsetof(mavlink_safety_set_allowed_area_t, target_system) }, \ - { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 25, offsetof(mavlink_safety_set_allowed_area_t, target_component) }, \ - { "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 26, offsetof(mavlink_safety_set_allowed_area_t, frame) }, \ } \ } #endif @@ -65,15 +65,15 @@ typedef struct __mavlink_safety_set_allowed_area_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param target_system System ID - * @param target_component Component ID - * @param frame Coordinate frame, as defined by MAV_FRAME enum in mavlink_types.h. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down. - * @param p1x x position 1 / Latitude 1 - * @param p1y y position 1 / Longitude 1 - * @param p1z z position 1 / Altitude 1 - * @param p2x x position 2 / Latitude 2 - * @param p2y y position 2 / Longitude 2 - * @param p2z z position 2 / Altitude 2 + * @param target_system System ID + * @param target_component Component ID + * @param frame Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down. + * @param p1x [m] x position 1 / Latitude 1 + * @param p1y [m] y position 1 / Longitude 1 + * @param p1z [m] z position 1 / Altitude 1 + * @param p2x [m] x position 2 / Latitude 2 + * @param p2y [m] y position 2 / Longitude 2 + * @param p2z [m] z position 2 / Altitude 2 * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_safety_set_allowed_area_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -117,15 +117,15 @@ static inline uint16_t mavlink_msg_safety_set_allowed_area_pack(uint8_t system_i * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param target_system System ID - * @param target_component Component ID - * @param frame Coordinate frame, as defined by MAV_FRAME enum in mavlink_types.h. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down. - * @param p1x x position 1 / Latitude 1 - * @param p1y y position 1 / Longitude 1 - * @param p1z z position 1 / Altitude 1 - * @param p2x x position 2 / Latitude 2 - * @param p2y y position 2 / Longitude 2 - * @param p2z z position 2 / Altitude 2 + * @param target_system System ID + * @param target_component Component ID + * @param frame Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down. + * @param p1x [m] x position 1 / Latitude 1 + * @param p1y [m] y position 1 / Longitude 1 + * @param p1z [m] z position 1 / Altitude 1 + * @param p2x [m] x position 2 / Latitude 2 + * @param p2y [m] y position 2 / Longitude 2 + * @param p2z [m] z position 2 / Altitude 2 * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_safety_set_allowed_area_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -195,15 +195,15 @@ static inline uint16_t mavlink_msg_safety_set_allowed_area_encode_chan(uint8_t s * @brief Send a safety_set_allowed_area message * @param chan MAVLink channel to send the message * - * @param target_system System ID - * @param target_component Component ID - * @param frame Coordinate frame, as defined by MAV_FRAME enum in mavlink_types.h. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down. - * @param p1x x position 1 / Latitude 1 - * @param p1y y position 1 / Longitude 1 - * @param p1z z position 1 / Altitude 1 - * @param p2x x position 2 / Latitude 2 - * @param p2y y position 2 / Longitude 2 - * @param p2z z position 2 / Altitude 2 + * @param target_system System ID + * @param target_component Component ID + * @param frame Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down. + * @param p1x [m] x position 1 / Latitude 1 + * @param p1y [m] y position 1 / Longitude 1 + * @param p1z [m] z position 1 / Altitude 1 + * @param p2x [m] x position 2 / Latitude 2 + * @param p2y [m] y position 2 / Longitude 2 + * @param p2z [m] z position 2 / Altitude 2 */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -300,7 +300,7 @@ static inline void mavlink_msg_safety_set_allowed_area_send_buf(mavlink_message_ /** * @brief Get field target_system from safety_set_allowed_area message * - * @return System ID + * @return System ID */ static inline uint8_t mavlink_msg_safety_set_allowed_area_get_target_system(const mavlink_message_t* msg) { @@ -310,7 +310,7 @@ static inline uint8_t mavlink_msg_safety_set_allowed_area_get_target_system(cons /** * @brief Get field target_component from safety_set_allowed_area message * - * @return Component ID + * @return Component ID */ static inline uint8_t mavlink_msg_safety_set_allowed_area_get_target_component(const mavlink_message_t* msg) { @@ -320,7 +320,7 @@ static inline uint8_t mavlink_msg_safety_set_allowed_area_get_target_component(c /** * @brief Get field frame from safety_set_allowed_area message * - * @return Coordinate frame, as defined by MAV_FRAME enum in mavlink_types.h. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down. + * @return Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down. */ static inline uint8_t mavlink_msg_safety_set_allowed_area_get_frame(const mavlink_message_t* msg) { @@ -330,7 +330,7 @@ static inline uint8_t mavlink_msg_safety_set_allowed_area_get_frame(const mavlin /** * @brief Get field p1x from safety_set_allowed_area message * - * @return x position 1 / Latitude 1 + * @return [m] x position 1 / Latitude 1 */ static inline float mavlink_msg_safety_set_allowed_area_get_p1x(const mavlink_message_t* msg) { @@ -340,7 +340,7 @@ static inline float mavlink_msg_safety_set_allowed_area_get_p1x(const mavlink_me /** * @brief Get field p1y from safety_set_allowed_area message * - * @return y position 1 / Longitude 1 + * @return [m] y position 1 / Longitude 1 */ static inline float mavlink_msg_safety_set_allowed_area_get_p1y(const mavlink_message_t* msg) { @@ -350,7 +350,7 @@ static inline float mavlink_msg_safety_set_allowed_area_get_p1y(const mavlink_me /** * @brief Get field p1z from safety_set_allowed_area message * - * @return z position 1 / Altitude 1 + * @return [m] z position 1 / Altitude 1 */ static inline float mavlink_msg_safety_set_allowed_area_get_p1z(const mavlink_message_t* msg) { @@ -360,7 +360,7 @@ static inline float mavlink_msg_safety_set_allowed_area_get_p1z(const mavlink_me /** * @brief Get field p2x from safety_set_allowed_area message * - * @return x position 2 / Latitude 2 + * @return [m] x position 2 / Latitude 2 */ static inline float mavlink_msg_safety_set_allowed_area_get_p2x(const mavlink_message_t* msg) { @@ -370,7 +370,7 @@ static inline float mavlink_msg_safety_set_allowed_area_get_p2x(const mavlink_me /** * @brief Get field p2y from safety_set_allowed_area message * - * @return y position 2 / Longitude 2 + * @return [m] y position 2 / Longitude 2 */ static inline float mavlink_msg_safety_set_allowed_area_get_p2y(const mavlink_message_t* msg) { @@ -380,7 +380,7 @@ static inline float mavlink_msg_safety_set_allowed_area_get_p2y(const mavlink_me /** * @brief Get field p2z from safety_set_allowed_area message * - * @return z position 2 / Altitude 2 + * @return [m] z position 2 / Altitude 2 */ static inline float mavlink_msg_safety_set_allowed_area_get_p2z(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_scaled_imu.h b/lib/main/MAVLink/common/mavlink_msg_scaled_imu.h index 2994d999a5..f94b146bf2 100755 --- a/lib/main/MAVLink/common/mavlink_msg_scaled_imu.h +++ b/lib/main/MAVLink/common/mavlink_msg_scaled_imu.h @@ -3,19 +3,19 @@ #define MAVLINK_MSG_ID_SCALED_IMU 26 -MAVPACKED( + typedef struct __mavlink_scaled_imu_t { - uint32_t time_boot_ms; /*< Timestamp (milliseconds since system boot)*/ - int16_t xacc; /*< X acceleration (mg)*/ - int16_t yacc; /*< Y acceleration (mg)*/ - int16_t zacc; /*< Z acceleration (mg)*/ - int16_t xgyro; /*< Angular speed around X axis (millirad /sec)*/ - int16_t ygyro; /*< Angular speed around Y axis (millirad /sec)*/ - int16_t zgyro; /*< Angular speed around Z axis (millirad /sec)*/ - int16_t xmag; /*< X Magnetic field (milli tesla)*/ - int16_t ymag; /*< Y Magnetic field (milli tesla)*/ - int16_t zmag; /*< Z Magnetic field (milli tesla)*/ -}) mavlink_scaled_imu_t; + uint32_t time_boot_ms; /*< [ms] Timestamp (time since system boot).*/ + int16_t xacc; /*< [mG] X acceleration*/ + int16_t yacc; /*< [mG] Y acceleration*/ + int16_t zacc; /*< [mG] Z acceleration*/ + int16_t xgyro; /*< [mrad/s] Angular speed around X axis*/ + int16_t ygyro; /*< [mrad/s] Angular speed around Y axis*/ + int16_t zgyro; /*< [mrad/s] Angular speed around Z axis*/ + int16_t xmag; /*< [mgauss] X Magnetic field*/ + int16_t ymag; /*< [mgauss] Y Magnetic field*/ + int16_t zmag; /*< [mgauss] Z Magnetic field*/ +} mavlink_scaled_imu_t; #define MAVLINK_MSG_ID_SCALED_IMU_LEN 22 #define MAVLINK_MSG_ID_SCALED_IMU_MIN_LEN 22 @@ -68,16 +68,16 @@ typedef struct __mavlink_scaled_imu_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param time_boot_ms Timestamp (milliseconds since system boot) - * @param xacc X acceleration (mg) - * @param yacc Y acceleration (mg) - * @param zacc Z acceleration (mg) - * @param xgyro Angular speed around X axis (millirad /sec) - * @param ygyro Angular speed around Y axis (millirad /sec) - * @param zgyro Angular speed around Z axis (millirad /sec) - * @param xmag X Magnetic field (milli tesla) - * @param ymag Y Magnetic field (milli tesla) - * @param zmag Z Magnetic field (milli tesla) + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param xacc [mG] X acceleration + * @param yacc [mG] Y acceleration + * @param zacc [mG] Z acceleration + * @param xgyro [mrad/s] Angular speed around X axis + * @param ygyro [mrad/s] Angular speed around Y axis + * @param zgyro [mrad/s] Angular speed around Z axis + * @param xmag [mgauss] X Magnetic field + * @param ymag [mgauss] Y Magnetic field + * @param zmag [mgauss] Z Magnetic field * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_scaled_imu_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -123,16 +123,16 @@ static inline uint16_t mavlink_msg_scaled_imu_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 will be sent over * @param msg The MAVLink message to compress the data into - * @param time_boot_ms Timestamp (milliseconds since system boot) - * @param xacc X acceleration (mg) - * @param yacc Y acceleration (mg) - * @param zacc Z acceleration (mg) - * @param xgyro Angular speed around X axis (millirad /sec) - * @param ygyro Angular speed around Y axis (millirad /sec) - * @param zgyro Angular speed around Z axis (millirad /sec) - * @param xmag X Magnetic field (milli tesla) - * @param ymag Y Magnetic field (milli tesla) - * @param zmag Z Magnetic field (milli tesla) + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param xacc [mG] X acceleration + * @param yacc [mG] Y acceleration + * @param zacc [mG] Z acceleration + * @param xgyro [mrad/s] Angular speed around X axis + * @param ygyro [mrad/s] Angular speed around Y axis + * @param zgyro [mrad/s] Angular speed around Z axis + * @param xmag [mgauss] X Magnetic field + * @param ymag [mgauss] Y Magnetic field + * @param zmag [mgauss] Z Magnetic field * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_scaled_imu_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -204,16 +204,16 @@ static inline uint16_t mavlink_msg_scaled_imu_encode_chan(uint8_t system_id, uin * @brief Send a scaled_imu message * @param chan MAVLink channel to send the message * - * @param time_boot_ms Timestamp (milliseconds since system boot) - * @param xacc X acceleration (mg) - * @param yacc Y acceleration (mg) - * @param zacc Z acceleration (mg) - * @param xgyro Angular speed around X axis (millirad /sec) - * @param ygyro Angular speed around Y axis (millirad /sec) - * @param zgyro Angular speed around Z axis (millirad /sec) - * @param xmag X Magnetic field (milli tesla) - * @param ymag Y Magnetic field (milli tesla) - * @param zmag Z Magnetic field (milli tesla) + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param xacc [mG] X acceleration + * @param yacc [mG] Y acceleration + * @param zacc [mG] Z acceleration + * @param xgyro [mrad/s] Angular speed around X axis + * @param ygyro [mrad/s] Angular speed around Y axis + * @param zgyro [mrad/s] Angular speed around Z axis + * @param xmag [mgauss] X Magnetic field + * @param ymag [mgauss] Y Magnetic field + * @param zmag [mgauss] Z Magnetic field */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -314,7 +314,7 @@ static inline void mavlink_msg_scaled_imu_send_buf(mavlink_message_t *msgbuf, ma /** * @brief Get field time_boot_ms from scaled_imu message * - * @return Timestamp (milliseconds since system boot) + * @return [ms] Timestamp (time since system boot). */ static inline uint32_t mavlink_msg_scaled_imu_get_time_boot_ms(const mavlink_message_t* msg) { @@ -324,7 +324,7 @@ static inline uint32_t mavlink_msg_scaled_imu_get_time_boot_ms(const mavlink_mes /** * @brief Get field xacc from scaled_imu message * - * @return X acceleration (mg) + * @return [mG] X acceleration */ static inline int16_t mavlink_msg_scaled_imu_get_xacc(const mavlink_message_t* msg) { @@ -334,7 +334,7 @@ static inline int16_t mavlink_msg_scaled_imu_get_xacc(const mavlink_message_t* m /** * @brief Get field yacc from scaled_imu message * - * @return Y acceleration (mg) + * @return [mG] Y acceleration */ static inline int16_t mavlink_msg_scaled_imu_get_yacc(const mavlink_message_t* msg) { @@ -344,7 +344,7 @@ static inline int16_t mavlink_msg_scaled_imu_get_yacc(const mavlink_message_t* m /** * @brief Get field zacc from scaled_imu message * - * @return Z acceleration (mg) + * @return [mG] Z acceleration */ static inline int16_t mavlink_msg_scaled_imu_get_zacc(const mavlink_message_t* msg) { @@ -354,7 +354,7 @@ static inline int16_t mavlink_msg_scaled_imu_get_zacc(const mavlink_message_t* m /** * @brief Get field xgyro from scaled_imu message * - * @return Angular speed around X axis (millirad /sec) + * @return [mrad/s] Angular speed around X axis */ static inline int16_t mavlink_msg_scaled_imu_get_xgyro(const mavlink_message_t* msg) { @@ -364,7 +364,7 @@ static inline int16_t mavlink_msg_scaled_imu_get_xgyro(const mavlink_message_t* /** * @brief Get field ygyro from scaled_imu message * - * @return Angular speed around Y axis (millirad /sec) + * @return [mrad/s] Angular speed around Y axis */ static inline int16_t mavlink_msg_scaled_imu_get_ygyro(const mavlink_message_t* msg) { @@ -374,7 +374,7 @@ static inline int16_t mavlink_msg_scaled_imu_get_ygyro(const mavlink_message_t* /** * @brief Get field zgyro from scaled_imu message * - * @return Angular speed around Z axis (millirad /sec) + * @return [mrad/s] Angular speed around Z axis */ static inline int16_t mavlink_msg_scaled_imu_get_zgyro(const mavlink_message_t* msg) { @@ -384,7 +384,7 @@ static inline int16_t mavlink_msg_scaled_imu_get_zgyro(const mavlink_message_t* /** * @brief Get field xmag from scaled_imu message * - * @return X Magnetic field (milli tesla) + * @return [mgauss] X Magnetic field */ static inline int16_t mavlink_msg_scaled_imu_get_xmag(const mavlink_message_t* msg) { @@ -394,7 +394,7 @@ static inline int16_t mavlink_msg_scaled_imu_get_xmag(const mavlink_message_t* m /** * @brief Get field ymag from scaled_imu message * - * @return Y Magnetic field (milli tesla) + * @return [mgauss] Y Magnetic field */ static inline int16_t mavlink_msg_scaled_imu_get_ymag(const mavlink_message_t* msg) { @@ -404,7 +404,7 @@ static inline int16_t mavlink_msg_scaled_imu_get_ymag(const mavlink_message_t* m /** * @brief Get field zmag from scaled_imu message * - * @return Z Magnetic field (milli tesla) + * @return [mgauss] Z Magnetic field */ static inline int16_t mavlink_msg_scaled_imu_get_zmag(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_scaled_imu2.h b/lib/main/MAVLink/common/mavlink_msg_scaled_imu2.h index c232691790..297874cb4a 100755 --- a/lib/main/MAVLink/common/mavlink_msg_scaled_imu2.h +++ b/lib/main/MAVLink/common/mavlink_msg_scaled_imu2.h @@ -3,19 +3,19 @@ #define MAVLINK_MSG_ID_SCALED_IMU2 116 -MAVPACKED( + typedef struct __mavlink_scaled_imu2_t { - uint32_t time_boot_ms; /*< Timestamp (milliseconds since system boot)*/ - int16_t xacc; /*< X acceleration (mg)*/ - int16_t yacc; /*< Y acceleration (mg)*/ - int16_t zacc; /*< Z acceleration (mg)*/ - int16_t xgyro; /*< Angular speed around X axis (millirad /sec)*/ - int16_t ygyro; /*< Angular speed around Y axis (millirad /sec)*/ - int16_t zgyro; /*< Angular speed around Z axis (millirad /sec)*/ - int16_t xmag; /*< X Magnetic field (milli tesla)*/ - int16_t ymag; /*< Y Magnetic field (milli tesla)*/ - int16_t zmag; /*< Z Magnetic field (milli tesla)*/ -}) mavlink_scaled_imu2_t; + uint32_t time_boot_ms; /*< [ms] Timestamp (time since system boot).*/ + int16_t xacc; /*< [mG] X acceleration*/ + int16_t yacc; /*< [mG] Y acceleration*/ + int16_t zacc; /*< [mG] Z acceleration*/ + int16_t xgyro; /*< [mrad/s] Angular speed around X axis*/ + int16_t ygyro; /*< [mrad/s] Angular speed around Y axis*/ + int16_t zgyro; /*< [mrad/s] Angular speed around Z axis*/ + int16_t xmag; /*< [mgauss] X Magnetic field*/ + int16_t ymag; /*< [mgauss] Y Magnetic field*/ + int16_t zmag; /*< [mgauss] Z Magnetic field*/ +} mavlink_scaled_imu2_t; #define MAVLINK_MSG_ID_SCALED_IMU2_LEN 22 #define MAVLINK_MSG_ID_SCALED_IMU2_MIN_LEN 22 @@ -68,16 +68,16 @@ typedef struct __mavlink_scaled_imu2_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param time_boot_ms Timestamp (milliseconds since system boot) - * @param xacc X acceleration (mg) - * @param yacc Y acceleration (mg) - * @param zacc Z acceleration (mg) - * @param xgyro Angular speed around X axis (millirad /sec) - * @param ygyro Angular speed around Y axis (millirad /sec) - * @param zgyro Angular speed around Z axis (millirad /sec) - * @param xmag X Magnetic field (milli tesla) - * @param ymag Y Magnetic field (milli tesla) - * @param zmag Z Magnetic field (milli tesla) + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param xacc [mG] X acceleration + * @param yacc [mG] Y acceleration + * @param zacc [mG] Z acceleration + * @param xgyro [mrad/s] Angular speed around X axis + * @param ygyro [mrad/s] Angular speed around Y axis + * @param zgyro [mrad/s] Angular speed around Z axis + * @param xmag [mgauss] X Magnetic field + * @param ymag [mgauss] Y Magnetic field + * @param zmag [mgauss] Z Magnetic field * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_scaled_imu2_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -123,16 +123,16 @@ static inline uint16_t mavlink_msg_scaled_imu2_pack(uint8_t system_id, uint8_t c * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param time_boot_ms Timestamp (milliseconds since system boot) - * @param xacc X acceleration (mg) - * @param yacc Y acceleration (mg) - * @param zacc Z acceleration (mg) - * @param xgyro Angular speed around X axis (millirad /sec) - * @param ygyro Angular speed around Y axis (millirad /sec) - * @param zgyro Angular speed around Z axis (millirad /sec) - * @param xmag X Magnetic field (milli tesla) - * @param ymag Y Magnetic field (milli tesla) - * @param zmag Z Magnetic field (milli tesla) + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param xacc [mG] X acceleration + * @param yacc [mG] Y acceleration + * @param zacc [mG] Z acceleration + * @param xgyro [mrad/s] Angular speed around X axis + * @param ygyro [mrad/s] Angular speed around Y axis + * @param zgyro [mrad/s] Angular speed around Z axis + * @param xmag [mgauss] X Magnetic field + * @param ymag [mgauss] Y Magnetic field + * @param zmag [mgauss] Z Magnetic field * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_scaled_imu2_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -204,16 +204,16 @@ static inline uint16_t mavlink_msg_scaled_imu2_encode_chan(uint8_t system_id, ui * @brief Send a scaled_imu2 message * @param chan MAVLink channel to send the message * - * @param time_boot_ms Timestamp (milliseconds since system boot) - * @param xacc X acceleration (mg) - * @param yacc Y acceleration (mg) - * @param zacc Z acceleration (mg) - * @param xgyro Angular speed around X axis (millirad /sec) - * @param ygyro Angular speed around Y axis (millirad /sec) - * @param zgyro Angular speed around Z axis (millirad /sec) - * @param xmag X Magnetic field (milli tesla) - * @param ymag Y Magnetic field (milli tesla) - * @param zmag Z Magnetic field (milli tesla) + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param xacc [mG] X acceleration + * @param yacc [mG] Y acceleration + * @param zacc [mG] Z acceleration + * @param xgyro [mrad/s] Angular speed around X axis + * @param ygyro [mrad/s] Angular speed around Y axis + * @param zgyro [mrad/s] Angular speed around Z axis + * @param xmag [mgauss] X Magnetic field + * @param ymag [mgauss] Y Magnetic field + * @param zmag [mgauss] Z Magnetic field */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -314,7 +314,7 @@ static inline void mavlink_msg_scaled_imu2_send_buf(mavlink_message_t *msgbuf, m /** * @brief Get field time_boot_ms from scaled_imu2 message * - * @return Timestamp (milliseconds since system boot) + * @return [ms] Timestamp (time since system boot). */ static inline uint32_t mavlink_msg_scaled_imu2_get_time_boot_ms(const mavlink_message_t* msg) { @@ -324,7 +324,7 @@ static inline uint32_t mavlink_msg_scaled_imu2_get_time_boot_ms(const mavlink_me /** * @brief Get field xacc from scaled_imu2 message * - * @return X acceleration (mg) + * @return [mG] X acceleration */ static inline int16_t mavlink_msg_scaled_imu2_get_xacc(const mavlink_message_t* msg) { @@ -334,7 +334,7 @@ static inline int16_t mavlink_msg_scaled_imu2_get_xacc(const mavlink_message_t* /** * @brief Get field yacc from scaled_imu2 message * - * @return Y acceleration (mg) + * @return [mG] Y acceleration */ static inline int16_t mavlink_msg_scaled_imu2_get_yacc(const mavlink_message_t* msg) { @@ -344,7 +344,7 @@ static inline int16_t mavlink_msg_scaled_imu2_get_yacc(const mavlink_message_t* /** * @brief Get field zacc from scaled_imu2 message * - * @return Z acceleration (mg) + * @return [mG] Z acceleration */ static inline int16_t mavlink_msg_scaled_imu2_get_zacc(const mavlink_message_t* msg) { @@ -354,7 +354,7 @@ static inline int16_t mavlink_msg_scaled_imu2_get_zacc(const mavlink_message_t* /** * @brief Get field xgyro from scaled_imu2 message * - * @return Angular speed around X axis (millirad /sec) + * @return [mrad/s] Angular speed around X axis */ static inline int16_t mavlink_msg_scaled_imu2_get_xgyro(const mavlink_message_t* msg) { @@ -364,7 +364,7 @@ static inline int16_t mavlink_msg_scaled_imu2_get_xgyro(const mavlink_message_t* /** * @brief Get field ygyro from scaled_imu2 message * - * @return Angular speed around Y axis (millirad /sec) + * @return [mrad/s] Angular speed around Y axis */ static inline int16_t mavlink_msg_scaled_imu2_get_ygyro(const mavlink_message_t* msg) { @@ -374,7 +374,7 @@ static inline int16_t mavlink_msg_scaled_imu2_get_ygyro(const mavlink_message_t* /** * @brief Get field zgyro from scaled_imu2 message * - * @return Angular speed around Z axis (millirad /sec) + * @return [mrad/s] Angular speed around Z axis */ static inline int16_t mavlink_msg_scaled_imu2_get_zgyro(const mavlink_message_t* msg) { @@ -384,7 +384,7 @@ static inline int16_t mavlink_msg_scaled_imu2_get_zgyro(const mavlink_message_t* /** * @brief Get field xmag from scaled_imu2 message * - * @return X Magnetic field (milli tesla) + * @return [mgauss] X Magnetic field */ static inline int16_t mavlink_msg_scaled_imu2_get_xmag(const mavlink_message_t* msg) { @@ -394,7 +394,7 @@ static inline int16_t mavlink_msg_scaled_imu2_get_xmag(const mavlink_message_t* /** * @brief Get field ymag from scaled_imu2 message * - * @return Y Magnetic field (milli tesla) + * @return [mgauss] Y Magnetic field */ static inline int16_t mavlink_msg_scaled_imu2_get_ymag(const mavlink_message_t* msg) { @@ -404,7 +404,7 @@ static inline int16_t mavlink_msg_scaled_imu2_get_ymag(const mavlink_message_t* /** * @brief Get field zmag from scaled_imu2 message * - * @return Z Magnetic field (milli tesla) + * @return [mgauss] Z Magnetic field */ static inline int16_t mavlink_msg_scaled_imu2_get_zmag(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_scaled_imu3.h b/lib/main/MAVLink/common/mavlink_msg_scaled_imu3.h index 22b9d86cf0..d01ac948fd 100755 --- a/lib/main/MAVLink/common/mavlink_msg_scaled_imu3.h +++ b/lib/main/MAVLink/common/mavlink_msg_scaled_imu3.h @@ -3,19 +3,19 @@ #define MAVLINK_MSG_ID_SCALED_IMU3 129 -MAVPACKED( + typedef struct __mavlink_scaled_imu3_t { - uint32_t time_boot_ms; /*< Timestamp (milliseconds since system boot)*/ - int16_t xacc; /*< X acceleration (mg)*/ - int16_t yacc; /*< Y acceleration (mg)*/ - int16_t zacc; /*< Z acceleration (mg)*/ - int16_t xgyro; /*< Angular speed around X axis (millirad /sec)*/ - int16_t ygyro; /*< Angular speed around Y axis (millirad /sec)*/ - int16_t zgyro; /*< Angular speed around Z axis (millirad /sec)*/ - int16_t xmag; /*< X Magnetic field (milli tesla)*/ - int16_t ymag; /*< Y Magnetic field (milli tesla)*/ - int16_t zmag; /*< Z Magnetic field (milli tesla)*/ -}) mavlink_scaled_imu3_t; + uint32_t time_boot_ms; /*< [ms] Timestamp (time since system boot).*/ + int16_t xacc; /*< [mG] X acceleration*/ + int16_t yacc; /*< [mG] Y acceleration*/ + int16_t zacc; /*< [mG] Z acceleration*/ + int16_t xgyro; /*< [mrad/s] Angular speed around X axis*/ + int16_t ygyro; /*< [mrad/s] Angular speed around Y axis*/ + int16_t zgyro; /*< [mrad/s] Angular speed around Z axis*/ + int16_t xmag; /*< [mgauss] X Magnetic field*/ + int16_t ymag; /*< [mgauss] Y Magnetic field*/ + int16_t zmag; /*< [mgauss] Z Magnetic field*/ +} mavlink_scaled_imu3_t; #define MAVLINK_MSG_ID_SCALED_IMU3_LEN 22 #define MAVLINK_MSG_ID_SCALED_IMU3_MIN_LEN 22 @@ -68,16 +68,16 @@ typedef struct __mavlink_scaled_imu3_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param time_boot_ms Timestamp (milliseconds since system boot) - * @param xacc X acceleration (mg) - * @param yacc Y acceleration (mg) - * @param zacc Z acceleration (mg) - * @param xgyro Angular speed around X axis (millirad /sec) - * @param ygyro Angular speed around Y axis (millirad /sec) - * @param zgyro Angular speed around Z axis (millirad /sec) - * @param xmag X Magnetic field (milli tesla) - * @param ymag Y Magnetic field (milli tesla) - * @param zmag Z Magnetic field (milli tesla) + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param xacc [mG] X acceleration + * @param yacc [mG] Y acceleration + * @param zacc [mG] Z acceleration + * @param xgyro [mrad/s] Angular speed around X axis + * @param ygyro [mrad/s] Angular speed around Y axis + * @param zgyro [mrad/s] Angular speed around Z axis + * @param xmag [mgauss] X Magnetic field + * @param ymag [mgauss] Y Magnetic field + * @param zmag [mgauss] Z Magnetic field * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_scaled_imu3_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -123,16 +123,16 @@ static inline uint16_t mavlink_msg_scaled_imu3_pack(uint8_t system_id, uint8_t c * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param time_boot_ms Timestamp (milliseconds since system boot) - * @param xacc X acceleration (mg) - * @param yacc Y acceleration (mg) - * @param zacc Z acceleration (mg) - * @param xgyro Angular speed around X axis (millirad /sec) - * @param ygyro Angular speed around Y axis (millirad /sec) - * @param zgyro Angular speed around Z axis (millirad /sec) - * @param xmag X Magnetic field (milli tesla) - * @param ymag Y Magnetic field (milli tesla) - * @param zmag Z Magnetic field (milli tesla) + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param xacc [mG] X acceleration + * @param yacc [mG] Y acceleration + * @param zacc [mG] Z acceleration + * @param xgyro [mrad/s] Angular speed around X axis + * @param ygyro [mrad/s] Angular speed around Y axis + * @param zgyro [mrad/s] Angular speed around Z axis + * @param xmag [mgauss] X Magnetic field + * @param ymag [mgauss] Y Magnetic field + * @param zmag [mgauss] Z Magnetic field * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_scaled_imu3_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -204,16 +204,16 @@ static inline uint16_t mavlink_msg_scaled_imu3_encode_chan(uint8_t system_id, ui * @brief Send a scaled_imu3 message * @param chan MAVLink channel to send the message * - * @param time_boot_ms Timestamp (milliseconds since system boot) - * @param xacc X acceleration (mg) - * @param yacc Y acceleration (mg) - * @param zacc Z acceleration (mg) - * @param xgyro Angular speed around X axis (millirad /sec) - * @param ygyro Angular speed around Y axis (millirad /sec) - * @param zgyro Angular speed around Z axis (millirad /sec) - * @param xmag X Magnetic field (milli tesla) - * @param ymag Y Magnetic field (milli tesla) - * @param zmag Z Magnetic field (milli tesla) + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param xacc [mG] X acceleration + * @param yacc [mG] Y acceleration + * @param zacc [mG] Z acceleration + * @param xgyro [mrad/s] Angular speed around X axis + * @param ygyro [mrad/s] Angular speed around Y axis + * @param zgyro [mrad/s] Angular speed around Z axis + * @param xmag [mgauss] X Magnetic field + * @param ymag [mgauss] Y Magnetic field + * @param zmag [mgauss] Z Magnetic field */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -314,7 +314,7 @@ static inline void mavlink_msg_scaled_imu3_send_buf(mavlink_message_t *msgbuf, m /** * @brief Get field time_boot_ms from scaled_imu3 message * - * @return Timestamp (milliseconds since system boot) + * @return [ms] Timestamp (time since system boot). */ static inline uint32_t mavlink_msg_scaled_imu3_get_time_boot_ms(const mavlink_message_t* msg) { @@ -324,7 +324,7 @@ static inline uint32_t mavlink_msg_scaled_imu3_get_time_boot_ms(const mavlink_me /** * @brief Get field xacc from scaled_imu3 message * - * @return X acceleration (mg) + * @return [mG] X acceleration */ static inline int16_t mavlink_msg_scaled_imu3_get_xacc(const mavlink_message_t* msg) { @@ -334,7 +334,7 @@ static inline int16_t mavlink_msg_scaled_imu3_get_xacc(const mavlink_message_t* /** * @brief Get field yacc from scaled_imu3 message * - * @return Y acceleration (mg) + * @return [mG] Y acceleration */ static inline int16_t mavlink_msg_scaled_imu3_get_yacc(const mavlink_message_t* msg) { @@ -344,7 +344,7 @@ static inline int16_t mavlink_msg_scaled_imu3_get_yacc(const mavlink_message_t* /** * @brief Get field zacc from scaled_imu3 message * - * @return Z acceleration (mg) + * @return [mG] Z acceleration */ static inline int16_t mavlink_msg_scaled_imu3_get_zacc(const mavlink_message_t* msg) { @@ -354,7 +354,7 @@ static inline int16_t mavlink_msg_scaled_imu3_get_zacc(const mavlink_message_t* /** * @brief Get field xgyro from scaled_imu3 message * - * @return Angular speed around X axis (millirad /sec) + * @return [mrad/s] Angular speed around X axis */ static inline int16_t mavlink_msg_scaled_imu3_get_xgyro(const mavlink_message_t* msg) { @@ -364,7 +364,7 @@ static inline int16_t mavlink_msg_scaled_imu3_get_xgyro(const mavlink_message_t* /** * @brief Get field ygyro from scaled_imu3 message * - * @return Angular speed around Y axis (millirad /sec) + * @return [mrad/s] Angular speed around Y axis */ static inline int16_t mavlink_msg_scaled_imu3_get_ygyro(const mavlink_message_t* msg) { @@ -374,7 +374,7 @@ static inline int16_t mavlink_msg_scaled_imu3_get_ygyro(const mavlink_message_t* /** * @brief Get field zgyro from scaled_imu3 message * - * @return Angular speed around Z axis (millirad /sec) + * @return [mrad/s] Angular speed around Z axis */ static inline int16_t mavlink_msg_scaled_imu3_get_zgyro(const mavlink_message_t* msg) { @@ -384,7 +384,7 @@ static inline int16_t mavlink_msg_scaled_imu3_get_zgyro(const mavlink_message_t* /** * @brief Get field xmag from scaled_imu3 message * - * @return X Magnetic field (milli tesla) + * @return [mgauss] X Magnetic field */ static inline int16_t mavlink_msg_scaled_imu3_get_xmag(const mavlink_message_t* msg) { @@ -394,7 +394,7 @@ static inline int16_t mavlink_msg_scaled_imu3_get_xmag(const mavlink_message_t* /** * @brief Get field ymag from scaled_imu3 message * - * @return Y Magnetic field (milli tesla) + * @return [mgauss] Y Magnetic field */ static inline int16_t mavlink_msg_scaled_imu3_get_ymag(const mavlink_message_t* msg) { @@ -404,7 +404,7 @@ static inline int16_t mavlink_msg_scaled_imu3_get_ymag(const mavlink_message_t* /** * @brief Get field zmag from scaled_imu3 message * - * @return Z Magnetic field (milli tesla) + * @return [mgauss] Z Magnetic field */ static inline int16_t mavlink_msg_scaled_imu3_get_zmag(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_scaled_pressure.h b/lib/main/MAVLink/common/mavlink_msg_scaled_pressure.h index 0dcfc9277d..9889c4676a 100755 --- a/lib/main/MAVLink/common/mavlink_msg_scaled_pressure.h +++ b/lib/main/MAVLink/common/mavlink_msg_scaled_pressure.h @@ -3,13 +3,13 @@ #define MAVLINK_MSG_ID_SCALED_PRESSURE 29 -MAVPACKED( + typedef struct __mavlink_scaled_pressure_t { - uint32_t time_boot_ms; /*< Timestamp (milliseconds since system boot)*/ - float press_abs; /*< Absolute pressure (hectopascal)*/ - float press_diff; /*< Differential pressure 1 (hectopascal)*/ - int16_t temperature; /*< Temperature measurement (0.01 degrees celsius)*/ -}) mavlink_scaled_pressure_t; + uint32_t time_boot_ms; /*< [ms] Timestamp (time since system boot).*/ + float press_abs; /*< [hPa] Absolute pressure*/ + float press_diff; /*< [hPa] Differential pressure 1*/ + int16_t temperature; /*< [cdegC] Absolute pressure temperature*/ +} mavlink_scaled_pressure_t; #define MAVLINK_MSG_ID_SCALED_PRESSURE_LEN 14 #define MAVLINK_MSG_ID_SCALED_PRESSURE_MIN_LEN 14 @@ -50,10 +50,10 @@ typedef struct __mavlink_scaled_pressure_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param time_boot_ms Timestamp (milliseconds since system boot) - * @param press_abs Absolute pressure (hectopascal) - * @param press_diff Differential pressure 1 (hectopascal) - * @param temperature Temperature measurement (0.01 degrees celsius) + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param press_abs [hPa] Absolute pressure + * @param press_diff [hPa] Differential pressure 1 + * @param temperature [cdegC] Absolute pressure temperature * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_scaled_pressure_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -87,10 +87,10 @@ static inline uint16_t mavlink_msg_scaled_pressure_pack(uint8_t system_id, uint8 * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param time_boot_ms Timestamp (milliseconds since system boot) - * @param press_abs Absolute pressure (hectopascal) - * @param press_diff Differential pressure 1 (hectopascal) - * @param temperature Temperature measurement (0.01 degrees celsius) + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param press_abs [hPa] Absolute pressure + * @param press_diff [hPa] Differential pressure 1 + * @param temperature [cdegC] Absolute pressure temperature * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_scaled_pressure_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -150,10 +150,10 @@ static inline uint16_t mavlink_msg_scaled_pressure_encode_chan(uint8_t system_id * @brief Send a scaled_pressure message * @param chan MAVLink channel to send the message * - * @param time_boot_ms Timestamp (milliseconds since system boot) - * @param press_abs Absolute pressure (hectopascal) - * @param press_diff Differential pressure 1 (hectopascal) - * @param temperature Temperature measurement (0.01 degrees celsius) + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param press_abs [hPa] Absolute pressure + * @param press_diff [hPa] Differential pressure 1 + * @param temperature [cdegC] Absolute pressure temperature */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -230,7 +230,7 @@ static inline void mavlink_msg_scaled_pressure_send_buf(mavlink_message_t *msgbu /** * @brief Get field time_boot_ms from scaled_pressure message * - * @return Timestamp (milliseconds since system boot) + * @return [ms] Timestamp (time since system boot). */ static inline uint32_t mavlink_msg_scaled_pressure_get_time_boot_ms(const mavlink_message_t* msg) { @@ -240,7 +240,7 @@ static inline uint32_t mavlink_msg_scaled_pressure_get_time_boot_ms(const mavlin /** * @brief Get field press_abs from scaled_pressure message * - * @return Absolute pressure (hectopascal) + * @return [hPa] Absolute pressure */ static inline float mavlink_msg_scaled_pressure_get_press_abs(const mavlink_message_t* msg) { @@ -250,7 +250,7 @@ static inline float mavlink_msg_scaled_pressure_get_press_abs(const mavlink_mess /** * @brief Get field press_diff from scaled_pressure message * - * @return Differential pressure 1 (hectopascal) + * @return [hPa] Differential pressure 1 */ static inline float mavlink_msg_scaled_pressure_get_press_diff(const mavlink_message_t* msg) { @@ -260,7 +260,7 @@ static inline float mavlink_msg_scaled_pressure_get_press_diff(const mavlink_mes /** * @brief Get field temperature from scaled_pressure message * - * @return Temperature measurement (0.01 degrees celsius) + * @return [cdegC] Absolute pressure temperature */ static inline int16_t mavlink_msg_scaled_pressure_get_temperature(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_scaled_pressure2.h b/lib/main/MAVLink/common/mavlink_msg_scaled_pressure2.h index 1e7920b040..7ac74c6758 100755 --- a/lib/main/MAVLink/common/mavlink_msg_scaled_pressure2.h +++ b/lib/main/MAVLink/common/mavlink_msg_scaled_pressure2.h @@ -3,13 +3,13 @@ #define MAVLINK_MSG_ID_SCALED_PRESSURE2 137 -MAVPACKED( + typedef struct __mavlink_scaled_pressure2_t { - uint32_t time_boot_ms; /*< Timestamp (milliseconds since system boot)*/ - float press_abs; /*< Absolute pressure (hectopascal)*/ - float press_diff; /*< Differential pressure 1 (hectopascal)*/ - int16_t temperature; /*< Temperature measurement (0.01 degrees celsius)*/ -}) mavlink_scaled_pressure2_t; + uint32_t time_boot_ms; /*< [ms] Timestamp (time since system boot).*/ + float press_abs; /*< [hPa] Absolute pressure*/ + float press_diff; /*< [hPa] Differential pressure*/ + int16_t temperature; /*< [cdegC] Absolute pressure temperature*/ +} mavlink_scaled_pressure2_t; #define MAVLINK_MSG_ID_SCALED_PRESSURE2_LEN 14 #define MAVLINK_MSG_ID_SCALED_PRESSURE2_MIN_LEN 14 @@ -50,10 +50,10 @@ typedef struct __mavlink_scaled_pressure2_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param time_boot_ms Timestamp (milliseconds since system boot) - * @param press_abs Absolute pressure (hectopascal) - * @param press_diff Differential pressure 1 (hectopascal) - * @param temperature Temperature measurement (0.01 degrees celsius) + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param press_abs [hPa] Absolute pressure + * @param press_diff [hPa] Differential pressure + * @param temperature [cdegC] Absolute pressure temperature * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_scaled_pressure2_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -87,10 +87,10 @@ static inline uint16_t mavlink_msg_scaled_pressure2_pack(uint8_t system_id, uint * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param time_boot_ms Timestamp (milliseconds since system boot) - * @param press_abs Absolute pressure (hectopascal) - * @param press_diff Differential pressure 1 (hectopascal) - * @param temperature Temperature measurement (0.01 degrees celsius) + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param press_abs [hPa] Absolute pressure + * @param press_diff [hPa] Differential pressure + * @param temperature [cdegC] Absolute pressure temperature * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_scaled_pressure2_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -150,10 +150,10 @@ static inline uint16_t mavlink_msg_scaled_pressure2_encode_chan(uint8_t system_i * @brief Send a scaled_pressure2 message * @param chan MAVLink channel to send the message * - * @param time_boot_ms Timestamp (milliseconds since system boot) - * @param press_abs Absolute pressure (hectopascal) - * @param press_diff Differential pressure 1 (hectopascal) - * @param temperature Temperature measurement (0.01 degrees celsius) + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param press_abs [hPa] Absolute pressure + * @param press_diff [hPa] Differential pressure + * @param temperature [cdegC] Absolute pressure temperature */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -230,7 +230,7 @@ static inline void mavlink_msg_scaled_pressure2_send_buf(mavlink_message_t *msgb /** * @brief Get field time_boot_ms from scaled_pressure2 message * - * @return Timestamp (milliseconds since system boot) + * @return [ms] Timestamp (time since system boot). */ static inline uint32_t mavlink_msg_scaled_pressure2_get_time_boot_ms(const mavlink_message_t* msg) { @@ -240,7 +240,7 @@ static inline uint32_t mavlink_msg_scaled_pressure2_get_time_boot_ms(const mavli /** * @brief Get field press_abs from scaled_pressure2 message * - * @return Absolute pressure (hectopascal) + * @return [hPa] Absolute pressure */ static inline float mavlink_msg_scaled_pressure2_get_press_abs(const mavlink_message_t* msg) { @@ -250,7 +250,7 @@ static inline float mavlink_msg_scaled_pressure2_get_press_abs(const mavlink_mes /** * @brief Get field press_diff from scaled_pressure2 message * - * @return Differential pressure 1 (hectopascal) + * @return [hPa] Differential pressure */ static inline float mavlink_msg_scaled_pressure2_get_press_diff(const mavlink_message_t* msg) { @@ -260,7 +260,7 @@ static inline float mavlink_msg_scaled_pressure2_get_press_diff(const mavlink_me /** * @brief Get field temperature from scaled_pressure2 message * - * @return Temperature measurement (0.01 degrees celsius) + * @return [cdegC] Absolute pressure temperature */ static inline int16_t mavlink_msg_scaled_pressure2_get_temperature(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_scaled_pressure3.h b/lib/main/MAVLink/common/mavlink_msg_scaled_pressure3.h index a0b6586e90..e0007cf8ed 100755 --- a/lib/main/MAVLink/common/mavlink_msg_scaled_pressure3.h +++ b/lib/main/MAVLink/common/mavlink_msg_scaled_pressure3.h @@ -3,13 +3,13 @@ #define MAVLINK_MSG_ID_SCALED_PRESSURE3 143 -MAVPACKED( + typedef struct __mavlink_scaled_pressure3_t { - uint32_t time_boot_ms; /*< Timestamp (milliseconds since system boot)*/ - float press_abs; /*< Absolute pressure (hectopascal)*/ - float press_diff; /*< Differential pressure 1 (hectopascal)*/ - int16_t temperature; /*< Temperature measurement (0.01 degrees celsius)*/ -}) mavlink_scaled_pressure3_t; + uint32_t time_boot_ms; /*< [ms] Timestamp (time since system boot).*/ + float press_abs; /*< [hPa] Absolute pressure*/ + float press_diff; /*< [hPa] Differential pressure*/ + int16_t temperature; /*< [cdegC] Absolute pressure temperature*/ +} mavlink_scaled_pressure3_t; #define MAVLINK_MSG_ID_SCALED_PRESSURE3_LEN 14 #define MAVLINK_MSG_ID_SCALED_PRESSURE3_MIN_LEN 14 @@ -50,10 +50,10 @@ typedef struct __mavlink_scaled_pressure3_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param time_boot_ms Timestamp (milliseconds since system boot) - * @param press_abs Absolute pressure (hectopascal) - * @param press_diff Differential pressure 1 (hectopascal) - * @param temperature Temperature measurement (0.01 degrees celsius) + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param press_abs [hPa] Absolute pressure + * @param press_diff [hPa] Differential pressure + * @param temperature [cdegC] Absolute pressure temperature * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_scaled_pressure3_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -87,10 +87,10 @@ static inline uint16_t mavlink_msg_scaled_pressure3_pack(uint8_t system_id, uint * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param time_boot_ms Timestamp (milliseconds since system boot) - * @param press_abs Absolute pressure (hectopascal) - * @param press_diff Differential pressure 1 (hectopascal) - * @param temperature Temperature measurement (0.01 degrees celsius) + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param press_abs [hPa] Absolute pressure + * @param press_diff [hPa] Differential pressure + * @param temperature [cdegC] Absolute pressure temperature * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_scaled_pressure3_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -150,10 +150,10 @@ static inline uint16_t mavlink_msg_scaled_pressure3_encode_chan(uint8_t system_i * @brief Send a scaled_pressure3 message * @param chan MAVLink channel to send the message * - * @param time_boot_ms Timestamp (milliseconds since system boot) - * @param press_abs Absolute pressure (hectopascal) - * @param press_diff Differential pressure 1 (hectopascal) - * @param temperature Temperature measurement (0.01 degrees celsius) + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param press_abs [hPa] Absolute pressure + * @param press_diff [hPa] Differential pressure + * @param temperature [cdegC] Absolute pressure temperature */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -230,7 +230,7 @@ static inline void mavlink_msg_scaled_pressure3_send_buf(mavlink_message_t *msgb /** * @brief Get field time_boot_ms from scaled_pressure3 message * - * @return Timestamp (milliseconds since system boot) + * @return [ms] Timestamp (time since system boot). */ static inline uint32_t mavlink_msg_scaled_pressure3_get_time_boot_ms(const mavlink_message_t* msg) { @@ -240,7 +240,7 @@ static inline uint32_t mavlink_msg_scaled_pressure3_get_time_boot_ms(const mavli /** * @brief Get field press_abs from scaled_pressure3 message * - * @return Absolute pressure (hectopascal) + * @return [hPa] Absolute pressure */ static inline float mavlink_msg_scaled_pressure3_get_press_abs(const mavlink_message_t* msg) { @@ -250,7 +250,7 @@ static inline float mavlink_msg_scaled_pressure3_get_press_abs(const mavlink_mes /** * @brief Get field press_diff from scaled_pressure3 message * - * @return Differential pressure 1 (hectopascal) + * @return [hPa] Differential pressure */ static inline float mavlink_msg_scaled_pressure3_get_press_diff(const mavlink_message_t* msg) { @@ -260,7 +260,7 @@ static inline float mavlink_msg_scaled_pressure3_get_press_diff(const mavlink_me /** * @brief Get field temperature from scaled_pressure3 message * - * @return Temperature measurement (0.01 degrees celsius) + * @return [cdegC] Absolute pressure temperature */ static inline int16_t mavlink_msg_scaled_pressure3_get_temperature(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_serial_control.h b/lib/main/MAVLink/common/mavlink_msg_serial_control.h index ce9581185a..16ed754cf6 100755 --- a/lib/main/MAVLink/common/mavlink_msg_serial_control.h +++ b/lib/main/MAVLink/common/mavlink_msg_serial_control.h @@ -3,15 +3,15 @@ #define MAVLINK_MSG_ID_SERIAL_CONTROL 126 -MAVPACKED( + typedef struct __mavlink_serial_control_t { - uint32_t baudrate; /*< Baudrate of transfer. Zero means no change.*/ - uint16_t timeout; /*< Timeout for reply data in milliseconds*/ - uint8_t device; /*< See SERIAL_CONTROL_DEV enum*/ - uint8_t flags; /*< See SERIAL_CONTROL_FLAG enum*/ - uint8_t count; /*< how many bytes in this transfer*/ - uint8_t data[70]; /*< serial data*/ -}) mavlink_serial_control_t; + uint32_t baudrate; /*< [bits/s] Baudrate of transfer. Zero means no change.*/ + uint16_t timeout; /*< [ms] Timeout for reply data*/ + uint8_t device; /*< Serial control device type.*/ + uint8_t flags; /*< Bitmap of serial control flags.*/ + uint8_t count; /*< [bytes] how many bytes in this transfer*/ + uint8_t data[70]; /*< serial data*/ +} mavlink_serial_control_t; #define MAVLINK_MSG_ID_SERIAL_CONTROL_LEN 79 #define MAVLINK_MSG_ID_SERIAL_CONTROL_MIN_LEN 79 @@ -28,10 +28,10 @@ typedef struct __mavlink_serial_control_t { 126, \ "SERIAL_CONTROL", \ 6, \ - { { "baudrate", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_serial_control_t, baudrate) }, \ - { "timeout", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_serial_control_t, timeout) }, \ - { "device", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_serial_control_t, device) }, \ + { { "device", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_serial_control_t, device) }, \ { "flags", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_serial_control_t, flags) }, \ + { "timeout", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_serial_control_t, timeout) }, \ + { "baudrate", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_serial_control_t, baudrate) }, \ { "count", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_serial_control_t, count) }, \ { "data", NULL, MAVLINK_TYPE_UINT8_T, 70, 9, offsetof(mavlink_serial_control_t, data) }, \ } \ @@ -40,10 +40,10 @@ typedef struct __mavlink_serial_control_t { #define MAVLINK_MESSAGE_INFO_SERIAL_CONTROL { \ "SERIAL_CONTROL", \ 6, \ - { { "baudrate", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_serial_control_t, baudrate) }, \ - { "timeout", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_serial_control_t, timeout) }, \ - { "device", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_serial_control_t, device) }, \ + { { "device", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_serial_control_t, device) }, \ { "flags", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_serial_control_t, flags) }, \ + { "timeout", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_serial_control_t, timeout) }, \ + { "baudrate", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_serial_control_t, baudrate) }, \ { "count", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_serial_control_t, count) }, \ { "data", NULL, MAVLINK_TYPE_UINT8_T, 70, 9, offsetof(mavlink_serial_control_t, data) }, \ } \ @@ -56,12 +56,12 @@ typedef struct __mavlink_serial_control_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param device See SERIAL_CONTROL_DEV enum - * @param flags See SERIAL_CONTROL_FLAG enum - * @param timeout Timeout for reply data in milliseconds - * @param baudrate Baudrate of transfer. Zero means no change. - * @param count how many bytes in this transfer - * @param data serial data + * @param device Serial control device type. + * @param flags Bitmap of serial control flags. + * @param timeout [ms] Timeout for reply data + * @param baudrate [bits/s] Baudrate of transfer. Zero means no change. + * @param count [bytes] how many bytes in this transfer + * @param data serial data * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_serial_control_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -97,12 +97,12 @@ static inline uint16_t mavlink_msg_serial_control_pack(uint8_t system_id, uint8_ * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param device See SERIAL_CONTROL_DEV enum - * @param flags See SERIAL_CONTROL_FLAG enum - * @param timeout Timeout for reply data in milliseconds - * @param baudrate Baudrate of transfer. Zero means no change. - * @param count how many bytes in this transfer - * @param data serial data + * @param device Serial control device type. + * @param flags Bitmap of serial control flags. + * @param timeout [ms] Timeout for reply data + * @param baudrate [bits/s] Baudrate of transfer. Zero means no change. + * @param count [bytes] how many bytes in this transfer + * @param data serial data * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_serial_control_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -164,12 +164,12 @@ static inline uint16_t mavlink_msg_serial_control_encode_chan(uint8_t system_id, * @brief Send a serial_control message * @param chan MAVLink channel to send the message * - * @param device See SERIAL_CONTROL_DEV enum - * @param flags See SERIAL_CONTROL_FLAG enum - * @param timeout Timeout for reply data in milliseconds - * @param baudrate Baudrate of transfer. Zero means no change. - * @param count how many bytes in this transfer - * @param data serial data + * @param device Serial control device type. + * @param flags Bitmap of serial control flags. + * @param timeout [ms] Timeout for reply data + * @param baudrate [bits/s] Baudrate of transfer. Zero means no change. + * @param count [bytes] how many bytes in this transfer + * @param data serial data */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -250,7 +250,7 @@ static inline void mavlink_msg_serial_control_send_buf(mavlink_message_t *msgbuf /** * @brief Get field device from serial_control message * - * @return See SERIAL_CONTROL_DEV enum + * @return Serial control device type. */ static inline uint8_t mavlink_msg_serial_control_get_device(const mavlink_message_t* msg) { @@ -260,7 +260,7 @@ static inline uint8_t mavlink_msg_serial_control_get_device(const mavlink_messag /** * @brief Get field flags from serial_control message * - * @return See SERIAL_CONTROL_FLAG enum + * @return Bitmap of serial control flags. */ static inline uint8_t mavlink_msg_serial_control_get_flags(const mavlink_message_t* msg) { @@ -270,7 +270,7 @@ static inline uint8_t mavlink_msg_serial_control_get_flags(const mavlink_message /** * @brief Get field timeout from serial_control message * - * @return Timeout for reply data in milliseconds + * @return [ms] Timeout for reply data */ static inline uint16_t mavlink_msg_serial_control_get_timeout(const mavlink_message_t* msg) { @@ -280,7 +280,7 @@ static inline uint16_t mavlink_msg_serial_control_get_timeout(const mavlink_mess /** * @brief Get field baudrate from serial_control message * - * @return Baudrate of transfer. Zero means no change. + * @return [bits/s] Baudrate of transfer. Zero means no change. */ static inline uint32_t mavlink_msg_serial_control_get_baudrate(const mavlink_message_t* msg) { @@ -290,7 +290,7 @@ static inline uint32_t mavlink_msg_serial_control_get_baudrate(const mavlink_mes /** * @brief Get field count from serial_control message * - * @return how many bytes in this transfer + * @return [bytes] how many bytes in this transfer */ static inline uint8_t mavlink_msg_serial_control_get_count(const mavlink_message_t* msg) { @@ -300,7 +300,7 @@ static inline uint8_t mavlink_msg_serial_control_get_count(const mavlink_message /** * @brief Get field data from serial_control message * - * @return serial data + * @return serial data */ static inline uint16_t mavlink_msg_serial_control_get_data(const mavlink_message_t* msg, uint8_t *data) { diff --git a/lib/main/MAVLink/common/mavlink_msg_servo_output_raw.h b/lib/main/MAVLink/common/mavlink_msg_servo_output_raw.h index 0bf3936cdc..840c6a25f6 100755 --- a/lib/main/MAVLink/common/mavlink_msg_servo_output_raw.h +++ b/lib/main/MAVLink/common/mavlink_msg_servo_output_raw.h @@ -3,19 +3,19 @@ #define MAVLINK_MSG_ID_SERVO_OUTPUT_RAW 36 -MAVPACKED( + typedef struct __mavlink_servo_output_raw_t { - uint32_t time_usec; /*< Timestamp (microseconds since system boot)*/ - uint16_t servo1_raw; /*< Servo output 1 value, in microseconds*/ - uint16_t servo2_raw; /*< Servo output 2 value, in microseconds*/ - uint16_t servo3_raw; /*< Servo output 3 value, in microseconds*/ - uint16_t servo4_raw; /*< Servo output 4 value, in microseconds*/ - uint16_t servo5_raw; /*< Servo output 5 value, in microseconds*/ - uint16_t servo6_raw; /*< Servo output 6 value, in microseconds*/ - uint16_t servo7_raw; /*< Servo output 7 value, in microseconds*/ - uint16_t servo8_raw; /*< Servo output 8 value, in microseconds*/ - uint8_t port; /*< Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows to encode more than 8 servos.*/ -}) mavlink_servo_output_raw_t; + uint32_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.*/ + uint16_t servo1_raw; /*< [us] Servo output 1 value*/ + uint16_t servo2_raw; /*< [us] Servo output 2 value*/ + uint16_t servo3_raw; /*< [us] Servo output 3 value*/ + uint16_t servo4_raw; /*< [us] Servo output 4 value*/ + uint16_t servo5_raw; /*< [us] Servo output 5 value*/ + uint16_t servo6_raw; /*< [us] Servo output 6 value*/ + uint16_t servo7_raw; /*< [us] Servo output 7 value*/ + uint16_t servo8_raw; /*< [us] Servo output 8 value*/ + uint8_t port; /*< Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX.*/ +} mavlink_servo_output_raw_t; #define MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN 21 #define MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_MIN_LEN 21 @@ -33,6 +33,7 @@ typedef struct __mavlink_servo_output_raw_t { "SERVO_OUTPUT_RAW", \ 10, \ { { "time_usec", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_servo_output_raw_t, time_usec) }, \ + { "port", NULL, MAVLINK_TYPE_UINT8_T, 0, 20, offsetof(mavlink_servo_output_raw_t, port) }, \ { "servo1_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_servo_output_raw_t, servo1_raw) }, \ { "servo2_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_servo_output_raw_t, servo2_raw) }, \ { "servo3_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_servo_output_raw_t, servo3_raw) }, \ @@ -41,7 +42,6 @@ typedef struct __mavlink_servo_output_raw_t { { "servo6_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_servo_output_raw_t, servo6_raw) }, \ { "servo7_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_servo_output_raw_t, servo7_raw) }, \ { "servo8_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_servo_output_raw_t, servo8_raw) }, \ - { "port", NULL, MAVLINK_TYPE_UINT8_T, 0, 20, offsetof(mavlink_servo_output_raw_t, port) }, \ } \ } #else @@ -49,6 +49,7 @@ typedef struct __mavlink_servo_output_raw_t { "SERVO_OUTPUT_RAW", \ 10, \ { { "time_usec", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_servo_output_raw_t, time_usec) }, \ + { "port", NULL, MAVLINK_TYPE_UINT8_T, 0, 20, offsetof(mavlink_servo_output_raw_t, port) }, \ { "servo1_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_servo_output_raw_t, servo1_raw) }, \ { "servo2_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_servo_output_raw_t, servo2_raw) }, \ { "servo3_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_servo_output_raw_t, servo3_raw) }, \ @@ -57,7 +58,6 @@ typedef struct __mavlink_servo_output_raw_t { { "servo6_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_servo_output_raw_t, servo6_raw) }, \ { "servo7_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_servo_output_raw_t, servo7_raw) }, \ { "servo8_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_servo_output_raw_t, servo8_raw) }, \ - { "port", NULL, MAVLINK_TYPE_UINT8_T, 0, 20, offsetof(mavlink_servo_output_raw_t, port) }, \ } \ } #endif @@ -68,16 +68,16 @@ typedef struct __mavlink_servo_output_raw_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param time_usec Timestamp (microseconds since system boot) - * @param port Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows to encode more than 8 servos. - * @param servo1_raw Servo output 1 value, in microseconds - * @param servo2_raw Servo output 2 value, in microseconds - * @param servo3_raw Servo output 3 value, in microseconds - * @param servo4_raw Servo output 4 value, in microseconds - * @param servo5_raw Servo output 5 value, in microseconds - * @param servo6_raw Servo output 6 value, in microseconds - * @param servo7_raw Servo output 7 value, in microseconds - * @param servo8_raw Servo output 8 value, in microseconds + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param port Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX. + * @param servo1_raw [us] Servo output 1 value + * @param servo2_raw [us] Servo output 2 value + * @param servo3_raw [us] Servo output 3 value + * @param servo4_raw [us] Servo output 4 value + * @param servo5_raw [us] Servo output 5 value + * @param servo6_raw [us] Servo output 6 value + * @param servo7_raw [us] Servo output 7 value + * @param servo8_raw [us] Servo output 8 value * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_servo_output_raw_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -123,16 +123,16 @@ static inline uint16_t mavlink_msg_servo_output_raw_pack(uint8_t system_id, uint * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param time_usec Timestamp (microseconds since system boot) - * @param port Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows to encode more than 8 servos. - * @param servo1_raw Servo output 1 value, in microseconds - * @param servo2_raw Servo output 2 value, in microseconds - * @param servo3_raw Servo output 3 value, in microseconds - * @param servo4_raw Servo output 4 value, in microseconds - * @param servo5_raw Servo output 5 value, in microseconds - * @param servo6_raw Servo output 6 value, in microseconds - * @param servo7_raw Servo output 7 value, in microseconds - * @param servo8_raw Servo output 8 value, in microseconds + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param port Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX. + * @param servo1_raw [us] Servo output 1 value + * @param servo2_raw [us] Servo output 2 value + * @param servo3_raw [us] Servo output 3 value + * @param servo4_raw [us] Servo output 4 value + * @param servo5_raw [us] Servo output 5 value + * @param servo6_raw [us] Servo output 6 value + * @param servo7_raw [us] Servo output 7 value + * @param servo8_raw [us] Servo output 8 value * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_servo_output_raw_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -204,16 +204,16 @@ static inline uint16_t mavlink_msg_servo_output_raw_encode_chan(uint8_t system_i * @brief Send a servo_output_raw message * @param chan MAVLink channel to send the message * - * @param time_usec Timestamp (microseconds since system boot) - * @param port Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows to encode more than 8 servos. - * @param servo1_raw Servo output 1 value, in microseconds - * @param servo2_raw Servo output 2 value, in microseconds - * @param servo3_raw Servo output 3 value, in microseconds - * @param servo4_raw Servo output 4 value, in microseconds - * @param servo5_raw Servo output 5 value, in microseconds - * @param servo6_raw Servo output 6 value, in microseconds - * @param servo7_raw Servo output 7 value, in microseconds - * @param servo8_raw Servo output 8 value, in microseconds + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param port Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX. + * @param servo1_raw [us] Servo output 1 value + * @param servo2_raw [us] Servo output 2 value + * @param servo3_raw [us] Servo output 3 value + * @param servo4_raw [us] Servo output 4 value + * @param servo5_raw [us] Servo output 5 value + * @param servo6_raw [us] Servo output 6 value + * @param servo7_raw [us] Servo output 7 value + * @param servo8_raw [us] Servo output 8 value */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -314,7 +314,7 @@ static inline void mavlink_msg_servo_output_raw_send_buf(mavlink_message_t *msgb /** * @brief Get field time_usec from servo_output_raw message * - * @return Timestamp (microseconds since system boot) + * @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. */ static inline uint32_t mavlink_msg_servo_output_raw_get_time_usec(const mavlink_message_t* msg) { @@ -324,7 +324,7 @@ static inline uint32_t mavlink_msg_servo_output_raw_get_time_usec(const mavlink_ /** * @brief Get field port from servo_output_raw message * - * @return Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows to encode more than 8 servos. + * @return Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX. */ static inline uint8_t mavlink_msg_servo_output_raw_get_port(const mavlink_message_t* msg) { @@ -334,7 +334,7 @@ static inline uint8_t mavlink_msg_servo_output_raw_get_port(const mavlink_messag /** * @brief Get field servo1_raw from servo_output_raw message * - * @return Servo output 1 value, in microseconds + * @return [us] Servo output 1 value */ static inline uint16_t mavlink_msg_servo_output_raw_get_servo1_raw(const mavlink_message_t* msg) { @@ -344,7 +344,7 @@ static inline uint16_t mavlink_msg_servo_output_raw_get_servo1_raw(const mavlink /** * @brief Get field servo2_raw from servo_output_raw message * - * @return Servo output 2 value, in microseconds + * @return [us] Servo output 2 value */ static inline uint16_t mavlink_msg_servo_output_raw_get_servo2_raw(const mavlink_message_t* msg) { @@ -354,7 +354,7 @@ static inline uint16_t mavlink_msg_servo_output_raw_get_servo2_raw(const mavlink /** * @brief Get field servo3_raw from servo_output_raw message * - * @return Servo output 3 value, in microseconds + * @return [us] Servo output 3 value */ static inline uint16_t mavlink_msg_servo_output_raw_get_servo3_raw(const mavlink_message_t* msg) { @@ -364,7 +364,7 @@ static inline uint16_t mavlink_msg_servo_output_raw_get_servo3_raw(const mavlink /** * @brief Get field servo4_raw from servo_output_raw message * - * @return Servo output 4 value, in microseconds + * @return [us] Servo output 4 value */ static inline uint16_t mavlink_msg_servo_output_raw_get_servo4_raw(const mavlink_message_t* msg) { @@ -374,7 +374,7 @@ static inline uint16_t mavlink_msg_servo_output_raw_get_servo4_raw(const mavlink /** * @brief Get field servo5_raw from servo_output_raw message * - * @return Servo output 5 value, in microseconds + * @return [us] Servo output 5 value */ static inline uint16_t mavlink_msg_servo_output_raw_get_servo5_raw(const mavlink_message_t* msg) { @@ -384,7 +384,7 @@ static inline uint16_t mavlink_msg_servo_output_raw_get_servo5_raw(const mavlink /** * @brief Get field servo6_raw from servo_output_raw message * - * @return Servo output 6 value, in microseconds + * @return [us] Servo output 6 value */ static inline uint16_t mavlink_msg_servo_output_raw_get_servo6_raw(const mavlink_message_t* msg) { @@ -394,7 +394,7 @@ static inline uint16_t mavlink_msg_servo_output_raw_get_servo6_raw(const mavlink /** * @brief Get field servo7_raw from servo_output_raw message * - * @return Servo output 7 value, in microseconds + * @return [us] Servo output 7 value */ static inline uint16_t mavlink_msg_servo_output_raw_get_servo7_raw(const mavlink_message_t* msg) { @@ -404,7 +404,7 @@ static inline uint16_t mavlink_msg_servo_output_raw_get_servo7_raw(const mavlink /** * @brief Get field servo8_raw from servo_output_raw message * - * @return Servo output 8 value, in microseconds + * @return [us] Servo output 8 value */ static inline uint16_t mavlink_msg_servo_output_raw_get_servo8_raw(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_set_actuator_control_target.h b/lib/main/MAVLink/common/mavlink_msg_set_actuator_control_target.h index f804d4bc85..7d21dac9d3 100755 --- a/lib/main/MAVLink/common/mavlink_msg_set_actuator_control_target.h +++ b/lib/main/MAVLink/common/mavlink_msg_set_actuator_control_target.h @@ -3,14 +3,14 @@ #define MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET 139 -MAVPACKED( + typedef struct __mavlink_set_actuator_control_target_t { - uint64_t time_usec; /*< Timestamp (micros since boot or Unix epoch)*/ - float controls[8]; /*< Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs.*/ - uint8_t group_mlx; /*< Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances.*/ - uint8_t target_system; /*< System ID*/ - uint8_t target_component; /*< Component ID*/ -}) mavlink_set_actuator_control_target_t; + uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.*/ + float controls[8]; /*< Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs.*/ + uint8_t group_mlx; /*< Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances.*/ + uint8_t target_system; /*< System ID*/ + uint8_t target_component; /*< Component ID*/ +} mavlink_set_actuator_control_target_t; #define MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN 43 #define MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_MIN_LEN 43 @@ -28,10 +28,10 @@ typedef struct __mavlink_set_actuator_control_target_t { "SET_ACTUATOR_CONTROL_TARGET", \ 5, \ { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_set_actuator_control_target_t, time_usec) }, \ - { "controls", NULL, MAVLINK_TYPE_FLOAT, 8, 8, offsetof(mavlink_set_actuator_control_target_t, controls) }, \ { "group_mlx", NULL, MAVLINK_TYPE_UINT8_T, 0, 40, offsetof(mavlink_set_actuator_control_target_t, group_mlx) }, \ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 41, offsetof(mavlink_set_actuator_control_target_t, target_system) }, \ { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 42, offsetof(mavlink_set_actuator_control_target_t, target_component) }, \ + { "controls", NULL, MAVLINK_TYPE_FLOAT, 8, 8, offsetof(mavlink_set_actuator_control_target_t, controls) }, \ } \ } #else @@ -39,10 +39,10 @@ typedef struct __mavlink_set_actuator_control_target_t { "SET_ACTUATOR_CONTROL_TARGET", \ 5, \ { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_set_actuator_control_target_t, time_usec) }, \ - { "controls", NULL, MAVLINK_TYPE_FLOAT, 8, 8, offsetof(mavlink_set_actuator_control_target_t, controls) }, \ { "group_mlx", NULL, MAVLINK_TYPE_UINT8_T, 0, 40, offsetof(mavlink_set_actuator_control_target_t, group_mlx) }, \ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 41, offsetof(mavlink_set_actuator_control_target_t, target_system) }, \ { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 42, offsetof(mavlink_set_actuator_control_target_t, target_component) }, \ + { "controls", NULL, MAVLINK_TYPE_FLOAT, 8, 8, offsetof(mavlink_set_actuator_control_target_t, controls) }, \ } \ } #endif @@ -53,11 +53,11 @@ typedef struct __mavlink_set_actuator_control_target_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param time_usec Timestamp (micros since boot or Unix epoch) - * @param group_mlx Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances. - * @param target_system System ID - * @param target_component Component ID - * @param controls Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs. + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param group_mlx Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances. + * @param target_system System ID + * @param target_component Component ID + * @param controls Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_set_actuator_control_target_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -91,11 +91,11 @@ static inline uint16_t mavlink_msg_set_actuator_control_target_pack(uint8_t syst * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param time_usec Timestamp (micros since boot or Unix epoch) - * @param group_mlx Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances. - * @param target_system System ID - * @param target_component Component ID - * @param controls Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs. + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param group_mlx Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances. + * @param target_system System ID + * @param target_component Component ID + * @param controls Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_set_actuator_control_target_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -155,11 +155,11 @@ static inline uint16_t mavlink_msg_set_actuator_control_target_encode_chan(uint8 * @brief Send a set_actuator_control_target message * @param chan MAVLink channel to send the message * - * @param time_usec Timestamp (micros since boot or Unix epoch) - * @param group_mlx Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances. - * @param target_system System ID - * @param target_component Component ID - * @param controls Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs. + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param group_mlx Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances. + * @param target_system System ID + * @param target_component Component ID + * @param controls Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs. */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -236,7 +236,7 @@ static inline void mavlink_msg_set_actuator_control_target_send_buf(mavlink_mess /** * @brief Get field time_usec from set_actuator_control_target message * - * @return Timestamp (micros since boot or Unix epoch) + * @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. */ static inline uint64_t mavlink_msg_set_actuator_control_target_get_time_usec(const mavlink_message_t* msg) { @@ -246,7 +246,7 @@ static inline uint64_t mavlink_msg_set_actuator_control_target_get_time_usec(con /** * @brief Get field group_mlx from set_actuator_control_target message * - * @return Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances. + * @return Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances. */ static inline uint8_t mavlink_msg_set_actuator_control_target_get_group_mlx(const mavlink_message_t* msg) { @@ -256,7 +256,7 @@ static inline uint8_t mavlink_msg_set_actuator_control_target_get_group_mlx(cons /** * @brief Get field target_system from set_actuator_control_target message * - * @return System ID + * @return System ID */ static inline uint8_t mavlink_msg_set_actuator_control_target_get_target_system(const mavlink_message_t* msg) { @@ -266,7 +266,7 @@ static inline uint8_t mavlink_msg_set_actuator_control_target_get_target_system( /** * @brief Get field target_component from set_actuator_control_target message * - * @return Component ID + * @return Component ID */ static inline uint8_t mavlink_msg_set_actuator_control_target_get_target_component(const mavlink_message_t* msg) { @@ -276,7 +276,7 @@ static inline uint8_t mavlink_msg_set_actuator_control_target_get_target_compone /** * @brief Get field controls from set_actuator_control_target message * - * @return Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs. + * @return Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs. */ static inline uint16_t mavlink_msg_set_actuator_control_target_get_controls(const mavlink_message_t* msg, float *controls) { diff --git a/lib/main/MAVLink/common/mavlink_msg_set_attitude_target.h b/lib/main/MAVLink/common/mavlink_msg_set_attitude_target.h index 1b68caa025..94a2e856b8 100755 --- a/lib/main/MAVLink/common/mavlink_msg_set_attitude_target.h +++ b/lib/main/MAVLink/common/mavlink_msg_set_attitude_target.h @@ -3,18 +3,18 @@ #define MAVLINK_MSG_ID_SET_ATTITUDE_TARGET 82 -MAVPACKED( + typedef struct __mavlink_set_attitude_target_t { - uint32_t time_boot_ms; /*< Timestamp in milliseconds since system boot*/ - float q[4]; /*< Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)*/ - float body_roll_rate; /*< Body roll rate in radians per second*/ - float body_pitch_rate; /*< Body roll rate in radians per second*/ - float body_yaw_rate; /*< Body roll rate in radians per second*/ - float thrust; /*< Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)*/ - uint8_t target_system; /*< System ID*/ - uint8_t target_component; /*< Component ID*/ - uint8_t type_mask; /*< Mappings: If any of these bits are set, the corresponding input should be ignored: bit 1: body roll rate, bit 2: body pitch rate, bit 3: body yaw rate. bit 4-bit 6: reserved, bit 7: throttle, bit 8: attitude*/ -}) mavlink_set_attitude_target_t; + uint32_t time_boot_ms; /*< [ms] Timestamp (time since system boot).*/ + float q[4]; /*< Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)*/ + float body_roll_rate; /*< [rad/s] Body roll rate*/ + float body_pitch_rate; /*< [rad/s] Body pitch rate*/ + float body_yaw_rate; /*< [rad/s] Body yaw rate*/ + float thrust; /*< Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)*/ + uint8_t target_system; /*< System ID*/ + uint8_t target_component; /*< Component ID*/ + uint8_t type_mask; /*< Mappings: If any of these bits are set, the corresponding input should be ignored: bit 1: body roll rate, bit 2: body pitch rate, bit 3: body yaw rate. bit 4-bit 6: reserved, bit 7: throttle, bit 8: attitude*/ +} mavlink_set_attitude_target_t; #define MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN 39 #define MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_MIN_LEN 39 @@ -32,14 +32,14 @@ typedef struct __mavlink_set_attitude_target_t { "SET_ATTITUDE_TARGET", \ 9, \ { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_set_attitude_target_t, time_boot_ms) }, \ + { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_set_attitude_target_t, target_system) }, \ + { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 37, offsetof(mavlink_set_attitude_target_t, target_component) }, \ + { "type_mask", NULL, MAVLINK_TYPE_UINT8_T, 0, 38, offsetof(mavlink_set_attitude_target_t, type_mask) }, \ { "q", NULL, MAVLINK_TYPE_FLOAT, 4, 4, offsetof(mavlink_set_attitude_target_t, q) }, \ { "body_roll_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_set_attitude_target_t, body_roll_rate) }, \ { "body_pitch_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_set_attitude_target_t, body_pitch_rate) }, \ { "body_yaw_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_set_attitude_target_t, body_yaw_rate) }, \ { "thrust", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_set_attitude_target_t, thrust) }, \ - { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_set_attitude_target_t, target_system) }, \ - { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 37, offsetof(mavlink_set_attitude_target_t, target_component) }, \ - { "type_mask", NULL, MAVLINK_TYPE_UINT8_T, 0, 38, offsetof(mavlink_set_attitude_target_t, type_mask) }, \ } \ } #else @@ -47,14 +47,14 @@ typedef struct __mavlink_set_attitude_target_t { "SET_ATTITUDE_TARGET", \ 9, \ { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_set_attitude_target_t, time_boot_ms) }, \ + { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_set_attitude_target_t, target_system) }, \ + { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 37, offsetof(mavlink_set_attitude_target_t, target_component) }, \ + { "type_mask", NULL, MAVLINK_TYPE_UINT8_T, 0, 38, offsetof(mavlink_set_attitude_target_t, type_mask) }, \ { "q", NULL, MAVLINK_TYPE_FLOAT, 4, 4, offsetof(mavlink_set_attitude_target_t, q) }, \ { "body_roll_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_set_attitude_target_t, body_roll_rate) }, \ { "body_pitch_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_set_attitude_target_t, body_pitch_rate) }, \ { "body_yaw_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_set_attitude_target_t, body_yaw_rate) }, \ { "thrust", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_set_attitude_target_t, thrust) }, \ - { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_set_attitude_target_t, target_system) }, \ - { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 37, offsetof(mavlink_set_attitude_target_t, target_component) }, \ - { "type_mask", NULL, MAVLINK_TYPE_UINT8_T, 0, 38, offsetof(mavlink_set_attitude_target_t, type_mask) }, \ } \ } #endif @@ -65,15 +65,15 @@ typedef struct __mavlink_set_attitude_target_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param time_boot_ms Timestamp in milliseconds since system boot - * @param target_system System ID - * @param target_component Component ID - * @param type_mask Mappings: If any of these bits are set, the corresponding input should be ignored: bit 1: body roll rate, bit 2: body pitch rate, bit 3: body yaw rate. bit 4-bit 6: reserved, bit 7: throttle, bit 8: attitude - * @param q Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) - * @param body_roll_rate Body roll rate in radians per second - * @param body_pitch_rate Body roll rate in radians per second - * @param body_yaw_rate Body roll rate in radians per second - * @param thrust Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust) + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param target_system System ID + * @param target_component Component ID + * @param type_mask Mappings: If any of these bits are set, the corresponding input should be ignored: bit 1: body roll rate, bit 2: body pitch rate, bit 3: body yaw rate. bit 4-bit 6: reserved, bit 7: throttle, bit 8: attitude + * @param q Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) + * @param body_roll_rate [rad/s] Body roll rate + * @param body_pitch_rate [rad/s] Body pitch rate + * @param body_yaw_rate [rad/s] Body yaw rate + * @param thrust Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust) * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_set_attitude_target_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -115,15 +115,15 @@ static inline uint16_t mavlink_msg_set_attitude_target_pack(uint8_t system_id, u * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param time_boot_ms Timestamp in milliseconds since system boot - * @param target_system System ID - * @param target_component Component ID - * @param type_mask Mappings: If any of these bits are set, the corresponding input should be ignored: bit 1: body roll rate, bit 2: body pitch rate, bit 3: body yaw rate. bit 4-bit 6: reserved, bit 7: throttle, bit 8: attitude - * @param q Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) - * @param body_roll_rate Body roll rate in radians per second - * @param body_pitch_rate Body roll rate in radians per second - * @param body_yaw_rate Body roll rate in radians per second - * @param thrust Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust) + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param target_system System ID + * @param target_component Component ID + * @param type_mask Mappings: If any of these bits are set, the corresponding input should be ignored: bit 1: body roll rate, bit 2: body pitch rate, bit 3: body yaw rate. bit 4-bit 6: reserved, bit 7: throttle, bit 8: attitude + * @param q Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) + * @param body_roll_rate [rad/s] Body roll rate + * @param body_pitch_rate [rad/s] Body pitch rate + * @param body_yaw_rate [rad/s] Body yaw rate + * @param thrust Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust) * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_set_attitude_target_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -191,15 +191,15 @@ static inline uint16_t mavlink_msg_set_attitude_target_encode_chan(uint8_t syste * @brief Send a set_attitude_target message * @param chan MAVLink channel to send the message * - * @param time_boot_ms Timestamp in milliseconds since system boot - * @param target_system System ID - * @param target_component Component ID - * @param type_mask Mappings: If any of these bits are set, the corresponding input should be ignored: bit 1: body roll rate, bit 2: body pitch rate, bit 3: body yaw rate. bit 4-bit 6: reserved, bit 7: throttle, bit 8: attitude - * @param q Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) - * @param body_roll_rate Body roll rate in radians per second - * @param body_pitch_rate Body roll rate in radians per second - * @param body_yaw_rate Body roll rate in radians per second - * @param thrust Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust) + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param target_system System ID + * @param target_component Component ID + * @param type_mask Mappings: If any of these bits are set, the corresponding input should be ignored: bit 1: body roll rate, bit 2: body pitch rate, bit 3: body yaw rate. bit 4-bit 6: reserved, bit 7: throttle, bit 8: attitude + * @param q Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) + * @param body_roll_rate [rad/s] Body roll rate + * @param body_pitch_rate [rad/s] Body pitch rate + * @param body_yaw_rate [rad/s] Body yaw rate + * @param thrust Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust) */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -292,7 +292,7 @@ static inline void mavlink_msg_set_attitude_target_send_buf(mavlink_message_t *m /** * @brief Get field time_boot_ms from set_attitude_target message * - * @return Timestamp in milliseconds since system boot + * @return [ms] Timestamp (time since system boot). */ static inline uint32_t mavlink_msg_set_attitude_target_get_time_boot_ms(const mavlink_message_t* msg) { @@ -302,7 +302,7 @@ static inline uint32_t mavlink_msg_set_attitude_target_get_time_boot_ms(const ma /** * @brief Get field target_system from set_attitude_target message * - * @return System ID + * @return System ID */ static inline uint8_t mavlink_msg_set_attitude_target_get_target_system(const mavlink_message_t* msg) { @@ -312,7 +312,7 @@ static inline uint8_t mavlink_msg_set_attitude_target_get_target_system(const ma /** * @brief Get field target_component from set_attitude_target message * - * @return Component ID + * @return Component ID */ static inline uint8_t mavlink_msg_set_attitude_target_get_target_component(const mavlink_message_t* msg) { @@ -322,7 +322,7 @@ static inline uint8_t mavlink_msg_set_attitude_target_get_target_component(const /** * @brief Get field type_mask from set_attitude_target message * - * @return Mappings: If any of these bits are set, the corresponding input should be ignored: bit 1: body roll rate, bit 2: body pitch rate, bit 3: body yaw rate. bit 4-bit 6: reserved, bit 7: throttle, bit 8: attitude + * @return Mappings: If any of these bits are set, the corresponding input should be ignored: bit 1: body roll rate, bit 2: body pitch rate, bit 3: body yaw rate. bit 4-bit 6: reserved, bit 7: throttle, bit 8: attitude */ static inline uint8_t mavlink_msg_set_attitude_target_get_type_mask(const mavlink_message_t* msg) { @@ -332,7 +332,7 @@ static inline uint8_t mavlink_msg_set_attitude_target_get_type_mask(const mavlin /** * @brief Get field q from set_attitude_target message * - * @return Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) + * @return Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) */ static inline uint16_t mavlink_msg_set_attitude_target_get_q(const mavlink_message_t* msg, float *q) { @@ -342,7 +342,7 @@ static inline uint16_t mavlink_msg_set_attitude_target_get_q(const mavlink_messa /** * @brief Get field body_roll_rate from set_attitude_target message * - * @return Body roll rate in radians per second + * @return [rad/s] Body roll rate */ static inline float mavlink_msg_set_attitude_target_get_body_roll_rate(const mavlink_message_t* msg) { @@ -352,7 +352,7 @@ static inline float mavlink_msg_set_attitude_target_get_body_roll_rate(const mav /** * @brief Get field body_pitch_rate from set_attitude_target message * - * @return Body roll rate in radians per second + * @return [rad/s] Body pitch rate */ static inline float mavlink_msg_set_attitude_target_get_body_pitch_rate(const mavlink_message_t* msg) { @@ -362,7 +362,7 @@ static inline float mavlink_msg_set_attitude_target_get_body_pitch_rate(const ma /** * @brief Get field body_yaw_rate from set_attitude_target message * - * @return Body roll rate in radians per second + * @return [rad/s] Body yaw rate */ static inline float mavlink_msg_set_attitude_target_get_body_yaw_rate(const mavlink_message_t* msg) { @@ -372,7 +372,7 @@ static inline float mavlink_msg_set_attitude_target_get_body_yaw_rate(const mavl /** * @brief Get field thrust from set_attitude_target message * - * @return Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust) + * @return Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust) */ static inline float mavlink_msg_set_attitude_target_get_thrust(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_set_gps_global_origin.h b/lib/main/MAVLink/common/mavlink_msg_set_gps_global_origin.h index a934c19324..7da7fbb510 100755 --- a/lib/main/MAVLink/common/mavlink_msg_set_gps_global_origin.h +++ b/lib/main/MAVLink/common/mavlink_msg_set_gps_global_origin.h @@ -3,13 +3,13 @@ #define MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN 48 -MAVPACKED( + typedef struct __mavlink_set_gps_global_origin_t { - int32_t latitude; /*< Latitude (WGS84), in degrees * 1E7*/ - int32_t longitude; /*< Longitude (WGS84, in degrees * 1E7*/ - int32_t altitude; /*< Altitude (AMSL), in meters * 1000 (positive for up)*/ - uint8_t target_system; /*< System ID*/ -}) mavlink_set_gps_global_origin_t; + int32_t latitude; /*< [degE7] Latitude (WGS84)*/ + int32_t longitude; /*< [degE7] Longitude (WGS84)*/ + int32_t altitude; /*< [mm] Altitude (MSL). Positive for up.*/ + uint8_t target_system; /*< System ID*/ +} mavlink_set_gps_global_origin_t; #define MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN 13 #define MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_MIN_LEN 13 @@ -26,20 +26,20 @@ typedef struct __mavlink_set_gps_global_origin_t { 48, \ "SET_GPS_GLOBAL_ORIGIN", \ 4, \ - { { "latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_set_gps_global_origin_t, latitude) }, \ + { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_set_gps_global_origin_t, target_system) }, \ + { "latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_set_gps_global_origin_t, latitude) }, \ { "longitude", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_set_gps_global_origin_t, longitude) }, \ { "altitude", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_set_gps_global_origin_t, altitude) }, \ - { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_set_gps_global_origin_t, target_system) }, \ } \ } #else #define MAVLINK_MESSAGE_INFO_SET_GPS_GLOBAL_ORIGIN { \ "SET_GPS_GLOBAL_ORIGIN", \ 4, \ - { { "latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_set_gps_global_origin_t, latitude) }, \ + { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_set_gps_global_origin_t, target_system) }, \ + { "latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_set_gps_global_origin_t, latitude) }, \ { "longitude", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_set_gps_global_origin_t, longitude) }, \ { "altitude", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_set_gps_global_origin_t, altitude) }, \ - { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_set_gps_global_origin_t, target_system) }, \ } \ } #endif @@ -50,10 +50,10 @@ typedef struct __mavlink_set_gps_global_origin_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param target_system System ID - * @param latitude Latitude (WGS84), in degrees * 1E7 - * @param longitude Longitude (WGS84, in degrees * 1E7 - * @param altitude Altitude (AMSL), in meters * 1000 (positive for up) + * @param target_system System ID + * @param latitude [degE7] Latitude (WGS84) + * @param longitude [degE7] Longitude (WGS84) + * @param altitude [mm] Altitude (MSL). Positive for up. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_set_gps_global_origin_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -87,10 +87,10 @@ static inline uint16_t mavlink_msg_set_gps_global_origin_pack(uint8_t system_id, * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param target_system System ID - * @param latitude Latitude (WGS84), in degrees * 1E7 - * @param longitude Longitude (WGS84, in degrees * 1E7 - * @param altitude Altitude (AMSL), in meters * 1000 (positive for up) + * @param target_system System ID + * @param latitude [degE7] Latitude (WGS84) + * @param longitude [degE7] Longitude (WGS84) + * @param altitude [mm] Altitude (MSL). Positive for up. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_set_gps_global_origin_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -150,10 +150,10 @@ static inline uint16_t mavlink_msg_set_gps_global_origin_encode_chan(uint8_t sys * @brief Send a set_gps_global_origin message * @param chan MAVLink channel to send the message * - * @param target_system System ID - * @param latitude Latitude (WGS84), in degrees * 1E7 - * @param longitude Longitude (WGS84, in degrees * 1E7 - * @param altitude Altitude (AMSL), in meters * 1000 (positive for up) + * @param target_system System ID + * @param latitude [degE7] Latitude (WGS84) + * @param longitude [degE7] Longitude (WGS84) + * @param altitude [mm] Altitude (MSL). Positive for up. */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -230,7 +230,7 @@ static inline void mavlink_msg_set_gps_global_origin_send_buf(mavlink_message_t /** * @brief Get field target_system from set_gps_global_origin message * - * @return System ID + * @return System ID */ static inline uint8_t mavlink_msg_set_gps_global_origin_get_target_system(const mavlink_message_t* msg) { @@ -240,7 +240,7 @@ static inline uint8_t mavlink_msg_set_gps_global_origin_get_target_system(const /** * @brief Get field latitude from set_gps_global_origin message * - * @return Latitude (WGS84), in degrees * 1E7 + * @return [degE7] Latitude (WGS84) */ static inline int32_t mavlink_msg_set_gps_global_origin_get_latitude(const mavlink_message_t* msg) { @@ -250,7 +250,7 @@ static inline int32_t mavlink_msg_set_gps_global_origin_get_latitude(const mavli /** * @brief Get field longitude from set_gps_global_origin message * - * @return Longitude (WGS84, in degrees * 1E7 + * @return [degE7] Longitude (WGS84) */ static inline int32_t mavlink_msg_set_gps_global_origin_get_longitude(const mavlink_message_t* msg) { @@ -260,7 +260,7 @@ static inline int32_t mavlink_msg_set_gps_global_origin_get_longitude(const mavl /** * @brief Get field altitude from set_gps_global_origin message * - * @return Altitude (AMSL), in meters * 1000 (positive for up) + * @return [mm] Altitude (MSL). Positive for up. */ static inline int32_t mavlink_msg_set_gps_global_origin_get_altitude(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_set_home_position.h b/lib/main/MAVLink/common/mavlink_msg_set_home_position.h index cd7c8d34c4..7ddcae5a09 100755 --- a/lib/main/MAVLink/common/mavlink_msg_set_home_position.h +++ b/lib/main/MAVLink/common/mavlink_msg_set_home_position.h @@ -3,20 +3,20 @@ #define MAVLINK_MSG_ID_SET_HOME_POSITION 243 -MAVPACKED( + typedef struct __mavlink_set_home_position_t { - int32_t latitude; /*< Latitude (WGS84), in degrees * 1E7*/ - int32_t longitude; /*< Longitude (WGS84, in degrees * 1E7*/ - int32_t altitude; /*< Altitude (AMSL), in meters * 1000 (positive for up)*/ - float x; /*< Local X position of this position in the local coordinate frame*/ - float y; /*< Local Y position of this position in the local coordinate frame*/ - float z; /*< Local Z position of this position in the local coordinate frame*/ - float q[4]; /*< World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground*/ - float approach_x; /*< Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.*/ - float approach_y; /*< Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.*/ - float approach_z; /*< Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.*/ - uint8_t target_system; /*< System ID.*/ -}) mavlink_set_home_position_t; + int32_t latitude; /*< [degE7] Latitude (WGS84)*/ + int32_t longitude; /*< [degE7] Longitude (WGS84)*/ + int32_t altitude; /*< [mm] Altitude (MSL). Positive for up.*/ + float x; /*< [m] Local X position of this position in the local coordinate frame*/ + float y; /*< [m] Local Y position of this position in the local coordinate frame*/ + float z; /*< [m] Local Z position of this position in the local coordinate frame*/ + float q[4]; /*< World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground*/ + float approach_x; /*< [m] Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.*/ + float approach_y; /*< [m] Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.*/ + float approach_z; /*< [m] Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.*/ + uint8_t target_system; /*< System ID.*/ +} mavlink_set_home_position_t; #define MAVLINK_MSG_ID_SET_HOME_POSITION_LEN 53 #define MAVLINK_MSG_ID_SET_HOME_POSITION_MIN_LEN 53 @@ -33,7 +33,8 @@ typedef struct __mavlink_set_home_position_t { 243, \ "SET_HOME_POSITION", \ 11, \ - { { "latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_set_home_position_t, latitude) }, \ + { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 52, offsetof(mavlink_set_home_position_t, target_system) }, \ + { "latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_set_home_position_t, latitude) }, \ { "longitude", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_set_home_position_t, longitude) }, \ { "altitude", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_set_home_position_t, altitude) }, \ { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_set_home_position_t, x) }, \ @@ -43,14 +44,14 @@ typedef struct __mavlink_set_home_position_t { { "approach_x", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_set_home_position_t, approach_x) }, \ { "approach_y", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_set_home_position_t, approach_y) }, \ { "approach_z", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_set_home_position_t, approach_z) }, \ - { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 52, offsetof(mavlink_set_home_position_t, target_system) }, \ } \ } #else #define MAVLINK_MESSAGE_INFO_SET_HOME_POSITION { \ "SET_HOME_POSITION", \ 11, \ - { { "latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_set_home_position_t, latitude) }, \ + { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 52, offsetof(mavlink_set_home_position_t, target_system) }, \ + { "latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_set_home_position_t, latitude) }, \ { "longitude", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_set_home_position_t, longitude) }, \ { "altitude", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_set_home_position_t, altitude) }, \ { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_set_home_position_t, x) }, \ @@ -60,7 +61,6 @@ typedef struct __mavlink_set_home_position_t { { "approach_x", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_set_home_position_t, approach_x) }, \ { "approach_y", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_set_home_position_t, approach_y) }, \ { "approach_z", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_set_home_position_t, approach_z) }, \ - { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 52, offsetof(mavlink_set_home_position_t, target_system) }, \ } \ } #endif @@ -71,17 +71,17 @@ typedef struct __mavlink_set_home_position_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param target_system System ID. - * @param latitude Latitude (WGS84), in degrees * 1E7 - * @param longitude Longitude (WGS84, in degrees * 1E7 - * @param altitude Altitude (AMSL), in meters * 1000 (positive for up) - * @param x Local X position of this position in the local coordinate frame - * @param y Local Y position of this position in the local coordinate frame - * @param z Local Z position of this position in the local coordinate frame - * @param q World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground - * @param approach_x Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. - * @param approach_y Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. - * @param approach_z Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. + * @param target_system System ID. + * @param latitude [degE7] Latitude (WGS84) + * @param longitude [degE7] Longitude (WGS84) + * @param altitude [mm] Altitude (MSL). Positive for up. + * @param x [m] Local X position of this position in the local coordinate frame + * @param y [m] Local Y position of this position in the local coordinate frame + * @param z [m] Local Z position of this position in the local coordinate frame + * @param q World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground + * @param approach_x [m] Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. + * @param approach_y [m] Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. + * @param approach_z [m] Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_set_home_position_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -127,17 +127,17 @@ static inline uint16_t mavlink_msg_set_home_position_pack(uint8_t system_id, uin * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param target_system System ID. - * @param latitude Latitude (WGS84), in degrees * 1E7 - * @param longitude Longitude (WGS84, in degrees * 1E7 - * @param altitude Altitude (AMSL), in meters * 1000 (positive for up) - * @param x Local X position of this position in the local coordinate frame - * @param y Local Y position of this position in the local coordinate frame - * @param z Local Z position of this position in the local coordinate frame - * @param q World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground - * @param approach_x Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. - * @param approach_y Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. - * @param approach_z Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. + * @param target_system System ID. + * @param latitude [degE7] Latitude (WGS84) + * @param longitude [degE7] Longitude (WGS84) + * @param altitude [mm] Altitude (MSL). Positive for up. + * @param x [m] Local X position of this position in the local coordinate frame + * @param y [m] Local Y position of this position in the local coordinate frame + * @param z [m] Local Z position of this position in the local coordinate frame + * @param q World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground + * @param approach_x [m] Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. + * @param approach_y [m] Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. + * @param approach_z [m] Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_set_home_position_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -209,17 +209,17 @@ static inline uint16_t mavlink_msg_set_home_position_encode_chan(uint8_t system_ * @brief Send a set_home_position message * @param chan MAVLink channel to send the message * - * @param target_system System ID. - * @param latitude Latitude (WGS84), in degrees * 1E7 - * @param longitude Longitude (WGS84, in degrees * 1E7 - * @param altitude Altitude (AMSL), in meters * 1000 (positive for up) - * @param x Local X position of this position in the local coordinate frame - * @param y Local Y position of this position in the local coordinate frame - * @param z Local Z position of this position in the local coordinate frame - * @param q World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground - * @param approach_x Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. - * @param approach_y Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. - * @param approach_z Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. + * @param target_system System ID. + * @param latitude [degE7] Latitude (WGS84) + * @param longitude [degE7] Longitude (WGS84) + * @param altitude [mm] Altitude (MSL). Positive for up. + * @param x [m] Local X position of this position in the local coordinate frame + * @param y [m] Local Y position of this position in the local coordinate frame + * @param z [m] Local Z position of this position in the local coordinate frame + * @param q World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground + * @param approach_x [m] Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. + * @param approach_y [m] Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. + * @param approach_z [m] Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -320,7 +320,7 @@ static inline void mavlink_msg_set_home_position_send_buf(mavlink_message_t *msg /** * @brief Get field target_system from set_home_position message * - * @return System ID. + * @return System ID. */ static inline uint8_t mavlink_msg_set_home_position_get_target_system(const mavlink_message_t* msg) { @@ -330,7 +330,7 @@ static inline uint8_t mavlink_msg_set_home_position_get_target_system(const mavl /** * @brief Get field latitude from set_home_position message * - * @return Latitude (WGS84), in degrees * 1E7 + * @return [degE7] Latitude (WGS84) */ static inline int32_t mavlink_msg_set_home_position_get_latitude(const mavlink_message_t* msg) { @@ -340,7 +340,7 @@ static inline int32_t mavlink_msg_set_home_position_get_latitude(const mavlink_m /** * @brief Get field longitude from set_home_position message * - * @return Longitude (WGS84, in degrees * 1E7 + * @return [degE7] Longitude (WGS84) */ static inline int32_t mavlink_msg_set_home_position_get_longitude(const mavlink_message_t* msg) { @@ -350,7 +350,7 @@ static inline int32_t mavlink_msg_set_home_position_get_longitude(const mavlink_ /** * @brief Get field altitude from set_home_position message * - * @return Altitude (AMSL), in meters * 1000 (positive for up) + * @return [mm] Altitude (MSL). Positive for up. */ static inline int32_t mavlink_msg_set_home_position_get_altitude(const mavlink_message_t* msg) { @@ -360,7 +360,7 @@ static inline int32_t mavlink_msg_set_home_position_get_altitude(const mavlink_m /** * @brief Get field x from set_home_position message * - * @return Local X position of this position in the local coordinate frame + * @return [m] Local X position of this position in the local coordinate frame */ static inline float mavlink_msg_set_home_position_get_x(const mavlink_message_t* msg) { @@ -370,7 +370,7 @@ static inline float mavlink_msg_set_home_position_get_x(const mavlink_message_t* /** * @brief Get field y from set_home_position message * - * @return Local Y position of this position in the local coordinate frame + * @return [m] Local Y position of this position in the local coordinate frame */ static inline float mavlink_msg_set_home_position_get_y(const mavlink_message_t* msg) { @@ -380,7 +380,7 @@ static inline float mavlink_msg_set_home_position_get_y(const mavlink_message_t* /** * @brief Get field z from set_home_position message * - * @return Local Z position of this position in the local coordinate frame + * @return [m] Local Z position of this position in the local coordinate frame */ static inline float mavlink_msg_set_home_position_get_z(const mavlink_message_t* msg) { @@ -390,7 +390,7 @@ static inline float mavlink_msg_set_home_position_get_z(const mavlink_message_t* /** * @brief Get field q from set_home_position message * - * @return World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground + * @return World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground */ static inline uint16_t mavlink_msg_set_home_position_get_q(const mavlink_message_t* msg, float *q) { @@ -400,7 +400,7 @@ static inline uint16_t mavlink_msg_set_home_position_get_q(const mavlink_message /** * @brief Get field approach_x from set_home_position message * - * @return Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. + * @return [m] Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. */ static inline float mavlink_msg_set_home_position_get_approach_x(const mavlink_message_t* msg) { @@ -410,7 +410,7 @@ static inline float mavlink_msg_set_home_position_get_approach_x(const mavlink_m /** * @brief Get field approach_y from set_home_position message * - * @return Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. + * @return [m] Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. */ static inline float mavlink_msg_set_home_position_get_approach_y(const mavlink_message_t* msg) { @@ -420,7 +420,7 @@ static inline float mavlink_msg_set_home_position_get_approach_y(const mavlink_m /** * @brief Get field approach_z from set_home_position message * - * @return Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. + * @return [m] Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. */ static inline float mavlink_msg_set_home_position_get_approach_z(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_set_mode.h b/lib/main/MAVLink/common/mavlink_msg_set_mode.h index a4c6ef32bf..d2d0874525 100755 --- a/lib/main/MAVLink/common/mavlink_msg_set_mode.h +++ b/lib/main/MAVLink/common/mavlink_msg_set_mode.h @@ -3,12 +3,12 @@ #define MAVLINK_MSG_ID_SET_MODE 11 -MAVPACKED( + typedef struct __mavlink_set_mode_t { - uint32_t custom_mode; /*< The new autopilot-specific mode. This field can be ignored by an autopilot.*/ - uint8_t target_system; /*< The system setting the mode*/ - uint8_t base_mode; /*< The new base mode*/ -}) mavlink_set_mode_t; + uint32_t custom_mode; /*< The new autopilot-specific mode. This field can be ignored by an autopilot.*/ + uint8_t target_system; /*< The system setting the mode*/ + uint8_t base_mode; /*< The new base mode.*/ +} mavlink_set_mode_t; #define MAVLINK_MSG_ID_SET_MODE_LEN 6 #define MAVLINK_MSG_ID_SET_MODE_MIN_LEN 6 @@ -25,18 +25,18 @@ typedef struct __mavlink_set_mode_t { 11, \ "SET_MODE", \ 3, \ - { { "custom_mode", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_set_mode_t, custom_mode) }, \ - { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_set_mode_t, target_system) }, \ + { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_set_mode_t, target_system) }, \ { "base_mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_set_mode_t, base_mode) }, \ + { "custom_mode", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_set_mode_t, custom_mode) }, \ } \ } #else #define MAVLINK_MESSAGE_INFO_SET_MODE { \ "SET_MODE", \ 3, \ - { { "custom_mode", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_set_mode_t, custom_mode) }, \ - { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_set_mode_t, target_system) }, \ + { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_set_mode_t, target_system) }, \ { "base_mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_set_mode_t, base_mode) }, \ + { "custom_mode", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_set_mode_t, custom_mode) }, \ } \ } #endif @@ -47,9 +47,9 @@ typedef struct __mavlink_set_mode_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param target_system The system setting the mode - * @param base_mode The new base mode - * @param custom_mode The new autopilot-specific mode. This field can be ignored by an autopilot. + * @param target_system The system setting the mode + * @param base_mode The new base mode. + * @param custom_mode The new autopilot-specific mode. This field can be ignored by an autopilot. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_set_mode_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -81,9 +81,9 @@ static inline uint16_t mavlink_msg_set_mode_pack(uint8_t system_id, uint8_t comp * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param target_system The system setting the mode - * @param base_mode The new base mode - * @param custom_mode The new autopilot-specific mode. This field can be ignored by an autopilot. + * @param target_system The system setting the mode + * @param base_mode The new base mode. + * @param custom_mode The new autopilot-specific mode. This field can be ignored by an autopilot. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_set_mode_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -141,9 +141,9 @@ static inline uint16_t mavlink_msg_set_mode_encode_chan(uint8_t system_id, uint8 * @brief Send a set_mode message * @param chan MAVLink channel to send the message * - * @param target_system The system setting the mode - * @param base_mode The new base mode - * @param custom_mode The new autopilot-specific mode. This field can be ignored by an autopilot. + * @param target_system The system setting the mode + * @param base_mode The new base mode. + * @param custom_mode The new autopilot-specific mode. This field can be ignored by an autopilot. */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -216,7 +216,7 @@ static inline void mavlink_msg_set_mode_send_buf(mavlink_message_t *msgbuf, mavl /** * @brief Get field target_system from set_mode message * - * @return The system setting the mode + * @return The system setting the mode */ static inline uint8_t mavlink_msg_set_mode_get_target_system(const mavlink_message_t* msg) { @@ -226,7 +226,7 @@ static inline uint8_t mavlink_msg_set_mode_get_target_system(const mavlink_messa /** * @brief Get field base_mode from set_mode message * - * @return The new base mode + * @return The new base mode. */ static inline uint8_t mavlink_msg_set_mode_get_base_mode(const mavlink_message_t* msg) { @@ -236,7 +236,7 @@ static inline uint8_t mavlink_msg_set_mode_get_base_mode(const mavlink_message_t /** * @brief Get field custom_mode from set_mode message * - * @return The new autopilot-specific mode. This field can be ignored by an autopilot. + * @return The new autopilot-specific mode. This field can be ignored by an autopilot. */ static inline uint32_t mavlink_msg_set_mode_get_custom_mode(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_set_position_target_global_int.h b/lib/main/MAVLink/common/mavlink_msg_set_position_target_global_int.h index ec0c9c1a88..3a1523078c 100755 --- a/lib/main/MAVLink/common/mavlink_msg_set_position_target_global_int.h +++ b/lib/main/MAVLink/common/mavlink_msg_set_position_target_global_int.h @@ -3,25 +3,25 @@ #define MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT 86 -MAVPACKED( + typedef struct __mavlink_set_position_target_global_int_t { - uint32_t time_boot_ms; /*< Timestamp in milliseconds since system boot. The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency.*/ - int32_t lat_int; /*< X Position in WGS84 frame in 1e7 * meters*/ - int32_t lon_int; /*< Y Position in WGS84 frame in 1e7 * meters*/ - float alt; /*< Altitude in meters in AMSL altitude, not WGS84 if absolute or relative, above terrain if GLOBAL_TERRAIN_ALT_INT*/ - float vx; /*< X velocity in NED frame in meter / s*/ - float vy; /*< Y velocity in NED frame in meter / s*/ - float vz; /*< Z velocity in NED frame in meter / s*/ - float afx; /*< X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N*/ - float afy; /*< Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N*/ - float afz; /*< Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N*/ - float yaw; /*< yaw setpoint in rad*/ - float yaw_rate; /*< yaw rate setpoint in rad/s*/ - uint16_t type_mask; /*< Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate*/ - uint8_t target_system; /*< System ID*/ - uint8_t target_component; /*< Component ID*/ - uint8_t coordinate_frame; /*< Valid options are: MAV_FRAME_GLOBAL_INT = 5, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11*/ -}) mavlink_set_position_target_global_int_t; + uint32_t time_boot_ms; /*< [ms] Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency.*/ + int32_t lat_int; /*< [degE7] X Position in WGS84 frame*/ + int32_t lon_int; /*< [degE7] Y Position in WGS84 frame*/ + float alt; /*< [m] Altitude (MSL, Relative to home, or AGL - depending on frame)*/ + float vx; /*< [m/s] X velocity in NED frame*/ + float vy; /*< [m/s] Y velocity in NED frame*/ + float vz; /*< [m/s] Z velocity in NED frame*/ + float afx; /*< [m/s/s] X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N*/ + float afy; /*< [m/s/s] Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N*/ + float afz; /*< [m/s/s] Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N*/ + float yaw; /*< [rad] yaw setpoint*/ + float yaw_rate; /*< [rad/s] yaw rate setpoint*/ + uint16_t type_mask; /*< Bitmap to indicate which dimensions should be ignored by the vehicle.*/ + uint8_t target_system; /*< System ID*/ + uint8_t target_component; /*< Component ID*/ + uint8_t coordinate_frame; /*< Valid options are: MAV_FRAME_GLOBAL_INT = 5, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11*/ +} mavlink_set_position_target_global_int_t; #define MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_LEN 53 #define MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_MIN_LEN 53 @@ -39,6 +39,10 @@ typedef struct __mavlink_set_position_target_global_int_t { "SET_POSITION_TARGET_GLOBAL_INT", \ 16, \ { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_set_position_target_global_int_t, time_boot_ms) }, \ + { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 50, offsetof(mavlink_set_position_target_global_int_t, target_system) }, \ + { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 51, offsetof(mavlink_set_position_target_global_int_t, target_component) }, \ + { "coordinate_frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 52, offsetof(mavlink_set_position_target_global_int_t, coordinate_frame) }, \ + { "type_mask", NULL, MAVLINK_TYPE_UINT16_T, 0, 48, offsetof(mavlink_set_position_target_global_int_t, type_mask) }, \ { "lat_int", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_set_position_target_global_int_t, lat_int) }, \ { "lon_int", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_set_position_target_global_int_t, lon_int) }, \ { "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_set_position_target_global_int_t, alt) }, \ @@ -50,10 +54,6 @@ typedef struct __mavlink_set_position_target_global_int_t { { "afz", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_set_position_target_global_int_t, afz) }, \ { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_set_position_target_global_int_t, yaw) }, \ { "yaw_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_set_position_target_global_int_t, yaw_rate) }, \ - { "type_mask", NULL, MAVLINK_TYPE_UINT16_T, 0, 48, offsetof(mavlink_set_position_target_global_int_t, type_mask) }, \ - { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 50, offsetof(mavlink_set_position_target_global_int_t, target_system) }, \ - { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 51, offsetof(mavlink_set_position_target_global_int_t, target_component) }, \ - { "coordinate_frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 52, offsetof(mavlink_set_position_target_global_int_t, coordinate_frame) }, \ } \ } #else @@ -61,6 +61,10 @@ typedef struct __mavlink_set_position_target_global_int_t { "SET_POSITION_TARGET_GLOBAL_INT", \ 16, \ { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_set_position_target_global_int_t, time_boot_ms) }, \ + { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 50, offsetof(mavlink_set_position_target_global_int_t, target_system) }, \ + { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 51, offsetof(mavlink_set_position_target_global_int_t, target_component) }, \ + { "coordinate_frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 52, offsetof(mavlink_set_position_target_global_int_t, coordinate_frame) }, \ + { "type_mask", NULL, MAVLINK_TYPE_UINT16_T, 0, 48, offsetof(mavlink_set_position_target_global_int_t, type_mask) }, \ { "lat_int", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_set_position_target_global_int_t, lat_int) }, \ { "lon_int", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_set_position_target_global_int_t, lon_int) }, \ { "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_set_position_target_global_int_t, alt) }, \ @@ -72,10 +76,6 @@ typedef struct __mavlink_set_position_target_global_int_t { { "afz", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_set_position_target_global_int_t, afz) }, \ { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_set_position_target_global_int_t, yaw) }, \ { "yaw_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_set_position_target_global_int_t, yaw_rate) }, \ - { "type_mask", NULL, MAVLINK_TYPE_UINT16_T, 0, 48, offsetof(mavlink_set_position_target_global_int_t, type_mask) }, \ - { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 50, offsetof(mavlink_set_position_target_global_int_t, target_system) }, \ - { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 51, offsetof(mavlink_set_position_target_global_int_t, target_component) }, \ - { "coordinate_frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 52, offsetof(mavlink_set_position_target_global_int_t, coordinate_frame) }, \ } \ } #endif @@ -86,22 +86,22 @@ typedef struct __mavlink_set_position_target_global_int_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param time_boot_ms Timestamp in milliseconds since system boot. The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency. - * @param target_system System ID - * @param target_component Component ID - * @param coordinate_frame Valid options are: MAV_FRAME_GLOBAL_INT = 5, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11 - * @param type_mask Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate - * @param lat_int X Position in WGS84 frame in 1e7 * meters - * @param lon_int Y Position in WGS84 frame in 1e7 * meters - * @param alt Altitude in meters in AMSL altitude, not WGS84 if absolute or relative, above terrain if GLOBAL_TERRAIN_ALT_INT - * @param vx X velocity in NED frame in meter / s - * @param vy Y velocity in NED frame in meter / s - * @param vz Z velocity in NED frame in meter / s - * @param afx X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N - * @param afy Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N - * @param afz Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N - * @param yaw yaw setpoint in rad - * @param yaw_rate yaw rate setpoint in rad/s + * @param time_boot_ms [ms] Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency. + * @param target_system System ID + * @param target_component Component ID + * @param coordinate_frame Valid options are: MAV_FRAME_GLOBAL_INT = 5, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11 + * @param type_mask Bitmap to indicate which dimensions should be ignored by the vehicle. + * @param lat_int [degE7] X Position in WGS84 frame + * @param lon_int [degE7] Y Position in WGS84 frame + * @param alt [m] Altitude (MSL, Relative to home, or AGL - depending on frame) + * @param vx [m/s] X velocity in NED frame + * @param vy [m/s] Y velocity in NED frame + * @param vz [m/s] Z velocity in NED frame + * @param afx [m/s/s] X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + * @param afy [m/s/s] Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + * @param afz [m/s/s] Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + * @param yaw [rad] yaw setpoint + * @param yaw_rate [rad/s] yaw rate setpoint * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_set_position_target_global_int_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -159,22 +159,22 @@ static inline uint16_t mavlink_msg_set_position_target_global_int_pack(uint8_t s * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param time_boot_ms Timestamp in milliseconds since system boot. The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency. - * @param target_system System ID - * @param target_component Component ID - * @param coordinate_frame Valid options are: MAV_FRAME_GLOBAL_INT = 5, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11 - * @param type_mask Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate - * @param lat_int X Position in WGS84 frame in 1e7 * meters - * @param lon_int Y Position in WGS84 frame in 1e7 * meters - * @param alt Altitude in meters in AMSL altitude, not WGS84 if absolute or relative, above terrain if GLOBAL_TERRAIN_ALT_INT - * @param vx X velocity in NED frame in meter / s - * @param vy Y velocity in NED frame in meter / s - * @param vz Z velocity in NED frame in meter / s - * @param afx X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N - * @param afy Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N - * @param afz Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N - * @param yaw yaw setpoint in rad - * @param yaw_rate yaw rate setpoint in rad/s + * @param time_boot_ms [ms] Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency. + * @param target_system System ID + * @param target_component Component ID + * @param coordinate_frame Valid options are: MAV_FRAME_GLOBAL_INT = 5, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11 + * @param type_mask Bitmap to indicate which dimensions should be ignored by the vehicle. + * @param lat_int [degE7] X Position in WGS84 frame + * @param lon_int [degE7] Y Position in WGS84 frame + * @param alt [m] Altitude (MSL, Relative to home, or AGL - depending on frame) + * @param vx [m/s] X velocity in NED frame + * @param vy [m/s] Y velocity in NED frame + * @param vz [m/s] Z velocity in NED frame + * @param afx [m/s/s] X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + * @param afy [m/s/s] Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + * @param afz [m/s/s] Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + * @param yaw [rad] yaw setpoint + * @param yaw_rate [rad/s] yaw rate setpoint * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_set_position_target_global_int_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -258,22 +258,22 @@ static inline uint16_t mavlink_msg_set_position_target_global_int_encode_chan(ui * @brief Send a set_position_target_global_int message * @param chan MAVLink channel to send the message * - * @param time_boot_ms Timestamp in milliseconds since system boot. The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency. - * @param target_system System ID - * @param target_component Component ID - * @param coordinate_frame Valid options are: MAV_FRAME_GLOBAL_INT = 5, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11 - * @param type_mask Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate - * @param lat_int X Position in WGS84 frame in 1e7 * meters - * @param lon_int Y Position in WGS84 frame in 1e7 * meters - * @param alt Altitude in meters in AMSL altitude, not WGS84 if absolute or relative, above terrain if GLOBAL_TERRAIN_ALT_INT - * @param vx X velocity in NED frame in meter / s - * @param vy Y velocity in NED frame in meter / s - * @param vz Z velocity in NED frame in meter / s - * @param afx X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N - * @param afy Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N - * @param afz Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N - * @param yaw yaw setpoint in rad - * @param yaw_rate yaw rate setpoint in rad/s + * @param time_boot_ms [ms] Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency. + * @param target_system System ID + * @param target_component Component ID + * @param coordinate_frame Valid options are: MAV_FRAME_GLOBAL_INT = 5, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11 + * @param type_mask Bitmap to indicate which dimensions should be ignored by the vehicle. + * @param lat_int [degE7] X Position in WGS84 frame + * @param lon_int [degE7] Y Position in WGS84 frame + * @param alt [m] Altitude (MSL, Relative to home, or AGL - depending on frame) + * @param vx [m/s] X velocity in NED frame + * @param vy [m/s] Y velocity in NED frame + * @param vz [m/s] Z velocity in NED frame + * @param afx [m/s/s] X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + * @param afy [m/s/s] Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + * @param afz [m/s/s] Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + * @param yaw [rad] yaw setpoint + * @param yaw_rate [rad/s] yaw rate setpoint */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -398,7 +398,7 @@ static inline void mavlink_msg_set_position_target_global_int_send_buf(mavlink_m /** * @brief Get field time_boot_ms from set_position_target_global_int message * - * @return Timestamp in milliseconds since system boot. The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency. + * @return [ms] Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency. */ static inline uint32_t mavlink_msg_set_position_target_global_int_get_time_boot_ms(const mavlink_message_t* msg) { @@ -408,7 +408,7 @@ static inline uint32_t mavlink_msg_set_position_target_global_int_get_time_boot_ /** * @brief Get field target_system from set_position_target_global_int message * - * @return System ID + * @return System ID */ static inline uint8_t mavlink_msg_set_position_target_global_int_get_target_system(const mavlink_message_t* msg) { @@ -418,7 +418,7 @@ static inline uint8_t mavlink_msg_set_position_target_global_int_get_target_syst /** * @brief Get field target_component from set_position_target_global_int message * - * @return Component ID + * @return Component ID */ static inline uint8_t mavlink_msg_set_position_target_global_int_get_target_component(const mavlink_message_t* msg) { @@ -428,7 +428,7 @@ static inline uint8_t mavlink_msg_set_position_target_global_int_get_target_comp /** * @brief Get field coordinate_frame from set_position_target_global_int message * - * @return Valid options are: MAV_FRAME_GLOBAL_INT = 5, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11 + * @return Valid options are: MAV_FRAME_GLOBAL_INT = 5, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11 */ static inline uint8_t mavlink_msg_set_position_target_global_int_get_coordinate_frame(const mavlink_message_t* msg) { @@ -438,7 +438,7 @@ static inline uint8_t mavlink_msg_set_position_target_global_int_get_coordinate_ /** * @brief Get field type_mask from set_position_target_global_int message * - * @return Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate + * @return Bitmap to indicate which dimensions should be ignored by the vehicle. */ static inline uint16_t mavlink_msg_set_position_target_global_int_get_type_mask(const mavlink_message_t* msg) { @@ -448,7 +448,7 @@ static inline uint16_t mavlink_msg_set_position_target_global_int_get_type_mask( /** * @brief Get field lat_int from set_position_target_global_int message * - * @return X Position in WGS84 frame in 1e7 * meters + * @return [degE7] X Position in WGS84 frame */ static inline int32_t mavlink_msg_set_position_target_global_int_get_lat_int(const mavlink_message_t* msg) { @@ -458,7 +458,7 @@ static inline int32_t mavlink_msg_set_position_target_global_int_get_lat_int(con /** * @brief Get field lon_int from set_position_target_global_int message * - * @return Y Position in WGS84 frame in 1e7 * meters + * @return [degE7] Y Position in WGS84 frame */ static inline int32_t mavlink_msg_set_position_target_global_int_get_lon_int(const mavlink_message_t* msg) { @@ -468,7 +468,7 @@ static inline int32_t mavlink_msg_set_position_target_global_int_get_lon_int(con /** * @brief Get field alt from set_position_target_global_int message * - * @return Altitude in meters in AMSL altitude, not WGS84 if absolute or relative, above terrain if GLOBAL_TERRAIN_ALT_INT + * @return [m] Altitude (MSL, Relative to home, or AGL - depending on frame) */ static inline float mavlink_msg_set_position_target_global_int_get_alt(const mavlink_message_t* msg) { @@ -478,7 +478,7 @@ static inline float mavlink_msg_set_position_target_global_int_get_alt(const mav /** * @brief Get field vx from set_position_target_global_int message * - * @return X velocity in NED frame in meter / s + * @return [m/s] X velocity in NED frame */ static inline float mavlink_msg_set_position_target_global_int_get_vx(const mavlink_message_t* msg) { @@ -488,7 +488,7 @@ static inline float mavlink_msg_set_position_target_global_int_get_vx(const mavl /** * @brief Get field vy from set_position_target_global_int message * - * @return Y velocity in NED frame in meter / s + * @return [m/s] Y velocity in NED frame */ static inline float mavlink_msg_set_position_target_global_int_get_vy(const mavlink_message_t* msg) { @@ -498,7 +498,7 @@ static inline float mavlink_msg_set_position_target_global_int_get_vy(const mavl /** * @brief Get field vz from set_position_target_global_int message * - * @return Z velocity in NED frame in meter / s + * @return [m/s] Z velocity in NED frame */ static inline float mavlink_msg_set_position_target_global_int_get_vz(const mavlink_message_t* msg) { @@ -508,7 +508,7 @@ static inline float mavlink_msg_set_position_target_global_int_get_vz(const mavl /** * @brief Get field afx from set_position_target_global_int message * - * @return X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + * @return [m/s/s] X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N */ static inline float mavlink_msg_set_position_target_global_int_get_afx(const mavlink_message_t* msg) { @@ -518,7 +518,7 @@ static inline float mavlink_msg_set_position_target_global_int_get_afx(const mav /** * @brief Get field afy from set_position_target_global_int message * - * @return Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + * @return [m/s/s] Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N */ static inline float mavlink_msg_set_position_target_global_int_get_afy(const mavlink_message_t* msg) { @@ -528,7 +528,7 @@ static inline float mavlink_msg_set_position_target_global_int_get_afy(const mav /** * @brief Get field afz from set_position_target_global_int message * - * @return Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + * @return [m/s/s] Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N */ static inline float mavlink_msg_set_position_target_global_int_get_afz(const mavlink_message_t* msg) { @@ -538,7 +538,7 @@ static inline float mavlink_msg_set_position_target_global_int_get_afz(const mav /** * @brief Get field yaw from set_position_target_global_int message * - * @return yaw setpoint in rad + * @return [rad] yaw setpoint */ static inline float mavlink_msg_set_position_target_global_int_get_yaw(const mavlink_message_t* msg) { @@ -548,7 +548,7 @@ static inline float mavlink_msg_set_position_target_global_int_get_yaw(const mav /** * @brief Get field yaw_rate from set_position_target_global_int message * - * @return yaw rate setpoint in rad/s + * @return [rad/s] yaw rate setpoint */ static inline float mavlink_msg_set_position_target_global_int_get_yaw_rate(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_set_position_target_local_ned.h b/lib/main/MAVLink/common/mavlink_msg_set_position_target_local_ned.h index af4e8d68db..4e16b2ab34 100755 --- a/lib/main/MAVLink/common/mavlink_msg_set_position_target_local_ned.h +++ b/lib/main/MAVLink/common/mavlink_msg_set_position_target_local_ned.h @@ -3,25 +3,25 @@ #define MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED 84 -MAVPACKED( + typedef struct __mavlink_set_position_target_local_ned_t { - uint32_t time_boot_ms; /*< Timestamp in milliseconds since system boot*/ - float x; /*< X Position in NED frame in meters*/ - float y; /*< Y Position in NED frame in meters*/ - float z; /*< Z Position in NED frame in meters (note, altitude is negative in NED)*/ - float vx; /*< X velocity in NED frame in meter / s*/ - float vy; /*< Y velocity in NED frame in meter / s*/ - float vz; /*< Z velocity in NED frame in meter / s*/ - float afx; /*< X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N*/ - float afy; /*< Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N*/ - float afz; /*< Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N*/ - float yaw; /*< yaw setpoint in rad*/ - float yaw_rate; /*< yaw rate setpoint in rad/s*/ - uint16_t type_mask; /*< Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate*/ - uint8_t target_system; /*< System ID*/ - uint8_t target_component; /*< Component ID*/ - uint8_t coordinate_frame; /*< Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9*/ -}) mavlink_set_position_target_local_ned_t; + uint32_t time_boot_ms; /*< [ms] Timestamp (time since system boot).*/ + float x; /*< [m] X Position in NED frame*/ + float y; /*< [m] Y Position in NED frame*/ + float z; /*< [m] Z Position in NED frame (note, altitude is negative in NED)*/ + float vx; /*< [m/s] X velocity in NED frame*/ + float vy; /*< [m/s] Y velocity in NED frame*/ + float vz; /*< [m/s] Z velocity in NED frame*/ + float afx; /*< [m/s/s] X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N*/ + float afy; /*< [m/s/s] Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N*/ + float afz; /*< [m/s/s] Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N*/ + float yaw; /*< [rad] yaw setpoint*/ + float yaw_rate; /*< [rad/s] yaw rate setpoint*/ + uint16_t type_mask; /*< Bitmap to indicate which dimensions should be ignored by the vehicle.*/ + uint8_t target_system; /*< System ID*/ + uint8_t target_component; /*< Component ID*/ + uint8_t coordinate_frame; /*< Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9*/ +} mavlink_set_position_target_local_ned_t; #define MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN 53 #define MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_MIN_LEN 53 @@ -39,6 +39,10 @@ typedef struct __mavlink_set_position_target_local_ned_t { "SET_POSITION_TARGET_LOCAL_NED", \ 16, \ { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_set_position_target_local_ned_t, time_boot_ms) }, \ + { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 50, offsetof(mavlink_set_position_target_local_ned_t, target_system) }, \ + { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 51, offsetof(mavlink_set_position_target_local_ned_t, target_component) }, \ + { "coordinate_frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 52, offsetof(mavlink_set_position_target_local_ned_t, coordinate_frame) }, \ + { "type_mask", NULL, MAVLINK_TYPE_UINT16_T, 0, 48, offsetof(mavlink_set_position_target_local_ned_t, type_mask) }, \ { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_set_position_target_local_ned_t, x) }, \ { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_set_position_target_local_ned_t, y) }, \ { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_set_position_target_local_ned_t, z) }, \ @@ -50,10 +54,6 @@ typedef struct __mavlink_set_position_target_local_ned_t { { "afz", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_set_position_target_local_ned_t, afz) }, \ { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_set_position_target_local_ned_t, yaw) }, \ { "yaw_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_set_position_target_local_ned_t, yaw_rate) }, \ - { "type_mask", NULL, MAVLINK_TYPE_UINT16_T, 0, 48, offsetof(mavlink_set_position_target_local_ned_t, type_mask) }, \ - { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 50, offsetof(mavlink_set_position_target_local_ned_t, target_system) }, \ - { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 51, offsetof(mavlink_set_position_target_local_ned_t, target_component) }, \ - { "coordinate_frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 52, offsetof(mavlink_set_position_target_local_ned_t, coordinate_frame) }, \ } \ } #else @@ -61,6 +61,10 @@ typedef struct __mavlink_set_position_target_local_ned_t { "SET_POSITION_TARGET_LOCAL_NED", \ 16, \ { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_set_position_target_local_ned_t, time_boot_ms) }, \ + { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 50, offsetof(mavlink_set_position_target_local_ned_t, target_system) }, \ + { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 51, offsetof(mavlink_set_position_target_local_ned_t, target_component) }, \ + { "coordinate_frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 52, offsetof(mavlink_set_position_target_local_ned_t, coordinate_frame) }, \ + { "type_mask", NULL, MAVLINK_TYPE_UINT16_T, 0, 48, offsetof(mavlink_set_position_target_local_ned_t, type_mask) }, \ { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_set_position_target_local_ned_t, x) }, \ { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_set_position_target_local_ned_t, y) }, \ { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_set_position_target_local_ned_t, z) }, \ @@ -72,10 +76,6 @@ typedef struct __mavlink_set_position_target_local_ned_t { { "afz", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_set_position_target_local_ned_t, afz) }, \ { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_set_position_target_local_ned_t, yaw) }, \ { "yaw_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_set_position_target_local_ned_t, yaw_rate) }, \ - { "type_mask", NULL, MAVLINK_TYPE_UINT16_T, 0, 48, offsetof(mavlink_set_position_target_local_ned_t, type_mask) }, \ - { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 50, offsetof(mavlink_set_position_target_local_ned_t, target_system) }, \ - { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 51, offsetof(mavlink_set_position_target_local_ned_t, target_component) }, \ - { "coordinate_frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 52, offsetof(mavlink_set_position_target_local_ned_t, coordinate_frame) }, \ } \ } #endif @@ -86,22 +86,22 @@ typedef struct __mavlink_set_position_target_local_ned_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param time_boot_ms Timestamp in milliseconds since system boot - * @param target_system System ID - * @param target_component Component ID - * @param coordinate_frame Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9 - * @param type_mask Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate - * @param x X Position in NED frame in meters - * @param y Y Position in NED frame in meters - * @param z Z Position in NED frame in meters (note, altitude is negative in NED) - * @param vx X velocity in NED frame in meter / s - * @param vy Y velocity in NED frame in meter / s - * @param vz Z velocity in NED frame in meter / s - * @param afx X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N - * @param afy Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N - * @param afz Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N - * @param yaw yaw setpoint in rad - * @param yaw_rate yaw rate setpoint in rad/s + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param target_system System ID + * @param target_component Component ID + * @param coordinate_frame Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9 + * @param type_mask Bitmap to indicate which dimensions should be ignored by the vehicle. + * @param x [m] X Position in NED frame + * @param y [m] Y Position in NED frame + * @param z [m] Z Position in NED frame (note, altitude is negative in NED) + * @param vx [m/s] X velocity in NED frame + * @param vy [m/s] Y velocity in NED frame + * @param vz [m/s] Z velocity in NED frame + * @param afx [m/s/s] X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + * @param afy [m/s/s] Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + * @param afz [m/s/s] Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + * @param yaw [rad] yaw setpoint + * @param yaw_rate [rad/s] yaw rate setpoint * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_set_position_target_local_ned_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -159,22 +159,22 @@ static inline uint16_t mavlink_msg_set_position_target_local_ned_pack(uint8_t sy * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param time_boot_ms Timestamp in milliseconds since system boot - * @param target_system System ID - * @param target_component Component ID - * @param coordinate_frame Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9 - * @param type_mask Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate - * @param x X Position in NED frame in meters - * @param y Y Position in NED frame in meters - * @param z Z Position in NED frame in meters (note, altitude is negative in NED) - * @param vx X velocity in NED frame in meter / s - * @param vy Y velocity in NED frame in meter / s - * @param vz Z velocity in NED frame in meter / s - * @param afx X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N - * @param afy Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N - * @param afz Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N - * @param yaw yaw setpoint in rad - * @param yaw_rate yaw rate setpoint in rad/s + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param target_system System ID + * @param target_component Component ID + * @param coordinate_frame Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9 + * @param type_mask Bitmap to indicate which dimensions should be ignored by the vehicle. + * @param x [m] X Position in NED frame + * @param y [m] Y Position in NED frame + * @param z [m] Z Position in NED frame (note, altitude is negative in NED) + * @param vx [m/s] X velocity in NED frame + * @param vy [m/s] Y velocity in NED frame + * @param vz [m/s] Z velocity in NED frame + * @param afx [m/s/s] X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + * @param afy [m/s/s] Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + * @param afz [m/s/s] Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + * @param yaw [rad] yaw setpoint + * @param yaw_rate [rad/s] yaw rate setpoint * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_set_position_target_local_ned_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -258,22 +258,22 @@ static inline uint16_t mavlink_msg_set_position_target_local_ned_encode_chan(uin * @brief Send a set_position_target_local_ned message * @param chan MAVLink channel to send the message * - * @param time_boot_ms Timestamp in milliseconds since system boot - * @param target_system System ID - * @param target_component Component ID - * @param coordinate_frame Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9 - * @param type_mask Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate - * @param x X Position in NED frame in meters - * @param y Y Position in NED frame in meters - * @param z Z Position in NED frame in meters (note, altitude is negative in NED) - * @param vx X velocity in NED frame in meter / s - * @param vy Y velocity in NED frame in meter / s - * @param vz Z velocity in NED frame in meter / s - * @param afx X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N - * @param afy Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N - * @param afz Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N - * @param yaw yaw setpoint in rad - * @param yaw_rate yaw rate setpoint in rad/s + * @param time_boot_ms [ms] Timestamp (time since system boot). + * @param target_system System ID + * @param target_component Component ID + * @param coordinate_frame Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9 + * @param type_mask Bitmap to indicate which dimensions should be ignored by the vehicle. + * @param x [m] X Position in NED frame + * @param y [m] Y Position in NED frame + * @param z [m] Z Position in NED frame (note, altitude is negative in NED) + * @param vx [m/s] X velocity in NED frame + * @param vy [m/s] Y velocity in NED frame + * @param vz [m/s] Z velocity in NED frame + * @param afx [m/s/s] X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + * @param afy [m/s/s] Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + * @param afz [m/s/s] Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + * @param yaw [rad] yaw setpoint + * @param yaw_rate [rad/s] yaw rate setpoint */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -398,7 +398,7 @@ static inline void mavlink_msg_set_position_target_local_ned_send_buf(mavlink_me /** * @brief Get field time_boot_ms from set_position_target_local_ned message * - * @return Timestamp in milliseconds since system boot + * @return [ms] Timestamp (time since system boot). */ static inline uint32_t mavlink_msg_set_position_target_local_ned_get_time_boot_ms(const mavlink_message_t* msg) { @@ -408,7 +408,7 @@ static inline uint32_t mavlink_msg_set_position_target_local_ned_get_time_boot_m /** * @brief Get field target_system from set_position_target_local_ned message * - * @return System ID + * @return System ID */ static inline uint8_t mavlink_msg_set_position_target_local_ned_get_target_system(const mavlink_message_t* msg) { @@ -418,7 +418,7 @@ static inline uint8_t mavlink_msg_set_position_target_local_ned_get_target_syste /** * @brief Get field target_component from set_position_target_local_ned message * - * @return Component ID + * @return Component ID */ static inline uint8_t mavlink_msg_set_position_target_local_ned_get_target_component(const mavlink_message_t* msg) { @@ -428,7 +428,7 @@ static inline uint8_t mavlink_msg_set_position_target_local_ned_get_target_compo /** * @brief Get field coordinate_frame from set_position_target_local_ned message * - * @return Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9 + * @return Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9 */ static inline uint8_t mavlink_msg_set_position_target_local_ned_get_coordinate_frame(const mavlink_message_t* msg) { @@ -438,7 +438,7 @@ static inline uint8_t mavlink_msg_set_position_target_local_ned_get_coordinate_f /** * @brief Get field type_mask from set_position_target_local_ned message * - * @return Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate + * @return Bitmap to indicate which dimensions should be ignored by the vehicle. */ static inline uint16_t mavlink_msg_set_position_target_local_ned_get_type_mask(const mavlink_message_t* msg) { @@ -448,7 +448,7 @@ static inline uint16_t mavlink_msg_set_position_target_local_ned_get_type_mask(c /** * @brief Get field x from set_position_target_local_ned message * - * @return X Position in NED frame in meters + * @return [m] X Position in NED frame */ static inline float mavlink_msg_set_position_target_local_ned_get_x(const mavlink_message_t* msg) { @@ -458,7 +458,7 @@ static inline float mavlink_msg_set_position_target_local_ned_get_x(const mavlin /** * @brief Get field y from set_position_target_local_ned message * - * @return Y Position in NED frame in meters + * @return [m] Y Position in NED frame */ static inline float mavlink_msg_set_position_target_local_ned_get_y(const mavlink_message_t* msg) { @@ -468,7 +468,7 @@ static inline float mavlink_msg_set_position_target_local_ned_get_y(const mavlin /** * @brief Get field z from set_position_target_local_ned message * - * @return Z Position in NED frame in meters (note, altitude is negative in NED) + * @return [m] Z Position in NED frame (note, altitude is negative in NED) */ static inline float mavlink_msg_set_position_target_local_ned_get_z(const mavlink_message_t* msg) { @@ -478,7 +478,7 @@ static inline float mavlink_msg_set_position_target_local_ned_get_z(const mavlin /** * @brief Get field vx from set_position_target_local_ned message * - * @return X velocity in NED frame in meter / s + * @return [m/s] X velocity in NED frame */ static inline float mavlink_msg_set_position_target_local_ned_get_vx(const mavlink_message_t* msg) { @@ -488,7 +488,7 @@ static inline float mavlink_msg_set_position_target_local_ned_get_vx(const mavli /** * @brief Get field vy from set_position_target_local_ned message * - * @return Y velocity in NED frame in meter / s + * @return [m/s] Y velocity in NED frame */ static inline float mavlink_msg_set_position_target_local_ned_get_vy(const mavlink_message_t* msg) { @@ -498,7 +498,7 @@ static inline float mavlink_msg_set_position_target_local_ned_get_vy(const mavli /** * @brief Get field vz from set_position_target_local_ned message * - * @return Z velocity in NED frame in meter / s + * @return [m/s] Z velocity in NED frame */ static inline float mavlink_msg_set_position_target_local_ned_get_vz(const mavlink_message_t* msg) { @@ -508,7 +508,7 @@ static inline float mavlink_msg_set_position_target_local_ned_get_vz(const mavli /** * @brief Get field afx from set_position_target_local_ned message * - * @return X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + * @return [m/s/s] X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N */ static inline float mavlink_msg_set_position_target_local_ned_get_afx(const mavlink_message_t* msg) { @@ -518,7 +518,7 @@ static inline float mavlink_msg_set_position_target_local_ned_get_afx(const mavl /** * @brief Get field afy from set_position_target_local_ned message * - * @return Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + * @return [m/s/s] Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N */ static inline float mavlink_msg_set_position_target_local_ned_get_afy(const mavlink_message_t* msg) { @@ -528,7 +528,7 @@ static inline float mavlink_msg_set_position_target_local_ned_get_afy(const mavl /** * @brief Get field afz from set_position_target_local_ned message * - * @return Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + * @return [m/s/s] Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N */ static inline float mavlink_msg_set_position_target_local_ned_get_afz(const mavlink_message_t* msg) { @@ -538,7 +538,7 @@ static inline float mavlink_msg_set_position_target_local_ned_get_afz(const mavl /** * @brief Get field yaw from set_position_target_local_ned message * - * @return yaw setpoint in rad + * @return [rad] yaw setpoint */ static inline float mavlink_msg_set_position_target_local_ned_get_yaw(const mavlink_message_t* msg) { @@ -548,7 +548,7 @@ static inline float mavlink_msg_set_position_target_local_ned_get_yaw(const mavl /** * @brief Get field yaw_rate from set_position_target_local_ned message * - * @return yaw rate setpoint in rad/s + * @return [rad/s] yaw rate setpoint */ static inline float mavlink_msg_set_position_target_local_ned_get_yaw_rate(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_sim_state.h b/lib/main/MAVLink/common/mavlink_msg_sim_state.h index e49a07f1f4..b128b8d54b 100755 --- a/lib/main/MAVLink/common/mavlink_msg_sim_state.h +++ b/lib/main/MAVLink/common/mavlink_msg_sim_state.h @@ -3,30 +3,30 @@ #define MAVLINK_MSG_ID_SIM_STATE 108 -MAVPACKED( + typedef struct __mavlink_sim_state_t { - float q1; /*< True attitude quaternion component 1, w (1 in null-rotation)*/ - float q2; /*< True attitude quaternion component 2, x (0 in null-rotation)*/ - float q3; /*< True attitude quaternion component 3, y (0 in null-rotation)*/ - float q4; /*< True attitude quaternion component 4, z (0 in null-rotation)*/ - float roll; /*< Attitude roll expressed as Euler angles, not recommended except for human-readable outputs*/ - float pitch; /*< Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs*/ - float yaw; /*< Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs*/ - float xacc; /*< X acceleration m/s/s*/ - float yacc; /*< Y acceleration m/s/s*/ - float zacc; /*< Z acceleration m/s/s*/ - float xgyro; /*< Angular speed around X axis rad/s*/ - float ygyro; /*< Angular speed around Y axis rad/s*/ - float zgyro; /*< Angular speed around Z axis rad/s*/ - float lat; /*< Latitude in degrees*/ - float lon; /*< Longitude in degrees*/ - float alt; /*< Altitude in meters*/ - float std_dev_horz; /*< Horizontal position standard deviation*/ - float std_dev_vert; /*< Vertical position standard deviation*/ - float vn; /*< True velocity in m/s in NORTH direction in earth-fixed NED frame*/ - float ve; /*< True velocity in m/s in EAST direction in earth-fixed NED frame*/ - float vd; /*< True velocity in m/s in DOWN direction in earth-fixed NED frame*/ -}) mavlink_sim_state_t; + float q1; /*< True attitude quaternion component 1, w (1 in null-rotation)*/ + float q2; /*< True attitude quaternion component 2, x (0 in null-rotation)*/ + float q3; /*< True attitude quaternion component 3, y (0 in null-rotation)*/ + float q4; /*< True attitude quaternion component 4, z (0 in null-rotation)*/ + float roll; /*< Attitude roll expressed as Euler angles, not recommended except for human-readable outputs*/ + float pitch; /*< Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs*/ + float yaw; /*< Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs*/ + float xacc; /*< [m/s/s] X acceleration*/ + float yacc; /*< [m/s/s] Y acceleration*/ + float zacc; /*< [m/s/s] Z acceleration*/ + float xgyro; /*< [rad/s] Angular speed around X axis*/ + float ygyro; /*< [rad/s] Angular speed around Y axis*/ + float zgyro; /*< [rad/s] Angular speed around Z axis*/ + float lat; /*< [deg] Latitude*/ + float lon; /*< [deg] Longitude*/ + float alt; /*< [m] Altitude*/ + float std_dev_horz; /*< Horizontal position standard deviation*/ + float std_dev_vert; /*< Vertical position standard deviation*/ + float vn; /*< [m/s] True velocity in north direction in earth-fixed NED frame*/ + float ve; /*< [m/s] True velocity in east direction in earth-fixed NED frame*/ + float vd; /*< [m/s] True velocity in down direction in earth-fixed NED frame*/ +} mavlink_sim_state_t; #define MAVLINK_MSG_ID_SIM_STATE_LEN 84 #define MAVLINK_MSG_ID_SIM_STATE_MIN_LEN 84 @@ -101,27 +101,27 @@ typedef struct __mavlink_sim_state_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param q1 True attitude quaternion component 1, w (1 in null-rotation) - * @param q2 True attitude quaternion component 2, x (0 in null-rotation) - * @param q3 True attitude quaternion component 3, y (0 in null-rotation) - * @param q4 True attitude quaternion component 4, z (0 in null-rotation) - * @param roll Attitude roll expressed as Euler angles, not recommended except for human-readable outputs - * @param pitch Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs - * @param yaw Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs - * @param xacc X acceleration m/s/s - * @param yacc Y acceleration m/s/s - * @param zacc Z acceleration m/s/s - * @param xgyro Angular speed around X axis rad/s - * @param ygyro Angular speed around Y axis rad/s - * @param zgyro Angular speed around Z axis rad/s - * @param lat Latitude in degrees - * @param lon Longitude in degrees - * @param alt Altitude in meters - * @param std_dev_horz Horizontal position standard deviation - * @param std_dev_vert Vertical position standard deviation - * @param vn True velocity in m/s in NORTH direction in earth-fixed NED frame - * @param ve True velocity in m/s in EAST direction in earth-fixed NED frame - * @param vd True velocity in m/s in DOWN direction in earth-fixed NED frame + * @param q1 True attitude quaternion component 1, w (1 in null-rotation) + * @param q2 True attitude quaternion component 2, x (0 in null-rotation) + * @param q3 True attitude quaternion component 3, y (0 in null-rotation) + * @param q4 True attitude quaternion component 4, z (0 in null-rotation) + * @param roll Attitude roll expressed as Euler angles, not recommended except for human-readable outputs + * @param pitch Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs + * @param yaw Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs + * @param xacc [m/s/s] X acceleration + * @param yacc [m/s/s] Y acceleration + * @param zacc [m/s/s] Z acceleration + * @param xgyro [rad/s] Angular speed around X axis + * @param ygyro [rad/s] Angular speed around Y axis + * @param zgyro [rad/s] Angular speed around Z axis + * @param lat [deg] Latitude + * @param lon [deg] Longitude + * @param alt [m] Altitude + * @param std_dev_horz Horizontal position standard deviation + * @param std_dev_vert Vertical position standard deviation + * @param vn [m/s] True velocity in north direction in earth-fixed NED frame + * @param ve [m/s] True velocity in east direction in earth-fixed NED frame + * @param vd [m/s] True velocity in down direction in earth-fixed NED frame * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_sim_state_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -189,27 +189,27 @@ static inline uint16_t mavlink_msg_sim_state_pack(uint8_t system_id, uint8_t com * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param q1 True attitude quaternion component 1, w (1 in null-rotation) - * @param q2 True attitude quaternion component 2, x (0 in null-rotation) - * @param q3 True attitude quaternion component 3, y (0 in null-rotation) - * @param q4 True attitude quaternion component 4, z (0 in null-rotation) - * @param roll Attitude roll expressed as Euler angles, not recommended except for human-readable outputs - * @param pitch Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs - * @param yaw Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs - * @param xacc X acceleration m/s/s - * @param yacc Y acceleration m/s/s - * @param zacc Z acceleration m/s/s - * @param xgyro Angular speed around X axis rad/s - * @param ygyro Angular speed around Y axis rad/s - * @param zgyro Angular speed around Z axis rad/s - * @param lat Latitude in degrees - * @param lon Longitude in degrees - * @param alt Altitude in meters - * @param std_dev_horz Horizontal position standard deviation - * @param std_dev_vert Vertical position standard deviation - * @param vn True velocity in m/s in NORTH direction in earth-fixed NED frame - * @param ve True velocity in m/s in EAST direction in earth-fixed NED frame - * @param vd True velocity in m/s in DOWN direction in earth-fixed NED frame + * @param q1 True attitude quaternion component 1, w (1 in null-rotation) + * @param q2 True attitude quaternion component 2, x (0 in null-rotation) + * @param q3 True attitude quaternion component 3, y (0 in null-rotation) + * @param q4 True attitude quaternion component 4, z (0 in null-rotation) + * @param roll Attitude roll expressed as Euler angles, not recommended except for human-readable outputs + * @param pitch Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs + * @param yaw Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs + * @param xacc [m/s/s] X acceleration + * @param yacc [m/s/s] Y acceleration + * @param zacc [m/s/s] Z acceleration + * @param xgyro [rad/s] Angular speed around X axis + * @param ygyro [rad/s] Angular speed around Y axis + * @param zgyro [rad/s] Angular speed around Z axis + * @param lat [deg] Latitude + * @param lon [deg] Longitude + * @param alt [m] Altitude + * @param std_dev_horz Horizontal position standard deviation + * @param std_dev_vert Vertical position standard deviation + * @param vn [m/s] True velocity in north direction in earth-fixed NED frame + * @param ve [m/s] True velocity in east direction in earth-fixed NED frame + * @param vd [m/s] True velocity in down direction in earth-fixed NED frame * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_sim_state_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -303,27 +303,27 @@ static inline uint16_t mavlink_msg_sim_state_encode_chan(uint8_t system_id, uint * @brief Send a sim_state message * @param chan MAVLink channel to send the message * - * @param q1 True attitude quaternion component 1, w (1 in null-rotation) - * @param q2 True attitude quaternion component 2, x (0 in null-rotation) - * @param q3 True attitude quaternion component 3, y (0 in null-rotation) - * @param q4 True attitude quaternion component 4, z (0 in null-rotation) - * @param roll Attitude roll expressed as Euler angles, not recommended except for human-readable outputs - * @param pitch Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs - * @param yaw Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs - * @param xacc X acceleration m/s/s - * @param yacc Y acceleration m/s/s - * @param zacc Z acceleration m/s/s - * @param xgyro Angular speed around X axis rad/s - * @param ygyro Angular speed around Y axis rad/s - * @param zgyro Angular speed around Z axis rad/s - * @param lat Latitude in degrees - * @param lon Longitude in degrees - * @param alt Altitude in meters - * @param std_dev_horz Horizontal position standard deviation - * @param std_dev_vert Vertical position standard deviation - * @param vn True velocity in m/s in NORTH direction in earth-fixed NED frame - * @param ve True velocity in m/s in EAST direction in earth-fixed NED frame - * @param vd True velocity in m/s in DOWN direction in earth-fixed NED frame + * @param q1 True attitude quaternion component 1, w (1 in null-rotation) + * @param q2 True attitude quaternion component 2, x (0 in null-rotation) + * @param q3 True attitude quaternion component 3, y (0 in null-rotation) + * @param q4 True attitude quaternion component 4, z (0 in null-rotation) + * @param roll Attitude roll expressed as Euler angles, not recommended except for human-readable outputs + * @param pitch Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs + * @param yaw Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs + * @param xacc [m/s/s] X acceleration + * @param yacc [m/s/s] Y acceleration + * @param zacc [m/s/s] Z acceleration + * @param xgyro [rad/s] Angular speed around X axis + * @param ygyro [rad/s] Angular speed around Y axis + * @param zgyro [rad/s] Angular speed around Z axis + * @param lat [deg] Latitude + * @param lon [deg] Longitude + * @param alt [m] Altitude + * @param std_dev_horz Horizontal position standard deviation + * @param std_dev_vert Vertical position standard deviation + * @param vn [m/s] True velocity in north direction in earth-fixed NED frame + * @param ve [m/s] True velocity in east direction in earth-fixed NED frame + * @param vd [m/s] True velocity in down direction in earth-fixed NED frame */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -468,7 +468,7 @@ static inline void mavlink_msg_sim_state_send_buf(mavlink_message_t *msgbuf, mav /** * @brief Get field q1 from sim_state message * - * @return True attitude quaternion component 1, w (1 in null-rotation) + * @return True attitude quaternion component 1, w (1 in null-rotation) */ static inline float mavlink_msg_sim_state_get_q1(const mavlink_message_t* msg) { @@ -478,7 +478,7 @@ static inline float mavlink_msg_sim_state_get_q1(const mavlink_message_t* msg) /** * @brief Get field q2 from sim_state message * - * @return True attitude quaternion component 2, x (0 in null-rotation) + * @return True attitude quaternion component 2, x (0 in null-rotation) */ static inline float mavlink_msg_sim_state_get_q2(const mavlink_message_t* msg) { @@ -488,7 +488,7 @@ static inline float mavlink_msg_sim_state_get_q2(const mavlink_message_t* msg) /** * @brief Get field q3 from sim_state message * - * @return True attitude quaternion component 3, y (0 in null-rotation) + * @return True attitude quaternion component 3, y (0 in null-rotation) */ static inline float mavlink_msg_sim_state_get_q3(const mavlink_message_t* msg) { @@ -498,7 +498,7 @@ static inline float mavlink_msg_sim_state_get_q3(const mavlink_message_t* msg) /** * @brief Get field q4 from sim_state message * - * @return True attitude quaternion component 4, z (0 in null-rotation) + * @return True attitude quaternion component 4, z (0 in null-rotation) */ static inline float mavlink_msg_sim_state_get_q4(const mavlink_message_t* msg) { @@ -508,7 +508,7 @@ static inline float mavlink_msg_sim_state_get_q4(const mavlink_message_t* msg) /** * @brief Get field roll from sim_state message * - * @return Attitude roll expressed as Euler angles, not recommended except for human-readable outputs + * @return Attitude roll expressed as Euler angles, not recommended except for human-readable outputs */ static inline float mavlink_msg_sim_state_get_roll(const mavlink_message_t* msg) { @@ -518,7 +518,7 @@ static inline float mavlink_msg_sim_state_get_roll(const mavlink_message_t* msg) /** * @brief Get field pitch from sim_state message * - * @return Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs + * @return Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs */ static inline float mavlink_msg_sim_state_get_pitch(const mavlink_message_t* msg) { @@ -528,7 +528,7 @@ static inline float mavlink_msg_sim_state_get_pitch(const mavlink_message_t* msg /** * @brief Get field yaw from sim_state message * - * @return Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs + * @return Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs */ static inline float mavlink_msg_sim_state_get_yaw(const mavlink_message_t* msg) { @@ -538,7 +538,7 @@ static inline float mavlink_msg_sim_state_get_yaw(const mavlink_message_t* msg) /** * @brief Get field xacc from sim_state message * - * @return X acceleration m/s/s + * @return [m/s/s] X acceleration */ static inline float mavlink_msg_sim_state_get_xacc(const mavlink_message_t* msg) { @@ -548,7 +548,7 @@ static inline float mavlink_msg_sim_state_get_xacc(const mavlink_message_t* msg) /** * @brief Get field yacc from sim_state message * - * @return Y acceleration m/s/s + * @return [m/s/s] Y acceleration */ static inline float mavlink_msg_sim_state_get_yacc(const mavlink_message_t* msg) { @@ -558,7 +558,7 @@ static inline float mavlink_msg_sim_state_get_yacc(const mavlink_message_t* msg) /** * @brief Get field zacc from sim_state message * - * @return Z acceleration m/s/s + * @return [m/s/s] Z acceleration */ static inline float mavlink_msg_sim_state_get_zacc(const mavlink_message_t* msg) { @@ -568,7 +568,7 @@ static inline float mavlink_msg_sim_state_get_zacc(const mavlink_message_t* msg) /** * @brief Get field xgyro from sim_state message * - * @return Angular speed around X axis rad/s + * @return [rad/s] Angular speed around X axis */ static inline float mavlink_msg_sim_state_get_xgyro(const mavlink_message_t* msg) { @@ -578,7 +578,7 @@ static inline float mavlink_msg_sim_state_get_xgyro(const mavlink_message_t* msg /** * @brief Get field ygyro from sim_state message * - * @return Angular speed around Y axis rad/s + * @return [rad/s] Angular speed around Y axis */ static inline float mavlink_msg_sim_state_get_ygyro(const mavlink_message_t* msg) { @@ -588,7 +588,7 @@ static inline float mavlink_msg_sim_state_get_ygyro(const mavlink_message_t* msg /** * @brief Get field zgyro from sim_state message * - * @return Angular speed around Z axis rad/s + * @return [rad/s] Angular speed around Z axis */ static inline float mavlink_msg_sim_state_get_zgyro(const mavlink_message_t* msg) { @@ -598,7 +598,7 @@ static inline float mavlink_msg_sim_state_get_zgyro(const mavlink_message_t* msg /** * @brief Get field lat from sim_state message * - * @return Latitude in degrees + * @return [deg] Latitude */ static inline float mavlink_msg_sim_state_get_lat(const mavlink_message_t* msg) { @@ -608,7 +608,7 @@ static inline float mavlink_msg_sim_state_get_lat(const mavlink_message_t* msg) /** * @brief Get field lon from sim_state message * - * @return Longitude in degrees + * @return [deg] Longitude */ static inline float mavlink_msg_sim_state_get_lon(const mavlink_message_t* msg) { @@ -618,7 +618,7 @@ static inline float mavlink_msg_sim_state_get_lon(const mavlink_message_t* msg) /** * @brief Get field alt from sim_state message * - * @return Altitude in meters + * @return [m] Altitude */ static inline float mavlink_msg_sim_state_get_alt(const mavlink_message_t* msg) { @@ -628,7 +628,7 @@ static inline float mavlink_msg_sim_state_get_alt(const mavlink_message_t* msg) /** * @brief Get field std_dev_horz from sim_state message * - * @return Horizontal position standard deviation + * @return Horizontal position standard deviation */ static inline float mavlink_msg_sim_state_get_std_dev_horz(const mavlink_message_t* msg) { @@ -638,7 +638,7 @@ static inline float mavlink_msg_sim_state_get_std_dev_horz(const mavlink_message /** * @brief Get field std_dev_vert from sim_state message * - * @return Vertical position standard deviation + * @return Vertical position standard deviation */ static inline float mavlink_msg_sim_state_get_std_dev_vert(const mavlink_message_t* msg) { @@ -648,7 +648,7 @@ static inline float mavlink_msg_sim_state_get_std_dev_vert(const mavlink_message /** * @brief Get field vn from sim_state message * - * @return True velocity in m/s in NORTH direction in earth-fixed NED frame + * @return [m/s] True velocity in north direction in earth-fixed NED frame */ static inline float mavlink_msg_sim_state_get_vn(const mavlink_message_t* msg) { @@ -658,7 +658,7 @@ static inline float mavlink_msg_sim_state_get_vn(const mavlink_message_t* msg) /** * @brief Get field ve from sim_state message * - * @return True velocity in m/s in EAST direction in earth-fixed NED frame + * @return [m/s] True velocity in east direction in earth-fixed NED frame */ static inline float mavlink_msg_sim_state_get_ve(const mavlink_message_t* msg) { @@ -668,7 +668,7 @@ static inline float mavlink_msg_sim_state_get_ve(const mavlink_message_t* msg) /** * @brief Get field vd from sim_state message * - * @return True velocity in m/s in DOWN direction in earth-fixed NED frame + * @return [m/s] True velocity in down direction in earth-fixed NED frame */ static inline float mavlink_msg_sim_state_get_vd(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_statustext.h b/lib/main/MAVLink/common/mavlink_msg_statustext.h index e1ed320a3d..2193fac839 100755 --- a/lib/main/MAVLink/common/mavlink_msg_statustext.h +++ b/lib/main/MAVLink/common/mavlink_msg_statustext.h @@ -3,11 +3,11 @@ #define MAVLINK_MSG_ID_STATUSTEXT 253 -MAVPACKED( + typedef struct __mavlink_statustext_t { - uint8_t severity; /*< Severity of status. Relies on the definitions within RFC-5424. See enum MAV_SEVERITY.*/ - char text[50]; /*< Status text message, without null termination character*/ -}) mavlink_statustext_t; + uint8_t severity; /*< Severity of status. Relies on the definitions within RFC-5424.*/ + char text[50]; /*< Status text message, without null termination character*/ +} mavlink_statustext_t; #define MAVLINK_MSG_ID_STATUSTEXT_LEN 51 #define MAVLINK_MSG_ID_STATUSTEXT_MIN_LEN 51 @@ -44,8 +44,8 @@ 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. Relies on the definitions within RFC-5424. See enum MAV_SEVERITY. - * @param text Status text message, without null termination character + * @param severity Severity of status. Relies on the definitions within RFC-5424. + * @param text Status text message, without null termination character * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_statustext_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -73,8 +73,8 @@ 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 will be sent over * @param msg The MAVLink message to compress the data into - * @param severity Severity of status. Relies on the definitions within RFC-5424. See enum MAV_SEVERITY. - * @param text Status text message, without null termination character + * @param severity Severity of status. Relies on the definitions within RFC-5424. + * @param text Status text message, without null termination character * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_statustext_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -128,8 +128,8 @@ static inline uint16_t mavlink_msg_statustext_encode_chan(uint8_t system_id, uin * @brief Send a statustext message * @param chan MAVLink channel to send the message * - * @param severity Severity of status. Relies on the definitions within RFC-5424. See enum MAV_SEVERITY. - * @param text Status text message, without null termination character + * @param severity Severity of status. Relies on the definitions within RFC-5424. + * @param text Status text message, without null termination character */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -194,7 +194,7 @@ static inline void mavlink_msg_statustext_send_buf(mavlink_message_t *msgbuf, ma /** * @brief Get field severity from statustext message * - * @return Severity of status. Relies on the definitions within RFC-5424. See enum MAV_SEVERITY. + * @return Severity of status. Relies on the definitions within RFC-5424. */ static inline uint8_t mavlink_msg_statustext_get_severity(const mavlink_message_t* msg) { @@ -204,7 +204,7 @@ static inline uint8_t mavlink_msg_statustext_get_severity(const mavlink_message_ /** * @brief Get field text from statustext message * - * @return Status text message, without null termination character + * @return Status text message, without null termination character */ static inline uint16_t mavlink_msg_statustext_get_text(const mavlink_message_t* msg, char *text) { diff --git a/lib/main/MAVLink/common/mavlink_msg_sys_status.h b/lib/main/MAVLink/common/mavlink_msg_sys_status.h index 28a85b53f5..301302a14c 100755 --- a/lib/main/MAVLink/common/mavlink_msg_sys_status.h +++ b/lib/main/MAVLink/common/mavlink_msg_sys_status.h @@ -3,22 +3,22 @@ #define MAVLINK_MSG_ID_SYS_STATUS 1 -MAVPACKED( + typedef struct __mavlink_sys_status_t { - uint32_t onboard_control_sensors_present; /*< Bitmask showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present. Indices defined by ENUM MAV_SYS_STATUS_SENSOR*/ - uint32_t onboard_control_sensors_enabled; /*< Bitmask showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled. Indices defined by ENUM MAV_SYS_STATUS_SENSOR*/ - uint32_t onboard_control_sensors_health; /*< Bitmask showing which onboard controllers and sensors are operational or have an error: Value of 0: not enabled. Value of 1: enabled. Indices defined by ENUM MAV_SYS_STATUS_SENSOR*/ - uint16_t load; /*< Maximum usage in percent of the mainloop time, (0%: 0, 100%: 1000) should be always below 1000*/ - uint16_t voltage_battery; /*< Battery voltage, in millivolts (1 = 1 millivolt)*/ - int16_t current_battery; /*< Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current*/ - uint16_t drop_rate_comm; /*< Communication drops in percent, (0%: 0, 100%: 10'000), (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)*/ - uint16_t errors_comm; /*< Communication errors (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)*/ - uint16_t errors_count1; /*< Autopilot-specific errors*/ - uint16_t errors_count2; /*< Autopilot-specific errors*/ - uint16_t errors_count3; /*< Autopilot-specific errors*/ - uint16_t errors_count4; /*< Autopilot-specific errors*/ - int8_t battery_remaining; /*< Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot estimate the remaining battery*/ -}) mavlink_sys_status_t; + uint32_t onboard_control_sensors_present; /*< Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present.*/ + uint32_t onboard_control_sensors_enabled; /*< Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled.*/ + uint32_t onboard_control_sensors_health; /*< Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy.*/ + uint16_t load; /*< [d%] Maximum usage in percent of the mainloop time. Values: [0-1000] - should always be below 1000*/ + uint16_t voltage_battery; /*< [mV] Battery voltage, UINT16_MAX: Voltage not sent by autopilot*/ + int16_t current_battery; /*< [cA] Battery current, -1: Current not sent by autopilot*/ + uint16_t drop_rate_comm; /*< [c%] Communication drop rate, (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)*/ + uint16_t errors_comm; /*< Communication errors (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)*/ + uint16_t errors_count1; /*< Autopilot-specific errors*/ + uint16_t errors_count2; /*< Autopilot-specific errors*/ + uint16_t errors_count3; /*< Autopilot-specific errors*/ + uint16_t errors_count4; /*< Autopilot-specific errors*/ + int8_t battery_remaining; /*< [%] Battery energy remaining, -1: Battery remaining energy not sent by autopilot*/ +} mavlink_sys_status_t; #define MAVLINK_MSG_ID_SYS_STATUS_LEN 31 #define MAVLINK_MSG_ID_SYS_STATUS_MIN_LEN 31 @@ -41,13 +41,13 @@ typedef struct __mavlink_sys_status_t { { "load", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_sys_status_t, load) }, \ { "voltage_battery", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_sys_status_t, voltage_battery) }, \ { "current_battery", NULL, MAVLINK_TYPE_INT16_T, 0, 16, offsetof(mavlink_sys_status_t, current_battery) }, \ + { "battery_remaining", NULL, MAVLINK_TYPE_INT8_T, 0, 30, offsetof(mavlink_sys_status_t, battery_remaining) }, \ { "drop_rate_comm", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_sys_status_t, drop_rate_comm) }, \ { "errors_comm", NULL, MAVLINK_TYPE_UINT16_T, 0, 20, offsetof(mavlink_sys_status_t, errors_comm) }, \ { "errors_count1", NULL, MAVLINK_TYPE_UINT16_T, 0, 22, offsetof(mavlink_sys_status_t, errors_count1) }, \ { "errors_count2", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_sys_status_t, errors_count2) }, \ { "errors_count3", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_sys_status_t, errors_count3) }, \ { "errors_count4", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_sys_status_t, errors_count4) }, \ - { "battery_remaining", NULL, MAVLINK_TYPE_INT8_T, 0, 30, offsetof(mavlink_sys_status_t, battery_remaining) }, \ } \ } #else @@ -60,13 +60,13 @@ typedef struct __mavlink_sys_status_t { { "load", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_sys_status_t, load) }, \ { "voltage_battery", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_sys_status_t, voltage_battery) }, \ { "current_battery", NULL, MAVLINK_TYPE_INT16_T, 0, 16, offsetof(mavlink_sys_status_t, current_battery) }, \ + { "battery_remaining", NULL, MAVLINK_TYPE_INT8_T, 0, 30, offsetof(mavlink_sys_status_t, battery_remaining) }, \ { "drop_rate_comm", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_sys_status_t, drop_rate_comm) }, \ { "errors_comm", NULL, MAVLINK_TYPE_UINT16_T, 0, 20, offsetof(mavlink_sys_status_t, errors_comm) }, \ { "errors_count1", NULL, MAVLINK_TYPE_UINT16_T, 0, 22, offsetof(mavlink_sys_status_t, errors_count1) }, \ { "errors_count2", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_sys_status_t, errors_count2) }, \ { "errors_count3", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_sys_status_t, errors_count3) }, \ { "errors_count4", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_sys_status_t, errors_count4) }, \ - { "battery_remaining", NULL, MAVLINK_TYPE_INT8_T, 0, 30, offsetof(mavlink_sys_status_t, battery_remaining) }, \ } \ } #endif @@ -77,19 +77,19 @@ typedef struct __mavlink_sys_status_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param onboard_control_sensors_present Bitmask showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present. Indices defined by ENUM MAV_SYS_STATUS_SENSOR - * @param onboard_control_sensors_enabled Bitmask showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled. Indices defined by ENUM MAV_SYS_STATUS_SENSOR - * @param onboard_control_sensors_health Bitmask showing which onboard controllers and sensors are operational or have an error: Value of 0: not enabled. Value of 1: enabled. Indices defined by ENUM MAV_SYS_STATUS_SENSOR - * @param load Maximum usage in percent of the mainloop time, (0%: 0, 100%: 1000) should be always below 1000 - * @param voltage_battery Battery voltage, in millivolts (1 = 1 millivolt) - * @param current_battery Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current - * @param battery_remaining Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot estimate the remaining battery - * @param drop_rate_comm Communication drops in percent, (0%: 0, 100%: 10'000), (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV) - * @param errors_comm Communication errors (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV) - * @param errors_count1 Autopilot-specific errors - * @param errors_count2 Autopilot-specific errors - * @param errors_count3 Autopilot-specific errors - * @param errors_count4 Autopilot-specific errors + * @param onboard_control_sensors_present Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present. + * @param onboard_control_sensors_enabled Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled. + * @param onboard_control_sensors_health Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy. + * @param load [d%] Maximum usage in percent of the mainloop time. Values: [0-1000] - should always be below 1000 + * @param voltage_battery [mV] Battery voltage, UINT16_MAX: Voltage not sent by autopilot + * @param current_battery [cA] Battery current, -1: Current not sent by autopilot + * @param battery_remaining [%] Battery energy remaining, -1: Battery remaining energy not sent by autopilot + * @param drop_rate_comm [c%] Communication drop rate, (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV) + * @param errors_comm Communication errors (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV) + * @param errors_count1 Autopilot-specific errors + * @param errors_count2 Autopilot-specific errors + * @param errors_count3 Autopilot-specific errors + * @param errors_count4 Autopilot-specific errors * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_sys_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -141,19 +141,19 @@ static inline uint16_t mavlink_msg_sys_status_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 will be sent over * @param msg The MAVLink message to compress the data into - * @param onboard_control_sensors_present Bitmask showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present. Indices defined by ENUM MAV_SYS_STATUS_SENSOR - * @param onboard_control_sensors_enabled Bitmask showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled. Indices defined by ENUM MAV_SYS_STATUS_SENSOR - * @param onboard_control_sensors_health Bitmask showing which onboard controllers and sensors are operational or have an error: Value of 0: not enabled. Value of 1: enabled. Indices defined by ENUM MAV_SYS_STATUS_SENSOR - * @param load Maximum usage in percent of the mainloop time, (0%: 0, 100%: 1000) should be always below 1000 - * @param voltage_battery Battery voltage, in millivolts (1 = 1 millivolt) - * @param current_battery Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current - * @param battery_remaining Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot estimate the remaining battery - * @param drop_rate_comm Communication drops in percent, (0%: 0, 100%: 10'000), (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV) - * @param errors_comm Communication errors (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV) - * @param errors_count1 Autopilot-specific errors - * @param errors_count2 Autopilot-specific errors - * @param errors_count3 Autopilot-specific errors - * @param errors_count4 Autopilot-specific errors + * @param onboard_control_sensors_present Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present. + * @param onboard_control_sensors_enabled Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled. + * @param onboard_control_sensors_health Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy. + * @param load [d%] Maximum usage in percent of the mainloop time. Values: [0-1000] - should always be below 1000 + * @param voltage_battery [mV] Battery voltage, UINT16_MAX: Voltage not sent by autopilot + * @param current_battery [cA] Battery current, -1: Current not sent by autopilot + * @param battery_remaining [%] Battery energy remaining, -1: Battery remaining energy not sent by autopilot + * @param drop_rate_comm [c%] Communication drop rate, (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV) + * @param errors_comm Communication errors (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV) + * @param errors_count1 Autopilot-specific errors + * @param errors_count2 Autopilot-specific errors + * @param errors_count3 Autopilot-specific errors + * @param errors_count4 Autopilot-specific errors * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_sys_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -231,19 +231,19 @@ static inline uint16_t mavlink_msg_sys_status_encode_chan(uint8_t system_id, uin * @brief Send a sys_status message * @param chan MAVLink channel to send the message * - * @param onboard_control_sensors_present Bitmask showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present. Indices defined by ENUM MAV_SYS_STATUS_SENSOR - * @param onboard_control_sensors_enabled Bitmask showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled. Indices defined by ENUM MAV_SYS_STATUS_SENSOR - * @param onboard_control_sensors_health Bitmask showing which onboard controllers and sensors are operational or have an error: Value of 0: not enabled. Value of 1: enabled. Indices defined by ENUM MAV_SYS_STATUS_SENSOR - * @param load Maximum usage in percent of the mainloop time, (0%: 0, 100%: 1000) should be always below 1000 - * @param voltage_battery Battery voltage, in millivolts (1 = 1 millivolt) - * @param current_battery Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current - * @param battery_remaining Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot estimate the remaining battery - * @param drop_rate_comm Communication drops in percent, (0%: 0, 100%: 10'000), (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV) - * @param errors_comm Communication errors (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV) - * @param errors_count1 Autopilot-specific errors - * @param errors_count2 Autopilot-specific errors - * @param errors_count3 Autopilot-specific errors - * @param errors_count4 Autopilot-specific errors + * @param onboard_control_sensors_present Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present. + * @param onboard_control_sensors_enabled Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled. + * @param onboard_control_sensors_health Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy. + * @param load [d%] Maximum usage in percent of the mainloop time. Values: [0-1000] - should always be below 1000 + * @param voltage_battery [mV] Battery voltage, UINT16_MAX: Voltage not sent by autopilot + * @param current_battery [cA] Battery current, -1: Current not sent by autopilot + * @param battery_remaining [%] Battery energy remaining, -1: Battery remaining energy not sent by autopilot + * @param drop_rate_comm [c%] Communication drop rate, (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV) + * @param errors_comm Communication errors (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV) + * @param errors_count1 Autopilot-specific errors + * @param errors_count2 Autopilot-specific errors + * @param errors_count3 Autopilot-specific errors + * @param errors_count4 Autopilot-specific errors */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -356,7 +356,7 @@ static inline void mavlink_msg_sys_status_send_buf(mavlink_message_t *msgbuf, ma /** * @brief Get field onboard_control_sensors_present from sys_status message * - * @return Bitmask showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present. Indices defined by ENUM MAV_SYS_STATUS_SENSOR + * @return Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present. */ static inline uint32_t mavlink_msg_sys_status_get_onboard_control_sensors_present(const mavlink_message_t* msg) { @@ -366,7 +366,7 @@ static inline uint32_t mavlink_msg_sys_status_get_onboard_control_sensors_presen /** * @brief Get field onboard_control_sensors_enabled from sys_status message * - * @return Bitmask showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled. Indices defined by ENUM MAV_SYS_STATUS_SENSOR + * @return Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled. */ static inline uint32_t mavlink_msg_sys_status_get_onboard_control_sensors_enabled(const mavlink_message_t* msg) { @@ -376,7 +376,7 @@ static inline uint32_t mavlink_msg_sys_status_get_onboard_control_sensors_enable /** * @brief Get field onboard_control_sensors_health from sys_status message * - * @return Bitmask showing which onboard controllers and sensors are operational or have an error: Value of 0: not enabled. Value of 1: enabled. Indices defined by ENUM MAV_SYS_STATUS_SENSOR + * @return Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy. */ static inline uint32_t mavlink_msg_sys_status_get_onboard_control_sensors_health(const mavlink_message_t* msg) { @@ -386,7 +386,7 @@ static inline uint32_t mavlink_msg_sys_status_get_onboard_control_sensors_health /** * @brief Get field load from sys_status message * - * @return Maximum usage in percent of the mainloop time, (0%: 0, 100%: 1000) should be always below 1000 + * @return [d%] Maximum usage in percent of the mainloop time. Values: [0-1000] - should always be below 1000 */ static inline uint16_t mavlink_msg_sys_status_get_load(const mavlink_message_t* msg) { @@ -396,7 +396,7 @@ static inline uint16_t mavlink_msg_sys_status_get_load(const mavlink_message_t* /** * @brief Get field voltage_battery from sys_status message * - * @return Battery voltage, in millivolts (1 = 1 millivolt) + * @return [mV] Battery voltage, UINT16_MAX: Voltage not sent by autopilot */ static inline uint16_t mavlink_msg_sys_status_get_voltage_battery(const mavlink_message_t* msg) { @@ -406,7 +406,7 @@ static inline uint16_t mavlink_msg_sys_status_get_voltage_battery(const mavlink_ /** * @brief Get field current_battery from sys_status message * - * @return Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current + * @return [cA] Battery current, -1: Current not sent by autopilot */ static inline int16_t mavlink_msg_sys_status_get_current_battery(const mavlink_message_t* msg) { @@ -416,7 +416,7 @@ static inline int16_t mavlink_msg_sys_status_get_current_battery(const mavlink_m /** * @brief Get field battery_remaining from sys_status message * - * @return Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot estimate the remaining battery + * @return [%] Battery energy remaining, -1: Battery remaining energy not sent by autopilot */ static inline int8_t mavlink_msg_sys_status_get_battery_remaining(const mavlink_message_t* msg) { @@ -426,7 +426,7 @@ static inline int8_t mavlink_msg_sys_status_get_battery_remaining(const mavlink_ /** * @brief Get field drop_rate_comm from sys_status message * - * @return Communication drops in percent, (0%: 0, 100%: 10'000), (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV) + * @return [c%] Communication drop rate, (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV) */ static inline uint16_t mavlink_msg_sys_status_get_drop_rate_comm(const mavlink_message_t* msg) { @@ -436,7 +436,7 @@ static inline uint16_t mavlink_msg_sys_status_get_drop_rate_comm(const mavlink_m /** * @brief Get field errors_comm from sys_status message * - * @return Communication errors (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV) + * @return Communication errors (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV) */ static inline uint16_t mavlink_msg_sys_status_get_errors_comm(const mavlink_message_t* msg) { @@ -446,7 +446,7 @@ static inline uint16_t mavlink_msg_sys_status_get_errors_comm(const mavlink_mess /** * @brief Get field errors_count1 from sys_status message * - * @return Autopilot-specific errors + * @return Autopilot-specific errors */ static inline uint16_t mavlink_msg_sys_status_get_errors_count1(const mavlink_message_t* msg) { @@ -456,7 +456,7 @@ static inline uint16_t mavlink_msg_sys_status_get_errors_count1(const mavlink_me /** * @brief Get field errors_count2 from sys_status message * - * @return Autopilot-specific errors + * @return Autopilot-specific errors */ static inline uint16_t mavlink_msg_sys_status_get_errors_count2(const mavlink_message_t* msg) { @@ -466,7 +466,7 @@ static inline uint16_t mavlink_msg_sys_status_get_errors_count2(const mavlink_me /** * @brief Get field errors_count3 from sys_status message * - * @return Autopilot-specific errors + * @return Autopilot-specific errors */ static inline uint16_t mavlink_msg_sys_status_get_errors_count3(const mavlink_message_t* msg) { @@ -476,7 +476,7 @@ static inline uint16_t mavlink_msg_sys_status_get_errors_count3(const mavlink_me /** * @brief Get field errors_count4 from sys_status message * - * @return Autopilot-specific errors + * @return Autopilot-specific errors */ static inline uint16_t mavlink_msg_sys_status_get_errors_count4(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_system_time.h b/lib/main/MAVLink/common/mavlink_msg_system_time.h index 0e9b2ce5a8..a3848c7419 100755 --- a/lib/main/MAVLink/common/mavlink_msg_system_time.h +++ b/lib/main/MAVLink/common/mavlink_msg_system_time.h @@ -3,11 +3,11 @@ #define MAVLINK_MSG_ID_SYSTEM_TIME 2 -MAVPACKED( + typedef struct __mavlink_system_time_t { - uint64_t time_unix_usec; /*< Timestamp of the master clock in microseconds since UNIX epoch.*/ - uint32_t time_boot_ms; /*< Timestamp of the component clock since boot time in milliseconds.*/ -}) mavlink_system_time_t; + uint64_t time_unix_usec; /*< [us] Timestamp (UNIX epoch time).*/ + uint32_t time_boot_ms; /*< [ms] Timestamp (time since system boot).*/ +} mavlink_system_time_t; #define MAVLINK_MSG_ID_SYSTEM_TIME_LEN 12 #define MAVLINK_MSG_ID_SYSTEM_TIME_MIN_LEN 12 @@ -44,8 +44,8 @@ typedef struct __mavlink_system_time_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param time_unix_usec Timestamp of the master clock in microseconds since UNIX epoch. - * @param time_boot_ms Timestamp of the component clock since boot time in milliseconds. + * @param time_unix_usec [us] Timestamp (UNIX epoch time). + * @param time_boot_ms [ms] Timestamp (time since system boot). * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_system_time_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -75,8 +75,8 @@ static inline uint16_t mavlink_msg_system_time_pack(uint8_t system_id, uint8_t c * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param time_unix_usec Timestamp of the master clock in microseconds since UNIX epoch. - * @param time_boot_ms Timestamp of the component clock since boot time in milliseconds. + * @param time_unix_usec [us] Timestamp (UNIX epoch time). + * @param time_boot_ms [ms] Timestamp (time since system boot). * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_system_time_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -132,8 +132,8 @@ static inline uint16_t mavlink_msg_system_time_encode_chan(uint8_t system_id, ui * @brief Send a system_time message * @param chan MAVLink channel to send the message * - * @param time_unix_usec Timestamp of the master clock in microseconds since UNIX epoch. - * @param time_boot_ms Timestamp of the component clock since boot time in milliseconds. + * @param time_unix_usec [us] Timestamp (UNIX epoch time). + * @param time_boot_ms [ms] Timestamp (time since system boot). */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -202,7 +202,7 @@ static inline void mavlink_msg_system_time_send_buf(mavlink_message_t *msgbuf, m /** * @brief Get field time_unix_usec from system_time message * - * @return Timestamp of the master clock in microseconds since UNIX epoch. + * @return [us] Timestamp (UNIX epoch time). */ static inline uint64_t mavlink_msg_system_time_get_time_unix_usec(const mavlink_message_t* msg) { @@ -212,7 +212,7 @@ static inline uint64_t mavlink_msg_system_time_get_time_unix_usec(const mavlink_ /** * @brief Get field time_boot_ms from system_time message * - * @return Timestamp of the component clock since boot time in milliseconds. + * @return [ms] Timestamp (time since system boot). */ static inline uint32_t mavlink_msg_system_time_get_time_boot_ms(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_terrain_check.h b/lib/main/MAVLink/common/mavlink_msg_terrain_check.h index 820ff336c5..74afd52eea 100755 --- a/lib/main/MAVLink/common/mavlink_msg_terrain_check.h +++ b/lib/main/MAVLink/common/mavlink_msg_terrain_check.h @@ -3,11 +3,11 @@ #define MAVLINK_MSG_ID_TERRAIN_CHECK 135 -MAVPACKED( + typedef struct __mavlink_terrain_check_t { - int32_t lat; /*< Latitude (degrees *10^7)*/ - int32_t lon; /*< Longitude (degrees *10^7)*/ -}) mavlink_terrain_check_t; + int32_t lat; /*< [degE7] Latitude*/ + int32_t lon; /*< [degE7] Longitude*/ +} mavlink_terrain_check_t; #define MAVLINK_MSG_ID_TERRAIN_CHECK_LEN 8 #define MAVLINK_MSG_ID_TERRAIN_CHECK_MIN_LEN 8 @@ -44,8 +44,8 @@ typedef struct __mavlink_terrain_check_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param lat Latitude (degrees *10^7) - * @param lon Longitude (degrees *10^7) + * @param lat [degE7] Latitude + * @param lon [degE7] Longitude * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_terrain_check_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -75,8 +75,8 @@ static inline uint16_t mavlink_msg_terrain_check_pack(uint8_t system_id, uint8_t * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param lat Latitude (degrees *10^7) - * @param lon Longitude (degrees *10^7) + * @param lat [degE7] Latitude + * @param lon [degE7] Longitude * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_terrain_check_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -132,8 +132,8 @@ static inline uint16_t mavlink_msg_terrain_check_encode_chan(uint8_t system_id, * @brief Send a terrain_check message * @param chan MAVLink channel to send the message * - * @param lat Latitude (degrees *10^7) - * @param lon Longitude (degrees *10^7) + * @param lat [degE7] Latitude + * @param lon [degE7] Longitude */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -202,7 +202,7 @@ static inline void mavlink_msg_terrain_check_send_buf(mavlink_message_t *msgbuf, /** * @brief Get field lat from terrain_check message * - * @return Latitude (degrees *10^7) + * @return [degE7] Latitude */ static inline int32_t mavlink_msg_terrain_check_get_lat(const mavlink_message_t* msg) { @@ -212,7 +212,7 @@ static inline int32_t mavlink_msg_terrain_check_get_lat(const mavlink_message_t* /** * @brief Get field lon from terrain_check message * - * @return Longitude (degrees *10^7) + * @return [degE7] Longitude */ static inline int32_t mavlink_msg_terrain_check_get_lon(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_terrain_data.h b/lib/main/MAVLink/common/mavlink_msg_terrain_data.h index ac9b9be650..3099502cab 100755 --- a/lib/main/MAVLink/common/mavlink_msg_terrain_data.h +++ b/lib/main/MAVLink/common/mavlink_msg_terrain_data.h @@ -3,14 +3,14 @@ #define MAVLINK_MSG_ID_TERRAIN_DATA 134 -MAVPACKED( + typedef struct __mavlink_terrain_data_t { - int32_t lat; /*< Latitude of SW corner of first grid (degrees *10^7)*/ - int32_t lon; /*< Longitude of SW corner of first grid (in degrees *10^7)*/ - uint16_t grid_spacing; /*< Grid spacing in meters*/ - int16_t data[16]; /*< Terrain data in meters AMSL*/ - uint8_t gridbit; /*< bit within the terrain request mask*/ -}) mavlink_terrain_data_t; + int32_t lat; /*< [degE7] Latitude of SW corner of first grid*/ + int32_t lon; /*< [degE7] Longitude of SW corner of first grid*/ + uint16_t grid_spacing; /*< [m] Grid spacing*/ + int16_t data[16]; /*< [m] Terrain data MSL*/ + uint8_t gridbit; /*< bit within the terrain request mask*/ +} mavlink_terrain_data_t; #define MAVLINK_MSG_ID_TERRAIN_DATA_LEN 43 #define MAVLINK_MSG_ID_TERRAIN_DATA_MIN_LEN 43 @@ -30,8 +30,8 @@ typedef struct __mavlink_terrain_data_t { { { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_terrain_data_t, lat) }, \ { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_terrain_data_t, lon) }, \ { "grid_spacing", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_terrain_data_t, grid_spacing) }, \ - { "data", NULL, MAVLINK_TYPE_INT16_T, 16, 10, offsetof(mavlink_terrain_data_t, data) }, \ { "gridbit", NULL, MAVLINK_TYPE_UINT8_T, 0, 42, offsetof(mavlink_terrain_data_t, gridbit) }, \ + { "data", NULL, MAVLINK_TYPE_INT16_T, 16, 10, offsetof(mavlink_terrain_data_t, data) }, \ } \ } #else @@ -41,8 +41,8 @@ typedef struct __mavlink_terrain_data_t { { { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_terrain_data_t, lat) }, \ { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_terrain_data_t, lon) }, \ { "grid_spacing", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_terrain_data_t, grid_spacing) }, \ - { "data", NULL, MAVLINK_TYPE_INT16_T, 16, 10, offsetof(mavlink_terrain_data_t, data) }, \ { "gridbit", NULL, MAVLINK_TYPE_UINT8_T, 0, 42, offsetof(mavlink_terrain_data_t, gridbit) }, \ + { "data", NULL, MAVLINK_TYPE_INT16_T, 16, 10, offsetof(mavlink_terrain_data_t, data) }, \ } \ } #endif @@ -53,11 +53,11 @@ typedef struct __mavlink_terrain_data_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param lat Latitude of SW corner of first grid (degrees *10^7) - * @param lon Longitude of SW corner of first grid (in degrees *10^7) - * @param grid_spacing Grid spacing in meters - * @param gridbit bit within the terrain request mask - * @param data Terrain data in meters AMSL + * @param lat [degE7] Latitude of SW corner of first grid + * @param lon [degE7] Longitude of SW corner of first grid + * @param grid_spacing [m] Grid spacing + * @param gridbit bit within the terrain request mask + * @param data [m] Terrain data MSL * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_terrain_data_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -91,11 +91,11 @@ static inline uint16_t mavlink_msg_terrain_data_pack(uint8_t system_id, uint8_t * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param lat Latitude of SW corner of first grid (degrees *10^7) - * @param lon Longitude of SW corner of first grid (in degrees *10^7) - * @param grid_spacing Grid spacing in meters - * @param gridbit bit within the terrain request mask - * @param data Terrain data in meters AMSL + * @param lat [degE7] Latitude of SW corner of first grid + * @param lon [degE7] Longitude of SW corner of first grid + * @param grid_spacing [m] Grid spacing + * @param gridbit bit within the terrain request mask + * @param data [m] Terrain data MSL * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_terrain_data_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -155,11 +155,11 @@ static inline uint16_t mavlink_msg_terrain_data_encode_chan(uint8_t system_id, u * @brief Send a terrain_data message * @param chan MAVLink channel to send the message * - * @param lat Latitude of SW corner of first grid (degrees *10^7) - * @param lon Longitude of SW corner of first grid (in degrees *10^7) - * @param grid_spacing Grid spacing in meters - * @param gridbit bit within the terrain request mask - * @param data Terrain data in meters AMSL + * @param lat [degE7] Latitude of SW corner of first grid + * @param lon [degE7] Longitude of SW corner of first grid + * @param grid_spacing [m] Grid spacing + * @param gridbit bit within the terrain request mask + * @param data [m] Terrain data MSL */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -236,7 +236,7 @@ static inline void mavlink_msg_terrain_data_send_buf(mavlink_message_t *msgbuf, /** * @brief Get field lat from terrain_data message * - * @return Latitude of SW corner of first grid (degrees *10^7) + * @return [degE7] Latitude of SW corner of first grid */ static inline int32_t mavlink_msg_terrain_data_get_lat(const mavlink_message_t* msg) { @@ -246,7 +246,7 @@ static inline int32_t mavlink_msg_terrain_data_get_lat(const mavlink_message_t* /** * @brief Get field lon from terrain_data message * - * @return Longitude of SW corner of first grid (in degrees *10^7) + * @return [degE7] Longitude of SW corner of first grid */ static inline int32_t mavlink_msg_terrain_data_get_lon(const mavlink_message_t* msg) { @@ -256,7 +256,7 @@ static inline int32_t mavlink_msg_terrain_data_get_lon(const mavlink_message_t* /** * @brief Get field grid_spacing from terrain_data message * - * @return Grid spacing in meters + * @return [m] Grid spacing */ static inline uint16_t mavlink_msg_terrain_data_get_grid_spacing(const mavlink_message_t* msg) { @@ -266,7 +266,7 @@ static inline uint16_t mavlink_msg_terrain_data_get_grid_spacing(const mavlink_m /** * @brief Get field gridbit from terrain_data message * - * @return bit within the terrain request mask + * @return bit within the terrain request mask */ static inline uint8_t mavlink_msg_terrain_data_get_gridbit(const mavlink_message_t* msg) { @@ -276,7 +276,7 @@ static inline uint8_t mavlink_msg_terrain_data_get_gridbit(const mavlink_message /** * @brief Get field data from terrain_data message * - * @return Terrain data in meters AMSL + * @return [m] Terrain data MSL */ static inline uint16_t mavlink_msg_terrain_data_get_data(const mavlink_message_t* msg, int16_t *data) { diff --git a/lib/main/MAVLink/common/mavlink_msg_terrain_report.h b/lib/main/MAVLink/common/mavlink_msg_terrain_report.h index 1374db5bc0..8757a75a27 100755 --- a/lib/main/MAVLink/common/mavlink_msg_terrain_report.h +++ b/lib/main/MAVLink/common/mavlink_msg_terrain_report.h @@ -3,16 +3,16 @@ #define MAVLINK_MSG_ID_TERRAIN_REPORT 136 -MAVPACKED( + typedef struct __mavlink_terrain_report_t { - int32_t lat; /*< Latitude (degrees *10^7)*/ - int32_t lon; /*< Longitude (degrees *10^7)*/ - float terrain_height; /*< Terrain height in meters AMSL*/ - float current_height; /*< Current vehicle height above lat/lon terrain height (meters)*/ - uint16_t spacing; /*< grid spacing (zero if terrain at this location unavailable)*/ - uint16_t pending; /*< Number of 4x4 terrain blocks waiting to be received or read from disk*/ - uint16_t loaded; /*< Number of 4x4 terrain blocks in memory*/ -}) mavlink_terrain_report_t; + int32_t lat; /*< [degE7] Latitude*/ + int32_t lon; /*< [degE7] Longitude*/ + float terrain_height; /*< [m] Terrain height MSL*/ + float current_height; /*< [m] Current vehicle height above lat/lon terrain height*/ + uint16_t spacing; /*< grid spacing (zero if terrain at this location unavailable)*/ + uint16_t pending; /*< Number of 4x4 terrain blocks waiting to be received or read from disk*/ + uint16_t loaded; /*< Number of 4x4 terrain blocks in memory*/ +} mavlink_terrain_report_t; #define MAVLINK_MSG_ID_TERRAIN_REPORT_LEN 22 #define MAVLINK_MSG_ID_TERRAIN_REPORT_MIN_LEN 22 @@ -31,9 +31,9 @@ typedef struct __mavlink_terrain_report_t { 7, \ { { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_terrain_report_t, lat) }, \ { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_terrain_report_t, lon) }, \ + { "spacing", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_terrain_report_t, spacing) }, \ { "terrain_height", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_terrain_report_t, terrain_height) }, \ { "current_height", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_terrain_report_t, current_height) }, \ - { "spacing", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_terrain_report_t, spacing) }, \ { "pending", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_terrain_report_t, pending) }, \ { "loaded", NULL, MAVLINK_TYPE_UINT16_T, 0, 20, offsetof(mavlink_terrain_report_t, loaded) }, \ } \ @@ -44,9 +44,9 @@ typedef struct __mavlink_terrain_report_t { 7, \ { { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_terrain_report_t, lat) }, \ { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_terrain_report_t, lon) }, \ + { "spacing", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_terrain_report_t, spacing) }, \ { "terrain_height", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_terrain_report_t, terrain_height) }, \ { "current_height", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_terrain_report_t, current_height) }, \ - { "spacing", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_terrain_report_t, spacing) }, \ { "pending", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_terrain_report_t, pending) }, \ { "loaded", NULL, MAVLINK_TYPE_UINT16_T, 0, 20, offsetof(mavlink_terrain_report_t, loaded) }, \ } \ @@ -59,13 +59,13 @@ typedef struct __mavlink_terrain_report_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param lat Latitude (degrees *10^7) - * @param lon Longitude (degrees *10^7) - * @param spacing grid spacing (zero if terrain at this location unavailable) - * @param terrain_height Terrain height in meters AMSL - * @param current_height Current vehicle height above lat/lon terrain height (meters) - * @param pending Number of 4x4 terrain blocks waiting to be received or read from disk - * @param loaded Number of 4x4 terrain blocks in memory + * @param lat [degE7] Latitude + * @param lon [degE7] Longitude + * @param spacing grid spacing (zero if terrain at this location unavailable) + * @param terrain_height [m] Terrain height MSL + * @param current_height [m] Current vehicle height above lat/lon terrain height + * @param pending Number of 4x4 terrain blocks waiting to be received or read from disk + * @param loaded Number of 4x4 terrain blocks in memory * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_terrain_report_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -105,13 +105,13 @@ static inline uint16_t mavlink_msg_terrain_report_pack(uint8_t system_id, uint8_ * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param lat Latitude (degrees *10^7) - * @param lon Longitude (degrees *10^7) - * @param spacing grid spacing (zero if terrain at this location unavailable) - * @param terrain_height Terrain height in meters AMSL - * @param current_height Current vehicle height above lat/lon terrain height (meters) - * @param pending Number of 4x4 terrain blocks waiting to be received or read from disk - * @param loaded Number of 4x4 terrain blocks in memory + * @param lat [degE7] Latitude + * @param lon [degE7] Longitude + * @param spacing grid spacing (zero if terrain at this location unavailable) + * @param terrain_height [m] Terrain height MSL + * @param current_height [m] Current vehicle height above lat/lon terrain height + * @param pending Number of 4x4 terrain blocks waiting to be received or read from disk + * @param loaded Number of 4x4 terrain blocks in memory * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_terrain_report_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -177,13 +177,13 @@ static inline uint16_t mavlink_msg_terrain_report_encode_chan(uint8_t system_id, * @brief Send a terrain_report message * @param chan MAVLink channel to send the message * - * @param lat Latitude (degrees *10^7) - * @param lon Longitude (degrees *10^7) - * @param spacing grid spacing (zero if terrain at this location unavailable) - * @param terrain_height Terrain height in meters AMSL - * @param current_height Current vehicle height above lat/lon terrain height (meters) - * @param pending Number of 4x4 terrain blocks waiting to be received or read from disk - * @param loaded Number of 4x4 terrain blocks in memory + * @param lat [degE7] Latitude + * @param lon [degE7] Longitude + * @param spacing grid spacing (zero if terrain at this location unavailable) + * @param terrain_height [m] Terrain height MSL + * @param current_height [m] Current vehicle height above lat/lon terrain height + * @param pending Number of 4x4 terrain blocks waiting to be received or read from disk + * @param loaded Number of 4x4 terrain blocks in memory */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -272,7 +272,7 @@ static inline void mavlink_msg_terrain_report_send_buf(mavlink_message_t *msgbuf /** * @brief Get field lat from terrain_report message * - * @return Latitude (degrees *10^7) + * @return [degE7] Latitude */ static inline int32_t mavlink_msg_terrain_report_get_lat(const mavlink_message_t* msg) { @@ -282,7 +282,7 @@ static inline int32_t mavlink_msg_terrain_report_get_lat(const mavlink_message_t /** * @brief Get field lon from terrain_report message * - * @return Longitude (degrees *10^7) + * @return [degE7] Longitude */ static inline int32_t mavlink_msg_terrain_report_get_lon(const mavlink_message_t* msg) { @@ -292,7 +292,7 @@ static inline int32_t mavlink_msg_terrain_report_get_lon(const mavlink_message_t /** * @brief Get field spacing from terrain_report message * - * @return grid spacing (zero if terrain at this location unavailable) + * @return grid spacing (zero if terrain at this location unavailable) */ static inline uint16_t mavlink_msg_terrain_report_get_spacing(const mavlink_message_t* msg) { @@ -302,7 +302,7 @@ static inline uint16_t mavlink_msg_terrain_report_get_spacing(const mavlink_mess /** * @brief Get field terrain_height from terrain_report message * - * @return Terrain height in meters AMSL + * @return [m] Terrain height MSL */ static inline float mavlink_msg_terrain_report_get_terrain_height(const mavlink_message_t* msg) { @@ -312,7 +312,7 @@ static inline float mavlink_msg_terrain_report_get_terrain_height(const mavlink_ /** * @brief Get field current_height from terrain_report message * - * @return Current vehicle height above lat/lon terrain height (meters) + * @return [m] Current vehicle height above lat/lon terrain height */ static inline float mavlink_msg_terrain_report_get_current_height(const mavlink_message_t* msg) { @@ -322,7 +322,7 @@ static inline float mavlink_msg_terrain_report_get_current_height(const mavlink_ /** * @brief Get field pending from terrain_report message * - * @return Number of 4x4 terrain blocks waiting to be received or read from disk + * @return Number of 4x4 terrain blocks waiting to be received or read from disk */ static inline uint16_t mavlink_msg_terrain_report_get_pending(const mavlink_message_t* msg) { @@ -332,7 +332,7 @@ static inline uint16_t mavlink_msg_terrain_report_get_pending(const mavlink_mess /** * @brief Get field loaded from terrain_report message * - * @return Number of 4x4 terrain blocks in memory + * @return Number of 4x4 terrain blocks in memory */ static inline uint16_t mavlink_msg_terrain_report_get_loaded(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_terrain_request.h b/lib/main/MAVLink/common/mavlink_msg_terrain_request.h index 8924ed4f19..9889edd7d0 100755 --- a/lib/main/MAVLink/common/mavlink_msg_terrain_request.h +++ b/lib/main/MAVLink/common/mavlink_msg_terrain_request.h @@ -3,13 +3,13 @@ #define MAVLINK_MSG_ID_TERRAIN_REQUEST 133 -MAVPACKED( + typedef struct __mavlink_terrain_request_t { - uint64_t mask; /*< Bitmask of requested 4x4 grids (row major 8x7 array of grids, 56 bits)*/ - int32_t lat; /*< Latitude of SW corner of first grid (degrees *10^7)*/ - int32_t lon; /*< Longitude of SW corner of first grid (in degrees *10^7)*/ - uint16_t grid_spacing; /*< Grid spacing in meters*/ -}) mavlink_terrain_request_t; + uint64_t mask; /*< Bitmask of requested 4x4 grids (row major 8x7 array of grids, 56 bits)*/ + int32_t lat; /*< [degE7] Latitude of SW corner of first grid*/ + int32_t lon; /*< [degE7] Longitude of SW corner of first grid*/ + uint16_t grid_spacing; /*< [m] Grid spacing*/ +} mavlink_terrain_request_t; #define MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN 18 #define MAVLINK_MSG_ID_TERRAIN_REQUEST_MIN_LEN 18 @@ -26,20 +26,20 @@ typedef struct __mavlink_terrain_request_t { 133, \ "TERRAIN_REQUEST", \ 4, \ - { { "mask", "0x%07x", MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_terrain_request_t, mask) }, \ - { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_terrain_request_t, lat) }, \ + { { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_terrain_request_t, lat) }, \ { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_terrain_request_t, lon) }, \ { "grid_spacing", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_terrain_request_t, grid_spacing) }, \ + { "mask", "0x%07x", MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_terrain_request_t, mask) }, \ } \ } #else #define MAVLINK_MESSAGE_INFO_TERRAIN_REQUEST { \ "TERRAIN_REQUEST", \ 4, \ - { { "mask", "0x%07x", MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_terrain_request_t, mask) }, \ - { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_terrain_request_t, lat) }, \ + { { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_terrain_request_t, lat) }, \ { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_terrain_request_t, lon) }, \ { "grid_spacing", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_terrain_request_t, grid_spacing) }, \ + { "mask", "0x%07x", MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_terrain_request_t, mask) }, \ } \ } #endif @@ -50,10 +50,10 @@ typedef struct __mavlink_terrain_request_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param lat Latitude of SW corner of first grid (degrees *10^7) - * @param lon Longitude of SW corner of first grid (in degrees *10^7) - * @param grid_spacing Grid spacing in meters - * @param mask Bitmask of requested 4x4 grids (row major 8x7 array of grids, 56 bits) + * @param lat [degE7] Latitude of SW corner of first grid + * @param lon [degE7] Longitude of SW corner of first grid + * @param grid_spacing [m] Grid spacing + * @param mask Bitmask of requested 4x4 grids (row major 8x7 array of grids, 56 bits) * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_terrain_request_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -87,10 +87,10 @@ static inline uint16_t mavlink_msg_terrain_request_pack(uint8_t system_id, uint8 * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param lat Latitude of SW corner of first grid (degrees *10^7) - * @param lon Longitude of SW corner of first grid (in degrees *10^7) - * @param grid_spacing Grid spacing in meters - * @param mask Bitmask of requested 4x4 grids (row major 8x7 array of grids, 56 bits) + * @param lat [degE7] Latitude of SW corner of first grid + * @param lon [degE7] Longitude of SW corner of first grid + * @param grid_spacing [m] Grid spacing + * @param mask Bitmask of requested 4x4 grids (row major 8x7 array of grids, 56 bits) * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_terrain_request_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -150,10 +150,10 @@ static inline uint16_t mavlink_msg_terrain_request_encode_chan(uint8_t system_id * @brief Send a terrain_request message * @param chan MAVLink channel to send the message * - * @param lat Latitude of SW corner of first grid (degrees *10^7) - * @param lon Longitude of SW corner of first grid (in degrees *10^7) - * @param grid_spacing Grid spacing in meters - * @param mask Bitmask of requested 4x4 grids (row major 8x7 array of grids, 56 bits) + * @param lat [degE7] Latitude of SW corner of first grid + * @param lon [degE7] Longitude of SW corner of first grid + * @param grid_spacing [m] Grid spacing + * @param mask Bitmask of requested 4x4 grids (row major 8x7 array of grids, 56 bits) */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -230,7 +230,7 @@ static inline void mavlink_msg_terrain_request_send_buf(mavlink_message_t *msgbu /** * @brief Get field lat from terrain_request message * - * @return Latitude of SW corner of first grid (degrees *10^7) + * @return [degE7] Latitude of SW corner of first grid */ static inline int32_t mavlink_msg_terrain_request_get_lat(const mavlink_message_t* msg) { @@ -240,7 +240,7 @@ static inline int32_t mavlink_msg_terrain_request_get_lat(const mavlink_message_ /** * @brief Get field lon from terrain_request message * - * @return Longitude of SW corner of first grid (in degrees *10^7) + * @return [degE7] Longitude of SW corner of first grid */ static inline int32_t mavlink_msg_terrain_request_get_lon(const mavlink_message_t* msg) { @@ -250,7 +250,7 @@ static inline int32_t mavlink_msg_terrain_request_get_lon(const mavlink_message_ /** * @brief Get field grid_spacing from terrain_request message * - * @return Grid spacing in meters + * @return [m] Grid spacing */ static inline uint16_t mavlink_msg_terrain_request_get_grid_spacing(const mavlink_message_t* msg) { @@ -260,7 +260,7 @@ static inline uint16_t mavlink_msg_terrain_request_get_grid_spacing(const mavlin /** * @brief Get field mask from terrain_request message * - * @return Bitmask of requested 4x4 grids (row major 8x7 array of grids, 56 bits) + * @return Bitmask of requested 4x4 grids (row major 8x7 array of grids, 56 bits) */ static inline uint64_t mavlink_msg_terrain_request_get_mask(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_timesync.h b/lib/main/MAVLink/common/mavlink_msg_timesync.h index 395211fd8b..a9de47dd45 100755 --- a/lib/main/MAVLink/common/mavlink_msg_timesync.h +++ b/lib/main/MAVLink/common/mavlink_msg_timesync.h @@ -3,11 +3,11 @@ #define MAVLINK_MSG_ID_TIMESYNC 111 -MAVPACKED( + typedef struct __mavlink_timesync_t { - int64_t tc1; /*< Time sync timestamp 1*/ - int64_t ts1; /*< Time sync timestamp 2*/ -}) mavlink_timesync_t; + int64_t tc1; /*< Time sync timestamp 1*/ + int64_t ts1; /*< Time sync timestamp 2*/ +} mavlink_timesync_t; #define MAVLINK_MSG_ID_TIMESYNC_LEN 16 #define MAVLINK_MSG_ID_TIMESYNC_MIN_LEN 16 @@ -44,8 +44,8 @@ typedef struct __mavlink_timesync_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param tc1 Time sync timestamp 1 - * @param ts1 Time sync timestamp 2 + * @param tc1 Time sync timestamp 1 + * @param ts1 Time sync timestamp 2 * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_timesync_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -75,8 +75,8 @@ static inline uint16_t mavlink_msg_timesync_pack(uint8_t system_id, uint8_t comp * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param tc1 Time sync timestamp 1 - * @param ts1 Time sync timestamp 2 + * @param tc1 Time sync timestamp 1 + * @param ts1 Time sync timestamp 2 * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_timesync_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -132,8 +132,8 @@ static inline uint16_t mavlink_msg_timesync_encode_chan(uint8_t system_id, uint8 * @brief Send a timesync message * @param chan MAVLink channel to send the message * - * @param tc1 Time sync timestamp 1 - * @param ts1 Time sync timestamp 2 + * @param tc1 Time sync timestamp 1 + * @param ts1 Time sync timestamp 2 */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -202,7 +202,7 @@ static inline void mavlink_msg_timesync_send_buf(mavlink_message_t *msgbuf, mavl /** * @brief Get field tc1 from timesync message * - * @return Time sync timestamp 1 + * @return Time sync timestamp 1 */ static inline int64_t mavlink_msg_timesync_get_tc1(const mavlink_message_t* msg) { @@ -212,7 +212,7 @@ static inline int64_t mavlink_msg_timesync_get_tc1(const mavlink_message_t* msg) /** * @brief Get field ts1 from timesync message * - * @return Time sync timestamp 2 + * @return Time sync timestamp 2 */ static inline int64_t mavlink_msg_timesync_get_ts1(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_v2_extension.h b/lib/main/MAVLink/common/mavlink_msg_v2_extension.h index 31777f2d9c..689e891146 100755 --- a/lib/main/MAVLink/common/mavlink_msg_v2_extension.h +++ b/lib/main/MAVLink/common/mavlink_msg_v2_extension.h @@ -3,14 +3,14 @@ #define MAVLINK_MSG_ID_V2_EXTENSION 248 -MAVPACKED( + typedef struct __mavlink_v2_extension_t { - uint16_t message_type; /*< A code that identifies the software component that understands this message (analogous to usb device classes or mime type strings). If this code is less than 32768, it is considered a 'registered' protocol extension and the corresponding entry should be added to https://github.com/mavlink/mavlink/extension-message-ids.xml. Software creators can register blocks of message IDs as needed (useful for GCS specific metadata, etc...). Message_types greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase.*/ - uint8_t target_network; /*< Network ID (0 for broadcast)*/ - uint8_t target_system; /*< System ID (0 for broadcast)*/ - uint8_t target_component; /*< Component ID (0 for broadcast)*/ - uint8_t payload[249]; /*< Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The entire content of this block is opaque unless you understand any the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the mavlink specification.*/ -}) mavlink_v2_extension_t; + uint16_t message_type; /*< A code that identifies the software component that understands this message (analogous to USB device classes or mime type strings). If this code is less than 32768, it is considered a 'registered' protocol extension and the corresponding entry should be added to https://github.com/mavlink/mavlink/definition_files/extension_message_ids.xml. Software creators can register blocks of message IDs as needed (useful for GCS specific metadata, etc...). Message_types greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase.*/ + uint8_t target_network; /*< Network ID (0 for broadcast)*/ + uint8_t target_system; /*< System ID (0 for broadcast)*/ + uint8_t target_component; /*< Component ID (0 for broadcast)*/ + uint8_t payload[249]; /*< Variable length payload. The length must be encoded in the payload as part of the message_type protocol, e.g. by including the length as payload data, or by terminating the payload data with a non-zero marker. This is required in order to reconstruct zero-terminated payloads that are (or otherwise would be) trimmed by MAVLink 2 empty-byte truncation. The entire content of the payload block is opaque unless you understand the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the MAVLink specification.*/ +} mavlink_v2_extension_t; #define MAVLINK_MSG_ID_V2_EXTENSION_LEN 254 #define MAVLINK_MSG_ID_V2_EXTENSION_MIN_LEN 254 @@ -27,10 +27,10 @@ typedef struct __mavlink_v2_extension_t { 248, \ "V2_EXTENSION", \ 5, \ - { { "message_type", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_v2_extension_t, message_type) }, \ - { "target_network", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_v2_extension_t, target_network) }, \ + { { "target_network", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_v2_extension_t, target_network) }, \ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_v2_extension_t, target_system) }, \ { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_v2_extension_t, target_component) }, \ + { "message_type", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_v2_extension_t, message_type) }, \ { "payload", NULL, MAVLINK_TYPE_UINT8_T, 249, 5, offsetof(mavlink_v2_extension_t, payload) }, \ } \ } @@ -38,10 +38,10 @@ typedef struct __mavlink_v2_extension_t { #define MAVLINK_MESSAGE_INFO_V2_EXTENSION { \ "V2_EXTENSION", \ 5, \ - { { "message_type", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_v2_extension_t, message_type) }, \ - { "target_network", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_v2_extension_t, target_network) }, \ + { { "target_network", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_v2_extension_t, target_network) }, \ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_v2_extension_t, target_system) }, \ { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_v2_extension_t, target_component) }, \ + { "message_type", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_v2_extension_t, message_type) }, \ { "payload", NULL, MAVLINK_TYPE_UINT8_T, 249, 5, offsetof(mavlink_v2_extension_t, payload) }, \ } \ } @@ -53,11 +53,11 @@ typedef struct __mavlink_v2_extension_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param target_network Network ID (0 for broadcast) - * @param target_system System ID (0 for broadcast) - * @param target_component Component ID (0 for broadcast) - * @param message_type A code that identifies the software component that understands this message (analogous to usb device classes or mime type strings). If this code is less than 32768, it is considered a 'registered' protocol extension and the corresponding entry should be added to https://github.com/mavlink/mavlink/extension-message-ids.xml. Software creators can register blocks of message IDs as needed (useful for GCS specific metadata, etc...). Message_types greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase. - * @param payload Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The entire content of this block is opaque unless you understand any the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the mavlink specification. + * @param target_network Network ID (0 for broadcast) + * @param target_system System ID (0 for broadcast) + * @param target_component Component ID (0 for broadcast) + * @param message_type A code that identifies the software component that understands this message (analogous to USB device classes or mime type strings). If this code is less than 32768, it is considered a 'registered' protocol extension and the corresponding entry should be added to https://github.com/mavlink/mavlink/definition_files/extension_message_ids.xml. Software creators can register blocks of message IDs as needed (useful for GCS specific metadata, etc...). Message_types greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase. + * @param payload Variable length payload. The length must be encoded in the payload as part of the message_type protocol, e.g. by including the length as payload data, or by terminating the payload data with a non-zero marker. This is required in order to reconstruct zero-terminated payloads that are (or otherwise would be) trimmed by MAVLink 2 empty-byte truncation. The entire content of the payload block is opaque unless you understand the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the MAVLink specification. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_v2_extension_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -91,11 +91,11 @@ static inline uint16_t mavlink_msg_v2_extension_pack(uint8_t system_id, uint8_t * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param target_network Network ID (0 for broadcast) - * @param target_system System ID (0 for broadcast) - * @param target_component Component ID (0 for broadcast) - * @param message_type A code that identifies the software component that understands this message (analogous to usb device classes or mime type strings). If this code is less than 32768, it is considered a 'registered' protocol extension and the corresponding entry should be added to https://github.com/mavlink/mavlink/extension-message-ids.xml. Software creators can register blocks of message IDs as needed (useful for GCS specific metadata, etc...). Message_types greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase. - * @param payload Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The entire content of this block is opaque unless you understand any the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the mavlink specification. + * @param target_network Network ID (0 for broadcast) + * @param target_system System ID (0 for broadcast) + * @param target_component Component ID (0 for broadcast) + * @param message_type A code that identifies the software component that understands this message (analogous to USB device classes or mime type strings). If this code is less than 32768, it is considered a 'registered' protocol extension and the corresponding entry should be added to https://github.com/mavlink/mavlink/definition_files/extension_message_ids.xml. Software creators can register blocks of message IDs as needed (useful for GCS specific metadata, etc...). Message_types greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase. + * @param payload Variable length payload. The length must be encoded in the payload as part of the message_type protocol, e.g. by including the length as payload data, or by terminating the payload data with a non-zero marker. This is required in order to reconstruct zero-terminated payloads that are (or otherwise would be) trimmed by MAVLink 2 empty-byte truncation. The entire content of the payload block is opaque unless you understand the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the MAVLink specification. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_v2_extension_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -155,11 +155,11 @@ static inline uint16_t mavlink_msg_v2_extension_encode_chan(uint8_t system_id, u * @brief Send a v2_extension message * @param chan MAVLink channel to send the message * - * @param target_network Network ID (0 for broadcast) - * @param target_system System ID (0 for broadcast) - * @param target_component Component ID (0 for broadcast) - * @param message_type A code that identifies the software component that understands this message (analogous to usb device classes or mime type strings). If this code is less than 32768, it is considered a 'registered' protocol extension and the corresponding entry should be added to https://github.com/mavlink/mavlink/extension-message-ids.xml. Software creators can register blocks of message IDs as needed (useful for GCS specific metadata, etc...). Message_types greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase. - * @param payload Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The entire content of this block is opaque unless you understand any the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the mavlink specification. + * @param target_network Network ID (0 for broadcast) + * @param target_system System ID (0 for broadcast) + * @param target_component Component ID (0 for broadcast) + * @param message_type A code that identifies the software component that understands this message (analogous to USB device classes or mime type strings). If this code is less than 32768, it is considered a 'registered' protocol extension and the corresponding entry should be added to https://github.com/mavlink/mavlink/definition_files/extension_message_ids.xml. Software creators can register blocks of message IDs as needed (useful for GCS specific metadata, etc...). Message_types greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase. + * @param payload Variable length payload. The length must be encoded in the payload as part of the message_type protocol, e.g. by including the length as payload data, or by terminating the payload data with a non-zero marker. This is required in order to reconstruct zero-terminated payloads that are (or otherwise would be) trimmed by MAVLink 2 empty-byte truncation. The entire content of the payload block is opaque unless you understand the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the MAVLink specification. */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -236,7 +236,7 @@ static inline void mavlink_msg_v2_extension_send_buf(mavlink_message_t *msgbuf, /** * @brief Get field target_network from v2_extension message * - * @return Network ID (0 for broadcast) + * @return Network ID (0 for broadcast) */ static inline uint8_t mavlink_msg_v2_extension_get_target_network(const mavlink_message_t* msg) { @@ -246,7 +246,7 @@ static inline uint8_t mavlink_msg_v2_extension_get_target_network(const mavlink_ /** * @brief Get field target_system from v2_extension message * - * @return System ID (0 for broadcast) + * @return System ID (0 for broadcast) */ static inline uint8_t mavlink_msg_v2_extension_get_target_system(const mavlink_message_t* msg) { @@ -256,7 +256,7 @@ static inline uint8_t mavlink_msg_v2_extension_get_target_system(const mavlink_m /** * @brief Get field target_component from v2_extension message * - * @return Component ID (0 for broadcast) + * @return Component ID (0 for broadcast) */ static inline uint8_t mavlink_msg_v2_extension_get_target_component(const mavlink_message_t* msg) { @@ -266,7 +266,7 @@ static inline uint8_t mavlink_msg_v2_extension_get_target_component(const mavlin /** * @brief Get field message_type from v2_extension message * - * @return A code that identifies the software component that understands this message (analogous to usb device classes or mime type strings). If this code is less than 32768, it is considered a 'registered' protocol extension and the corresponding entry should be added to https://github.com/mavlink/mavlink/extension-message-ids.xml. Software creators can register blocks of message IDs as needed (useful for GCS specific metadata, etc...). Message_types greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase. + * @return A code that identifies the software component that understands this message (analogous to USB device classes or mime type strings). If this code is less than 32768, it is considered a 'registered' protocol extension and the corresponding entry should be added to https://github.com/mavlink/mavlink/definition_files/extension_message_ids.xml. Software creators can register blocks of message IDs as needed (useful for GCS specific metadata, etc...). Message_types greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase. */ static inline uint16_t mavlink_msg_v2_extension_get_message_type(const mavlink_message_t* msg) { @@ -276,7 +276,7 @@ static inline uint16_t mavlink_msg_v2_extension_get_message_type(const mavlink_m /** * @brief Get field payload from v2_extension message * - * @return Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The entire content of this block is opaque unless you understand any the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the mavlink specification. + * @return Variable length payload. The length must be encoded in the payload as part of the message_type protocol, e.g. by including the length as payload data, or by terminating the payload data with a non-zero marker. This is required in order to reconstruct zero-terminated payloads that are (or otherwise would be) trimmed by MAVLink 2 empty-byte truncation. The entire content of the payload block is opaque unless you understand the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the MAVLink specification. */ static inline uint16_t mavlink_msg_v2_extension_get_payload(const mavlink_message_t* msg, uint8_t *payload) { diff --git a/lib/main/MAVLink/common/mavlink_msg_vfr_hud.h b/lib/main/MAVLink/common/mavlink_msg_vfr_hud.h index 1700dd0aa2..f1706ea65c 100755 --- a/lib/main/MAVLink/common/mavlink_msg_vfr_hud.h +++ b/lib/main/MAVLink/common/mavlink_msg_vfr_hud.h @@ -3,15 +3,15 @@ #define MAVLINK_MSG_ID_VFR_HUD 74 -MAVPACKED( + typedef struct __mavlink_vfr_hud_t { - float airspeed; /*< Current airspeed in m/s*/ - float groundspeed; /*< Current ground speed in m/s*/ - float alt; /*< Current altitude (MSL), in meters*/ - float climb; /*< Current climb rate in meters/second*/ - int16_t heading; /*< Current heading in degrees, in compass units (0..360, 0=north)*/ - uint16_t throttle; /*< Current throttle setting in integer percent, 0 to 100*/ -}) mavlink_vfr_hud_t; + float airspeed; /*< [m/s] Vehicle speed in form appropriate for vehicle type. For standard aircraft this is typically calibrated airspeed (CAS) or indicated airspeed (IAS) - either of which can be used by a pilot to estimate stall speed.*/ + float groundspeed; /*< [m/s] Current ground speed.*/ + float alt; /*< [m] Current altitude (MSL).*/ + float climb; /*< [m/s] Current climb rate.*/ + int16_t heading; /*< [deg] Current heading in compass units (0-360, 0=north).*/ + uint16_t throttle; /*< [%] Current throttle setting (0 to 100).*/ +} mavlink_vfr_hud_t; #define MAVLINK_MSG_ID_VFR_HUD_LEN 20 #define MAVLINK_MSG_ID_VFR_HUD_MIN_LEN 20 @@ -30,10 +30,10 @@ typedef struct __mavlink_vfr_hud_t { 6, \ { { "airspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_vfr_hud_t, airspeed) }, \ { "groundspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_vfr_hud_t, groundspeed) }, \ - { "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_vfr_hud_t, alt) }, \ - { "climb", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_vfr_hud_t, climb) }, \ { "heading", NULL, MAVLINK_TYPE_INT16_T, 0, 16, offsetof(mavlink_vfr_hud_t, heading) }, \ { "throttle", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_vfr_hud_t, throttle) }, \ + { "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_vfr_hud_t, alt) }, \ + { "climb", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_vfr_hud_t, climb) }, \ } \ } #else @@ -42,10 +42,10 @@ typedef struct __mavlink_vfr_hud_t { 6, \ { { "airspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_vfr_hud_t, airspeed) }, \ { "groundspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_vfr_hud_t, groundspeed) }, \ - { "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_vfr_hud_t, alt) }, \ - { "climb", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_vfr_hud_t, climb) }, \ { "heading", NULL, MAVLINK_TYPE_INT16_T, 0, 16, offsetof(mavlink_vfr_hud_t, heading) }, \ { "throttle", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_vfr_hud_t, throttle) }, \ + { "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_vfr_hud_t, alt) }, \ + { "climb", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_vfr_hud_t, climb) }, \ } \ } #endif @@ -56,12 +56,12 @@ typedef struct __mavlink_vfr_hud_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param airspeed Current airspeed in m/s - * @param groundspeed Current ground speed in m/s - * @param heading Current heading in degrees, in compass units (0..360, 0=north) - * @param throttle Current throttle setting in integer percent, 0 to 100 - * @param alt Current altitude (MSL), in meters - * @param climb Current climb rate in meters/second + * @param airspeed [m/s] Vehicle speed in form appropriate for vehicle type. For standard aircraft this is typically calibrated airspeed (CAS) or indicated airspeed (IAS) - either of which can be used by a pilot to estimate stall speed. + * @param groundspeed [m/s] Current ground speed. + * @param heading [deg] Current heading in compass units (0-360, 0=north). + * @param throttle [%] Current throttle setting (0 to 100). + * @param alt [m] Current altitude (MSL). + * @param climb [m/s] Current climb rate. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_vfr_hud_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -99,12 +99,12 @@ static inline uint16_t mavlink_msg_vfr_hud_pack(uint8_t system_id, uint8_t compo * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param airspeed Current airspeed in m/s - * @param groundspeed Current ground speed in m/s - * @param heading Current heading in degrees, in compass units (0..360, 0=north) - * @param throttle Current throttle setting in integer percent, 0 to 100 - * @param alt Current altitude (MSL), in meters - * @param climb Current climb rate in meters/second + * @param airspeed [m/s] Vehicle speed in form appropriate for vehicle type. For standard aircraft this is typically calibrated airspeed (CAS) or indicated airspeed (IAS) - either of which can be used by a pilot to estimate stall speed. + * @param groundspeed [m/s] Current ground speed. + * @param heading [deg] Current heading in compass units (0-360, 0=north). + * @param throttle [%] Current throttle setting (0 to 100). + * @param alt [m] Current altitude (MSL). + * @param climb [m/s] Current climb rate. * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_vfr_hud_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -168,12 +168,12 @@ static inline uint16_t mavlink_msg_vfr_hud_encode_chan(uint8_t system_id, uint8_ * @brief Send a vfr_hud message * @param chan MAVLink channel to send the message * - * @param airspeed Current airspeed in m/s - * @param groundspeed Current ground speed in m/s - * @param heading Current heading in degrees, in compass units (0..360, 0=north) - * @param throttle Current throttle setting in integer percent, 0 to 100 - * @param alt Current altitude (MSL), in meters - * @param climb Current climb rate in meters/second + * @param airspeed [m/s] Vehicle speed in form appropriate for vehicle type. For standard aircraft this is typically calibrated airspeed (CAS) or indicated airspeed (IAS) - either of which can be used by a pilot to estimate stall speed. + * @param groundspeed [m/s] Current ground speed. + * @param heading [deg] Current heading in compass units (0-360, 0=north). + * @param throttle [%] Current throttle setting (0 to 100). + * @param alt [m] Current altitude (MSL). + * @param climb [m/s] Current climb rate. */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -258,7 +258,7 @@ static inline void mavlink_msg_vfr_hud_send_buf(mavlink_message_t *msgbuf, mavli /** * @brief Get field airspeed from vfr_hud message * - * @return Current airspeed in m/s + * @return [m/s] Vehicle speed in form appropriate for vehicle type. For standard aircraft this is typically calibrated airspeed (CAS) or indicated airspeed (IAS) - either of which can be used by a pilot to estimate stall speed. */ static inline float mavlink_msg_vfr_hud_get_airspeed(const mavlink_message_t* msg) { @@ -268,7 +268,7 @@ static inline float mavlink_msg_vfr_hud_get_airspeed(const mavlink_message_t* ms /** * @brief Get field groundspeed from vfr_hud message * - * @return Current ground speed in m/s + * @return [m/s] Current ground speed. */ static inline float mavlink_msg_vfr_hud_get_groundspeed(const mavlink_message_t* msg) { @@ -278,7 +278,7 @@ static inline float mavlink_msg_vfr_hud_get_groundspeed(const mavlink_message_t* /** * @brief Get field heading from vfr_hud message * - * @return Current heading in degrees, in compass units (0..360, 0=north) + * @return [deg] Current heading in compass units (0-360, 0=north). */ static inline int16_t mavlink_msg_vfr_hud_get_heading(const mavlink_message_t* msg) { @@ -288,7 +288,7 @@ static inline int16_t mavlink_msg_vfr_hud_get_heading(const mavlink_message_t* m /** * @brief Get field throttle from vfr_hud message * - * @return Current throttle setting in integer percent, 0 to 100 + * @return [%] Current throttle setting (0 to 100). */ static inline uint16_t mavlink_msg_vfr_hud_get_throttle(const mavlink_message_t* msg) { @@ -298,7 +298,7 @@ static inline uint16_t mavlink_msg_vfr_hud_get_throttle(const mavlink_message_t* /** * @brief Get field alt from vfr_hud message * - * @return Current altitude (MSL), in meters + * @return [m] Current altitude (MSL). */ static inline float mavlink_msg_vfr_hud_get_alt(const mavlink_message_t* msg) { @@ -308,7 +308,7 @@ static inline float mavlink_msg_vfr_hud_get_alt(const mavlink_message_t* msg) /** * @brief Get field climb from vfr_hud message * - * @return Current climb rate in meters/second + * @return [m/s] Current climb rate. */ static inline float mavlink_msg_vfr_hud_get_climb(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_vibration.h b/lib/main/MAVLink/common/mavlink_msg_vibration.h index a8760f79e5..acc99c4f63 100755 --- a/lib/main/MAVLink/common/mavlink_msg_vibration.h +++ b/lib/main/MAVLink/common/mavlink_msg_vibration.h @@ -3,16 +3,16 @@ #define MAVLINK_MSG_ID_VIBRATION 241 -MAVPACKED( + typedef struct __mavlink_vibration_t { - uint64_t time_usec; /*< Timestamp (micros since boot or Unix epoch)*/ - float vibration_x; /*< Vibration levels on X-axis*/ - float vibration_y; /*< Vibration levels on Y-axis*/ - float vibration_z; /*< Vibration levels on Z-axis*/ - uint32_t clipping_0; /*< first accelerometer clipping count*/ - uint32_t clipping_1; /*< second accelerometer clipping count*/ - uint32_t clipping_2; /*< third accelerometer clipping count*/ -}) mavlink_vibration_t; + uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.*/ + float vibration_x; /*< Vibration levels on X-axis*/ + float vibration_y; /*< Vibration levels on Y-axis*/ + float vibration_z; /*< Vibration levels on Z-axis*/ + uint32_t clipping_0; /*< first accelerometer clipping count*/ + uint32_t clipping_1; /*< second accelerometer clipping count*/ + uint32_t clipping_2; /*< third accelerometer clipping count*/ +} mavlink_vibration_t; #define MAVLINK_MSG_ID_VIBRATION_LEN 32 #define MAVLINK_MSG_ID_VIBRATION_MIN_LEN 32 @@ -59,13 +59,13 @@ typedef struct __mavlink_vibration_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param time_usec Timestamp (micros since boot or Unix epoch) - * @param vibration_x Vibration levels on X-axis - * @param vibration_y Vibration levels on Y-axis - * @param vibration_z Vibration levels on Z-axis - * @param clipping_0 first accelerometer clipping count - * @param clipping_1 second accelerometer clipping count - * @param clipping_2 third accelerometer clipping count + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param vibration_x Vibration levels on X-axis + * @param vibration_y Vibration levels on Y-axis + * @param vibration_z Vibration levels on Z-axis + * @param clipping_0 first accelerometer clipping count + * @param clipping_1 second accelerometer clipping count + * @param clipping_2 third accelerometer clipping count * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_vibration_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -105,13 +105,13 @@ static inline uint16_t mavlink_msg_vibration_pack(uint8_t system_id, uint8_t com * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param time_usec Timestamp (micros since boot or Unix epoch) - * @param vibration_x Vibration levels on X-axis - * @param vibration_y Vibration levels on Y-axis - * @param vibration_z Vibration levels on Z-axis - * @param clipping_0 first accelerometer clipping count - * @param clipping_1 second accelerometer clipping count - * @param clipping_2 third accelerometer clipping count + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param vibration_x Vibration levels on X-axis + * @param vibration_y Vibration levels on Y-axis + * @param vibration_z Vibration levels on Z-axis + * @param clipping_0 first accelerometer clipping count + * @param clipping_1 second accelerometer clipping count + * @param clipping_2 third accelerometer clipping count * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_vibration_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -177,13 +177,13 @@ static inline uint16_t mavlink_msg_vibration_encode_chan(uint8_t system_id, uint * @brief Send a vibration message * @param chan MAVLink channel to send the message * - * @param time_usec Timestamp (micros since boot or Unix epoch) - * @param vibration_x Vibration levels on X-axis - * @param vibration_y Vibration levels on Y-axis - * @param vibration_z Vibration levels on Z-axis - * @param clipping_0 first accelerometer clipping count - * @param clipping_1 second accelerometer clipping count - * @param clipping_2 third accelerometer clipping count + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param vibration_x Vibration levels on X-axis + * @param vibration_y Vibration levels on Y-axis + * @param vibration_z Vibration levels on Z-axis + * @param clipping_0 first accelerometer clipping count + * @param clipping_1 second accelerometer clipping count + * @param clipping_2 third accelerometer clipping count */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -272,7 +272,7 @@ static inline void mavlink_msg_vibration_send_buf(mavlink_message_t *msgbuf, mav /** * @brief Get field time_usec from vibration message * - * @return Timestamp (micros since boot or Unix epoch) + * @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. */ static inline uint64_t mavlink_msg_vibration_get_time_usec(const mavlink_message_t* msg) { @@ -282,7 +282,7 @@ static inline uint64_t mavlink_msg_vibration_get_time_usec(const mavlink_message /** * @brief Get field vibration_x from vibration message * - * @return Vibration levels on X-axis + * @return Vibration levels on X-axis */ static inline float mavlink_msg_vibration_get_vibration_x(const mavlink_message_t* msg) { @@ -292,7 +292,7 @@ static inline float mavlink_msg_vibration_get_vibration_x(const mavlink_message_ /** * @brief Get field vibration_y from vibration message * - * @return Vibration levels on Y-axis + * @return Vibration levels on Y-axis */ static inline float mavlink_msg_vibration_get_vibration_y(const mavlink_message_t* msg) { @@ -302,7 +302,7 @@ static inline float mavlink_msg_vibration_get_vibration_y(const mavlink_message_ /** * @brief Get field vibration_z from vibration message * - * @return Vibration levels on Z-axis + * @return Vibration levels on Z-axis */ static inline float mavlink_msg_vibration_get_vibration_z(const mavlink_message_t* msg) { @@ -312,7 +312,7 @@ static inline float mavlink_msg_vibration_get_vibration_z(const mavlink_message_ /** * @brief Get field clipping_0 from vibration message * - * @return first accelerometer clipping count + * @return first accelerometer clipping count */ static inline uint32_t mavlink_msg_vibration_get_clipping_0(const mavlink_message_t* msg) { @@ -322,7 +322,7 @@ static inline uint32_t mavlink_msg_vibration_get_clipping_0(const mavlink_messag /** * @brief Get field clipping_1 from vibration message * - * @return second accelerometer clipping count + * @return second accelerometer clipping count */ static inline uint32_t mavlink_msg_vibration_get_clipping_1(const mavlink_message_t* msg) { @@ -332,7 +332,7 @@ static inline uint32_t mavlink_msg_vibration_get_clipping_1(const mavlink_messag /** * @brief Get field clipping_2 from vibration message * - * @return third accelerometer clipping count + * @return third accelerometer clipping count */ static inline uint32_t mavlink_msg_vibration_get_clipping_2(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_vicon_position_estimate.h b/lib/main/MAVLink/common/mavlink_msg_vicon_position_estimate.h index 5813b74a64..4ad2a73885 100755 --- a/lib/main/MAVLink/common/mavlink_msg_vicon_position_estimate.h +++ b/lib/main/MAVLink/common/mavlink_msg_vicon_position_estimate.h @@ -3,16 +3,16 @@ #define MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE 104 -MAVPACKED( + typedef struct __mavlink_vicon_position_estimate_t { - uint64_t usec; /*< Timestamp (microseconds, synced to UNIX time or since system boot)*/ - float x; /*< Global X position*/ - float y; /*< Global Y position*/ - float z; /*< Global Z position*/ - float roll; /*< Roll angle in rad*/ - float pitch; /*< Pitch angle in rad*/ - float yaw; /*< Yaw angle in rad*/ -}) mavlink_vicon_position_estimate_t; + uint64_t usec; /*< [us] Timestamp (UNIX time or time since system boot)*/ + float x; /*< [m] Global X position*/ + float y; /*< [m] Global Y position*/ + float z; /*< [m] Global Z position*/ + float roll; /*< [rad] Roll angle*/ + float pitch; /*< [rad] Pitch angle*/ + float yaw; /*< [rad] Yaw angle*/ +} mavlink_vicon_position_estimate_t; #define MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN 32 #define MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_MIN_LEN 32 @@ -59,13 +59,13 @@ typedef struct __mavlink_vicon_position_estimate_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param usec Timestamp (microseconds, synced to UNIX time or since system boot) - * @param x Global X position - * @param y Global Y position - * @param z Global Z position - * @param roll Roll angle in rad - * @param pitch Pitch angle in rad - * @param yaw Yaw angle in rad + * @param usec [us] Timestamp (UNIX time or time since system boot) + * @param x [m] Global X position + * @param y [m] Global Y position + * @param z [m] Global Z position + * @param roll [rad] Roll angle + * @param pitch [rad] Pitch angle + * @param yaw [rad] Yaw angle * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_vicon_position_estimate_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -105,13 +105,13 @@ static inline uint16_t mavlink_msg_vicon_position_estimate_pack(uint8_t system_i * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param usec Timestamp (microseconds, synced to UNIX time or since system boot) - * @param x Global X position - * @param y Global Y position - * @param z Global Z position - * @param roll Roll angle in rad - * @param pitch Pitch angle in rad - * @param yaw Yaw angle in rad + * @param usec [us] Timestamp (UNIX time or time since system boot) + * @param x [m] Global X position + * @param y [m] Global Y position + * @param z [m] Global Z position + * @param roll [rad] Roll angle + * @param pitch [rad] Pitch angle + * @param yaw [rad] Yaw angle * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_vicon_position_estimate_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -177,13 +177,13 @@ static inline uint16_t mavlink_msg_vicon_position_estimate_encode_chan(uint8_t s * @brief Send a vicon_position_estimate message * @param chan MAVLink channel to send the message * - * @param usec Timestamp (microseconds, synced to UNIX time or since system boot) - * @param x Global X position - * @param y Global Y position - * @param z Global Z position - * @param roll Roll angle in rad - * @param pitch Pitch angle in rad - * @param yaw Yaw angle in rad + * @param usec [us] Timestamp (UNIX time or time since system boot) + * @param x [m] Global X position + * @param y [m] Global Y position + * @param z [m] Global Z position + * @param roll [rad] Roll angle + * @param pitch [rad] Pitch angle + * @param yaw [rad] Yaw angle */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -272,7 +272,7 @@ static inline void mavlink_msg_vicon_position_estimate_send_buf(mavlink_message_ /** * @brief Get field usec from vicon_position_estimate message * - * @return Timestamp (microseconds, synced to UNIX time or since system boot) + * @return [us] Timestamp (UNIX time or time since system boot) */ static inline uint64_t mavlink_msg_vicon_position_estimate_get_usec(const mavlink_message_t* msg) { @@ -282,7 +282,7 @@ static inline uint64_t mavlink_msg_vicon_position_estimate_get_usec(const mavlin /** * @brief Get field x from vicon_position_estimate message * - * @return Global X position + * @return [m] Global X position */ static inline float mavlink_msg_vicon_position_estimate_get_x(const mavlink_message_t* msg) { @@ -292,7 +292,7 @@ static inline float mavlink_msg_vicon_position_estimate_get_x(const mavlink_mess /** * @brief Get field y from vicon_position_estimate message * - * @return Global Y position + * @return [m] Global Y position */ static inline float mavlink_msg_vicon_position_estimate_get_y(const mavlink_message_t* msg) { @@ -302,7 +302,7 @@ static inline float mavlink_msg_vicon_position_estimate_get_y(const mavlink_mess /** * @brief Get field z from vicon_position_estimate message * - * @return Global Z position + * @return [m] Global Z position */ static inline float mavlink_msg_vicon_position_estimate_get_z(const mavlink_message_t* msg) { @@ -312,7 +312,7 @@ static inline float mavlink_msg_vicon_position_estimate_get_z(const mavlink_mess /** * @brief Get field roll from vicon_position_estimate message * - * @return Roll angle in rad + * @return [rad] Roll angle */ static inline float mavlink_msg_vicon_position_estimate_get_roll(const mavlink_message_t* msg) { @@ -322,7 +322,7 @@ static inline float mavlink_msg_vicon_position_estimate_get_roll(const mavlink_m /** * @brief Get field pitch from vicon_position_estimate message * - * @return Pitch angle in rad + * @return [rad] Pitch angle */ static inline float mavlink_msg_vicon_position_estimate_get_pitch(const mavlink_message_t* msg) { @@ -332,7 +332,7 @@ static inline float mavlink_msg_vicon_position_estimate_get_pitch(const mavlink_ /** * @brief Get field yaw from vicon_position_estimate message * - * @return Yaw angle in rad + * @return [rad] Yaw angle */ static inline float mavlink_msg_vicon_position_estimate_get_yaw(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_vision_position_estimate.h b/lib/main/MAVLink/common/mavlink_msg_vision_position_estimate.h index 0c351e0845..8c5d5d2e96 100755 --- a/lib/main/MAVLink/common/mavlink_msg_vision_position_estimate.h +++ b/lib/main/MAVLink/common/mavlink_msg_vision_position_estimate.h @@ -3,16 +3,16 @@ #define MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE 102 -MAVPACKED( + typedef struct __mavlink_vision_position_estimate_t { - uint64_t usec; /*< Timestamp (microseconds, synced to UNIX time or since system boot)*/ - float x; /*< Global X position*/ - float y; /*< Global Y position*/ - float z; /*< Global Z position*/ - float roll; /*< Roll angle in rad*/ - float pitch; /*< Pitch angle in rad*/ - float yaw; /*< Yaw angle in rad*/ -}) mavlink_vision_position_estimate_t; + uint64_t usec; /*< [us] Timestamp (UNIX time or time since system boot)*/ + float x; /*< [m] Local X position*/ + float y; /*< [m] Local Y position*/ + float z; /*< [m] Local Z position*/ + float roll; /*< [rad] Roll angle*/ + float pitch; /*< [rad] Pitch angle*/ + float yaw; /*< [rad] Yaw angle*/ +} mavlink_vision_position_estimate_t; #define MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN 32 #define MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_MIN_LEN 32 @@ -59,13 +59,13 @@ typedef struct __mavlink_vision_position_estimate_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param usec Timestamp (microseconds, synced to UNIX time or since system boot) - * @param x Global X position - * @param y Global Y position - * @param z Global Z position - * @param roll Roll angle in rad - * @param pitch Pitch angle in rad - * @param yaw Yaw angle in rad + * @param usec [us] Timestamp (UNIX time or time since system boot) + * @param x [m] Local X position + * @param y [m] Local Y position + * @param z [m] Local Z position + * @param roll [rad] Roll angle + * @param pitch [rad] Pitch angle + * @param yaw [rad] Yaw angle * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_vision_position_estimate_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -105,13 +105,13 @@ static inline uint16_t mavlink_msg_vision_position_estimate_pack(uint8_t system_ * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param usec Timestamp (microseconds, synced to UNIX time or since system boot) - * @param x Global X position - * @param y Global Y position - * @param z Global Z position - * @param roll Roll angle in rad - * @param pitch Pitch angle in rad - * @param yaw Yaw angle in rad + * @param usec [us] Timestamp (UNIX time or time since system boot) + * @param x [m] Local X position + * @param y [m] Local Y position + * @param z [m] Local Z position + * @param roll [rad] Roll angle + * @param pitch [rad] Pitch angle + * @param yaw [rad] Yaw angle * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_vision_position_estimate_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -177,13 +177,13 @@ static inline uint16_t mavlink_msg_vision_position_estimate_encode_chan(uint8_t * @brief Send a vision_position_estimate message * @param chan MAVLink channel to send the message * - * @param usec Timestamp (microseconds, synced to UNIX time or since system boot) - * @param x Global X position - * @param y Global Y position - * @param z Global Z position - * @param roll Roll angle in rad - * @param pitch Pitch angle in rad - * @param yaw Yaw angle in rad + * @param usec [us] Timestamp (UNIX time or time since system boot) + * @param x [m] Local X position + * @param y [m] Local Y position + * @param z [m] Local Z position + * @param roll [rad] Roll angle + * @param pitch [rad] Pitch angle + * @param yaw [rad] Yaw angle */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -272,7 +272,7 @@ static inline void mavlink_msg_vision_position_estimate_send_buf(mavlink_message /** * @brief Get field usec from vision_position_estimate message * - * @return Timestamp (microseconds, synced to UNIX time or since system boot) + * @return [us] Timestamp (UNIX time or time since system boot) */ static inline uint64_t mavlink_msg_vision_position_estimate_get_usec(const mavlink_message_t* msg) { @@ -282,7 +282,7 @@ static inline uint64_t mavlink_msg_vision_position_estimate_get_usec(const mavli /** * @brief Get field x from vision_position_estimate message * - * @return Global X position + * @return [m] Local X position */ static inline float mavlink_msg_vision_position_estimate_get_x(const mavlink_message_t* msg) { @@ -292,7 +292,7 @@ static inline float mavlink_msg_vision_position_estimate_get_x(const mavlink_mes /** * @brief Get field y from vision_position_estimate message * - * @return Global Y position + * @return [m] Local Y position */ static inline float mavlink_msg_vision_position_estimate_get_y(const mavlink_message_t* msg) { @@ -302,7 +302,7 @@ static inline float mavlink_msg_vision_position_estimate_get_y(const mavlink_mes /** * @brief Get field z from vision_position_estimate message * - * @return Global Z position + * @return [m] Local Z position */ static inline float mavlink_msg_vision_position_estimate_get_z(const mavlink_message_t* msg) { @@ -312,7 +312,7 @@ static inline float mavlink_msg_vision_position_estimate_get_z(const mavlink_mes /** * @brief Get field roll from vision_position_estimate message * - * @return Roll angle in rad + * @return [rad] Roll angle */ static inline float mavlink_msg_vision_position_estimate_get_roll(const mavlink_message_t* msg) { @@ -322,7 +322,7 @@ static inline float mavlink_msg_vision_position_estimate_get_roll(const mavlink_ /** * @brief Get field pitch from vision_position_estimate message * - * @return Pitch angle in rad + * @return [rad] Pitch angle */ static inline float mavlink_msg_vision_position_estimate_get_pitch(const mavlink_message_t* msg) { @@ -332,7 +332,7 @@ static inline float mavlink_msg_vision_position_estimate_get_pitch(const mavlink /** * @brief Get field yaw from vision_position_estimate message * - * @return Yaw angle in rad + * @return [rad] Yaw angle */ static inline float mavlink_msg_vision_position_estimate_get_yaw(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_vision_speed_estimate.h b/lib/main/MAVLink/common/mavlink_msg_vision_speed_estimate.h index bca094713a..b3f3003636 100755 --- a/lib/main/MAVLink/common/mavlink_msg_vision_speed_estimate.h +++ b/lib/main/MAVLink/common/mavlink_msg_vision_speed_estimate.h @@ -3,13 +3,13 @@ #define MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE 103 -MAVPACKED( + typedef struct __mavlink_vision_speed_estimate_t { - uint64_t usec; /*< Timestamp (microseconds, synced to UNIX time or since system boot)*/ - float x; /*< Global X speed*/ - float y; /*< Global Y speed*/ - float z; /*< Global Z speed*/ -}) mavlink_vision_speed_estimate_t; + uint64_t usec; /*< [us] Timestamp (UNIX time or time since system boot)*/ + float x; /*< [m/s] Global X speed*/ + float y; /*< [m/s] Global Y speed*/ + float z; /*< [m/s] Global Z speed*/ +} mavlink_vision_speed_estimate_t; #define MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN 20 #define MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_MIN_LEN 20 @@ -50,10 +50,10 @@ typedef struct __mavlink_vision_speed_estimate_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param usec Timestamp (microseconds, synced to UNIX time or since system boot) - * @param x Global X speed - * @param y Global Y speed - * @param z Global Z speed + * @param usec [us] Timestamp (UNIX time or time since system boot) + * @param x [m/s] Global X speed + * @param y [m/s] Global Y speed + * @param z [m/s] Global Z speed * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_vision_speed_estimate_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -87,10 +87,10 @@ static inline uint16_t mavlink_msg_vision_speed_estimate_pack(uint8_t system_id, * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param usec Timestamp (microseconds, synced to UNIX time or since system boot) - * @param x Global X speed - * @param y Global Y speed - * @param z Global Z speed + * @param usec [us] Timestamp (UNIX time or time since system boot) + * @param x [m/s] Global X speed + * @param y [m/s] Global Y speed + * @param z [m/s] Global Z speed * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_vision_speed_estimate_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -150,10 +150,10 @@ static inline uint16_t mavlink_msg_vision_speed_estimate_encode_chan(uint8_t sys * @brief Send a vision_speed_estimate message * @param chan MAVLink channel to send the message * - * @param usec Timestamp (microseconds, synced to UNIX time or since system boot) - * @param x Global X speed - * @param y Global Y speed - * @param z Global Z speed + * @param usec [us] Timestamp (UNIX time or time since system boot) + * @param x [m/s] Global X speed + * @param y [m/s] Global Y speed + * @param z [m/s] Global Z speed */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -230,7 +230,7 @@ static inline void mavlink_msg_vision_speed_estimate_send_buf(mavlink_message_t /** * @brief Get field usec from vision_speed_estimate message * - * @return Timestamp (microseconds, synced to UNIX time or since system boot) + * @return [us] Timestamp (UNIX time or time since system boot) */ static inline uint64_t mavlink_msg_vision_speed_estimate_get_usec(const mavlink_message_t* msg) { @@ -240,7 +240,7 @@ static inline uint64_t mavlink_msg_vision_speed_estimate_get_usec(const mavlink_ /** * @brief Get field x from vision_speed_estimate message * - * @return Global X speed + * @return [m/s] Global X speed */ static inline float mavlink_msg_vision_speed_estimate_get_x(const mavlink_message_t* msg) { @@ -250,7 +250,7 @@ static inline float mavlink_msg_vision_speed_estimate_get_x(const mavlink_messag /** * @brief Get field y from vision_speed_estimate message * - * @return Global Y speed + * @return [m/s] Global Y speed */ static inline float mavlink_msg_vision_speed_estimate_get_y(const mavlink_message_t* msg) { @@ -260,7 +260,7 @@ static inline float mavlink_msg_vision_speed_estimate_get_y(const mavlink_messag /** * @brief Get field z from vision_speed_estimate message * - * @return Global Z speed + * @return [m/s] Global Z speed */ static inline float mavlink_msg_vision_speed_estimate_get_z(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/mavlink_msg_wind_cov.h b/lib/main/MAVLink/common/mavlink_msg_wind_cov.h index 0562fb0ea3..abce953e21 100755 --- a/lib/main/MAVLink/common/mavlink_msg_wind_cov.h +++ b/lib/main/MAVLink/common/mavlink_msg_wind_cov.h @@ -3,18 +3,18 @@ #define MAVLINK_MSG_ID_WIND_COV 231 -MAVPACKED( + typedef struct __mavlink_wind_cov_t { - uint64_t time_usec; /*< Timestamp (micros since boot or Unix epoch)*/ - float wind_x; /*< Wind in X (NED) direction in m/s*/ - float wind_y; /*< Wind in Y (NED) direction in m/s*/ - float wind_z; /*< Wind in Z (NED) direction in m/s*/ - float var_horiz; /*< Variability of the wind in XY. RMS of a 1 Hz lowpassed wind estimate.*/ - float var_vert; /*< Variability of the wind in Z. RMS of a 1 Hz lowpassed wind estimate.*/ - float wind_alt; /*< AMSL altitude (m) this measurement was taken at*/ - float horiz_accuracy; /*< Horizontal speed 1-STD accuracy*/ - float vert_accuracy; /*< Vertical speed 1-STD accuracy*/ -}) mavlink_wind_cov_t; + uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.*/ + float wind_x; /*< [m/s] Wind in X (NED) direction*/ + float wind_y; /*< [m/s] Wind in Y (NED) direction*/ + float wind_z; /*< [m/s] Wind in Z (NED) direction*/ + float var_horiz; /*< [m/s] Variability of the wind in XY. RMS of a 1 Hz lowpassed wind estimate.*/ + float var_vert; /*< [m/s] Variability of the wind in Z. RMS of a 1 Hz lowpassed wind estimate.*/ + float wind_alt; /*< [m] Altitude (MSL) that this measurement was taken at*/ + float horiz_accuracy; /*< [m] Horizontal speed 1-STD accuracy*/ + float vert_accuracy; /*< [m] Vertical speed 1-STD accuracy*/ +} mavlink_wind_cov_t; #define MAVLINK_MSG_ID_WIND_COV_LEN 40 #define MAVLINK_MSG_ID_WIND_COV_MIN_LEN 40 @@ -65,15 +65,15 @@ typedef struct __mavlink_wind_cov_t { * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * - * @param time_usec Timestamp (micros since boot or Unix epoch) - * @param wind_x Wind in X (NED) direction in m/s - * @param wind_y Wind in Y (NED) direction in m/s - * @param wind_z Wind in Z (NED) direction in m/s - * @param var_horiz Variability of the wind in XY. RMS of a 1 Hz lowpassed wind estimate. - * @param var_vert Variability of the wind in Z. RMS of a 1 Hz lowpassed wind estimate. - * @param wind_alt AMSL altitude (m) this measurement was taken at - * @param horiz_accuracy Horizontal speed 1-STD accuracy - * @param vert_accuracy Vertical speed 1-STD accuracy + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param wind_x [m/s] Wind in X (NED) direction + * @param wind_y [m/s] Wind in Y (NED) direction + * @param wind_z [m/s] Wind in Z (NED) direction + * @param var_horiz [m/s] Variability of the wind in XY. RMS of a 1 Hz lowpassed wind estimate. + * @param var_vert [m/s] Variability of the wind in Z. RMS of a 1 Hz lowpassed wind estimate. + * @param wind_alt [m] Altitude (MSL) that this measurement was taken at + * @param horiz_accuracy [m] Horizontal speed 1-STD accuracy + * @param vert_accuracy [m] Vertical speed 1-STD accuracy * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_wind_cov_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, @@ -117,15 +117,15 @@ static inline uint16_t mavlink_msg_wind_cov_pack(uint8_t system_id, uint8_t comp * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into - * @param time_usec Timestamp (micros since boot or Unix epoch) - * @param wind_x Wind in X (NED) direction in m/s - * @param wind_y Wind in Y (NED) direction in m/s - * @param wind_z Wind in Z (NED) direction in m/s - * @param var_horiz Variability of the wind in XY. RMS of a 1 Hz lowpassed wind estimate. - * @param var_vert Variability of the wind in Z. RMS of a 1 Hz lowpassed wind estimate. - * @param wind_alt AMSL altitude (m) this measurement was taken at - * @param horiz_accuracy Horizontal speed 1-STD accuracy - * @param vert_accuracy Vertical speed 1-STD accuracy + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param wind_x [m/s] Wind in X (NED) direction + * @param wind_y [m/s] Wind in Y (NED) direction + * @param wind_z [m/s] Wind in Z (NED) direction + * @param var_horiz [m/s] Variability of the wind in XY. RMS of a 1 Hz lowpassed wind estimate. + * @param var_vert [m/s] Variability of the wind in Z. RMS of a 1 Hz lowpassed wind estimate. + * @param wind_alt [m] Altitude (MSL) that this measurement was taken at + * @param horiz_accuracy [m] Horizontal speed 1-STD accuracy + * @param vert_accuracy [m] Vertical speed 1-STD accuracy * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_wind_cov_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, @@ -195,15 +195,15 @@ static inline uint16_t mavlink_msg_wind_cov_encode_chan(uint8_t system_id, uint8 * @brief Send a wind_cov message * @param chan MAVLink channel to send the message * - * @param time_usec Timestamp (micros since boot or Unix epoch) - * @param wind_x Wind in X (NED) direction in m/s - * @param wind_y Wind in Y (NED) direction in m/s - * @param wind_z Wind in Z (NED) direction in m/s - * @param var_horiz Variability of the wind in XY. RMS of a 1 Hz lowpassed wind estimate. - * @param var_vert Variability of the wind in Z. RMS of a 1 Hz lowpassed wind estimate. - * @param wind_alt AMSL altitude (m) this measurement was taken at - * @param horiz_accuracy Horizontal speed 1-STD accuracy - * @param vert_accuracy Vertical speed 1-STD accuracy + * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + * @param wind_x [m/s] Wind in X (NED) direction + * @param wind_y [m/s] Wind in Y (NED) direction + * @param wind_z [m/s] Wind in Z (NED) direction + * @param var_horiz [m/s] Variability of the wind in XY. RMS of a 1 Hz lowpassed wind estimate. + * @param var_vert [m/s] Variability of the wind in Z. RMS of a 1 Hz lowpassed wind estimate. + * @param wind_alt [m] Altitude (MSL) that this measurement was taken at + * @param horiz_accuracy [m] Horizontal speed 1-STD accuracy + * @param vert_accuracy [m] Vertical speed 1-STD accuracy */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS @@ -300,7 +300,7 @@ static inline void mavlink_msg_wind_cov_send_buf(mavlink_message_t *msgbuf, mavl /** * @brief Get field time_usec from wind_cov message * - * @return Timestamp (micros since boot or Unix epoch) + * @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. */ static inline uint64_t mavlink_msg_wind_cov_get_time_usec(const mavlink_message_t* msg) { @@ -310,7 +310,7 @@ static inline uint64_t mavlink_msg_wind_cov_get_time_usec(const mavlink_message_ /** * @brief Get field wind_x from wind_cov message * - * @return Wind in X (NED) direction in m/s + * @return [m/s] Wind in X (NED) direction */ static inline float mavlink_msg_wind_cov_get_wind_x(const mavlink_message_t* msg) { @@ -320,7 +320,7 @@ static inline float mavlink_msg_wind_cov_get_wind_x(const mavlink_message_t* msg /** * @brief Get field wind_y from wind_cov message * - * @return Wind in Y (NED) direction in m/s + * @return [m/s] Wind in Y (NED) direction */ static inline float mavlink_msg_wind_cov_get_wind_y(const mavlink_message_t* msg) { @@ -330,7 +330,7 @@ static inline float mavlink_msg_wind_cov_get_wind_y(const mavlink_message_t* msg /** * @brief Get field wind_z from wind_cov message * - * @return Wind in Z (NED) direction in m/s + * @return [m/s] Wind in Z (NED) direction */ static inline float mavlink_msg_wind_cov_get_wind_z(const mavlink_message_t* msg) { @@ -340,7 +340,7 @@ static inline float mavlink_msg_wind_cov_get_wind_z(const mavlink_message_t* msg /** * @brief Get field var_horiz from wind_cov message * - * @return Variability of the wind in XY. RMS of a 1 Hz lowpassed wind estimate. + * @return [m/s] Variability of the wind in XY. RMS of a 1 Hz lowpassed wind estimate. */ static inline float mavlink_msg_wind_cov_get_var_horiz(const mavlink_message_t* msg) { @@ -350,7 +350,7 @@ static inline float mavlink_msg_wind_cov_get_var_horiz(const mavlink_message_t* /** * @brief Get field var_vert from wind_cov message * - * @return Variability of the wind in Z. RMS of a 1 Hz lowpassed wind estimate. + * @return [m/s] Variability of the wind in Z. RMS of a 1 Hz lowpassed wind estimate. */ static inline float mavlink_msg_wind_cov_get_var_vert(const mavlink_message_t* msg) { @@ -360,7 +360,7 @@ static inline float mavlink_msg_wind_cov_get_var_vert(const mavlink_message_t* m /** * @brief Get field wind_alt from wind_cov message * - * @return AMSL altitude (m) this measurement was taken at + * @return [m] Altitude (MSL) that this measurement was taken at */ static inline float mavlink_msg_wind_cov_get_wind_alt(const mavlink_message_t* msg) { @@ -370,7 +370,7 @@ static inline float mavlink_msg_wind_cov_get_wind_alt(const mavlink_message_t* m /** * @brief Get field horiz_accuracy from wind_cov message * - * @return Horizontal speed 1-STD accuracy + * @return [m] Horizontal speed 1-STD accuracy */ static inline float mavlink_msg_wind_cov_get_horiz_accuracy(const mavlink_message_t* msg) { @@ -380,7 +380,7 @@ static inline float mavlink_msg_wind_cov_get_horiz_accuracy(const mavlink_messag /** * @brief Get field vert_accuracy from wind_cov message * - * @return Vertical speed 1-STD accuracy + * @return [m] Vertical speed 1-STD accuracy */ static inline float mavlink_msg_wind_cov_get_vert_accuracy(const mavlink_message_t* msg) { diff --git a/lib/main/MAVLink/common/testsuite.h b/lib/main/MAVLink/common/testsuite.h index 1952d024a3..a450230f3d 100755 --- a/lib/main/MAVLink/common/testsuite.h +++ b/lib/main/MAVLink/common/testsuite.h @@ -429,6 +429,70 @@ static void mavlink_test_auth_key(uint8_t system_id, uint8_t component_id, mavli MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); } +static void mavlink_test_link_node_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg) +{ +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0); + if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_LINK_NODE_STATUS >= 256) { + return; + } +#endif + mavlink_message_t msg; + uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; + uint16_t i; + mavlink_link_node_status_t packet_in = { + 93372036854775807ULL,963497880,963498088,963498296,963498504,963498712,18691,18795,18899,235,46 + }; + mavlink_link_node_status_t packet1, packet2; + memset(&packet1, 0, sizeof(packet1)); + packet1.timestamp = packet_in.timestamp; + packet1.tx_rate = packet_in.tx_rate; + packet1.rx_rate = packet_in.rx_rate; + packet1.messages_sent = packet_in.messages_sent; + packet1.messages_received = packet_in.messages_received; + packet1.messages_lost = packet_in.messages_lost; + packet1.rx_parse_err = packet_in.rx_parse_err; + packet1.tx_overflows = packet_in.tx_overflows; + packet1.rx_overflows = packet_in.rx_overflows; + packet1.tx_buf = packet_in.tx_buf; + packet1.rx_buf = packet_in.rx_buf; + + +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_LINK_NODE_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_LINK_NODE_STATUS_MIN_LEN); + } +#endif + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_link_node_status_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_link_node_status_decode(&msg, &packet2); + MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_link_node_status_pack(system_id, component_id, &msg , packet1.timestamp , packet1.tx_buf , packet1.rx_buf , packet1.tx_rate , packet1.rx_rate , packet1.rx_parse_err , packet1.tx_overflows , packet1.rx_overflows , packet1.messages_sent , packet1.messages_received , packet1.messages_lost ); + mavlink_msg_link_node_status_decode(&msg, &packet2); + MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_link_node_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.timestamp , packet1.tx_buf , packet1.rx_buf , packet1.tx_rate , packet1.rx_rate , packet1.rx_parse_err , packet1.tx_overflows , packet1.rx_overflows , packet1.messages_sent , packet1.messages_received , packet1.messages_lost ); + mavlink_msg_link_node_status_decode(&msg, &packet2); + MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_to_send_buffer(buffer, &msg); + for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_PARAM_ACK_TRANSACTION >= 256) { + return; + } +#endif + mavlink_message_t msg; + uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; + uint16_t i; + mavlink_param_ack_transaction_t packet_in = { + 17.0,17,84,"GHIJKLMNOPQRSTU",199,10 + }; + mavlink_param_ack_transaction_t packet1, packet2; + memset(&packet1, 0, sizeof(packet1)); + packet1.param_value = packet_in.param_value; + packet1.target_system = packet_in.target_system; + packet1.target_component = packet_in.target_component; + packet1.param_type = packet_in.param_type; + packet1.param_result = packet_in.param_result; + + mav_array_memcpy(packet1.param_id, packet_in.param_id, sizeof(char)*16); + +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_PARAM_ACK_TRANSACTION_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_PARAM_ACK_TRANSACTION_MIN_LEN); + } +#endif + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_param_ack_transaction_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_param_ack_transaction_decode(&msg, &packet2); + MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_param_ack_transaction_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_value , packet1.param_type , packet1.param_result ); + mavlink_msg_param_ack_transaction_decode(&msg, &packet2); + MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_param_ack_transaction_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_value , packet1.param_type , packet1.param_result ); + mavlink_msg_param_ack_transaction_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; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MISSION_CHANGED >= 256) { + return; + } +#endif + mavlink_message_t msg; + uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; + uint16_t i; + mavlink_mission_changed_t packet_in = { + 17235,17339,17,84,151 + }; + mavlink_mission_changed_t packet1, packet2; + memset(&packet1, 0, sizeof(packet1)); + packet1.start_index = packet_in.start_index; + packet1.end_index = packet_in.end_index; + packet1.origin_sysid = packet_in.origin_sysid; + packet1.origin_compid = packet_in.origin_compid; + packet1.mission_type = packet_in.mission_type; + + +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_MISSION_CHANGED_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MISSION_CHANGED_MIN_LEN); + } +#endif + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_mission_changed_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_mission_changed_decode(&msg, &packet2); + MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_mission_changed_pack(system_id, component_id, &msg , packet1.start_index , packet1.end_index , packet1.origin_sysid , packet1.origin_compid , packet1.mission_type ); + mavlink_msg_mission_changed_decode(&msg, &packet2); + MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_mission_changed_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.start_index , packet1.end_index , packet1.origin_sysid , packet1.origin_compid , packet1.mission_type ); + mavlink_msg_mission_changed_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; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_COMMAND_CANCEL >= 256) { + return; + } +#endif + mavlink_message_t msg; + uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; + uint16_t i; + mavlink_command_cancel_t packet_in = { + 17235,139,206 + }; + mavlink_command_cancel_t packet1, packet2; + memset(&packet1, 0, sizeof(packet1)); + packet1.command = packet_in.command; + packet1.target_system = packet_in.target_system; + packet1.target_component = packet_in.target_component; + + +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_COMMAND_CANCEL_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_COMMAND_CANCEL_MIN_LEN); + } +#endif + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_command_cancel_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_command_cancel_decode(&msg, &packet2); + MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_command_cancel_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.command ); + mavlink_msg_command_cancel_decode(&msg, &packet2); + MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_command_cancel_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.command ); + mavlink_msg_command_cancel_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; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_FENCE_STATUS >= 256) { + return; + } +#endif + mavlink_message_t msg; + uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; + uint16_t i; + mavlink_fence_status_t packet_in = { + 963497464,17443,151,218 + }; + mavlink_fence_status_t packet1, packet2; + memset(&packet1, 0, sizeof(packet1)); + packet1.breach_time = packet_in.breach_time; + packet1.breach_count = packet_in.breach_count; + packet1.breach_status = packet_in.breach_status; + packet1.breach_type = packet_in.breach_type; + + +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_FENCE_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_FENCE_STATUS_MIN_LEN); + } +#endif + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_fence_status_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_fence_status_decode(&msg, &packet2); + MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_fence_status_pack(system_id, component_id, &msg , packet1.breach_status , packet1.breach_count , packet1.breach_type , packet1.breach_time ); + mavlink_msg_fence_status_decode(&msg, &packet2); + MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_fence_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.breach_status , packet1.breach_count , packet1.breach_type , packet1.breach_time ); + mavlink_msg_fence_status_decode(&msg, &packet2); + MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_to_send_buffer(buffer, &msg); + for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_HIGH_LATENCY2 >= 256) { + return; + } +#endif + mavlink_message_t msg; + uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; + uint16_t i; + mavlink_high_latency2_t packet_in = { + 963497464,963497672,963497880,17859,17963,18067,18171,18275,18379,77,144,211,22,89,156,223,34,101,168,235,46,113,180,247,58,125,192 + }; + mavlink_high_latency2_t packet1, packet2; + memset(&packet1, 0, sizeof(packet1)); + packet1.timestamp = packet_in.timestamp; + packet1.latitude = packet_in.latitude; + packet1.longitude = packet_in.longitude; + packet1.custom_mode = packet_in.custom_mode; + packet1.altitude = packet_in.altitude; + packet1.target_altitude = packet_in.target_altitude; + packet1.target_distance = packet_in.target_distance; + packet1.wp_num = packet_in.wp_num; + packet1.failure_flags = packet_in.failure_flags; + packet1.type = packet_in.type; + packet1.autopilot = packet_in.autopilot; + packet1.heading = packet_in.heading; + packet1.target_heading = packet_in.target_heading; + packet1.throttle = packet_in.throttle; + packet1.airspeed = packet_in.airspeed; + packet1.airspeed_sp = packet_in.airspeed_sp; + packet1.groundspeed = packet_in.groundspeed; + packet1.windspeed = packet_in.windspeed; + packet1.wind_heading = packet_in.wind_heading; + packet1.eph = packet_in.eph; + packet1.epv = packet_in.epv; + packet1.temperature_air = packet_in.temperature_air; + packet1.climb_rate = packet_in.climb_rate; + packet1.battery = packet_in.battery; + packet1.custom0 = packet_in.custom0; + packet1.custom1 = packet_in.custom1; + packet1.custom2 = packet_in.custom2; + + +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_HIGH_LATENCY2_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_HIGH_LATENCY2_MIN_LEN); + } +#endif + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_high_latency2_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_high_latency2_decode(&msg, &packet2); + MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_high_latency2_pack(system_id, component_id, &msg , packet1.timestamp , packet1.type , packet1.autopilot , packet1.custom_mode , packet1.latitude , packet1.longitude , packet1.altitude , packet1.target_altitude , packet1.heading , packet1.target_heading , packet1.target_distance , packet1.throttle , packet1.airspeed , packet1.airspeed_sp , packet1.groundspeed , packet1.windspeed , packet1.wind_heading , packet1.eph , packet1.epv , packet1.temperature_air , packet1.climb_rate , packet1.battery , packet1.wp_num , packet1.failure_flags , packet1.custom0 , packet1.custom1 , packet1.custom2 ); + mavlink_msg_high_latency2_decode(&msg, &packet2); + MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_high_latency2_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.timestamp , packet1.type , packet1.autopilot , packet1.custom_mode , packet1.latitude , packet1.longitude , packet1.altitude , packet1.target_altitude , packet1.heading , packet1.target_heading , packet1.target_distance , packet1.throttle , packet1.airspeed , packet1.airspeed_sp , packet1.groundspeed , packet1.windspeed , packet1.wind_heading , packet1.eph , packet1.epv , packet1.temperature_air , packet1.climb_rate , packet1.battery , packet1.wp_num , packet1.failure_flags , packet1.custom0 , packet1.custom1 , packet1.custom2 ); + mavlink_msg_high_latency2_decode(&msg, &packet2); + MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_to_send_buffer(buffer, &msg); + for (i=0; i - * - * mavlink_message_t msg; - * int chan = 0; - * - * - * while(serial.bytesAvailable > 0) - * { - * uint8_t byte = serial.getNextByte(); - * if (mavlink_frame_char(chan, byte, &msg) != MAVLINK_FRAMING_INCOMPLETE) - * { - * printf("Received message with ID %d, sequence: %d from component %d of system %d", msg.msgid, msg.seq, msg.compid, msg.sysid); - * } - * } - * - * - * @endcode */ MAVLINK_HELPER uint8_t mavlink_frame_char_buffer(mavlink_message_t* rxmsg, mavlink_status_t* status, @@ -430,17 +409,17 @@ MAVLINK_HELPER uint8_t mavlink_frame_char_buffer(mavlink_message_t* rxmsg, * 2 (MAVLINK_FRAMING_INCOMPLETE, MAVLINK_FRAMING_OK or MAVLINK_FRAMING_BAD_CRC) * * Messages are parsed into an internal buffer (one for each channel). When a complete - * message is received it is copies into *returnMsg and the channel's status is - * copied into *returnStats. + * message is received it is copies into *r_message and the channel's status is + * copied into *r_mavlink_status. * - * @param chan ID of the current channel. This allows to parse different channels with this function. - * a channel is not a physical message channel like a serial port, but a logic partition of - * the communication streams in this case. COMM_NB is the limit for the number of channels + * @param chan ID of the channel to be parsed. + * A channel is not a physical message channel like a serial port, but a logical partition of + * the communication streams. COMM_NB is the limit for the number of channels * on MCU (e.g. ARM7), while COMM_NB_HIGH is the limit for the number of channels in Linux/Windows * @param c The char to parse * - * @param returnMsg NULL if no message could be decoded, the message data else - * @param returnStats if a message was decoded, this is filled with the channel's stats + * @param r_message NULL if no message could be decoded, the message data else + * @param r_mavlink_status if a message was decoded, this is filled with the channel's stats * @return 0 if no message could be decoded, 1 on good message and CRC, 2 on bad CRC * * A typical use scenario of this function call is: @@ -448,6 +427,7 @@ MAVLINK_HELPER uint8_t mavlink_frame_char_buffer(mavlink_message_t* rxmsg, * @code * #include * + * mavlink_status_t status; * mavlink_message_t msg; * int chan = 0; * @@ -455,7 +435,7 @@ MAVLINK_HELPER uint8_t mavlink_frame_char_buffer(mavlink_message_t* rxmsg, * while(serial.bytesAvailable > 0) * { * uint8_t byte = serial.getNextByte(); - * if (mavlink_frame_char(chan, byte, &msg) != MAVLINK_FRAMING_INCOMPLETE) + * if (mavlink_frame_char(chan, byte, &msg, &status) != MAVLINK_FRAMING_INCOMPLETE) * { * printf("Received message with ID %d, sequence: %d from component %d of system %d", msg.msgid, msg.seq, msg.compid, msg.sysid); * } @@ -480,17 +460,17 @@ MAVLINK_HELPER uint8_t mavlink_frame_char(uint8_t chan, uint8_t c, mavlink_messa * it could be successfully decoded. This function will return 0 or 1. * * Messages are parsed into an internal buffer (one for each channel). When a complete - * message is received it is copies into *returnMsg and the channel's status is - * copied into *returnStats. + * message is received it is copies into *r_message and the channel's status is + * copied into *r_mavlink_status. * - * @param chan ID of the current channel. This allows to parse different channels with this function. - * a channel is not a physical message channel like a serial port, but a logic partition of - * the communication streams in this case. COMM_NB is the limit for the number of channels + * @param chan ID of the channel to be parsed. + * A channel is not a physical message channel like a serial port, but a logical partition of + * the communication streams. COMM_NB is the limit for the number of channels * on MCU (e.g. ARM7), while COMM_NB_HIGH is the limit for the number of channels in Linux/Windows * @param c The char to parse * - * @param returnMsg NULL if no message could be decoded, the message data else - * @param returnStats if a message was decoded, this is filled with the channel's stats + * @param r_message NULL if no message could be decoded, otherwise the message data. + * @param r_mavlink_status if a message was decoded, this is filled with the channel's stats * @return 0 if no message could be decoded or bad CRC, 1 on good message and CRC * * A typical use scenario of this function call is: @@ -498,6 +478,7 @@ MAVLINK_HELPER uint8_t mavlink_frame_char(uint8_t chan, uint8_t c, mavlink_messa * @code * #include * + * mavlink_status_t status; * mavlink_message_t msg; * int chan = 0; * @@ -505,7 +486,7 @@ MAVLINK_HELPER uint8_t mavlink_frame_char(uint8_t chan, uint8_t c, mavlink_messa * while(serial.bytesAvailable > 0) * { * uint8_t byte = serial.getNextByte(); - * if (mavlink_parse_char(chan, byte, &msg)) + * if (mavlink_parse_char(chan, byte, &msg, &status)) * { * printf("Received message with ID %d, sequence: %d from component %d of system %d", msg.msgid, msg.seq, msg.compid, msg.sysid); * } diff --git a/lib/main/MAVLink/protocol.h b/lib/main/MAVLink/protocol.h index 731bd3a583..34749d9ba7 100755 --- a/lib/main/MAVLink/protocol.h +++ b/lib/main/MAVLink/protocol.h @@ -239,9 +239,9 @@ _MAV_PUT_ARRAY(int64_t, i64) _MAV_PUT_ARRAY(float, f) _MAV_PUT_ARRAY(double, d) -#define _MAV_RETURN_char(msg, wire_offset) (const char)_MAV_PAYLOAD(msg)[wire_offset] -#define _MAV_RETURN_int8_t(msg, wire_offset) (const int8_t)_MAV_PAYLOAD(msg)[wire_offset] -#define _MAV_RETURN_uint8_t(msg, wire_offset) (const uint8_t)_MAV_PAYLOAD(msg)[wire_offset] +#define _MAV_RETURN_char(msg, wire_offset) (char)_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] #if MAVLINK_NEED_BYTE_SWAP #define _MAV_MSG_RETURN_TYPE(TYPE, SIZE) \ diff --git a/src/main/CMakeLists.txt b/src/main/CMakeLists.txt index 674b766d0b..0bd201a9fb 100644 --- a/src/main/CMakeLists.txt +++ b/src/main/CMakeLists.txt @@ -118,6 +118,8 @@ main_sources(COMMON_SRC drivers/barometer/barometer_ms56xx.h drivers/barometer/barometer_spl06.c drivers/barometer/barometer_spl06.h + drivers/barometer/barometer_msp.c + drivers/barometer/barometer_msp.h drivers/buf_writer.c drivers/buf_writer.h @@ -148,6 +150,8 @@ main_sources(COMMON_SRC drivers/compass/compass_mpu9250.h drivers/compass/compass_qmc5883l.c drivers/compass/compass_qmc5883l.h + drivers/compass/compass_msp.c + drivers/compass/compass_msp.h drivers/display.c drivers/display.h @@ -195,12 +199,14 @@ main_sources(COMMON_SRC drivers/osd.h drivers/persistent.c drivers/persistent.h - drivers/pitotmeter_adc.c - drivers/pitotmeter_adc.h - drivers/pitotmeter_ms4525.c - drivers/pitotmeter_ms4525.h - drivers/pitotmeter_virtual.c - drivers/pitotmeter_virtual.h + drivers/pitotmeter/pitotmeter_adc.c + drivers/pitotmeter/pitotmeter_adc.h + drivers/pitotmeter/pitotmeter_ms4525.c + drivers/pitotmeter/pitotmeter_ms4525.h + drivers/pitotmeter/pitotmeter_msp.c + drivers/pitotmeter/pitotmeter_msp.h + drivers/pitotmeter/pitotmeter_virtual.c + drivers/pitotmeter/pitotmeter_virtual.h drivers/pwm_esc_detect.c drivers/pwm_esc_detect.h drivers/pwm_mapping.c @@ -401,6 +407,8 @@ main_sources(COMMON_SRC rx/sbus_channels.h rx/spektrum.c rx/spektrum.h + rx/srxl2.c + rx/srxl2.h rx/sumd.c rx/sumd.h rx/sumh.c @@ -486,6 +494,8 @@ main_sources(COMMON_SRC io/displayport_msp.h io/displayport_oled.c io/displayport_oled.h + io/displayport_srxl.c + io/displayport_srxl.h io/displayport_hott.c io/displayport_hott.h io/flashfs.c @@ -495,6 +505,7 @@ main_sources(COMMON_SRC io/gps_ublox.c io/gps_nmea.c io/gps_naza.c + io/gps_msp.c io/gps_private.h io/ledstrip.c io/ledstrip.h @@ -547,6 +558,8 @@ main_sources(COMMON_SRC telemetry/crsf.c telemetry/crsf.h + telemetry/srxl.c + telemetry/srxl.h telemetry/frsky.c telemetry/frsky.h telemetry/frsky_d.c diff --git a/src/main/cms/cms_menu_imu.c b/src/main/cms/cms_menu_imu.c index 3b02bb1927..07e56539b7 100644 --- a/src/main/cms/cms_menu_imu.c +++ b/src/main/cms/cms_menu_imu.c @@ -400,13 +400,21 @@ static const CMS_Menu cmsx_menuProfileOther = { // static const OSD_Entry cmsx_menuFilterPerProfileEntries[] = { - OSD_LABEL_DATA_ENTRY("-- FILTER PP --", profileIndexString), - + OSD_LABEL_DATA_ENTRY("-- FILTERING --", profileIndexString), + OSD_SETTING_ENTRY("HARDWARE LPF", SETTING_GYRO_HARDWARE_LPF), + OSD_SETTING_ENTRY("GYRO LPF", SETTING_GYRO_LPF_HZ), + OSD_SETTING_ENTRY("GYRO LPF2", SETTING_GYRO_STAGE2_LOWPASS_HZ), OSD_SETTING_ENTRY("DTERM LPF", SETTING_DTERM_LPF_HZ), - OSD_SETTING_ENTRY("GYRO SLPF", SETTING_GYRO_LPF_HZ), - OSD_SETTING_ENTRY("YAW SUM LIM", SETTING_PIDSUM_LIMIT_YAW), - OSD_SETTING_ENTRY("YAW LPF", SETTING_YAW_LPF_HZ), - + OSD_SETTING_ENTRY("DTERM LPF2", SETTING_DTERM_LPF2_HZ), +#ifdef USE_DYNAMIC_FILTERS + OSD_SETTING_ENTRY("MATRIX FILTER", SETTING_DYNAMIC_GYRO_NOTCH_ENABLED), + OSD_SETTING_ENTRY("MATRIX MIN HZ", SETTING_DYNAMIC_GYRO_NOTCH_MIN_HZ), //dynamic_gyro_notch_min_hz + OSD_SETTING_ENTRY("MATRIX Q", SETTING_DYNAMIC_GYRO_NOTCH_Q), //dynamic_gyro_notch_q +#endif +#ifdef USE_GYRO_KALMAN + OSD_SETTING_ENTRY("UNICORN FILTER", SETTING_SETPOINT_KALMAN_ENABLED), //setpoint_kalman_enabled + OSD_SETTING_ENTRY("UNICORN Q", SETTING_SETPOINT_KALMAN_Q), //setpoint_kalman_q +#endif OSD_BACK_AND_END_ENTRY, }; @@ -421,17 +429,23 @@ static const CMS_Menu cmsx_menuFilterPerProfile = { .entries = cmsx_menuFilterPerProfileEntries, }; -static const OSD_Entry cmsx_menuGyroEntries[] = +static const OSD_Entry cmsx_menuMechanicsEntries[] = { - OSD_LABEL_DATA_ENTRY("-- GYRO GLB --", profileIndexString), - - OSD_SETTING_ENTRY("GYRO SYNC", SETTING_GYRO_SYNC), - OSD_SETTING_ENTRY("GYRO LPF", SETTING_GYRO_HARDWARE_LPF), - + OSD_LABEL_DATA_ENTRY("-- MECHANICS --", profileIndexString), +#ifdef USE_D_BOOST + OSD_SETTING_ENTRY("DBOOST_FACTOR", SETTING_D_BOOST_FACTOR), +#endif +#ifdef USE_ANTIGRAVITY + OSD_SETTING_ENTRY("ANTIGRAV. GAIN", SETTING_ANTIGRAVITY_GAIN), +#endif + OSD_SETTING_ENTRY("ITERM RELAX", SETTING_MC_ITERM_RELAX), + OSD_SETTING_ENTRY("ITERM CUTOFF", SETTING_MC_ITERM_RELAX_CUTOFF), + OSD_SETTING_ENTRY("CD LPF", SETTING_MC_CD_LPF_HZ), + OSD_BACK_AND_END_ENTRY, }; -static const CMS_Menu cmsx_menuGyro = { +static const CMS_Menu cmsx_menuMechanics = { #ifdef CMS_MENU_DEBUG .GUARD_text = "XGYROGLB", .GUARD_type = OME_MENU, @@ -439,7 +453,7 @@ static const CMS_Menu cmsx_menuGyro = { .onEnter = NULL, .onExit = NULL, .onGlobalExit = NULL, - .entries = cmsx_menuGyroEntries, + .entries = cmsx_menuMechanicsEntries, }; static const OSD_Entry cmsx_menuImuEntries[] = @@ -451,7 +465,8 @@ static const OSD_Entry cmsx_menuImuEntries[] = OSD_SUBMENU_ENTRY("PID", &cmsx_menuPid), OSD_SUBMENU_ENTRY("PID ALTMAG", &cmsx_menuPidAltMag), OSD_SUBMENU_ENTRY("PID GPSNAV", &cmsx_menuPidGpsnav), - OSD_SUBMENU_ENTRY("FILT PP", &cmsx_menuFilterPerProfile), + OSD_SUBMENU_ENTRY("FILTERING", &cmsx_menuFilterPerProfile), + OSD_SUBMENU_ENTRY("MECHANICS", &cmsx_menuMechanics), // Rate profile dependent OSD_UINT8_CALLBACK_ENTRY("RATE PROF", cmsx_profileIndexOnChange, (&(const OSD_UINT8_t){ &tmpProfileIndex, 1, MAX_CONTROL_RATE_PROFILE_COUNT, 1})), @@ -459,7 +474,6 @@ static const OSD_Entry cmsx_menuImuEntries[] = OSD_SUBMENU_ENTRY("MANU RATE", &cmsx_menuManualRateProfile), // Global - OSD_SUBMENU_ENTRY("GYRO GLB", &cmsx_menuGyro), #ifdef NOT_YET {"OTHER PP", OME_Submenu, cmsMenuChange, &cmsx_menuProfileOther, 0}, diff --git a/src/main/cms/cms_menu_navigation.c b/src/main/cms/cms_menu_navigation.c index af5ac8574b..2a70ce6fe6 100644 --- a/src/main/cms/cms_menu_navigation.c +++ b/src/main/cms/cms_menu_navigation.c @@ -96,9 +96,9 @@ static const CMS_Menu cmsx_menuRTH = { .entries = cmsx_menuRTHEntries }; -static const OSD_Entry cmsx_menuFixedWingEntries[] = +static const OSD_Entry cmsx_menuFWCruiseEntries[] = { - OSD_LABEL_ENTRY("-- FIXED WING --"), + OSD_LABEL_ENTRY("-- CRUISE --"), OSD_SETTING_ENTRY("CRUISE THROTTLE", SETTING_NAV_FW_CRUISE_THR), OSD_SETTING_ENTRY("MIN THROTTLE", SETTING_NAV_FW_MIN_THR), @@ -109,11 +109,65 @@ static const OSD_Entry cmsx_menuFixedWingEntries[] = OSD_SETTING_ENTRY("PITCH TO THR RATIO", SETTING_NAV_FW_PITCH2THR), OSD_SETTING_ENTRY("LOITER RADIUS", SETTING_NAV_FW_LOITER_RADIUS), OSD_SETTING_ENTRY("CONTROL SMOOTHNESS", SETTING_NAV_FW_CONTROL_SMOOTHNESS), + OSD_SETTING_ENTRY("PITCH TO THR SMOOTHING", SETTING_NAV_FW_PITCH2THR_SMOOTHING), + OSD_SETTING_ENTRY("PITCH TO THR THRESHOLD", SETTING_NAV_FW_PITCH2THR_THRESHOLD), OSD_BACK_AND_END_ENTRY, }; -static const CMS_Menu cmsx_menuFixedWing = { +static const CMS_Menu cmsx_menuFWCruise = { +#ifdef CMS_MENU_DEBUG + .GUARD_text = "MENUNAVFWCRUISE", + .GUARD_type = OME_MENU, +#endif + .onEnter = NULL, + .onExit = NULL, + .onGlobalExit = NULL, + .entries = cmsx_menuFWCruiseEntries +}; + +static const OSD_Entry cmsx_menuFWLaunchEntries[] = +{ + OSD_LABEL_ENTRY("-- AUTOLAUNCH --"), + + OSD_SETTING_ENTRY("LAUNCH THR", SETTING_NAV_FW_LAUNCH_THR), + OSD_SETTING_ENTRY("IDLE THROTTLE", SETTING_NAV_FW_LAUNCH_IDLE_THR), + OSD_SETTING_ENTRY("MOTOR SPINUP TIME", SETTING_NAV_FW_LAUNCH_SPINUP_TIME), + OSD_SETTING_ENTRY("TIMEOUT", SETTING_NAV_FW_LAUNCH_TIMEOUT), + OSD_SETTING_ENTRY("END TRANSITION TIME", SETTING_NAV_FW_LAUNCH_END_TIME), + OSD_SETTING_ENTRY("MAX ALTITUDE", SETTING_NAV_FW_LAUNCH_MAX_ALTITUDE), + OSD_SETTING_ENTRY("CLIMB ANGLE", SETTING_NAV_FW_LAUNCH_CLIMB_ANGLE), + OSD_SETTING_ENTRY("MAX BANK ANGLE", SETTING_NAV_FW_LAUNCH_MAX_ANGLE), + OSD_SETTING_ENTRY("MOTOR DELAY", SETTING_NAV_FW_LAUNCH_MOTOR_DELAY), + OSD_SETTING_ENTRY("VELOCITY", SETTING_NAV_FW_LAUNCH_VELOCITY), + OSD_SETTING_ENTRY("ACCELERATION", SETTING_NAV_FW_LAUNCH_ACCEL), + OSD_SETTING_ENTRY("DETECT TIME", SETTING_NAV_FW_LAUNCH_DETECT_TIME), + + OSD_BACK_AND_END_ENTRY, + }; + +static const CMS_Menu cmsx_menuFWLaunch = { +#ifdef CMS_MENU_DEBUG + .GUARD_text = "MENUNAVFWLAUNCH", + .GUARD_type = OME_MENU, +#endif + .onEnter = NULL, + .onExit = NULL, + .onGlobalExit = NULL, + .entries = cmsx_menuFWLaunchEntries +}; + +static const OSD_Entry cmsx_menuFWSettingsEntries[] = +{ + OSD_LABEL_ENTRY("-- FIXED WING --"), + + OSD_SUBMENU_ENTRY("AUTOLAUNCH", &cmsx_menuFWLaunch), + OSD_SUBMENU_ENTRY("CRUISE", &cmsx_menuFWCruise), + + OSD_BACK_AND_END_ENTRY, +}; + +static const CMS_Menu cmsx_menuFWSettings = { #ifdef CMS_MENU_DEBUG .GUARD_text = "MENUNAVFW", .GUARD_type = OME_MENU, @@ -121,7 +175,7 @@ static const CMS_Menu cmsx_menuFixedWing = { .onEnter = NULL, .onExit = NULL, .onGlobalExit = NULL, - .entries = cmsx_menuFixedWingEntries + .entries = cmsx_menuFWSettingsEntries }; static const OSD_Entry cmsx_menuNavigationEntries[] = @@ -130,7 +184,7 @@ static const OSD_Entry cmsx_menuNavigationEntries[] = OSD_SUBMENU_ENTRY("BASIC SETTINGS", &cmsx_menuNavSettings), OSD_SUBMENU_ENTRY("RTH", &cmsx_menuRTH), - OSD_SUBMENU_ENTRY("FIXED WING", &cmsx_menuFixedWing), + OSD_SUBMENU_ENTRY("FIXED WING", &cmsx_menuFWSettings), OSD_BACK_AND_END_ENTRY, }; diff --git a/src/main/cms/cms_menu_osd.c b/src/main/cms/cms_menu_osd.c index 69c45d6217..874c5fde29 100755 --- a/src/main/cms/cms_menu_osd.c +++ b/src/main/cms/cms_menu_osd.c @@ -143,8 +143,9 @@ static const OSD_Entry menuCrsfRxEntries[]= { OSD_LABEL_ENTRY("-- CRSF RX --"), - OSD_SETTING_ENTRY("CRSF SNR LEVEL", SETTING_OSD_SNR_ALARM), - OSD_SETTING_ENTRY("LQ ALARM LEVEL", SETTING_OSD_RSSI_ALARM), + OSD_SETTING_ENTRY("LQ FORMAT", SETTING_OSD_CRSF_LQ_FORMAT), + OSD_SETTING_ENTRY("LQ ALARM LEVEL", SETTING_OSD_LINK_QUALITY_ALARM), + OSD_SETTING_ENTRY("SNR ALARM LEVEL", SETTING_OSD_SNR_ALARM), OSD_ELEMENT_ENTRY("RX RSSI DBM", OSD_CRSF_RSSI_DBM), OSD_ELEMENT_ENTRY("RX LQ", OSD_CRSF_LQ), OSD_ELEMENT_ENTRY("RX SNR ALARM", OSD_CRSF_SNR_DB), diff --git a/src/main/common/filter.c b/src/main/common/filter.c index 387d478d39..b3683c3edc 100644 --- a/src/main/common/filter.c +++ b/src/main/common/filter.c @@ -135,6 +135,17 @@ void biquadFilterInitLPF(biquadFilter_t *filter, uint16_t filterFreq, uint32_t s biquadFilterInit(filter, filterFreq, samplingIntervalUs, BIQUAD_Q, FILTER_LPF); } + +static void biquadFilterSetupPassthrough(biquadFilter_t *filter) +{ + // By default set as passthrough + filter->b0 = 1.0f; + filter->b1 = 0.0f; + filter->b2 = 0.0f; + filter->a1 = 0.0f; + filter->a2 = 0.0f; +} + void biquadFilterInit(biquadFilter_t *filter, uint16_t filterFreq, uint32_t samplingIntervalUs, float Q, biquadFilterType_e filterType) { // Check for Nyquist frequency and if it's not possible to initialize filter as requested - set to no filtering at all @@ -148,16 +159,19 @@ void biquadFilterInit(biquadFilter_t *filter, uint16_t filterFreq, uint32_t samp float b0, b1, b2; switch (filterType) { - case FILTER_LPF: - b0 = (1 - cs) / 2; - b1 = 1 - cs; - b2 = (1 - cs) / 2; - break; - case FILTER_NOTCH: - b0 = 1; - b1 = -2 * cs; - b2 = 1; - break; + case FILTER_LPF: + b0 = (1 - cs) / 2; + b1 = 1 - cs; + b2 = (1 - cs) / 2; + break; + case FILTER_NOTCH: + b0 = 1; + b1 = -2 * cs; + b2 = 1; + break; + default: + biquadFilterSetupPassthrough(filter); + return; } const float a0 = 1 + alpha; const float a1 = -2 * cs; @@ -169,14 +183,8 @@ void biquadFilterInit(biquadFilter_t *filter, uint16_t filterFreq, uint32_t samp filter->b2 = b2 / a0; filter->a1 = a1 / a0; filter->a2 = a2 / a0; - } - else { - // Not possible to filter frequencies above Nyquist frequency - passthrough - filter->b0 = 1.0f; - filter->b1 = 0.0f; - filter->b2 = 0.0f; - filter->a1 = 0.0f; - filter->a2 = 0.0f; + } else { + biquadFilterSetupPassthrough(filter); } // zero initial samples @@ -231,4 +239,4 @@ FAST_CODE void biquadFilterUpdate(biquadFilter_t *filter, float filterFreq, uint filter->x2 = x2; filter->y1 = y1; filter->y2 = y2; -} \ No newline at end of file +} diff --git a/src/main/common/log.h b/src/main/common/log.h index 1622063d35..080f36c357 100644 --- a/src/main/common/log.h +++ b/src/main/common/log.h @@ -30,6 +30,7 @@ typedef enum { LOG_TOPIC_POS_ESTIMATOR, // 8, mask = 256 LOG_TOPIC_VTX, // 9, mask = 512 LOG_TOPIC_OSD, // 10, mask = 1024 + LOG_TOPIC_GPS, // 11, mask = 2048 LOG_TOPIC_COUNT, } logTopic_e; diff --git a/src/main/config/parameter_group_ids.h b/src/main/config/parameter_group_ids.h index 67d86a1b9e..47c1faeb05 100644 --- a/src/main/config/parameter_group_ids.h +++ b/src/main/config/parameter_group_ids.h @@ -114,7 +114,8 @@ #define PG_SMARTPORT_MASTER_CONFIG 1024 #define PG_OSD_LAYOUTS_CONFIG 1025 #define PG_SAFE_HOME_CONFIG 1026 -#define PG_INAV_END 1026 +#define PG_DJI_OSD_CONFIG 1027 +#define PG_INAV_END 1027 // OSD configuration (subject to change) //#define PG_OSD_FONT_CONFIG 2047 diff --git a/src/main/drivers/barometer/barometer_msp.c b/src/main/drivers/barometer/barometer_msp.c new file mode 100644 index 0000000000..b17023d699 --- /dev/null +++ b/src/main/drivers/barometer/barometer_msp.c @@ -0,0 +1,102 @@ +/* + * This file is part of INAV Project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. + * + * Alternatively, the contents of this file may be used under the terms + * of the GNU General Public License Version 3, as described below: + * + * This file is free software: you may copy, redistribute 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 file 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 http://www.gnu.org/licenses/. + */ + +#include +#include + +#include "platform.h" + +#if defined(USE_BARO_MSP) + +#include "build/build_config.h" +#include "build/debug.h" + +#include "common/utils.h" +#include "common/time.h" + +#include "drivers/time.h" +#include "drivers/barometer/barometer.h" +#include "drivers/barometer/barometer_msp.h" + +#include "msp/msp_protocol_v2_sensor_msg.h" + +#define MSP_BARO_TIMEOUT_MS 250 // Less than 4Hz updates is considered a failure + +static int32_t mspBaroPressure; +static int32_t mspBaroTemperature; +static timeMs_t mspBaroLastUpdateMs; + +static bool mspBaroStartGet(baroDev_t * baro) +{ + UNUSED(baro); + return true; +} + +static bool mspBaroCalculate(baroDev_t * baro, int32_t *pressure, int32_t *temperature) +{ + UNUSED(baro); + + if ((millis() - mspBaroLastUpdateMs) > MSP_BARO_TIMEOUT_MS) { + return false; + } + + if (pressure) + *pressure = mspBaroPressure; + + if (temperature) + *temperature = mspBaroTemperature; + + return true; +} + +void mspBaroReceiveNewData(uint8_t * bufferPtr) +{ + const mspSensorBaroDataMessage_t * pkt = (const mspSensorBaroDataMessage_t *)bufferPtr; + + mspBaroPressure = pkt->pressurePa; + mspBaroTemperature = pkt->temp; + mspBaroLastUpdateMs = millis(); +} + +bool mspBaroDetect(baroDev_t *baro) +{ + mspBaroPressure = 101325; // pressure in Pa (0m MSL) + mspBaroTemperature = 2500; // temperature in 0.01 C = 25 deg + + // these are dummy as temperature is measured as part of pressure + baro->ut_delay = 10000; + baro->get_ut = mspBaroStartGet; + baro->start_ut = mspBaroStartGet; + + // only _up part is executed, and gets both temperature and pressure + baro->up_delay = 10000; + baro->start_up = mspBaroStartGet; + baro->get_up = mspBaroStartGet; + + baro->calculate = mspBaroCalculate; + + return true; +} + +#endif diff --git a/src/main/drivers/barometer/barometer_msp.h b/src/main/drivers/barometer/barometer_msp.h new file mode 100644 index 0000000000..dcf979be53 --- /dev/null +++ b/src/main/drivers/barometer/barometer_msp.h @@ -0,0 +1,29 @@ +/* + * This file is part of INAV Project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. + * + * Alternatively, the contents of this file may be used under the terms + * of the GNU General Public License Version 3, as described below: + * + * This file is free software: you may copy, redistribute 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 file 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 http://www.gnu.org/licenses/. + */ + +#pragma once + +struct baroDev_s; +bool mspBaroDetect(struct baroDev_s *baro); +void mspBaroReceiveNewData(uint8_t * bufferPtr); \ No newline at end of file diff --git a/src/main/drivers/compass/compass_msp.c b/src/main/drivers/compass/compass_msp.c new file mode 100644 index 0000000000..f9c1cb794b --- /dev/null +++ b/src/main/drivers/compass/compass_msp.c @@ -0,0 +1,96 @@ +/* + * This file is part of INAV Project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. + * + * Alternatively, the contents of this file may be used under the terms + * of the GNU General Public License Version 3, as described below: + * + * This file is free software: you may copy, redistribute 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 file 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 http://www.gnu.org/licenses/. + */ + +#include +#include + +#include "platform.h" + +#if defined(USE_MAG_MSP) + +#include "build/build_config.h" + +#include "common/axis.h" +#include "common/utils.h" +#include "common/time.h" + +#include "drivers/time.h" +#include "drivers/compass/compass.h" +#include "drivers/compass/compass_msp.h" + +#include "sensors/boardalignment.h" + +#include "msp/msp_protocol_v2_sensor_msg.h" + +#define MSP_MAG_TIMEOUT_MS 250 // Less than 4Hz updates is considered a failure + +static int32_t mspMagData[XYZ_AXIS_COUNT]; +static timeMs_t mspMagLastUpdateMs; + +static bool mspMagInit(magDev_t *magDev) +{ + UNUSED(magDev); + mspMagData[X] = 0; + mspMagData[Y] = 0; + mspMagData[Z] = 0; + mspMagLastUpdateMs = 0; + return true; +} + +void mspMagReceiveNewData(uint8_t * bufferPtr) +{ + const mspSensorCompassDataMessage_t * pkt = (const mspSensorCompassDataMessage_t *)bufferPtr; + + mspMagData[X] = pkt->magX; + mspMagData[Y] = pkt->magY; + mspMagData[Z] = pkt->magZ; + + applySensorAlignment(mspMagData, mspMagData, CW90_DEG_FLIP); + + mspMagLastUpdateMs = millis(); +} + +static bool mspMagRead(magDev_t *magDev) +{ + UNUSED(magDev); + + if ((millis() - mspMagLastUpdateMs) > MSP_MAG_TIMEOUT_MS) { + return false; + } + + magDev->magADCRaw[X] = mspMagData[X]; + magDev->magADCRaw[Y] = mspMagData[Y]; + magDev->magADCRaw[Z] = mspMagData[Z]; + + return true; +} + +bool mspMagDetect(magDev_t *mag) +{ + mag->init = mspMagInit; + mag->read = mspMagRead; + return true; +} + +#endif diff --git a/src/main/drivers/compass/compass_msp.h b/src/main/drivers/compass/compass_msp.h new file mode 100644 index 0000000000..529e0c1df0 --- /dev/null +++ b/src/main/drivers/compass/compass_msp.h @@ -0,0 +1,28 @@ +/* + * This file is part of INAV Project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. + * + * Alternatively, the contents of this file may be used under the terms + * of the GNU General Public License Version 3, as described below: + * + * This file is free software: you may copy, redistribute 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 file 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 http://www.gnu.org/licenses/. + */ + +#pragma once + +bool mspMagDetect(struct magDev_s *mag); +void mspMagReceiveNewData(uint8_t * bufferPtr); diff --git a/src/main/drivers/pitotmeter.h b/src/main/drivers/pitotmeter/pitotmeter.h similarity index 100% rename from src/main/drivers/pitotmeter.h rename to src/main/drivers/pitotmeter/pitotmeter.h diff --git a/src/main/drivers/pitotmeter_adc.c b/src/main/drivers/pitotmeter/pitotmeter_adc.c old mode 100755 new mode 100644 similarity index 94% rename from src/main/drivers/pitotmeter_adc.c rename to src/main/drivers/pitotmeter/pitotmeter_adc.c index d0c6a1ac0e..da68570ca9 --- a/src/main/drivers/pitotmeter_adc.c +++ b/src/main/drivers/pitotmeter/pitotmeter_adc.c @@ -24,9 +24,9 @@ #include "common/utils.h" -#include "pitotmeter.h" -#include "pitotmeter_adc.h" -#include "adc.h" +#include "drivers/pitotmeter/pitotmeter.h" +#include "drivers/pitotmeter/pitotmeter_adc.h" +#include "drivers/adc.h" #if defined(USE_ADC) && defined(USE_PITOT_ADC) diff --git a/src/main/drivers/pitotmeter_adc.h b/src/main/drivers/pitotmeter/pitotmeter_adc.h old mode 100755 new mode 100644 similarity index 100% rename from src/main/drivers/pitotmeter_adc.h rename to src/main/drivers/pitotmeter/pitotmeter_adc.h diff --git a/src/main/drivers/pitotmeter_fake.c b/src/main/drivers/pitotmeter/pitotmeter_fake.c old mode 100755 new mode 100644 similarity index 100% rename from src/main/drivers/pitotmeter_fake.c rename to src/main/drivers/pitotmeter/pitotmeter_fake.c diff --git a/src/main/drivers/pitotmeter_fake.h b/src/main/drivers/pitotmeter/pitotmeter_fake.h old mode 100755 new mode 100644 similarity index 100% rename from src/main/drivers/pitotmeter_fake.h rename to src/main/drivers/pitotmeter/pitotmeter_fake.h diff --git a/src/main/drivers/pitotmeter_ms4525.c b/src/main/drivers/pitotmeter/pitotmeter_ms4525.c similarity index 99% rename from src/main/drivers/pitotmeter_ms4525.c rename to src/main/drivers/pitotmeter/pitotmeter_ms4525.c index b21c35bb8f..436bddc3cf 100644 --- a/src/main/drivers/pitotmeter_ms4525.c +++ b/src/main/drivers/pitotmeter/pitotmeter_ms4525.c @@ -24,8 +24,8 @@ #include "common/utils.h" #include "common/maths.h" #include "drivers/bus_i2c.h" -#include "drivers/pitotmeter.h" #include "drivers/time.h" +#include "drivers/pitotmeter/pitotmeter.h" // MS4525, Standard address 0x28 #define MS4525_ADDR 0x28 diff --git a/src/main/drivers/pitotmeter_ms4525.h b/src/main/drivers/pitotmeter/pitotmeter_ms4525.h similarity index 100% rename from src/main/drivers/pitotmeter_ms4525.h rename to src/main/drivers/pitotmeter/pitotmeter_ms4525.h diff --git a/src/main/drivers/pitotmeter/pitotmeter_msp.c b/src/main/drivers/pitotmeter/pitotmeter_msp.c new file mode 100644 index 0000000000..be1cf852c7 --- /dev/null +++ b/src/main/drivers/pitotmeter/pitotmeter_msp.c @@ -0,0 +1,97 @@ +/* + * This file is part of INAV Project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. + * + * Alternatively, the contents of this file may be used under the terms + * of the GNU General Public License Version 3, as described below: + * + * This file is free software: you may copy, redistribute 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 file 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 http://www.gnu.org/licenses/. + */ + +#include +#include + +#include "platform.h" + +#if defined(USE_PITOT_MSP) + +#include "build/build_config.h" +#include "build/debug.h" + +#include "common/utils.h" +#include "common/time.h" + +#include "drivers/time.h" +#include "drivers/pitotmeter/pitotmeter.h" +#include "drivers/pitotmeter/pitotmeter_msp.h" + +#include "msp/msp_protocol_v2_sensor_msg.h" + +#define MSP_PITOT_TIMEOUT_MS 500 // Less than 2Hz updates is considered a failure + +static int32_t mspPitotPressure; +static int32_t mspPitotTemperature; +static timeMs_t mspPitotLastUpdateMs; + +static bool mspPitotStart(pitotDev_t *pitot) +{ + UNUSED(pitot); + return true; +} + +static bool mspPitotRead(pitotDev_t *pitot) +{ + UNUSED(pitot); + return true; +} + +static void mspPitotCalculate(pitotDev_t *pitot, float *pressure, float *temperature) +{ + UNUSED(pitot); + + if (pressure) { + *pressure = mspPitotPressure; + } + + if (temperature) { + *temperature = (mspPitotTemperature - 27315) / 100.0f; // Pitot expects temp in Kelvin + } +} + +void mspPitotmeterReceiveNewData(uint8_t * bufferPtr) +{ + const mspSensorAirspeedDataMessage_t * pkt = (const mspSensorAirspeedDataMessage_t *)bufferPtr; + + mspPitotPressure = pkt->diffPressurePa; + mspPitotTemperature = pkt->temp; + mspPitotLastUpdateMs = millis(); +} + +bool mspPitotmeterDetect(pitotDev_t *pitot) +{ + mspPitotPressure = 0; + mspPitotTemperature = 27315; // 0 deg/c + + pitot->delay = 10000; + pitot->start = mspPitotStart; + pitot->get = mspPitotRead; + pitot->calculate = mspPitotCalculate; + + return true; +} + +#endif diff --git a/src/main/drivers/pitotmeter/pitotmeter_msp.h b/src/main/drivers/pitotmeter/pitotmeter_msp.h new file mode 100644 index 0000000000..3e1fabec61 --- /dev/null +++ b/src/main/drivers/pitotmeter/pitotmeter_msp.h @@ -0,0 +1,29 @@ +/* + * This file is part of INAV Project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. + * + * Alternatively, the contents of this file may be used under the terms + * of the GNU General Public License Version 3, as described below: + * + * This file is free software: you may copy, redistribute 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 file 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 http://www.gnu.org/licenses/. + */ + +#pragma once + +struct pitotDev_s; +bool mspPitotmeterDetect(struct pitotDev_s *pitot); +void mspPitotmeterReceiveNewData(uint8_t * bufferPtr); \ No newline at end of file diff --git a/src/main/drivers/pitotmeter_virtual.c b/src/main/drivers/pitotmeter/pitotmeter_virtual.c similarity index 96% rename from src/main/drivers/pitotmeter_virtual.c rename to src/main/drivers/pitotmeter/pitotmeter_virtual.c index 4ef87375e8..3f72828517 100644 --- a/src/main/drivers/pitotmeter_virtual.c +++ b/src/main/drivers/pitotmeter/pitotmeter_virtual.c @@ -42,8 +42,8 @@ #include "sensors/pitotmeter.h" -#include "pitotmeter.h" -#include "pitotmeter_virtual.h" +#include "drivers/pitotmeter/pitotmeter.h" +#include "drivers/pitotmeter/pitotmeter_virtual.h" #if defined(USE_WIND_ESTIMATOR) && defined(USE_PITOT_VIRTUAL) diff --git a/src/main/drivers/pitotmeter_virtual.h b/src/main/drivers/pitotmeter/pitotmeter_virtual.h similarity index 100% rename from src/main/drivers/pitotmeter_virtual.h rename to src/main/drivers/pitotmeter/pitotmeter_virtual.h diff --git a/src/main/drivers/sdcard/sdmmc_sdio_f7xx.c b/src/main/drivers/sdcard/sdmmc_sdio_f7xx.c index d5b11946b2..e03d11acef 100644 --- a/src/main/drivers/sdcard/sdmmc_sdio_f7xx.c +++ b/src/main/drivers/sdcard/sdmmc_sdio_f7xx.c @@ -485,7 +485,7 @@ static SD_Error_t SD_InitializeCard(void) SD_GetResponse(SD_Handle.CID); } - if ((SD_CardType == SD_STD_CAPACITY_V1_1) || (SD_CardType == SD_STD_CAPACITY_V2_0) || + if ((SD_CardType == SD_STD_CAPACITY_V1_1) || (SD_CardType == SD_STD_CAPACITY_V2_0) || (SD_CardType == SD_SECURE_DIGITAL_IO_COMBO) || (SD_CardType == SD_HIGH_CAPACITY)) { // Send CMD3 SET_REL_ADDR with argument 0 // SD Card publishes its RCA. @@ -1000,7 +1000,7 @@ SD_Error_t SD_GetStatus(void) } } else { - ErrorState = SD_CARD_ERROR; + ErrorState = SD_ERROR; } return ErrorState; diff --git a/src/main/drivers/vtx_common.h b/src/main/drivers/vtx_common.h index 9971b8f497..c83b0aeab5 100644 --- a/src/main/drivers/vtx_common.h +++ b/src/main/drivers/vtx_common.h @@ -46,6 +46,10 @@ #define VTX_SETTINGS_FREQCMD #define VTX_SETTINGS_MAX_POWER (VTX_SETTINGS_POWER_COUNT - VTX_SETTINGS_MIN_POWER + 1) +#else + +#define VTX_SETTINGS_DEFAULT_POWER 0 + #endif // check value for MSP_SET_VTX_CONFIG to determine if value is encoded diff --git a/src/main/fc/cli.c b/src/main/fc/cli.c index cdeac26521..53c7fdb58c 100755 --- a/src/main/fc/cli.c +++ b/src/main/fc/cli.c @@ -103,6 +103,7 @@ extern uint8_t __config_end; #include "rx/rx.h" #include "rx/spektrum.h" #include "rx/eleres.h" +#include "rx/srxl2.h" #include "scheduler/scheduler.h" @@ -2578,6 +2579,35 @@ static void cliEleresBind(char *cmdline) } #endif // USE_RX_ELERES +#if defined(USE_RX_SPI) || defined (USE_SERIALRX_SRXL2) +void cliRxBind(char *cmdline){ + UNUSED(cmdline); + if (rxConfig()->receiverType == RX_TYPE_SERIAL) { + switch (rxConfig()->serialrx_provider) { + default: + cliPrint("Not supported."); + break; +#if defined(USE_SERIALRX_SRXL2) + case SERIALRX_SRXL2: + srxl2Bind(); + cliPrint("Binding SRXL2 receiver..."); + break; +#endif + } + } +#if defined(USE_RX_SPI) + else if (rxConfig()->receiverType == RX_TYPE_SPI) { + switch (rxConfig()->rx_spi_protocol) { + default: + cliPrint("Not supported."); + break; + } + + } +#endif +} +#endif + static void cliExit(char *cmdline) { UNUSED(cmdline); @@ -3465,6 +3495,9 @@ const clicmd_t cmdTable[] = { CLI_COMMAND_DEF("beeper", "turn on/off beeper", "list\r\n" "\t<+|->[name]", cliBeeper), #endif +#if defined(USE_RX_SPI) || defined (USE_SERIALRX_SRXL2) + CLI_COMMAND_DEF("bind_rx", "initiate binding for RX SPI or SRXL2", NULL, cliRxBind), +#endif #if defined(USE_BOOTLOG) CLI_COMMAND_DEF("bootlog", "show boot events", NULL, cliBootlog), #endif diff --git a/src/main/fc/fc_init.c b/src/main/fc/fc_init.c index 36b17ec055..c3da09cdf1 100644 --- a/src/main/fc/fc_init.c +++ b/src/main/fc/fc_init.c @@ -107,6 +107,7 @@ #include "io/displayport_frsky_osd.h" #include "io/displayport_msp.h" #include "io/displayport_max7456.h" +#include "io/displayport_srxl.h" #include "io/flashfs.h" #include "io/gps.h" #include "io/ledstrip.h" @@ -573,6 +574,11 @@ void init(void) uavInterconnectBusInit(); #endif +#if defined(USE_CMS) && defined(USE_SPEKTRUM_CMS_TELEMETRY) && defined(USE_TELEMETRY_SRXL) + // Register the srxl Textgen telemetry sensor as a displayport device + cmsDisplayPortRegister(displayPortSrxlInit()); +#endif + #ifdef USE_GPS if (feature(FEATURE_GPS)) { gpsInit(); diff --git a/src/main/fc/fc_msp.c b/src/main/fc/fc_msp.c index 16999bd057..7e070167ee 100644 --- a/src/main/fc/fc_msp.c +++ b/src/main/fc/fc_msp.c @@ -40,8 +40,11 @@ #include "config/parameter_group_ids.h" #include "drivers/accgyro/accgyro.h" -#include "drivers/bus_i2c.h" #include "drivers/compass/compass.h" +#include "drivers/compass/compass_msp.h" +#include "drivers/barometer/barometer_msp.h" +#include "drivers/pitotmeter/pitotmeter_msp.h" +#include "drivers/bus_i2c.h" #include "drivers/display.h" #include "drivers/flash.h" #include "drivers/osd.h" @@ -3215,6 +3218,30 @@ static mspResult_e mspProcessSensorCommand(uint16_t cmdMSP, sbuf_t *src) mspOpflowReceiveNewData(sbufPtr(src)); break; #endif + +#if defined(USE_GPS_PROTO_MSP) + case MSP2_SENSOR_GPS: + mspGPSReceiveNewData(sbufPtr(src)); + break; +#endif + +#if defined(USE_MAG_MSP) + case MSP2_SENSOR_COMPASS: + mspMagReceiveNewData(sbufPtr(src)); + break; +#endif + +#if defined(USE_BARO_MSP) + case MSP2_SENSOR_BAROMETER: + mspBaroReceiveNewData(sbufPtr(src)); + break; +#endif + +#if defined(USE_PITOT_MSP) + case MSP2_SENSOR_AIRSPEED: + mspPitotmeterReceiveNewData(sbufPtr(src)); + break; +#endif } return MSP_RESULT_NO_REPLY; diff --git a/src/main/fc/rc_adjustments.c b/src/main/fc/rc_adjustments.c index 182653a506..644dd19b4f 100644 --- a/src/main/fc/rc_adjustments.c +++ b/src/main/fc/rc_adjustments.c @@ -548,6 +548,7 @@ static void applyStepAdjustment(controlRateConfig_t *controlRateConfig, uint8_t case ADJUSTMENT_FW_MIN_THROTTLE_DOWN_PITCH_ANGLE: applyAdjustmentU16(ADJUSTMENT_FW_MIN_THROTTLE_DOWN_PITCH_ANGLE, &mixerConfigMutable()->fwMinThrottleDownPitchAngle, delta, 0, FW_MIN_THROTTLE_DOWN_PITCH_ANGLE_MAX); break; +#if defined(USE_VTX_SMARTAUDIO) || defined(USE_VTX_TRAMP) case ADJUSTMENT_VTX_POWER_LEVEL: { vtxDeviceCapability_t vtxDeviceCapability; @@ -556,6 +557,7 @@ static void applyStepAdjustment(controlRateConfig_t *controlRateConfig, uint8_t } } break; +#endif default: break; }; diff --git a/src/main/fc/settings.yaml b/src/main/fc/settings.yaml index 1451787e98..38994493e5 100644 --- a/src/main/fc/settings.yaml +++ b/src/main/fc/settings.yaml @@ -10,22 +10,22 @@ tables: values: ["NONE", "HCSR04", "SRF10", "INAV_I2C", "VL53L0X", "MSP", "UIB", "BENEWAKE"] enum: rangefinderType_e - name: mag_hardware - values: ["NONE", "AUTO", "HMC5883", "AK8975", "GPSMAG", "MAG3110", "AK8963", "IST8310", "QMC5883", "MPU9250", "IST8308", "LIS3MDL", "FAKE"] + values: ["NONE", "AUTO", "HMC5883", "AK8975", "GPSMAG", "MAG3110", "AK8963", "IST8310", "QMC5883", "MPU9250", "IST8308", "LIS3MDL", "MSP", "FAKE"] enum: magSensor_e - name: opflow_hardware values: ["NONE", "PMW3901", "CXOF", "MSP", "FAKE"] enum: opticalFlowSensor_e - name: baro_hardware - values: ["NONE", "AUTO", "BMP085", "MS5611", "BMP280", "MS5607", "LPS25H", "SPL06", "BMP388", "DPS310", "FAKE"] + values: ["NONE", "AUTO", "BMP085", "MS5611", "BMP280", "MS5607", "LPS25H", "SPL06", "BMP388", "DPS310", "MSP", "FAKE"] enum: baroSensor_e - name: pitot_hardware - values: ["NONE", "AUTO", "MS4525", "ADC", "VIRTUAL", "FAKE"] + values: ["NONE", "AUTO", "MS4525", "ADC", "VIRTUAL", "FAKE", "MSP"] enum: pitotSensor_e - name: receiver_type values: ["NONE", "PPM", "SERIAL", "MSP", "SPI", "UIB"] enum: rxReceiverType_e - name: serial_rx - values: ["SPEK1024", "SPEK2048", "SBUS", "SUMD", "SUMH", "XB-B", "XB-B-RJ01", "IBUS", "JETIEXBUS", "CRSF", "FPORT", "SBUS_FAST", "FPORT2"] + values: ["SPEK1024", "SPEK2048", "SBUS", "SUMD", "SUMH", "XB-B", "XB-B-RJ01", "IBUS", "JETIEXBUS", "CRSF", "FPORT", "SBUS_FAST", "FPORT2", "SRXL2"] - name: rx_spi_protocol values: ["V202_250K", "V202_1M", "SYMA_X", "SYMA_X5C", "CX10", "CX10A", "H8_3D", "INAV", "ELERES"] enum: rx_spi_protocol_e @@ -44,7 +44,7 @@ tables: values: ["NONE", "ADC", "ESC"] enum: voltageSensor_e - name: gps_provider - values: ["NMEA", "UBLOX", "UNUSED", "NAZA", "UBLOX7", "MTK"] + values: ["NMEA", "UBLOX", "UNUSED", "NAZA", "UBLOX7", "MTK", "MSP"] enum: gpsProvider_e - name: gps_sbas_mode values: ["AUTO", "EGNOS", "WAAS", "MSAS", "GAGAN", "NONE"] @@ -144,6 +144,17 @@ tables: - name: tristate enum: tristate_e values: ["AUTO", "ON", "OFF"] + - name: osd_crsf_lq_format + enum: osd_crsf_lq_format_e + values: ["TYPE1", "TYPE2"] + - name: off_on + values: ["OFF", "ON"] + - name: djiOsdTempSource + values: ["ESC", "IMU", "BARO"] + enum: djiOsdTempSource_e + - name: nav_overrides_motor_stop + enum: navOverridesMotorStop_e + values: ["OFF", "AUTO_ONLY", "ALL_NAV"] groups: - name: PG_GYRO_CONFIG @@ -567,6 +578,13 @@ groups: condition: USE_SPEKTRUM_BIND min: SPEKTRUM_SAT_BIND_DISABLED max: SPEKTRUM_SAT_BIND_MAX + - name: srxl2_unit_id + condition: USE_SERIALRX_SRXL2 + min: 0 + max: 15 + - name: srxl2_baud_fast + condition: USE_SERIALRX_SRXL2 + table: off_on - name: rx_min_usec description: "Defines the shortest pulse width value used when ensuring the channel value is valid. If the receiver gives a pulse value lower than this value then the channel will be marked as bad and will default to the value of mid_rc." default_value: "885" @@ -1539,6 +1557,12 @@ groups: field: fixedWingCoordinatedYawGain min: 0 max: 2 + - name: fw_turn_assist_pitch_gain + description: "Gain required to keep constant pitch angle during coordinated turns (in TURN_ASSIST mode). Value significantly different from 1.0 indicates a problem with the airspeed calibration (if present) or value of `fw_reference_airspeed` parameter" + default_value: "1" + field: fixedWingCoordinatedPitchGain + min: 0 + max: 2 - name: fw_iterm_limit_stick_position description: "Iterm is not allowed to grow when stick position is above threshold. This solves the problem of bounceback or followthrough when full stick deflection is applied on poorely tuned fixed wings. In other words, stabilization is partialy disabled when pilot is actively controlling the aircraft and active when sticks are not touched. `0` mean stick is in center position, `1` means it is fully deflected to either side" default_value: "0.5" @@ -2083,10 +2107,10 @@ groups: min: 0 max: 5000 - name: nav_overrides_motor_stop - description: "Setting to OFF combined with MOTOR_STOP feature will allow user to stop motor when in autonomous modes. On most places this setting is likely to cause a stall." - default_value: "ON" - field: general.flags.auto_overrides_motor_stop - type: bool + description: "When set OFF the navigation system will not take over the control of the motor if the throttle is low (motor will stop). When set to AUTO_ONLY the navigation system will only take over the control of the throttle in autonomous navigation modes (NAV WP and NAV RTH). When set to ALL_NAV (default) the navigation system will take over the control of the motor completely and never allow the motor to stop even when the throttle is low. This setting only has an effect combined with MOTOR_STOP and is likely to cause a stall if fw_min_throttle_down_pitch isn't set correctly or the pitch estimation is wrong for fixed wing models when not set to ALL_NAV" + default_value: "NOMS_ALL_NAV" + field: general.flags.nav_overrides_motor_stop + table: nav_overrides_motor_stop - name: nav_rth_climb_first description: "If set to ON drone will climb to nav_rth_altitude first and head home afterwards. If set to OFF drone will head home instantly and climb on the way." default_value: "ON" @@ -2265,6 +2289,18 @@ groups: field: fw.pitch_to_throttle min: 0 max: 100 + - name: nav_fw_pitch2thr_smoothing + description: "How smoothly the autopilot makes pitch to throttle correction inside a deadband defined by pitch_to_throttle_thresh." + default_value: "0" + field: fw.pitch_to_throttle_smooth + min: 0 + max: 9 + - name: nav_fw_pitch2thr_threshold + description: "Threshold from average pitch where momentary pitch_to_throttle correction kicks in. [decidegrees]" + default_value: "0" + field: fw.pitch_to_throttle_thresh + min: 0 + max: 900 - name: nav_fw_loiter_radius description: "PosHold radius. 3000 to 7500 is a good value (30-75m) [cm]" default_value: "5000" @@ -2340,6 +2376,12 @@ groups: field: fw.launch_motor_spinup_time min: 0 max: 1000 + - name: nav_fw_launch_end_time + description: "Time for the transition of throttle and pitch angle, between the launch state and the subsequent flight mode [ms]" + default_value: "2000" + field: fw.launch_end_time + min: 0 + max: 5000 - name: nav_fw_launch_min_time description: "Allow launch mode to execute at least this time (ms) and ignore stick movements [0-60000]." default_value: "0" @@ -2552,6 +2594,11 @@ groups: type: uint8_t min: 0 max: 255 + - name: mavlink_extra3_rate + field: mavlink.extra3_rate + type: uint8_t + min: 0 + max: 255 - name: PG_ELERES_CONFIG type: eleresConfig_t headers: ["rx/eleres.h"] @@ -2624,7 +2671,7 @@ groups: type: uint8_t - name: osd_rssi_alarm - description: "Value bellow which to make the OSD RSSI indicator blink" + description: "Value below which to make the OSD RSSI indicator blink" default_value: "20" field: rssi_alarm min: 0 @@ -2648,7 +2695,7 @@ groups: min: 0 max: 50000 - name: osd_neg_alt_alarm - description: "Value bellow which (negative altitude) to make the OSD relative altitude indicator blink (meters)" + description: "Value below which (negative altitude) to make the OSD relative altitude indicator blink (meters)" default_value: "5" field: neg_alt_alarm min: 0 @@ -2717,10 +2764,16 @@ groups: max: 1250 - name: osd_snr_alarm description: "Value below which Crossfire SNR Alarm pops-up. (dB)" - default_value: "5" + default_value: "4" field: snr_alarm min: -12 max: 8 + - name: osd_link_quality_alarm + description: "LQ % indicator blinks below this value. For Crossfire use 70%, for Tracer use 50%" + default_value: "70" + field: link_quality_alarm + min: 0 + max: 100 - name: osd_temp_label_align description: "Allows to chose between left and right alignment for the OSD temperature sensor labels. Valid values are `LEFT` and `RIGHT`" default_value: "LEFT" @@ -2744,6 +2797,12 @@ groups: field: crosshairs_style table: osd_crosshairs_style type: uint8_t + - name: osd_crsf_lq_format + description: "To select LQ format" + default_value: "TYPE1" + field: crsf_lq_format + table: osd_crsf_lq_format + type: uint8_t - name: osd_horizon_offset description: "To vertically adjust the whole OSD and AHI and scrolling bars" default_value: "0" @@ -3017,6 +3076,7 @@ groups: - name: PG_VTX_SETTINGS_CONFIG type: vtxSettingsConfig_t headers: ["drivers/vtx_common.h", "io/vtx.h"] + condition: USE_VTX_SMARTAUDIO || USE_VTX_TRAMP members: - name: vtx_band description: "Configure the VTX band. Set to zero to use `vtx_freq`. Bands: 1: A, 2: B, 3: E, 4: F, 5: Race." @@ -3095,6 +3155,7 @@ groups: max: UINT32_MAX description: "Defines serial debugging log topic. See `docs/development/serial_printf_debugging.md` for usage." default_value: "0" + - name: PG_ESC_SENSOR_CONFIG type: escSensorConfig_t headers: ["sensors/esc_sensor.h"] @@ -3115,3 +3176,23 @@ groups: - name: smartport_master_inverted field: inverted type: bool + + - name: PG_DJI_OSD_CONFIG + type: djiOsdConfig_t + headers: ["io/osd_dji_hd.h"] + condition: USE_DJI_HD_OSD + members: + - name: dji_workarounds + description: "Enables workarounds for different versions of MSP protocol used" + field: proto_workarounds + - name: dji_use_name_for_messages + description: "Re-purpose the craft name field for messages. Replace craft name with :WTSED for Warnings|Throttle|Speed|Efficiency|Trip distance" + default_value: "ON" + field: use_name_for_messages + type: bool + - name: dji_esc_temp_source + description: "Re-purpose the ESC temperature field for IMU/BARO temperature" + default_value: "ESC" + field: esc_temperature_source + table: djiOsdTempSource + type: uint8_t diff --git a/src/main/flight/imu.c b/src/main/flight/imu.c index 375a128f89..d75f416f8f 100644 --- a/src/main/flight/imu.c +++ b/src/main/flight/imu.c @@ -77,7 +77,7 @@ FILE_COMPILE_FOR_SPEED // http://gentlenav.googlecode.com/files/fastRotations.pdf #define SPIN_RATE_LIMIT 20 -#define MAX_ACC_SQ_NEARNESS 25 // 25% or G^2, accepted acceleration of (0.87 - 1.12G) +#define MAX_ACC_NEARNESS 0.33 // 33% or G error soft-accepted (0.67-1.33G) #define IMU_CENTRIFUGAL_LPF 1 // Hz FASTRAM fpVector3_t imuMeasuredAccelBF; @@ -472,16 +472,12 @@ STATIC_UNIT_TESTED void imuUpdateEulerAngles(void) static float imuCalculateAccelerometerWeight(const float dT) { - // If centrifugal test passed - do the usual "nearness" style check float accMagnitudeSq = 0; - for (int axis = 0; axis < 3; axis++) { accMagnitudeSq += acc.accADCf[axis] * acc.accADCf[axis]; } - // Magnitude^2 in percent of G^2 - const float nearness = ABS(100 - (accMagnitudeSq * 100)); - const float accWeight_Nearness = (nearness > MAX_ACC_SQ_NEARNESS) ? 0.0f : 1.0f; + const float accWeight_Nearness = bellCurve(sqrtf(accMagnitudeSq) - 1.0f, MAX_ACC_NEARNESS); // Experiment: if rotation rate on a FIXED_WING_LEGACY is higher than a threshold - centrifugal force messes up too much and we // should not use measured accel for AHRS comp diff --git a/src/main/flight/mixer.c b/src/main/flight/mixer.c index a3e6aebd59..cc65c2b258 100755 --- a/src/main/flight/mixer.c +++ b/src/main/flight/mixer.c @@ -579,7 +579,9 @@ motorStatus_e getMotorStatus(void) } if (calculateThrottleStatus(feature(FEATURE_REVERSIBLE_MOTORS) ? THROTTLE_STATUS_TYPE_COMMAND : THROTTLE_STATUS_TYPE_RC) == THROTTLE_LOW) { - if ((STATE(FIXED_WING_LEGACY) || !STATE(AIRMODE_ACTIVE)) && (!(navigationIsFlyingAutonomousMode() && navConfig()->general.flags.auto_overrides_motor_stop)) && (!failsafeIsActive())) { + navOverridesMotorStop_e motorStopOverride = navConfig()->general.flags.nav_overrides_motor_stop; + if (!failsafeIsActive() && (STATE(FIXED_WING_LEGACY) || !STATE(AIRMODE_ACTIVE)) && + ((motorStopOverride == NOMS_OFF) || ((motorStopOverride == NOMS_ALL_NAV) && !navigationIsControllingThrottle()) || ((motorStopOverride == NOMS_AUTO_ONLY) && !navigationIsFlyingAutonomousMode()))) { return MOTOR_STOPPED_USER; } } diff --git a/src/main/flight/pid.c b/src/main/flight/pid.c index f58ab3b7de..00cd8ac9c5 100644 --- a/src/main/flight/pid.c +++ b/src/main/flight/pid.c @@ -154,7 +154,7 @@ static EXTENDED_FASTRAM filterApplyFnPtr dTermLpfFilterApplyFn; static EXTENDED_FASTRAM filterApplyFnPtr dTermLpf2FilterApplyFn; static EXTENDED_FASTRAM bool levelingEnabled = false; -PG_REGISTER_PROFILE_WITH_RESET_TEMPLATE(pidProfile_t, pidProfile, PG_PID_PROFILE, 15); +PG_REGISTER_PROFILE_WITH_RESET_TEMPLATE(pidProfile_t, pidProfile, PG_PID_PROFILE, 0); PG_RESET_TEMPLATE(pidProfile_t, pidProfile, .bank_mc = { @@ -256,6 +256,7 @@ PG_RESET_TEMPLATE(pidProfile_t, pidProfile, .fixedWingItermThrowLimit = FW_ITERM_THROW_LIMIT_DEFAULT, .fixedWingReferenceAirspeed = 1000, .fixedWingCoordinatedYawGain = 1.0f, + .fixedWingCoordinatedPitchGain = 1.0f, .fixedWingItermLimitOnStickPosition = 0.5f, .loiter_direction = NAV_LOITER_RIGHT, @@ -889,7 +890,7 @@ static void NOINLINE pidTurnAssistant(pidState_t *pidState) // Add in roll and pitch pidState[ROLL].rateTarget = constrainf(pidState[ROLL].rateTarget + targetRates.x, -currentControlRateProfile->stabilized.rates[ROLL] * 10.0f, currentControlRateProfile->stabilized.rates[ROLL] * 10.0f); - pidState[PITCH].rateTarget = constrainf(pidState[PITCH].rateTarget + targetRates.y, -currentControlRateProfile->stabilized.rates[PITCH] * 10.0f, currentControlRateProfile->stabilized.rates[PITCH] * 10.0f); + pidState[PITCH].rateTarget = constrainf(pidState[PITCH].rateTarget + targetRates.y * pidProfile()->fixedWingCoordinatedPitchGain, -currentControlRateProfile->stabilized.rates[PITCH] * 10.0f, currentControlRateProfile->stabilized.rates[PITCH] * 10.0f); // Replace YAW on quads - add it in on airplanes if (STATE(AIRPLANE)) { diff --git a/src/main/flight/pid.h b/src/main/flight/pid.h index c325190923..cc4b20ae59 100644 --- a/src/main/flight/pid.h +++ b/src/main/flight/pid.h @@ -126,6 +126,7 @@ typedef struct pidProfile_s { uint16_t fixedWingItermThrowLimit; float fixedWingReferenceAirspeed; // Reference tuning airspeed for the airplane - the speed for which PID gains are tuned float fixedWingCoordinatedYawGain; // This is the gain of the yaw rate required to keep the yaw rate consistent with the turn rate for a coordinated turn. + float fixedWingCoordinatedPitchGain; // This is the gain of the pitch rate to keep the pitch angle constant during coordinated turns. float fixedWingItermLimitOnStickPosition; //Do not allow Iterm to grow when stick position is above this point uint8_t loiter_direction; // Direction of loitering center point on right wing (clockwise - as before), or center point on left wing (counterclockwise) diff --git a/src/main/flight/rth_estimator.c b/src/main/flight/rth_estimator.c index d9897c32c7..4ddc719037 100644 --- a/src/main/flight/rth_estimator.c +++ b/src/main/flight/rth_estimator.c @@ -77,7 +77,7 @@ static int8_t RTHInitialAltitudeChangePitchAngle(float altitudeChange) { // pitch in degrees // output in Watt static float estimatePitchPower(float pitch) { - int16_t altitudeChangeThrottle = fixedWingPitchToThrottleCorrection(DEGREES_TO_DECIDEGREES(pitch)); + int16_t altitudeChangeThrottle = (int16_t)pitch * navConfig()->fw.pitch_to_throttle; altitudeChangeThrottle = constrain(altitudeChangeThrottle, navConfig()->fw.min_throttle, navConfig()->fw.max_throttle); const float altitudeChangeThrToCruiseThrRatio = (float)(altitudeChangeThrottle - getThrottleIdleValue()) / (navConfig()->fw.cruise_throttle - getThrottleIdleValue()); return (float)heatLossesCompensatedPower(batteryMetersConfig()->idle_power + batteryMetersConfig()->cruise_power * altitudeChangeThrToCruiseThrRatio) / 100; diff --git a/src/main/io/asyncfatfs/asyncfatfs.c b/src/main/io/asyncfatfs/asyncfatfs.c index 5f57a10b8b..0d84a756ca 100644 --- a/src/main/io/asyncfatfs/asyncfatfs.c +++ b/src/main/io/asyncfatfs/asyncfatfs.c @@ -1694,6 +1694,8 @@ static afatfsOperationStatus_e afatfs_appendSuperclusterContinue(afatfsFile_t *f // Update the fileSize/firstCluster in the directory entry for the file status = afatfs_saveDirectoryEntry(file, AFATFS_SAVE_DIRECTORY_NORMAL); break; + default: + status = AFATFS_OPERATION_FAILURE; } if ((status == AFATFS_OPERATION_FAILURE || status == AFATFS_OPERATION_SUCCESS) && file->operation.operation == AFATFS_FILE_OPERATION_APPEND_SUPERCLUSTER) { @@ -2487,6 +2489,8 @@ static afatfsOperationStatus_e afatfs_ftruncateContinue(afatfsFilePtr_t file, bo return AFATFS_OPERATION_SUCCESS; break; + default: + status = AFATFS_OPERATION_FAILURE; } if (status == AFATFS_OPERATION_FAILURE && file->operation.operation == AFATFS_FILE_OPERATION_TRUNCATE) { diff --git a/src/main/io/beeper.c b/src/main/io/beeper.c index 4306d101f5..e24216cda0 100644 --- a/src/main/io/beeper.c +++ b/src/main/io/beeper.c @@ -121,6 +121,10 @@ static const uint8_t beep_runtimeCalibrationDone[] = { static const uint8_t beep_launchModeBeep[] = { 5, 5, 5, 100, BEEPER_COMMAND_STOP }; +// Two short beeps, then one shorter beep. Beeps to show the throttle needs to be raised. Will repeat every second while the throttle is low. +static const uint8_t beep_launchModeLowThrottleBeep[] = { + 5, 5, 5, 5, 3, 100, BEEPER_COMMAND_STOP +}; // short beeps static const uint8_t beep_hardwareFailure[] = { 10, 10, BEEPER_COMMAND_STOP @@ -164,31 +168,32 @@ typedef struct beeperTableEntry_s { #define BEEPER_ENTRY(a,b,c,d) a,b,c,d /*static*/ const beeperTableEntry_t beeperTable[] = { - { BEEPER_ENTRY(BEEPER_RUNTIME_CALIBRATION_DONE, 0, beep_runtimeCalibrationDone, "RUNTIME_CALIBRATION") }, - { BEEPER_ENTRY(BEEPER_HARDWARE_FAILURE , 1, beep_hardwareFailure, "HW_FAILURE") }, - { BEEPER_ENTRY(BEEPER_RX_LOST, 2, beep_txLostBeep, "RX_LOST") }, - { BEEPER_ENTRY(BEEPER_RX_LOST_LANDING, 3, beep_sos, "RX_LOST_LANDING") }, - { BEEPER_ENTRY(BEEPER_DISARMING, 4, beep_disarmBeep, "DISARMING") }, - { BEEPER_ENTRY(BEEPER_ARMING, 5, beep_armingBeep, "ARMING") }, - { BEEPER_ENTRY(BEEPER_ARMING_GPS_FIX, 6, beep_armedGpsFix, "ARMING_GPS_FIX") }, - { BEEPER_ENTRY(BEEPER_BAT_CRIT_LOW, 7, beep_critBatteryBeep, "BAT_CRIT_LOW") }, - { BEEPER_ENTRY(BEEPER_BAT_LOW, 8, beep_lowBatteryBeep, "BAT_LOW") }, - { BEEPER_ENTRY(BEEPER_GPS_STATUS, 9, beep_multiBeeps, "GPS_STATUS") }, - { BEEPER_ENTRY(BEEPER_RX_SET, 10, beep_shortBeep, "RX_SET") }, - { BEEPER_ENTRY(BEEPER_ACTION_SUCCESS, 11, beep_2shortBeeps, "ACTION_SUCCESS") }, - { BEEPER_ENTRY(BEEPER_ACTION_FAIL, 12, beep_2longerBeeps, "ACTION_FAIL") }, - { BEEPER_ENTRY(BEEPER_READY_BEEP, 13, beep_readyBeep, "READY_BEEP") }, - { BEEPER_ENTRY(BEEPER_MULTI_BEEPS, 14, beep_multiBeeps, "MULTI_BEEPS") }, // FIXME having this listed makes no sense since the beep array will not be initialised. - { BEEPER_ENTRY(BEEPER_DISARM_REPEAT, 15, beep_disarmRepeatBeep, "DISARM_REPEAT") }, - { BEEPER_ENTRY(BEEPER_ARMED, 16, beep_armedBeep, "ARMED") }, - { BEEPER_ENTRY(BEEPER_SYSTEM_INIT, 17, NULL, "SYSTEM_INIT") }, - { BEEPER_ENTRY(BEEPER_USB, 18, NULL, "ON_USB") }, - { BEEPER_ENTRY(BEEPER_LAUNCH_MODE_ENABLED, 19, beep_launchModeBeep, "LAUNCH_MODE") }, - { BEEPER_ENTRY(BEEPER_CAM_CONNECTION_OPEN, 20, beep_camOpenBeep, "CAM_CONNECTION_OPEN") }, - { BEEPER_ENTRY(BEEPER_CAM_CONNECTION_CLOSE, 21, beep_camCloseBeep, "CAM_CONNECTION_CLOSED") }, + { BEEPER_ENTRY(BEEPER_RUNTIME_CALIBRATION_DONE, 0, beep_runtimeCalibrationDone, "RUNTIME_CALIBRATION") }, + { BEEPER_ENTRY(BEEPER_HARDWARE_FAILURE , 1, beep_hardwareFailure, "HW_FAILURE") }, + { BEEPER_ENTRY(BEEPER_RX_LOST, 2, beep_txLostBeep, "RX_LOST") }, + { BEEPER_ENTRY(BEEPER_RX_LOST_LANDING, 3, beep_sos, "RX_LOST_LANDING") }, + { BEEPER_ENTRY(BEEPER_DISARMING, 4, beep_disarmBeep, "DISARMING") }, + { BEEPER_ENTRY(BEEPER_ARMING, 5, beep_armingBeep, "ARMING") }, + { BEEPER_ENTRY(BEEPER_ARMING_GPS_FIX, 6, beep_armedGpsFix, "ARMING_GPS_FIX") }, + { BEEPER_ENTRY(BEEPER_BAT_CRIT_LOW, 7, beep_critBatteryBeep, "BAT_CRIT_LOW") }, + { BEEPER_ENTRY(BEEPER_BAT_LOW, 8, beep_lowBatteryBeep, "BAT_LOW") }, + { BEEPER_ENTRY(BEEPER_GPS_STATUS, 9, beep_multiBeeps, "GPS_STATUS") }, + { BEEPER_ENTRY(BEEPER_RX_SET, 10, beep_shortBeep, "RX_SET") }, + { BEEPER_ENTRY(BEEPER_ACTION_SUCCESS, 11, beep_2shortBeeps, "ACTION_SUCCESS") }, + { BEEPER_ENTRY(BEEPER_ACTION_FAIL, 12, beep_2longerBeeps, "ACTION_FAIL") }, + { BEEPER_ENTRY(BEEPER_READY_BEEP, 13, beep_readyBeep, "READY_BEEP") }, + { BEEPER_ENTRY(BEEPER_MULTI_BEEPS, 14, beep_multiBeeps, "MULTI_BEEPS") }, // FIXME having this listed makes no sense since the beep array will not be initialised. + { BEEPER_ENTRY(BEEPER_DISARM_REPEAT, 15, beep_disarmRepeatBeep, "DISARM_REPEAT") }, + { BEEPER_ENTRY(BEEPER_ARMED, 16, beep_armedBeep, "ARMED") }, + { BEEPER_ENTRY(BEEPER_SYSTEM_INIT, 17, NULL, "SYSTEM_INIT") }, + { BEEPER_ENTRY(BEEPER_USB, 18, NULL, "ON_USB") }, + { BEEPER_ENTRY(BEEPER_LAUNCH_MODE_ENABLED, 19, beep_launchModeBeep, "LAUNCH_MODE") }, + { BEEPER_ENTRY(BEEPER_LAUNCH_MODE_LOW_THROTTLE, 20, beep_launchModeLowThrottleBeep, "LAUNCH_MODE_LOW_THROTTLE") }, + { BEEPER_ENTRY(BEEPER_CAM_CONNECTION_OPEN, 21, beep_camOpenBeep, "CAM_CONNECTION_OPEN") }, + { BEEPER_ENTRY(BEEPER_CAM_CONNECTION_CLOSE, 22, beep_camCloseBeep, "CAM_CONNECTION_CLOSED") }, - { BEEPER_ENTRY(BEEPER_ALL, 22, NULL, "ALL") }, - { BEEPER_ENTRY(BEEPER_PREFERENCE, 23, NULL, "PREFERED") }, + { BEEPER_ENTRY(BEEPER_ALL, 23, NULL, "ALL") }, + { BEEPER_ENTRY(BEEPER_PREFERENCE, 24, NULL, "PREFERED") }, }; static const beeperTableEntry_t *currentBeeperEntry = NULL; diff --git a/src/main/io/beeper.h b/src/main/io/beeper.h index 5dcff77f0a..0fcc8249dd 100644 --- a/src/main/io/beeper.h +++ b/src/main/io/beeper.h @@ -21,33 +21,34 @@ typedef enum { // IMPORTANT: these are in priority order, 0 = Highest - BEEPER_SILENCE = 0, // Silence, see beeperSilence() + BEEPER_SILENCE = 0, // Silence, see beeperSilence() BEEPER_RUNTIME_CALIBRATION_DONE, - BEEPER_HARDWARE_FAILURE, // HW failure - BEEPER_RX_LOST, // Beeps when TX is turned off or signal lost (repeat until TX is okay) - BEEPER_RX_LOST_LANDING, // Beeps SOS when armed and TX is turned off or signal lost (autolanding/autodisarm) - BEEPER_DISARMING, // Beep when disarming the board - BEEPER_ARMING, // Beep when arming the board - BEEPER_ARMING_GPS_FIX, // Beep a special tone when arming the board and GPS has fix - BEEPER_BAT_CRIT_LOW, // Longer warning beeps when battery is critically low (repeats) - BEEPER_BAT_LOW, // Warning beeps when battery is getting low (repeats) - BEEPER_GPS_STATUS, // FIXME **** Disable beeper when connected to USB **** - BEEPER_RX_SET, // Beeps when aux channel is set for beep or beep sequence how many satellites has found if GPS enabled - BEEPER_ACTION_SUCCESS, // Action success (various actions) - BEEPER_ACTION_FAIL, // Action fail (varions actions) - BEEPER_READY_BEEP, // Ring a tone when GPS is locked and ready - BEEPER_MULTI_BEEPS, // Internal value used by 'beeperConfirmationBeeps()'. - BEEPER_DISARM_REPEAT, // Beeps sounded while stick held in disarm position - BEEPER_ARMED, // Warning beeps when board is armed (repeats until board is disarmed or throttle is increased) - BEEPER_SYSTEM_INIT, // Initialisation beeps when board is powered on - BEEPER_USB, // Some boards have beeper powered USB connected - BEEPER_LAUNCH_MODE_ENABLED, // Fixed-wing launch mode enabled - BEEPER_CAM_CONNECTION_OPEN, // When the 5 key simulation stated - BEEPER_CAM_CONNECTION_CLOSE, // When the 5 key simulation stop + BEEPER_HARDWARE_FAILURE, // HW failure + BEEPER_RX_LOST, // Beeps when TX is turned off or signal lost (repeat until TX is okay) + BEEPER_RX_LOST_LANDING, // Beeps SOS when armed and TX is turned off or signal lost (autolanding/autodisarm) + BEEPER_DISARMING, // Beep when disarming the board + BEEPER_ARMING, // Beep when arming the board + BEEPER_ARMING_GPS_FIX, // Beep a special tone when arming the board and GPS has fix + BEEPER_BAT_CRIT_LOW, // Longer warning beeps when battery is critically low (repeats) + BEEPER_BAT_LOW, // Warning beeps when battery is getting low (repeats) + BEEPER_GPS_STATUS, // FIXME **** Disable beeper when connected to USB **** + BEEPER_RX_SET, // Beeps when aux channel is set for beep or beep sequence how many satellites has found if GPS enabled + BEEPER_ACTION_SUCCESS, // Action success (various actions) + BEEPER_ACTION_FAIL, // Action fail (varions actions) + BEEPER_READY_BEEP, // Ring a tone when GPS is locked and ready + BEEPER_MULTI_BEEPS, // Internal value used by 'beeperConfirmationBeeps()'. + BEEPER_DISARM_REPEAT, // Beeps sounded while stick held in disarm position + BEEPER_ARMED, // Warning beeps when board is armed (repeats until board is disarmed or throttle is increased) + BEEPER_SYSTEM_INIT, // Initialisation beeps when board is powered on + BEEPER_USB, // Some boards have beeper powered USB connected + BEEPER_LAUNCH_MODE_ENABLED, // Fixed-wing launch mode enabled + BEEPER_LAUNCH_MODE_LOW_THROTTLE, // Fixed-wing launch mode enabled, but throttle is low + BEEPER_CAM_CONNECTION_OPEN, // When the 5 key simulation stated + BEEPER_CAM_CONNECTION_CLOSE, // When the 5 key simulation stop - BEEPER_ALL, // Turn ON or OFF all beeper conditions - BEEPER_PREFERENCE, // Save preferred beeper configuration + BEEPER_ALL, // Turn ON or OFF all beeper conditions + BEEPER_PREFERENCE, // Save preferred beeper configuration // BEEPER_ALL and BEEPER_PREFERENCE must remain at the bottom of this enum } beeperMode_e; diff --git a/src/main/io/displayport_srxl.c b/src/main/io/displayport_srxl.c new file mode 100644 index 0000000000..8c73be1ae5 --- /dev/null +++ b/src/main/io/displayport_srxl.c @@ -0,0 +1,152 @@ +/* + * This file is part of Cleanflight and Betaflight. + * + * Cleanflight and Betaflight are free software. You can redistribute + * this software and/or modify this software 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. + * + * Cleanflight and Betaflight are distributed in the hope that they + * 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 software. + * + * If not, see . + */ + +#include +#include +#include + +#include "platform.h" +#if defined (USE_SPEKTRUM_CMS_TELEMETRY) && defined (USE_CMS) && defined(USE_TELEMETRY_SRXL) + +#include "common/utils.h" + +#include "drivers/display.h" +#include "cms/cms.h" + +#include "telemetry/srxl.h" + +displayPort_t srxlDisplayPort; + +static int srxlDrawScreen(displayPort_t *displayPort) +{ + UNUSED(displayPort); + return 0; +} + +static int srxlScreenSize(const displayPort_t *displayPort) +{ + return displayPort->rows * displayPort->cols; +} + +static int srxlWriteChar(displayPort_t *displayPort, uint8_t col, uint8_t row, uint16_t c, textAttributes_t attr) +{ + return (spektrumTmTextGenPutChar(col, row, c)); + UNUSED(displayPort); + UNUSED(attr); +} + + +static int srxlWriteString(displayPort_t *displayPort, uint8_t col, uint8_t row, const char *s, textAttributes_t attr) +{ + while (*s) { + srxlWriteChar(displayPort, col++, row, *(s++), attr); + } + return 0; +} + +static int srxlClearScreen(displayPort_t *displayPort) +{ + textAttributes_t attr = 0; + for (int row = 0; row < SPEKTRUM_SRXL_TEXTGEN_BUFFER_ROWS; row++) { + for (int col= 0; col < SPEKTRUM_SRXL_TEXTGEN_BUFFER_COLS; col++) { + srxlWriteChar(displayPort, col, row, ' ', attr); + } + } + srxlWriteString(displayPort, 1, 0, "INAV", attr); + + if (displayPort->grabCount == 0) { + srxlWriteString(displayPort, 0, 2, CMS_STARTUP_HELP_TEXT1, attr); + srxlWriteString(displayPort, 2, 3, CMS_STARTUP_HELP_TEXT2, attr); + srxlWriteString(displayPort, 2, 4, CMS_STARTUP_HELP_TEXT3, attr); + } + return 0; +} + +static bool srxlIsTransferInProgress(const displayPort_t *displayPort) +{ + UNUSED(displayPort); + return false; +} + +/* +static bool srxlIsSynced(const displayPort_t *displayPort) +{ + UNUSED(displayPort); + return true; +} +*/ + +static int srxlHeartbeat(displayPort_t *displayPort) +{ + UNUSED(displayPort); + return 0; +} + +static void srxlResync(displayPort_t *displayPort) +{ + UNUSED(displayPort); +} + +static uint32_t srxlTxBytesFree(const displayPort_t *displayPort) +{ + UNUSED(displayPort); + return UINT32_MAX; +} + +static int srxlGrab(displayPort_t *displayPort) +{ + return displayPort->grabCount = 1; +} + +static int srxlRelease(displayPort_t *displayPort) +{ + int cnt = displayPort->grabCount = 0; + srxlClearScreen(displayPort); + return cnt; +} + +static const displayPortVTable_t srxlVTable = { + .grab = srxlGrab, + .release = srxlRelease, + .clearScreen = srxlClearScreen, + .drawScreen = srxlDrawScreen, + .screenSize = srxlScreenSize, + .writeString = srxlWriteString, + .writeChar = srxlWriteChar, + .isTransferInProgress = srxlIsTransferInProgress, + .heartbeat = srxlHeartbeat, + .resync = srxlResync, + //.isSynced = srxlIsSynced, + .txBytesFree = srxlTxBytesFree, + //.layerSupported = NULL, + //.layerSelect = NULL, + //.layerCopy = NULL, +}; + +displayPort_t *displayPortSrxlInit(void) +{ + srxlDisplayPort.device = NULL; + displayInit(&srxlDisplayPort, &srxlVTable); + srxlDisplayPort.rows = SPEKTRUM_SRXL_TEXTGEN_BUFFER_ROWS; + srxlDisplayPort.cols = SPEKTRUM_SRXL_TEXTGEN_BUFFER_COLS; + return &srxlDisplayPort; +} + +#endif diff --git a/src/main/io/displayport_srxl.h b/src/main/io/displayport_srxl.h new file mode 100644 index 0000000000..62301a9436 --- /dev/null +++ b/src/main/io/displayport_srxl.h @@ -0,0 +1,25 @@ +/* + * This file is part of Cleanflight and Betaflight. + * + * Cleanflight and Betaflight are free software. You can redistribute + * this software and/or modify this software 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. + * + * Cleanflight and Betaflight are distributed in the hope that they + * 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 software. + * + * If not, see . + */ + +#pragma once + +displayPort_t *displayPortSrxlInit(void); + +extern displayPort_t srxlDisplayPort; diff --git a/src/main/io/gps.c b/src/main/io/gps.c index df63a806dc..fd0294bebc 100755 --- a/src/main/io/gps.c +++ b/src/main/io/gps.c @@ -60,6 +60,7 @@ #include "fc/runtime_config.h" typedef struct { + bool isDriverBased; portMode_t portMode; // Port mode RX/TX (only for serial based) bool hasCompass; // Has a compass (NAZA) void (*restart)(void); // Restart protocol driver thread @@ -72,47 +73,53 @@ gpsStatistics_t gpsStats; gpsSolutionData_t gpsSol; // Map gpsBaudRate_e index to baudRate_e -baudRate_e gpsToSerialBaudRate[GPS_BAUDRATE_COUNT] = { BAUD_115200, BAUD_57600, BAUD_38400, BAUD_19200, BAUD_9600 }; +baudRate_e gpsToSerialBaudRate[GPS_BAUDRATE_COUNT] = { BAUD_115200, BAUD_57600, BAUD_38400, BAUD_19200, BAUD_9600, BAUD_230400 }; static gpsProviderDescriptor_t gpsProviders[GPS_PROVIDER_COUNT] = { /* NMEA GPS */ #ifdef USE_GPS_PROTO_NMEA - { MODE_RX, false, &gpsRestartNMEA_MTK, &gpsHandleNMEA }, + { false, MODE_RX, false, &gpsRestartNMEA_MTK, &gpsHandleNMEA }, #else - { 0, false, NULL, NULL }, + { false, 0, false, NULL, NULL }, #endif /* UBLOX binary */ #ifdef USE_GPS_PROTO_UBLOX - { MODE_RXTX, false, &gpsRestartUBLOX, &gpsHandleUBLOX }, + { false, MODE_RXTX, false, &gpsRestartUBLOX, &gpsHandleUBLOX }, #else - { 0, false, NULL, NULL }, + { false, 0, false, NULL, NULL }, #endif /* Stub */ - { 0, false, NULL, NULL }, + { false, 0, false, NULL, NULL }, /* NAZA GPS module */ #ifdef USE_GPS_PROTO_NAZA - { MODE_RX, true, &gpsRestartNAZA, &gpsHandleNAZA }, + { false, MODE_RX, true, &gpsRestartNAZA, &gpsHandleNAZA }, #else - { 0, false, NULL, NULL }, + { false, 0, false, NULL, NULL }, #endif /* UBLOX7PLUS binary */ #ifdef USE_GPS_PROTO_UBLOX - { MODE_RXTX, false, &gpsRestartUBLOX, &gpsHandleUBLOX }, + { false, MODE_RXTX, false, &gpsRestartUBLOX, &gpsHandleUBLOX }, #else - { 0, false, NULL, NULL }, + { false, 0, false, NULL, NULL }, #endif /* MTK GPS */ #ifdef USE_GPS_PROTO_MTK - { MODE_RXTX, false, &gpsRestartNMEA_MTK, &gpsHandleMTK }, + { false, MODE_RXTX, false, &gpsRestartNMEA_MTK, &gpsHandleMTK }, #else - { 0, false, NULL, NULL }, + { false, 0, false, NULL, NULL }, #endif + /* MSP GPS */ +#ifdef USE_GPS_PROTO_MSP + { true, 0, false, &gpsRestartMSP, &gpsHandleMSP }, +#else + { false, 0, false, NULL, NULL }, +#endif }; PG_REGISTER_WITH_RESET_TEMPLATE(gpsConfig_t, gpsConfig, PG_GPS_CONFIG, 0); @@ -135,7 +142,7 @@ void gpsSetState(gpsState_e state) static void gpsUpdateTime(void) { - if (!rtcHasTime() && gpsSol.flags.validTime) { + if (!rtcHasTime() && gpsSol.flags.validTime && gpsSol.time.year != 0) { rtcSetDateTime(&gpsSol.time); } } @@ -220,6 +227,12 @@ void gpsInit(void) return; } + // Shortcut for driver-based GPS (MSP) + if (gpsProviders[gpsState.gpsConfig->provider].isDriverBased) { + gpsSetState(GPS_INITIALIZING); + return; + } + serialPortConfig_t * gpsPortConfig = findSerialPortConfig(FUNCTION_GPS); if (!gpsPortConfig) { featureClear(FEATURE_GPS); @@ -228,7 +241,8 @@ void gpsInit(void) // Start with baud rate index as configured for serial port int baudrateIndex; - for (gpsState.baudrateIndex = 0, baudrateIndex = 0; baudrateIndex < GPS_BAUDRATE_COUNT; baudrateIndex++) { + gpsState.baudrateIndex = GPS_BAUDRATE_115200; + for (baudrateIndex = 0, gpsState.baudrateIndex = 0; baudrateIndex < GPS_BAUDRATE_COUNT; baudrateIndex++) { if (gpsToSerialBaudRate[baudrateIndex] == gpsPortConfig->gps_baudrateIndex) { gpsState.baudrateIndex = baudrateIndex; break; diff --git a/src/main/io/gps.h b/src/main/io/gps.h index a707499735..6b1e09ad45 100755 --- a/src/main/io/gps.h +++ b/src/main/io/gps.h @@ -38,6 +38,7 @@ typedef enum { GPS_NAZA, GPS_UBLOX7PLUS, GPS_MTK, + GPS_MSP, GPS_PROVIDER_COUNT } gpsProvider_e; @@ -58,6 +59,7 @@ typedef enum { GPS_BAUDRATE_38400, GPS_BAUDRATE_19200, GPS_BAUDRATE_9600, + GPS_BAUDRATE_230400, GPS_BAUDRATE_COUNT } gpsBaudRate_e; @@ -163,3 +165,4 @@ bool isGPSHealthy(void); bool isGPSHeadingValid(void); struct serialPort_s; void gpsEnablePassthrough(struct serialPort_s *gpsPassthroughPort); +void mspGPSReceiveNewData(const uint8_t * bufferPtr); diff --git a/src/main/io/gps_msp.c b/src/main/io/gps_msp.c new file mode 100644 index 0000000000..35e7d12a1f --- /dev/null +++ b/src/main/io/gps_msp.c @@ -0,0 +1,113 @@ +/* + * This file is part of INAV Project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. + * + * Alternatively, the contents of this file may be used under the terms + * of the GNU General Public License Version 3, as described below: + * + * This file is free software: you may copy, redistribute 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 file 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 http://www.gnu.org/licenses/. + */ + +#include +#include +#include +#include +#include + +#include "platform.h" +#include "build/build_config.h" + + +#if defined(USE_GPS_PROTO_MSP) + +#include "build/debug.h" + +#include "common/axis.h" +#include "common/gps_conversion.h" +#include "common/maths.h" +#include "common/utils.h" + +#include "drivers/serial.h" +#include "drivers/time.h" + +#include "fc/config.h" +#include "fc/runtime_config.h" + +#include "io/gps.h" +#include "io/gps_private.h" +#include "io/serial.h" + +#include "msp/msp_protocol_v2_sensor_msg.h" + +static bool newDataReady; + +void gpsRestartMSP(void) +{ + // NOP +} + +void gpsHandleMSP(void) +{ + if (newDataReady) { + gpsProcessNewSolutionData(); + newDataReady = false; + } +} + +static uint8_t gpsMapFixType(uint8_t mspFixType) +{ + if (mspFixType == 2) + return GPS_FIX_2D; + if (mspFixType >= 3) + return GPS_FIX_3D; + return GPS_NO_FIX; +} + +void mspGPSReceiveNewData(const uint8_t * bufferPtr) +{ + const mspSensorGpsDataMessage_t * pkt = (const mspSensorGpsDataMessage_t *)bufferPtr; + + gpsSol.fixType = gpsMapFixType(pkt->fixType); + gpsSol.numSat = pkt->satellitesInView; + gpsSol.llh.lon = pkt->longitude; + gpsSol.llh.lat = pkt->latitude; + gpsSol.llh.alt = pkt->mslAltitude; + gpsSol.velNED[X] = pkt->nedVelNorth; + gpsSol.velNED[Y] = pkt->nedVelEast; + gpsSol.velNED[Z] = pkt->nedVelDown; + gpsSol.groundSpeed = sqrtf(sq((float)pkt->nedVelNorth) + sq((float)pkt->nedVelEast)); + gpsSol.groundCourse = pkt->groundCourse / 10; // in deg * 10 + gpsSol.eph = gpsConstrainEPE(pkt->horizontalPosAccuracy / 10); + gpsSol.epv = gpsConstrainEPE(pkt->verticalPosAccuracy / 10); + gpsSol.hdop = gpsConstrainHDOP(pkt->hdop); + gpsSol.flags.validVelNE = 1; + gpsSol.flags.validVelD = 1; + gpsSol.flags.validEPE = 1; + + gpsSol.time.year = pkt->year; + gpsSol.time.month = pkt->month; + gpsSol.time.day = pkt->day; + gpsSol.time.hours = pkt->hour; + gpsSol.time.minutes = pkt->min; + gpsSol.time.seconds = pkt->sec; + gpsSol.time.millis = 0; + + gpsSol.flags.validTime = (pkt->fixType >= 3); + + newDataReady = true; +} +#endif diff --git a/src/main/io/gps_nmea.c b/src/main/io/gps_nmea.c index f6af1cc4ac..814ed46b09 100755 --- a/src/main/io/gps_nmea.c +++ b/src/main/io/gps_nmea.c @@ -293,7 +293,8 @@ static const char * mtkBaudInitData[GPS_BAUDRATE_COUNT] = { "$PMTK251,57600*2C\r\n", // GPS_BAUDRATE_57600 "$PMTK251,38400*27\r\n", // GPS_BAUDRATE_38400 "$PMTK251,19200*22\r\n", // GPS_BAUDRATE_19200 - "$PMTK251,9600*17\r\n" // GPS_BAUDRATE_9600 + "$PMTK251,9600*17\r\n", // GPS_BAUDRATE_9600 + "$PMTK251,230400*1D\r\n", // GPS_BAUDRATE_230400 }; STATIC_PROTOTHREAD(gpsProtocolStateThreadMTK) diff --git a/src/main/io/gps_private.h b/src/main/io/gps_private.h index 4195529d05..196404beec 100755 --- a/src/main/io/gps_private.h +++ b/src/main/io/gps_private.h @@ -78,4 +78,7 @@ extern void gpsHandleMTK(void); extern void gpsRestartNAZA(void); extern void gpsHandleNAZA(void); +extern void gpsRestartMSP(void); +extern void gpsHandleMSP(void); + #endif diff --git a/src/main/io/gps_ublox.c b/src/main/io/gps_ublox.c index bae5e0be39..d94a8a46e3 100755 --- a/src/main/io/gps_ublox.c +++ b/src/main/io/gps_ublox.c @@ -35,6 +35,7 @@ #include "common/gps_conversion.h" #include "common/maths.h" #include "common/utils.h" +#include "common/log.h" #include "drivers/serial.h" #include "drivers/time.h" @@ -76,7 +77,8 @@ static const char * baudInitDataNMEA[GPS_BAUDRATE_COUNT] = { "$PUBX,41,1,0003,0001,57600,0*2D\r\n", // GPS_BAUDRATE_57600 "$PUBX,41,1,0003,0001,38400,0*26\r\n", // GPS_BAUDRATE_38400 "$PUBX,41,1,0003,0001,19200,0*23\r\n", // GPS_BAUDRATE_19200 - "$PUBX,41,1,0003,0001,9600,0*16\r\n" // GPS_BAUDRATE_9600 + "$PUBX,41,1,0003,0001,9600,0*16\r\n", // GPS_BAUDRATE_9600 + "$PUBX,41,1,0003,0001,230400,0*1C\r\n", // GPS_BAUDRATE_230400 }; // payload types @@ -273,6 +275,8 @@ enum { MSG_VELNED = 0x12, MSG_TIMEUTC = 0x21, MSG_SVINFO = 0x30, + MSG_NAV_SAT = 0x35, + MSG_NAV_SIG = 0x43, MSG_CFG_PRT = 0x00, MSG_CFG_RATE = 0x08, MSG_CFG_SET_RATE = 0x01, @@ -700,6 +704,7 @@ STATIC_PROTOTHREAD(gpsConfigure) gpsSetProtocolTimeout(GPS_SHORT_TIMEOUT); // Set dynamic model + LOG_D(GPS, "UBLOX: Configuring NAV5"); switch (gpsState.gpsConfig->dynModel) { case GPS_DYNMODEL_PEDESTRIAN: configureNAV5(UBX_DYNMODEL_PEDESTRIAN, UBX_FIXMODE_AUTO); @@ -717,6 +722,8 @@ STATIC_PROTOTHREAD(gpsConfigure) // Disable NMEA messages gpsSetProtocolTimeout(GPS_SHORT_TIMEOUT); + LOG_D(GPS, "UBLOX: Disable NMEA messages"); + configureMSG(MSG_CLASS_NMEA, MSG_NMEA_GGA, 0); ptWait(_ack_state == UBX_ACK_GOT_ACK); @@ -738,36 +745,17 @@ STATIC_PROTOTHREAD(gpsConfigure) // Configure UBX binary messages gpsSetProtocolTimeout(GPS_SHORT_TIMEOUT); - if ((gpsState.gpsConfig->provider == GPS_UBLOX) || (gpsState.hwVersion < 70000)) { - configureMSG(MSG_CLASS_UBX, MSG_POSLLH, 1); - ptWait(_ack_state == UBX_ACK_GOT_ACK); + // u-Blox 9 + // M9N does not support some of the UBX 6/7/8 messages, so we have to configure it using special sequence + if (gpsState.hwVersion >= 190000) { + LOG_D(GPS, "UBLOX: Configuring UBX-9 messages"); - configureMSG(MSG_CLASS_UBX, MSG_STATUS, 1); - ptWait(_ack_state == UBX_ACK_GOT_ACK); - - configureMSG(MSG_CLASS_UBX, MSG_SOL, 1); - ptWait(_ack_state == UBX_ACK_GOT_ACK); - - configureMSG(MSG_CLASS_UBX, MSG_VELNED, 1); - ptWait(_ack_state == UBX_ACK_GOT_ACK); - - configureMSG(MSG_CLASS_UBX, MSG_TIMEUTC, 10); - ptWait(_ack_state == UBX_ACK_GOT_ACK); - - // This may fail on old UBLOX units, advance forward on both ACK and NAK - configureMSG(MSG_CLASS_UBX, MSG_PVT, 0); - ptWait(_ack_state == UBX_ACK_GOT_ACK || _ack_state == UBX_ACK_GOT_NAK); - } - else { configureMSG(MSG_CLASS_UBX, MSG_POSLLH, 0); ptWait(_ack_state == UBX_ACK_GOT_ACK); configureMSG(MSG_CLASS_UBX, MSG_STATUS, 0); ptWait(_ack_state == UBX_ACK_GOT_ACK); - configureMSG(MSG_CLASS_UBX, MSG_SOL, 0); - ptWait(_ack_state == UBX_ACK_GOT_ACK); - configureMSG(MSG_CLASS_UBX, MSG_VELNED, 0); ptWait(_ack_state == UBX_ACK_GOT_ACK); @@ -776,20 +764,84 @@ STATIC_PROTOTHREAD(gpsConfigure) configureMSG(MSG_CLASS_UBX, MSG_PVT, 1); ptWait(_ack_state == UBX_ACK_GOT_ACK); - } - configureMSG(MSG_CLASS_UBX, MSG_SVINFO, 0); - ptWait(_ack_state == UBX_ACK_GOT_ACK); + configureMSG(MSG_CLASS_UBX, MSG_NAV_SAT, 0); + ptWait(_ack_state == UBX_ACK_GOT_ACK); - // Configure data rate - gpsSetProtocolTimeout(GPS_SHORT_TIMEOUT); - if ((gpsState.gpsConfig->provider == GPS_UBLOX7PLUS) && (gpsState.hwVersion >= 70000)) { - configureRATE(100); // 10Hz + configureMSG(MSG_CLASS_UBX, MSG_NAV_SIG, 0); + ptWait(_ack_state == UBX_ACK_GOT_ACK); + + // u-Blox 9 receivers such as M9N can do 10Hz as well, but the number of used satellites will be restricted to 16. + // Not mentioned in the datasheet + configureRATE(200); + ptWait(_ack_state == UBX_ACK_GOT_ACK); } else { - configureRATE(200); // 5Hz + // u-Blox 6/7/8 + // u-Blox 6 doesn't support PVT, use legacy config + if ((gpsState.gpsConfig->provider == GPS_UBLOX) || (gpsState.hwVersion < 70000)) { + LOG_D(GPS, "UBLOX: Configuring UBX-6 messages"); + + configureMSG(MSG_CLASS_UBX, MSG_POSLLH, 1); + ptWait(_ack_state == UBX_ACK_GOT_ACK); + + configureMSG(MSG_CLASS_UBX, MSG_STATUS, 1); + ptWait(_ack_state == UBX_ACK_GOT_ACK); + + configureMSG(MSG_CLASS_UBX, MSG_SOL, 1); + ptWait(_ack_state == UBX_ACK_GOT_ACK); + + configureMSG(MSG_CLASS_UBX, MSG_VELNED, 1); + ptWait(_ack_state == UBX_ACK_GOT_ACK); + + configureMSG(MSG_CLASS_UBX, MSG_TIMEUTC, 10); + ptWait(_ack_state == UBX_ACK_GOT_ACK); + + // This may fail on old UBLOX units, advance forward on both ACK and NAK + configureMSG(MSG_CLASS_UBX, MSG_PVT, 0); + ptWait(_ack_state == UBX_ACK_GOT_ACK || _ack_state == UBX_ACK_GOT_NAK); + + configureMSG(MSG_CLASS_UBX, MSG_SVINFO, 0); + ptWait(_ack_state == UBX_ACK_GOT_ACK); + + // Configure data rate to 5HZ + configureRATE(200); + ptWait(_ack_state == UBX_ACK_GOT_ACK); + } + // u-Blox 7-8 support PVT + else { + LOG_D(GPS, "UBLOX: Configuring UBX-7 messages"); + + configureMSG(MSG_CLASS_UBX, MSG_POSLLH, 0); + ptWait(_ack_state == UBX_ACK_GOT_ACK); + + configureMSG(MSG_CLASS_UBX, MSG_STATUS, 0); + ptWait(_ack_state == UBX_ACK_GOT_ACK); + + configureMSG(MSG_CLASS_UBX, MSG_SOL, 1); + ptWait(_ack_state == UBX_ACK_GOT_ACK); + + configureMSG(MSG_CLASS_UBX, MSG_VELNED, 0); + ptWait(_ack_state == UBX_ACK_GOT_ACK); + + configureMSG(MSG_CLASS_UBX, MSG_TIMEUTC, 0); + ptWait(_ack_state == UBX_ACK_GOT_ACK); + + configureMSG(MSG_CLASS_UBX, MSG_PVT, 1); + ptWait(_ack_state == UBX_ACK_GOT_ACK); + + configureMSG(MSG_CLASS_UBX, MSG_SVINFO, 0); + ptWait(_ack_state == UBX_ACK_GOT_ACK); + + if ((gpsState.gpsConfig->provider == GPS_UBLOX7PLUS) && (gpsState.hwVersion >= 70000)) { + configureRATE(100); // 10Hz + } + else { + configureRATE(200); // 5Hz + } + ptWait(_ack_state == UBX_ACK_GOT_ACK); + } } - ptWait(_ack_state == UBX_ACK_GOT_ACK); // Configure SBAS // If particular SBAS setting is not supported by the hardware we'll get a NAK, @@ -904,6 +956,14 @@ STATIC_PROTOTHREAD(gpsProtocolStateThread) ptWaitTimeout((gpsState.hwVersion != 0), GPS_CFG_CMD_TIMEOUT_MS); } while(gpsState.autoConfigStep < GPS_VERSION_RETRY_TIMES && gpsState.hwVersion == 0); + if (gpsState.hwVersion == 0) { + LOG_E(GPS, "UBLOX: version detection timeout"); + } + else { + LOG_I(GPS, "UBLOX: detected HW: %u", (unsigned)gpsState.hwVersion); + } + + // Configure GPS ptSpawn(gpsConfigure); } diff --git a/src/main/io/opflow_msp.c b/src/main/io/opflow_msp.c index 029fa09573..778ebccca4 100644 --- a/src/main/io/opflow_msp.c +++ b/src/main/io/opflow_msp.c @@ -37,15 +37,13 @@ #include "io/serial.h" #if defined(USE_OPFLOW_MSP) + #include "drivers/opflow/opflow_virtual.h" #include "drivers/time.h" #include "io/opflow.h" -typedef struct __attribute__((packed)) { - uint8_t quality; // [0;255] - int32_t motionX; - int32_t motionY; -} mspOpflowSensor_t; +#include "msp/msp_protocol_v2_sensor_msg.h" + static bool hasNewData = false; static timeUs_t updatedTimeUs = 0; @@ -76,7 +74,7 @@ static bool mspOpflowUpdate(opflowData_t * data) void mspOpflowReceiveNewData(uint8_t * bufferPtr) { const timeUs_t currentTimeUs = micros(); - const mspOpflowSensor_t * pkt = (const mspOpflowSensor_t *)bufferPtr; + const mspSensorOpflowDataMessage_t * pkt = (const mspSensorOpflowDataMessage_t *)bufferPtr; sensorData.deltaTime = currentTimeUs - updatedTimeUs; sensorData.flowRateRaw[0] = pkt->motionX; diff --git a/src/main/io/osd.c b/src/main/io/osd.c index 9128f571b3..bb7a5bcc61 100755 --- a/src/main/io/osd.c +++ b/src/main/io/osd.c @@ -104,6 +104,7 @@ FILE_COMPILE_FOR_SPEED #include "sensors/esc_sensor.h" #include "programming/logic_condition.h" +#include "programming/global_variables.h" #ifdef USE_HARDWARE_REVISION_DETECTION #include "hardware_revision.h" @@ -416,6 +417,7 @@ static void osdFormatWindSpeedStr(char *buff, int32_t ws, bool isValid) centivalue = (ws * 224) / 100; suffix = SYM_MPH; break; + default: case OSD_UNIT_METRIC: centivalue = (ws * 36) / 10; suffix = SYM_KMH; @@ -620,10 +622,6 @@ static void osdFormatCraftName(char *buff) } } -// Used twice, make sure it's exactly the same string -// to save some memory -#define RC_RX_LINK_LOST_MSG "!RC RX LINK LOST!" - static const char * osdArmingDisabledReasonMessage(void) { switch (isArmingDisabledReason()) { @@ -634,18 +632,18 @@ static const char * osdArmingDisabledReasonMessage(void) // If we're not using sticks, it means the ARM switch // hasn't been off since entering FAILSAFE_RX_LOSS_MONITORING // yet - return OSD_MESSAGE_STR("TURN ARM SWITCH OFF"); + return OSD_MESSAGE_STR(OSD_MSG_TURN_ARM_SW_OFF); } // Not receiving RX data - return OSD_MESSAGE_STR(RC_RX_LINK_LOST_MSG); + return OSD_MESSAGE_STR(OSD_MSG_RC_RX_LINK_LOST); } - return OSD_MESSAGE_STR("DISABLED BY FAILSAFE"); + return OSD_MESSAGE_STR(OSD_MSG_DISABLED_BY_FS); case ARMING_DISABLED_NOT_LEVEL: - return OSD_MESSAGE_STR("AIRCRAFT IS NOT LEVEL"); + return OSD_MESSAGE_STR(OSD_MSG_AIRCRAFT_UNLEVEL); case ARMING_DISABLED_SENSORS_CALIBRATING: - return OSD_MESSAGE_STR("SENSORS CALIBRATING"); + return OSD_MESSAGE_STR(OSD_MSG_SENSORS_CAL); case ARMING_DISABLED_SYSTEM_OVERLOADED: - return OSD_MESSAGE_STR("SYSTEM OVERLOADED"); + return OSD_MESSAGE_STR(OSD_MSG_SYS_OVERLOADED); case ARMING_DISABLED_NAVIGATION_UNSAFE: #if defined(USE_NAV) // Check the exact reason @@ -653,67 +651,67 @@ static const char * osdArmingDisabledReasonMessage(void) case NAV_ARMING_BLOCKER_NONE: break; case NAV_ARMING_BLOCKER_MISSING_GPS_FIX: - return OSD_MESSAGE_STR("WAITING FOR GPS FIX"); + return OSD_MESSAGE_STR(OSD_MSG_WAITING_GPS_FIX); case NAV_ARMING_BLOCKER_NAV_IS_ALREADY_ACTIVE: - return OSD_MESSAGE_STR("DISABLE NAVIGATION FIRST"); + return OSD_MESSAGE_STR(OSD_MSG_DISABLE_NAV_FIRST); case NAV_ARMING_BLOCKER_FIRST_WAYPOINT_TOO_FAR: - return OSD_MESSAGE_STR("FIRST WAYPOINT IS TOO FAR"); + return OSD_MESSAGE_STR(OSD_MSG_1ST_WP_TOO_FAR); case NAV_ARMING_BLOCKER_JUMP_WAYPOINT_ERROR: - return OSD_MESSAGE_STR("JUMP WAYPOINT MISCONFIGURED"); + return OSD_MESSAGE_STR(OSD_MSG_JUMP_WP_MISCONFIG); } #endif break; case ARMING_DISABLED_COMPASS_NOT_CALIBRATED: - return OSD_MESSAGE_STR("COMPASS NOT CALIBRATED"); + return OSD_MESSAGE_STR(OSD_MSG_MAG_NOT_CAL); case ARMING_DISABLED_ACCELEROMETER_NOT_CALIBRATED: - return OSD_MESSAGE_STR("ACCELEROMETER NOT CALIBRATED"); + return OSD_MESSAGE_STR(OSD_MSG_ACC_NOT_CAL); case ARMING_DISABLED_ARM_SWITCH: - return OSD_MESSAGE_STR("DISABLE ARM SWITCH FIRST"); + return OSD_MESSAGE_STR(OSD_MSG_DISARM_1ST); case ARMING_DISABLED_HARDWARE_FAILURE: { if (!HW_SENSOR_IS_HEALTHY(getHwGyroStatus())) { - return OSD_MESSAGE_STR("GYRO FAILURE"); + return OSD_MESSAGE_STR(OSD_MSG_GYRO_FAILURE); } if (!HW_SENSOR_IS_HEALTHY(getHwAccelerometerStatus())) { - return OSD_MESSAGE_STR("ACCELEROMETER FAILURE"); + return OSD_MESSAGE_STR(OSD_MSG_ACC_FAIL); } if (!HW_SENSOR_IS_HEALTHY(getHwCompassStatus())) { - return OSD_MESSAGE_STR("COMPASS FAILURE"); + return OSD_MESSAGE_STR(OSD_MSG_MAG_FAIL); } if (!HW_SENSOR_IS_HEALTHY(getHwBarometerStatus())) { - return OSD_MESSAGE_STR("BAROMETER FAILURE"); + return OSD_MESSAGE_STR(OSD_MSG_BARO_FAIL); } if (!HW_SENSOR_IS_HEALTHY(getHwGPSStatus())) { - return OSD_MESSAGE_STR("GPS FAILURE"); + return OSD_MESSAGE_STR(OSD_MSG_GPS_FAIL); } if (!HW_SENSOR_IS_HEALTHY(getHwRangefinderStatus())) { - return OSD_MESSAGE_STR("RANGE FINDER FAILURE"); + return OSD_MESSAGE_STR(OSD_MSG_RANGEFINDER_FAIL); } if (!HW_SENSOR_IS_HEALTHY(getHwPitotmeterStatus())) { - return OSD_MESSAGE_STR("PITOT METER FAILURE"); + return OSD_MESSAGE_STR(OSD_MSG_PITOT_FAIL); } } - return OSD_MESSAGE_STR("HARDWARE FAILURE"); + return OSD_MESSAGE_STR(OSD_MSG_HW_FAIL); case ARMING_DISABLED_BOXFAILSAFE: - return OSD_MESSAGE_STR("FAILSAFE MODE ENABLED"); + return OSD_MESSAGE_STR(OSD_MSG_FS_EN); case ARMING_DISABLED_BOXKILLSWITCH: - return OSD_MESSAGE_STR("KILLSWITCH MODE ENABLED"); + return OSD_MESSAGE_STR(OSD_MSG_KILL_SW_EN); case ARMING_DISABLED_RC_LINK: - return OSD_MESSAGE_STR("NO RC LINK"); + return OSD_MESSAGE_STR(OSD_MSG_NO_RC_LINK); case ARMING_DISABLED_THROTTLE: - return OSD_MESSAGE_STR("THROTTLE IS NOT LOW"); + return OSD_MESSAGE_STR(OSD_MSG_THROTTLE_NOT_LOW); case ARMING_DISABLED_ROLLPITCH_NOT_CENTERED: - return OSD_MESSAGE_STR("ROLLPITCH NOT CENTERED"); + return OSD_MESSAGE_STR(OSD_MSG_ROLLPITCH_OFFCENTER); case ARMING_DISABLED_SERVO_AUTOTRIM: - return OSD_MESSAGE_STR("AUTOTRIM IS ACTIVE"); + return OSD_MESSAGE_STR(OSD_MSG_AUTOTRIM_ACTIVE); case ARMING_DISABLED_OOM: - return OSD_MESSAGE_STR("NOT ENOUGH MEMORY"); + return OSD_MESSAGE_STR(OSD_MSG_NOT_ENOUGH_MEMORY); case ARMING_DISABLED_INVALID_SETTING: - return OSD_MESSAGE_STR("INVALID SETTING"); + return OSD_MESSAGE_STR(OSD_MSG_INVALID_SETTING); case ARMING_DISABLED_CLI: - return OSD_MESSAGE_STR("CLI IS ACTIVE"); + return OSD_MESSAGE_STR(OSD_MSG_CLI_ACTIVE); case ARMING_DISABLED_PWM_OUTPUT_ERROR: - return OSD_MESSAGE_STR("PWM INIT ERROR"); + return OSD_MESSAGE_STR(OSD_MSG_PWM_INIT_ERROR); // Cases without message case ARMING_DISABLED_CMS_MENU: FALLTHROUGH; @@ -736,11 +734,11 @@ static const char * osdFailsafePhaseMessage(void) #ifdef USE_NAV case FAILSAFE_RETURN_TO_HOME: // XXX: Keep this in sync with OSD_FLYMODE. - return OSD_MESSAGE_STR("(RTH)"); + return OSD_MESSAGE_STR(OSD_MSG_RTH_FS); #endif case FAILSAFE_LANDING: // This should be considered an emergengy landing - return OSD_MESSAGE_STR("(EMERGENCY LANDING)"); + return OSD_MESSAGE_STR(OSD_MSG_EMERG_LANDING_FS); case FAILSAFE_RX_LOSS_MONITORING: // Only reachable from FAILSAFE_LANDED, which performs // a disarm. Since aircraft has been disarmed, we no @@ -775,9 +773,9 @@ static const char * osdFailsafeInfoMessage(void) { if (failsafeIsReceivingRxData()) { // User must move sticks to exit FS mode - return OSD_MESSAGE_STR("!MOVE STICKS TO EXIT FS!"); + return OSD_MESSAGE_STR(OSD_MSG_MOVE_EXIT_FS); } - return OSD_MESSAGE_STR(RC_RX_LINK_LOST_MSG); + return OSD_MESSAGE_STR(OSD_MSG_RC_RX_LINK_LOST); } static const char * navigationStateMessage(void) @@ -786,22 +784,22 @@ static const char * navigationStateMessage(void) case MW_NAV_STATE_NONE: break; case MW_NAV_STATE_RTH_START: - return OSD_MESSAGE_STR("STARTING RTH"); + return OSD_MESSAGE_STR(OSD_MSG_STARTING_RTH); case MW_NAV_STATE_RTH_ENROUTE: // TODO: Break this up between climb and head home - return OSD_MESSAGE_STR("EN ROUTE TO HOME"); + return OSD_MESSAGE_STR(OSD_MSG_HEADING_HOME); case MW_NAV_STATE_HOLD_INFINIT: // Used by HOLD flight modes. No information to add. break; case MW_NAV_STATE_HOLD_TIMED: // TODO: Maybe we can display a count down - return OSD_MESSAGE_STR("HOLDING WAYPOINT"); + return OSD_MESSAGE_STR(OSD_MSG_HOLDING_WAYPOINT); break; case MW_NAV_STATE_WP_ENROUTE: // TODO: Show WP number - return OSD_MESSAGE_STR("TO WP"); + return OSD_MESSAGE_STR(OSD_MSG_TO_WP); case MW_NAV_STATE_PROCESS_NEXT: - return OSD_MESSAGE_STR("PREPARING FOR NEXT WAYPOINT"); + return OSD_MESSAGE_STR(OSD_MSG_PREPARE_NEXT_WP); case MW_NAV_STATE_DO_JUMP: // Not used break; @@ -809,18 +807,18 @@ static const char * navigationStateMessage(void) // Not used break; case MW_NAV_STATE_EMERGENCY_LANDING: - return OSD_MESSAGE_STR("EMERGENCY LANDING"); + return OSD_MESSAGE_STR(OSD_MSG_EMERG_LANDING); case MW_NAV_STATE_LAND_IN_PROGRESS: - return OSD_MESSAGE_STR("LANDING"); + return OSD_MESSAGE_STR(OSD_MSG_LANDING); case MW_NAV_STATE_HOVER_ABOVE_HOME: if (STATE(FIXED_WING_LEGACY)) { - return OSD_MESSAGE_STR("LOITERING AROUND HOME"); + return OSD_MESSAGE_STR(OSD_MSG_LOITERING_HOME); } - return OSD_MESSAGE_STR("HOVERING"); + return OSD_MESSAGE_STR(OSD_MSG_HOVERING); case MW_NAV_STATE_LANDED: - return OSD_MESSAGE_STR("LANDED"); + return OSD_MESSAGE_STR(OSD_MSG_LANDED); case MW_NAV_STATE_LAND_SETTLE: - return OSD_MESSAGE_STR("PREPARING TO LAND"); + return OSD_MESSAGE_STR(OSD_MSG_PREPARING_LAND); case MW_NAV_STATE_LAND_START_DESCENT: // Not used break; @@ -828,15 +826,14 @@ static const char * navigationStateMessage(void) return NULL; } -static void osdFormatMessage(char *buff, size_t size, const char *message) +static void osdFormatMessage(char *buff, size_t size, const char *message, bool isCenteredText) { + // String is always filled with Blanks memset(buff, SYM_BLANK, size); if (message) { - int messageLength = strlen(message); - int rem = MAX(0, OSD_MESSAGE_LENGTH - (int)messageLength); - // Don't finish the string at the end of the message, - // write the rest of the blanks. - strncpy(buff + rem / 2, message, MIN(OSD_MESSAGE_LENGTH - rem / 2, messageLength)); + size_t messageLength = strlen(message); + int rem = isCenteredText ? MAX(0, (int)size - (int)messageLength) : 0; + strncpy(buff + rem / 2, message, MIN((int)size - rem / 2, (int)messageLength)); } // Ensure buff is zero terminated buff[size - 1] = '\0'; @@ -887,6 +884,19 @@ static void osdFormatThrottlePosition(char *buff, bool autoThr, textAttributes_t tfp_sprintf(buff + 2, "%3d", (constrain(thr, PWM_RANGE_MIN, PWM_RANGE_MAX) - PWM_RANGE_MIN) * 100 / (PWM_RANGE_MAX - PWM_RANGE_MIN)); } +/** + * Formats gvars prefixed by its number (0-indexed). If autoThr + **/ +static void osdFormatGVar(char *buff, uint8_t index) +{ + buff[0] = 'G'; + buff[1] = '0'+index; + buff[2] = ':'; + #ifdef USE_PROGRAMMING_FRAMEWORK + osdFormatCentiNumber(buff + 3, (int32_t)gvGet(index)*(int32_t)100, 1, 0, 0, 5); + #endif +} + #if defined(USE_ESC_SENSOR) static void osdFormatRpm(char *buff, uint32_t rpm) { @@ -1002,6 +1012,7 @@ static void osdDrawMap(int referenceHeading, uint8_t referenceSym, uint8_t cente break; case OSD_UNIT_UK: FALLTHROUGH; + default: case OSD_UNIT_METRIC: initialScale = 10; // 10m as initial scale break; @@ -1651,15 +1662,31 @@ static bool osdDrawSingleElement(uint8_t item) } break; - case OSD_CRSF_LQ: +#if defined(USE_SERIALRX_CRSF) + case OSD_CRSF_LQ: { buff[0] = SYM_BLANK; - tfp_sprintf(buff, "%d:%3d%s", rxLinkStatistics.rfMode, rxLinkStatistics.uplinkLQ, "%"); - if (!failsafeIsReceivingRxData()){ - TEXT_ATTRIBUTES_ADD_BLINK(elemAttr); - } else if (rxLinkStatistics.uplinkLQ < osdConfig()->rssi_alarm) { - TEXT_ATTRIBUTES_ADD_BLINK(elemAttr); + int16_t statsLQ = rxLinkStatistics.uplinkLQ; + int16_t scaledLQ = scaleRange(constrain(statsLQ, 0, 100), 0, 100, 170, 300); + if (rxLinkStatistics.rfMode == 2) { + if (osdConfig()->crsf_lq_format == OSD_CRSF_LQ_TYPE1) { + tfp_sprintf(buff, "%5d%s", scaledLQ, "%"); + } else { + tfp_sprintf(buff, "%d:%3d%s", rxLinkStatistics.rfMode, rxLinkStatistics.uplinkLQ, "%"); + } + } else { + if (osdConfig()->crsf_lq_format == OSD_CRSF_LQ_TYPE1) { + tfp_sprintf(buff, "%5d%s", rxLinkStatistics.uplinkLQ, "%"); + } else { + tfp_sprintf(buff, "%d:%3d%s", rxLinkStatistics.rfMode, rxLinkStatistics.uplinkLQ, "%"); + } + } + if (!failsafeIsReceivingRxData()){ + TEXT_ATTRIBUTES_ADD_BLINK(elemAttr); + } else if (rxLinkStatistics.uplinkLQ < osdConfig()->link_quality_alarm) { + TEXT_ATTRIBUTES_ADD_BLINK(elemAttr); + } + break; } - break; case OSD_CRSF_SNR_DB: { const char* showsnr = "-12"; @@ -1680,6 +1707,7 @@ static bool osdDrawSingleElement(uint8_t item) } break; } +#endif case OSD_CRSF_TX_POWER: { tfp_sprintf(buff, "%4d%c", rxLinkStatistics.uplinkTXPower, SYM_MW); @@ -1818,6 +1846,7 @@ static bool osdDrawSingleElement(uint8_t item) value = CENTIMETERS_TO_CENTIFEET(value); sym = SYM_FTS; break; + default: case OSD_UNIT_METRIC: // Already in cm/s sym = SYM_MS; @@ -2035,99 +2064,7 @@ static bool osdDrawSingleElement(uint8_t item) case OSD_MESSAGES: { - const char *message = NULL; - char messageBuf[MAX(SETTING_MAX_NAME_LENGTH, OSD_MESSAGE_LENGTH+1)]; - if (ARMING_FLAG(ARMED)) { - // Aircraft is armed. We might have up to 5 - // messages to show. - const char *messages[5]; - unsigned messageCount = 0; - if (FLIGHT_MODE(FAILSAFE_MODE)) { - // In FS mode while being armed too - const char *failsafePhaseMessage = osdFailsafePhaseMessage(); - const char *failsafeInfoMessage = osdFailsafeInfoMessage(); - const char *navStateFSMessage = navigationStateMessage(); - if (failsafePhaseMessage) { - messages[messageCount++] = failsafePhaseMessage; - } - if (failsafeInfoMessage) { - messages[messageCount++] = failsafeInfoMessage; - } - if (navStateFSMessage) { - messages[messageCount++] = navStateFSMessage; - } - if (messageCount > 0) { - message = messages[OSD_ALTERNATING_CHOICES(1000, messageCount)]; - if (message == failsafeInfoMessage) { - // failsafeInfoMessage is not useful for recovering - // a lost model, but might help avoiding a crash. - // Blink to grab user attention. - TEXT_ATTRIBUTES_ADD_BLINK(elemAttr); - } - // We're shoing either failsafePhaseMessage or - // navStateFSMessage. Don't BLINK here since - // having this text available might be crucial - // during a lost aircraft recovery and blinking - // will cause it to be missing from some frames. - } - } else { - if (FLIGHT_MODE(NAV_RTH_MODE) || FLIGHT_MODE(NAV_WP_MODE) || navigationIsExecutingAnEmergencyLanding()) { - const char *navStateMessage = navigationStateMessage(); - if (navStateMessage) { - messages[messageCount++] = navStateMessage; - } - } else if (STATE(FIXED_WING_LEGACY) && (navGetCurrentStateFlags() & NAV_CTL_LAUNCH)) { - messages[messageCount++] = "AUTOLAUNCH"; - } else { - if (FLIGHT_MODE(NAV_ALTHOLD_MODE) && !navigationRequiresAngleMode()) { - // ALTHOLD might be enabled alongside ANGLE/HORIZON/ACRO - // when it doesn't require ANGLE mode (required only in FW - // right now). If if requires ANGLE, its display is handled - // by OSD_FLYMODE. - messages[messageCount++] = "(ALTITUDE HOLD)"; - } - if (IS_RC_MODE_ACTIVE(BOXAUTOTRIM)) { - messages[messageCount++] = "(AUTOTRIM)"; - } - if (IS_RC_MODE_ACTIVE(BOXAUTOTUNE)) { - messages[messageCount++] = "(AUTOTUNE)"; - } - if (FLIGHT_MODE(HEADFREE_MODE)) { - messages[messageCount++] = "(HEADFREE)"; - } - } - // Pick one of the available messages. Each message lasts - // a second. - if (messageCount > 0) { - message = messages[OSD_ALTERNATING_CHOICES(1000, messageCount)]; - } - } - } else if (ARMING_FLAG(ARMING_DISABLED_ALL_FLAGS)) { - unsigned invalidIndex; - // Check if we're unable to arm for some reason - if (ARMING_FLAG(ARMING_DISABLED_INVALID_SETTING) && !settingsValidate(&invalidIndex)) { - if (OSD_ALTERNATING_CHOICES(1000, 2) == 0) { - const setting_t *setting = settingGet(invalidIndex); - settingGetName(setting, messageBuf); - for (int ii = 0; messageBuf[ii]; ii++) { - messageBuf[ii] = sl_toupper(messageBuf[ii]); - } - message = messageBuf; - } else { - message = "INVALID SETTING"; - TEXT_ATTRIBUTES_ADD_INVERTED(elemAttr); - } - } else { - if (OSD_ALTERNATING_CHOICES(1000, 2) == 0) { - message = "UNABLE TO ARM"; - TEXT_ATTRIBUTES_ADD_INVERTED(elemAttr); - } else { - // Show the reason for not arming - message = osdArmingDisabledReasonMessage(); - } - } - } - osdFormatMessage(buff, sizeof(buff), message); + elemAttr = osdGetSystemMessage(buff, OSD_MESSAGE_LENGTH, true); break; } @@ -2391,6 +2328,7 @@ static bool osdDrawSingleElement(uint8_t item) break; case OSD_UNIT_UK: FALLTHROUGH; + default: case OSD_UNIT_METRIC: scaleToUnit = 100; // scale to cm for osdFormatCentiNumber() scaleUnitDivisor = 1000; // Convert to km when scale gets bigger than 999m @@ -2426,6 +2364,27 @@ static bool osdDrawSingleElement(uint8_t item) return true; } + case OSD_GVAR_0: + { + osdFormatGVar(buff, 0); + break; + } + case OSD_GVAR_1: + { + osdFormatGVar(buff, 1); + break; + } + case OSD_GVAR_2: + { + osdFormatGVar(buff, 2); + break; + } + case OSD_GVAR_3: + { + osdFormatGVar(buff, 3); + break; + } + #if defined(USE_RX_MSP) && defined(USE_MSP_RC_OVERRIDE) case OSD_RC_SOURCE: { @@ -2569,7 +2528,9 @@ PG_RESET_TEMPLATE(osdConfig_t, osdConfig, .baro_temp_alarm_max = 600, #endif #ifdef USE_SERIALRX_CRSF - .snr_alarm = 5, + .snr_alarm = 4, + .crsf_lq_format = OSD_CRSF_LQ_TYPE1, + .link_quality_alarm = 70, #endif #ifdef USE_TEMPERATURE_SENSOR .temp_label_align = OSD_ALIGN_LEFT, @@ -2658,10 +2619,10 @@ void pgResetFn_osdLayoutsConfig(osdLayoutsConfig_t *osdLayoutsConfig) osdLayoutsConfig->item_pos[0][OSD_VTX_CHANNEL] = OSD_POS(8, 6); #ifdef USE_SERIALRX_CRSF - osdLayoutsConfig->item_pos[0][OSD_CRSF_RSSI_DBM] = OSD_POS(23, 12); - osdLayoutsConfig->item_pos[0][OSD_CRSF_LQ] = OSD_POS(22, 11); - osdLayoutsConfig->item_pos[0][OSD_CRSF_SNR_DB] = OSD_POS(23, 9); - osdLayoutsConfig->item_pos[0][OSD_CRSF_TX_POWER] = OSD_POS(24, 10); + osdLayoutsConfig->item_pos[0][OSD_CRSF_RSSI_DBM] = OSD_POS(24, 12); + osdLayoutsConfig->item_pos[0][OSD_CRSF_LQ] = OSD_POS(24, 11); + osdLayoutsConfig->item_pos[0][OSD_CRSF_SNR_DB] = OSD_POS(25, 9); + osdLayoutsConfig->item_pos[0][OSD_CRSF_TX_POWER] = OSD_POS(25, 10); #endif osdLayoutsConfig->item_pos[0][OSD_ONTIME] = OSD_POS(23, 8); @@ -2739,6 +2700,11 @@ void pgResetFn_osdLayoutsConfig(osdLayoutsConfig_t *osdLayoutsConfig) osdLayoutsConfig->item_pos[0][OSD_VTX_POWER] = OSD_POS(3, 5); + osdLayoutsConfig->item_pos[0][OSD_GVAR_0] = OSD_POS(1, 1); + osdLayoutsConfig->item_pos[0][OSD_GVAR_1] = OSD_POS(1, 2); + osdLayoutsConfig->item_pos[0][OSD_GVAR_2] = OSD_POS(1, 3); + osdLayoutsConfig->item_pos[0][OSD_GVAR_3] = OSD_POS(1, 4); + #if defined(USE_ESC_SENSOR) osdLayoutsConfig->item_pos[0][OSD_ESC_RPM] = OSD_POS(1, 2); osdLayoutsConfig->item_pos[0][OSD_ESC_TEMPERATURE] = OSD_POS(1, 3); @@ -3314,4 +3280,110 @@ displayCanvas_t *osdGetDisplayPortCanvas(void) return NULL; } +textAttributes_t osdGetSystemMessage(char *buff, size_t buff_size, bool isCenteredText) +{ + textAttributes_t elemAttr = TEXT_ATTRIBUTES_NONE; + + if (buff != NULL) { + const char *message = NULL; + char messageBuf[MAX(SETTING_MAX_NAME_LENGTH, OSD_MESSAGE_LENGTH+1)]; + if (ARMING_FLAG(ARMED)) { + // Aircraft is armed. We might have up to 5 + // messages to show. + const char *messages[5]; + unsigned messageCount = 0; + if (FLIGHT_MODE(FAILSAFE_MODE)) { + // In FS mode while being armed too + const char *failsafePhaseMessage = osdFailsafePhaseMessage(); + const char *failsafeInfoMessage = osdFailsafeInfoMessage(); + const char *navStateFSMessage = navigationStateMessage(); + if (failsafePhaseMessage) { + messages[messageCount++] = failsafePhaseMessage; + } + if (failsafeInfoMessage) { + messages[messageCount++] = failsafeInfoMessage; + } + if (navStateFSMessage) { + messages[messageCount++] = navStateFSMessage; + } + if (messageCount > 0) { + message = messages[OSD_ALTERNATING_CHOICES(1000, messageCount)]; + if (message == failsafeInfoMessage) { + // failsafeInfoMessage is not useful for recovering + // a lost model, but might help avoiding a crash. + // Blink to grab user attention. + TEXT_ATTRIBUTES_ADD_BLINK(elemAttr); + } + // We're shoing either failsafePhaseMessage or + // navStateFSMessage. Don't BLINK here since + // having this text available might be crucial + // during a lost aircraft recovery and blinking + // will cause it to be missing from some frames. + } + } else { + if (FLIGHT_MODE(NAV_RTH_MODE) || FLIGHT_MODE(NAV_WP_MODE) || navigationIsExecutingAnEmergencyLanding()) { + const char *navStateMessage = navigationStateMessage(); + if (navStateMessage) { + messages[messageCount++] = navStateMessage; + } + } else if (STATE(FIXED_WING_LEGACY) && (navGetCurrentStateFlags() & NAV_CTL_LAUNCH)) { + messages[messageCount++] = OSD_MESSAGE_STR(OSD_MSG_AUTOLAUNCH); + const char *launchStateMessage = fixedWingLaunchStateMessage(); + if (launchStateMessage) { + messages[messageCount++] = launchStateMessage; + } + } else { + if (FLIGHT_MODE(NAV_ALTHOLD_MODE) && !navigationRequiresAngleMode()) { + // ALTHOLD might be enabled alongside ANGLE/HORIZON/ACRO + // when it doesn't require ANGLE mode (required only in FW + // right now). If if requires ANGLE, its display is handled + // by OSD_FLYMODE. + messages[messageCount++] = OSD_MESSAGE_STR(OSD_MSG_ALTITUDE_HOLD); + } + if (IS_RC_MODE_ACTIVE(BOXAUTOTRIM)) { + messages[messageCount++] = OSD_MESSAGE_STR(OSD_MSG_AUTOTRIM); + } + if (IS_RC_MODE_ACTIVE(BOXAUTOTUNE)) { + messages[messageCount++] = OSD_MESSAGE_STR(OSD_MSG_AUTOTUNE); + } + if (FLIGHT_MODE(HEADFREE_MODE)) { + messages[messageCount++] = OSD_MESSAGE_STR(OSD_MSG_HEADFREE); + } + } + // Pick one of the available messages. Each message lasts + // a second. + if (messageCount > 0) { + message = messages[OSD_ALTERNATING_CHOICES(1000, messageCount)]; + } + } + } else if (ARMING_FLAG(ARMING_DISABLED_ALL_FLAGS)) { + unsigned invalidIndex; + // Check if we're unable to arm for some reason + if (ARMING_FLAG(ARMING_DISABLED_INVALID_SETTING) && !settingsValidate(&invalidIndex)) { + if (OSD_ALTERNATING_CHOICES(1000, 2) == 0) { + const setting_t *setting = settingGet(invalidIndex); + settingGetName(setting, messageBuf); + for (int ii = 0; messageBuf[ii]; ii++) { + messageBuf[ii] = sl_toupper(messageBuf[ii]); + } + message = messageBuf; + } else { + message = OSD_MESSAGE_STR(OSD_MSG_INVALID_SETTING); + TEXT_ATTRIBUTES_ADD_INVERTED(elemAttr); + } + } else { + if (OSD_ALTERNATING_CHOICES(1000, 2) == 0) { + message = OSD_MESSAGE_STR(OSD_MSG_UNABLE_ARM); + TEXT_ATTRIBUTES_ADD_INVERTED(elemAttr); + } else { + // Show the reason for not arming + message = osdArmingDisabledReasonMessage(); + } + } + } + osdFormatMessage(buff, buff_size, message, isCenteredText); + } + return elemAttr; +} + #endif // OSD diff --git a/src/main/io/osd.h b/src/main/io/osd.h index f05a268ef5..b53d2c31c0 100755 --- a/src/main/io/osd.h +++ b/src/main/io/osd.h @@ -22,6 +22,7 @@ #include "config/parameter_group.h" #include "drivers/osd.h" +#include "drivers/display.h" #ifndef OSD_ALTERNATE_LAYOUT_COUNT #define OSD_ALTERNATE_LAYOUT_COUNT 3 @@ -43,6 +44,59 @@ #define OSD_HOMING_LIM_V2 10 #define OSD_HOMING_LIM_V3 15 +// Message defines to be use in OSD and/or telemetry exports +#define OSD_MSG_RC_RX_LINK_LOST "!RC RX LINK LOST!" +#define OSD_MSG_TURN_ARM_SW_OFF "TURN ARM SWITCH OFF" +#define OSD_MSG_DISABLED_BY_FS "DISABLED BY FAILSAFE" +#define OSD_MSG_AIRCRAFT_UNLEVEL "AIRCRAFT IS NOT LEVEL" +#define OSD_MSG_SENSORS_CAL "SENSORS CALIBRATING" +#define OSD_MSG_SYS_OVERLOADED "SYSTEM OVERLOADED" +#define OSD_MSG_WAITING_GPS_FIX "WAITING FOR GPS FIX" +#define OSD_MSG_DISABLE_NAV_FIRST "DISABLE NAVIGATION FIRST" +#define OSD_MSG_1ST_WP_TOO_FAR "FIRST WAYPOINT IS TOO FAR" +#define OSD_MSG_JUMP_WP_MISCONFIG "JUMP WAYPOINT MISCONFIGURED" +#define OSD_MSG_MAG_NOT_CAL "COMPASS NOT CALIBRATED" +#define OSD_MSG_ACC_NOT_CAL "ACCELEROMETER NOT CALIBRATED" +#define OSD_MSG_DISARM_1ST "DISABLE ARM SWITCH FIRST" +#define OSD_MSG_GYRO_FAILURE "GYRO FAILURE" +#define OSD_MSG_ACC_FAIL "ACCELEROMETER FAILURE" +#define OSD_MSG_MAG_FAIL "COMPASS FAILURE" +#define OSD_MSG_BARO_FAIL "BAROMETER FAILURE" +#define OSD_MSG_GPS_FAIL "GPS FAILURE" +#define OSD_MSG_RANGEFINDER_FAIL "RANGE FINDER FAILURE" +#define OSD_MSG_PITOT_FAIL "PITOT METER FAILURE" +#define OSD_MSG_HW_FAIL "HARDWARE FAILURE" +#define OSD_MSG_FS_EN "FAILSAFE MODE ENABLED" +#define OSD_MSG_KILL_SW_EN "KILLSWITCH MODE ENABLED" +#define OSD_MSG_NO_RC_LINK "NO RC LINK" +#define OSD_MSG_THROTTLE_NOT_LOW "THROTTLE IS NOT LOW" +#define OSD_MSG_ROLLPITCH_OFFCENTER "ROLLPITCH NOT CENTERED" +#define OSD_MSG_AUTOTRIM_ACTIVE "AUTOTRIM IS ACTIVE" +#define OSD_MSG_NOT_ENOUGH_MEMORY "NOT ENOUGH MEMORY" +#define OSD_MSG_INVALID_SETTING "INVALID SETTING" +#define OSD_MSG_CLI_ACTIVE "CLI IS ACTIVE" +#define OSD_MSG_PWM_INIT_ERROR "PWM INIT ERROR" +#define OSD_MSG_RTH_FS "(RTH)" +#define OSD_MSG_EMERG_LANDING_FS "(EMERGENCY LANDING)" +#define OSD_MSG_MOVE_EXIT_FS "!MOVE STICKS TO EXIT FS!" +#define OSD_MSG_STARTING_RTH "STARTING RTH" +#define OSD_MSG_HEADING_HOME "EN ROUTE TO HOME" +#define OSD_MSG_HOLDING_WAYPOINT "HOLDING WAYPOINT" +#define OSD_MSG_TO_WP "TO WP" +#define OSD_MSG_PREPARE_NEXT_WP "PREPARING FOR NEXT WAYPOINT" +#define OSD_MSG_EMERG_LANDING "EMERGENCY LANDING" +#define OSD_MSG_LANDING "LANDING" +#define OSD_MSG_LOITERING_HOME "LOITERING AROUND HOME" +#define OSD_MSG_HOVERING "HOVERING" +#define OSD_MSG_LANDED "LANDED" +#define OSD_MSG_PREPARING_LAND "PREPARING TO LAND" +#define OSD_MSG_AUTOLAUNCH "AUTOLAUNCH" +#define OSD_MSG_ALTITUDE_HOLD "(ALTITUDE HOLD)" +#define OSD_MSG_AUTOTRIM "(AUTOTRIM)" +#define OSD_MSG_AUTOTUNE "(AUTOTUNE)" +#define OSD_MSG_HEADFREE "(HEADFREE)" +#define OSD_MSG_UNABLE_ARM "UNABLE TO ARM" + typedef enum { OSD_RSSI_VALUE, OSD_MAIN_BATT_VOLTAGE, @@ -157,6 +211,10 @@ typedef enum { OSD_CRSF_LQ, OSD_CRSF_SNR_DB, OSD_CRSF_TX_POWER, + OSD_GVAR_0, + OSD_GVAR_1, + OSD_GVAR_2, + OSD_GVAR_3, OSD_ITEM_COUNT // MUST BE LAST } osd_items_e; @@ -202,6 +260,11 @@ typedef enum { OSD_AHI_STYLE_LINE, } osd_ahi_style_e; +typedef enum { + OSD_CRSF_LQ_TYPE1, + OSD_CRSF_LQ_TYPE2, +} osd_crsf_lq_format_e; + typedef struct osdLayoutsConfig_s { // Layouts uint16_t item_pos[OSD_LAYOUT_COUNT][OSD_ITEM_COUNT]; @@ -226,6 +289,7 @@ typedef struct osdConfig_s { float gforce_axis_alarm_max; #ifdef USE_SERIALRX_CRSF int16_t snr_alarm; //CRSF SNR alarm in dB + int8_t link_quality_alarm; #endif #ifdef USE_BARO int16_t baro_temp_alarm_min; @@ -279,6 +343,8 @@ typedef struct osdConfig_s { uint8_t left_sidebar_scroll_step; // How many units each sidebar step represents. 0 means the default value for the scroll type. uint8_t right_sidebar_scroll_step; // Same as left_sidebar_scroll_step, but for the right sidebar. + uint8_t crsf_lq_format; + } osdConfig_t; PG_DECLARE(osdConfig_t, osdConfig); @@ -313,3 +379,12 @@ void osdFormatAltitudeSymbol(char *buff, int32_t alt); void osdFormatVelocityStr(char* buff, int32_t vel, bool _3D); // Returns a heading angle in degrees normalized to [0, 360). int osdGetHeadingAngle(int angle); + +/** + * @brief Get the OSD system message + * @param buff pointer to the message buffer + * @param buff_size size of the buffer array + * @param isCenteredText if true, centered text based on buff_size + * @return osd text attributes (Blink, Inverted, Solid) + */ +textAttributes_t osdGetSystemMessage(char *buff, size_t buff_size, bool isCenteredText); diff --git a/src/main/io/osd_dji_hd.c b/src/main/io/osd_dji_hd.c index 379937d63d..574c5710a4 100644 --- a/src/main/io/osd_dji_hd.c +++ b/src/main/io/osd_dji_hd.c @@ -39,12 +39,16 @@ #include "common/time.h" #include "common/crc.h" +#include "config/parameter_group.h" +#include "config/parameter_group_ids.h" + #include "fc/fc_core.h" #include "fc/config.h" #include "fc/controlrate_profile.h" #include "fc/fc_msp.h" #include "fc/fc_msp_box.h" #include "fc/runtime_config.h" +#include "fc/settings.h" #include "flight/imu.h" #include "flight/pid.h" @@ -63,14 +67,21 @@ #include "sensors/rangefinder.h" #include "sensors/acceleration.h" #include "sensors/esc_sensor.h" +#include "sensors/temperature.h" #include "msp/msp.h" #include "msp/msp_protocol.h" #include "msp/msp_serial.h" +#include "common/string_light.h" #include "navigation/navigation.h" - +#include "navigation/navigation_private.h" +#include "common/constants.h" #include "scheduler/scheduler.h" +#include "common/printf.h" +#include +#include "rx/rx.h" +#include "fc/rc_controls.h" #if defined(USE_DJI_HD_OSD) @@ -80,6 +91,24 @@ #define DJI_OSD_WARNING_COUNT 16 #define DJI_OSD_TIMER_COUNT 2 #define DJI_OSD_FLAGS_OSD_FEATURE (1 << 0) +#define EFFICIENCY_UPDATE_INTERVAL (5 * 1000) + +#define RC_RX_LINK_LOST_MSG "!RC RX LINK LOST!" + +// Adjust OSD_MESSAGE's default position when +// changing OSD_MESSAGE_LENGTH +#define OSD_MESSAGE_LENGTH 28 + +#define OSD_ALTERNATING_CHOICES(ms, num_choices) ((millis() / ms) % num_choices) +#define _CONST_STR_SIZE(s) ((sizeof(s)/sizeof(s[0]))-1) // -1 to avoid counting final '\0' + +// Wrap all string constants intenteded for display as messages with +// this macro to ensure compile time length validation. +#define OSD_MESSAGE_STR(x) ({ \ + STATIC_ASSERT(_CONST_STR_SIZE(x) <= OSD_MESSAGE_LENGTH, message_string_ ## __COUNTER__ ## _too_long); \ + x; \ +}) + /* * DJI HD goggles use MSPv1 compatible with Betaflight 4.1.0 @@ -89,6 +118,13 @@ * but reuse the packet decoder to minimize code duplication */ +PG_REGISTER_WITH_RESET_TEMPLATE(djiOsdConfig_t, djiOsdConfig, PG_DJI_OSD_CONFIG, 1); +PG_RESET_TEMPLATE(djiOsdConfig_t, djiOsdConfig, + .use_name_for_messages = true, + .esc_temperature_source = DJI_OSD_TEMP_ESC, + .proto_workarounds = DJI_OSD_USE_NON_STANDARD_MSP_ESC_SENSOR_DATA, +); + // External dependency on looptime extern timeDelta_t cycleTime; @@ -145,7 +181,7 @@ const djiOsdMapping_t djiOSDItemIndexMap[] = { { OSD_HEADING, 0 }, // DJI: OSD_NUMERICAL_HEADING { OSD_VARIO_NUM, 0 }, // DJI: OSD_NUMERICAL_VARIO { -1, 0 }, // DJI: OSD_COMPASS_BAR - { -1, 0 }, // DJI: OSD_ESC_TMP + { OSD_ESC_TEMPERATURE, 0 }, // DJI: OSD_ESC_TEMPERATURE { OSD_ESC_RPM, 0 }, // DJI: OSD_ESC_RPM { OSD_REMAINING_FLIGHT_TIME_BEFORE_RTH, FEATURE_CURRENT_METER }, // DJI: OSD_REMAINING_TIME_ESTIMATE { OSD_RTC_TIME, 0 }, // DJI: OSD_RTC_DATETIME @@ -374,8 +410,493 @@ static void djiSerializeOSDConfigReply(sbuf_t *dst) //sbufWriteU8(dst, DJI_OSD_SCREEN_WIDTH); // osdConfig()->camera_frame_width //sbufWriteU8(dst, DJI_OSD_SCREEN_HEIGHT); // osdConfig()->camera_frame_height } + +static const char * osdArmingDisabledReasonMessage(void) +{ + switch (isArmingDisabledReason()) { + case ARMING_DISABLED_FAILSAFE_SYSTEM: + // See handling of FAILSAFE_RX_LOSS_MONITORING in failsafe.c + if (failsafePhase() == FAILSAFE_RX_LOSS_MONITORING) { + if (failsafeIsReceivingRxData()) { + // If we're not using sticks, it means the ARM switch + // hasn't been off since entering FAILSAFE_RX_LOSS_MONITORING + // yet + return OSD_MESSAGE_STR("DISARM!"); + } + // Not receiving RX data + return OSD_MESSAGE_STR(RC_RX_LINK_LOST_MSG); + } + return OSD_MESSAGE_STR("FAILSAFE"); + case ARMING_DISABLED_NOT_LEVEL: + return OSD_MESSAGE_STR("!LEVEL"); + case ARMING_DISABLED_SENSORS_CALIBRATING: + return OSD_MESSAGE_STR("CALIBRATING"); + case ARMING_DISABLED_SYSTEM_OVERLOADED: + return OSD_MESSAGE_STR("OVERLOAD"); + case ARMING_DISABLED_NAVIGATION_UNSAFE: + // Check the exact reason + switch (navigationIsBlockingArming(NULL)) { + case NAV_ARMING_BLOCKER_NONE: + break; + case NAV_ARMING_BLOCKER_MISSING_GPS_FIX: + return OSD_MESSAGE_STR("NO GPS FIX"); + case NAV_ARMING_BLOCKER_NAV_IS_ALREADY_ACTIVE: + return OSD_MESSAGE_STR("DISABLE NAV"); + case NAV_ARMING_BLOCKER_FIRST_WAYPOINT_TOO_FAR: + return OSD_MESSAGE_STR("1ST WYP TOO FAR"); + case NAV_ARMING_BLOCKER_JUMP_WAYPOINT_ERROR: + return OSD_MESSAGE_STR("WYP MISCONFIGURED"); + } + break; + case ARMING_DISABLED_COMPASS_NOT_CALIBRATED: + return OSD_MESSAGE_STR("COMPS CALIB"); + case ARMING_DISABLED_ACCELEROMETER_NOT_CALIBRATED: + return OSD_MESSAGE_STR("ACC CALIB"); + case ARMING_DISABLED_ARM_SWITCH: + return OSD_MESSAGE_STR("DISARM!"); + case ARMING_DISABLED_HARDWARE_FAILURE: + return OSD_MESSAGE_STR("ERR HW!"); + // { + // if (!HW_SENSOR_IS_HEALTHY(getHwGyroStatus())) { + // return OSD_MESSAGE_STR("GYRO FAILURE"); + // } + // if (!HW_SENSOR_IS_HEALTHY(getHwAccelerometerStatus())) { + // return OSD_MESSAGE_STR("ACCELEROMETER FAILURE"); + // } + // if (!HW_SENSOR_IS_HEALTHY(getHwCompassStatus())) { + // return OSD_MESSAGE_STR("COMPASS FAILURE"); + // } + // if (!HW_SENSOR_IS_HEALTHY(getHwBarometerStatus())) { + // return OSD_MESSAGE_STR("BAROMETER FAILURE"); + // } + // if (!HW_SENSOR_IS_HEALTHY(getHwGPSStatus())) { + // return OSD_MESSAGE_STR("GPS FAILURE"); + // } + // if (!HW_SENSOR_IS_HEALTHY(getHwRangefinderStatus())) { + // return OSD_MESSAGE_STR("RANGE FINDER FAILURE"); + // } + // if (!HW_SENSOR_IS_HEALTHY(getHwPitotmeterStatus())) { + // return OSD_MESSAGE_STR("PITOT METER FAILURE"); + // } + // } + // return OSD_MESSAGE_STR("HARDWARE FAILURE"); + case ARMING_DISABLED_BOXFAILSAFE: + return OSD_MESSAGE_STR("FAILSAFE ENABLED"); + case ARMING_DISABLED_BOXKILLSWITCH: + return OSD_MESSAGE_STR("KILLSWITCH ENABLED"); + case ARMING_DISABLED_RC_LINK: + return OSD_MESSAGE_STR("NO RC LINK"); + case ARMING_DISABLED_THROTTLE: + return OSD_MESSAGE_STR("THROTTLE!"); + case ARMING_DISABLED_ROLLPITCH_NOT_CENTERED: + return OSD_MESSAGE_STR("ROLLPITCH!"); + case ARMING_DISABLED_SERVO_AUTOTRIM: + return OSD_MESSAGE_STR("AUTOTRIM!"); + case ARMING_DISABLED_OOM: + return OSD_MESSAGE_STR("MEM LOW"); + case ARMING_DISABLED_INVALID_SETTING: + return OSD_MESSAGE_STR("ERR SETTING"); + case ARMING_DISABLED_CLI: + return OSD_MESSAGE_STR("CLI"); + case ARMING_DISABLED_PWM_OUTPUT_ERROR: + return OSD_MESSAGE_STR("PWM ERR"); + // Cases without message + case ARMING_DISABLED_CMS_MENU: + FALLTHROUGH; + case ARMING_DISABLED_OSD_MENU: + FALLTHROUGH; + case ARMING_DISABLED_ALL_FLAGS: + FALLTHROUGH; + case ARMED: + FALLTHROUGH; + case WAS_EVER_ARMED: + break; + } + + return NULL; +} + +static const char * osdFailsafePhaseMessage(void) +{ + // See failsafe.h for each phase explanation + switch (failsafePhase()) { + case FAILSAFE_RETURN_TO_HOME: + // XXX: Keep this in sync with OSD_FLYMODE. + return OSD_MESSAGE_STR("(RTH)"); + case FAILSAFE_LANDING: + // This should be considered an emergengy landing + return OSD_MESSAGE_STR("(EMRGY LANDING)"); + case FAILSAFE_RX_LOSS_MONITORING: + // Only reachable from FAILSAFE_LANDED, which performs + // a disarm. Since aircraft has been disarmed, we no + // longer show failsafe details. + FALLTHROUGH; + case FAILSAFE_LANDED: + // Very brief, disarms and transitions into + // FAILSAFE_RX_LOSS_MONITORING. Note that it prevents + // further rearming via ARMING_DISABLED_FAILSAFE_SYSTEM, + // so we'll show the user how to re-arm in when + // that flag is the reason to prevent arming. + FALLTHROUGH; + case FAILSAFE_RX_LOSS_IDLE: + // This only happens when user has chosen NONE as FS + // procedure. The recovery messages should be enough. + FALLTHROUGH; + case FAILSAFE_IDLE: + // Failsafe not active + FALLTHROUGH; + case FAILSAFE_RX_LOSS_DETECTED: + // Very brief, changes to FAILSAFE_RX_LOSS_RECOVERED + // or the FS procedure immediately. + FALLTHROUGH; + case FAILSAFE_RX_LOSS_RECOVERED: + // Exiting failsafe + break; + } + + return NULL; +} + +static const char * osdFailsafeInfoMessage(void) +{ + if (failsafeIsReceivingRxData()) { + // User must move sticks to exit FS mode + return OSD_MESSAGE_STR("!MOVE STICKS TO EXIT FS!"); + } + + return OSD_MESSAGE_STR(RC_RX_LINK_LOST_MSG); +} + +static const char * navigationStateMessage(void) +{ + switch (NAV_Status.state) { + case MW_NAV_STATE_NONE: + break; + case MW_NAV_STATE_RTH_START: + return OSD_MESSAGE_STR("STARTING RTH"); + case MW_NAV_STATE_RTH_ENROUTE: + // TODO: Break this up between climb and head home + return OSD_MESSAGE_STR("EN ROUTE TO HOME"); + case MW_NAV_STATE_HOLD_INFINIT: + // Used by HOLD flight modes. No information to add. + break; + case MW_NAV_STATE_HOLD_TIMED: + // TODO: Maybe we can display a count down + return OSD_MESSAGE_STR("HOLDING WAYPOINT"); + break; + case MW_NAV_STATE_WP_ENROUTE: + // TODO: Show WP number + return OSD_MESSAGE_STR("TO WP"); + case MW_NAV_STATE_PROCESS_NEXT: + return OSD_MESSAGE_STR("PREPARING FOR NEXT WAYPOINT"); + case MW_NAV_STATE_DO_JUMP: + // Not used + break; + case MW_NAV_STATE_LAND_START: + // Not used + break; + case MW_NAV_STATE_EMERGENCY_LANDING: + return OSD_MESSAGE_STR("EMRGY LANDING"); + case MW_NAV_STATE_LAND_IN_PROGRESS: + return OSD_MESSAGE_STR("LANDING"); + case MW_NAV_STATE_HOVER_ABOVE_HOME: + if (STATE(FIXED_WING_LEGACY)) { + return OSD_MESSAGE_STR("LOITERING AROUND HOME"); + } + return OSD_MESSAGE_STR("HOVERING"); + case MW_NAV_STATE_LANDED: + return OSD_MESSAGE_STR("LANDED"); + case MW_NAV_STATE_LAND_SETTLE: + return OSD_MESSAGE_STR("PREPARING TO LAND"); + case MW_NAV_STATE_LAND_START_DESCENT: + // Not used + break; + } + return NULL; +} + + +/** + * Converts velocity based on the current unit system (kmh or mph). + * @param alt Raw velocity (i.e. as taken from gpsSol.groundSpeed in centimeters/second) + */ +static int32_t osdConvertVelocityToUnit(int32_t vel) +{ + switch (osdConfig()->units) { + case OSD_UNIT_UK: + FALLTHROUGH; + + case OSD_UNIT_IMPERIAL: + return (vel * 224) / 10000; // Convert to mph + + case OSD_UNIT_METRIC: + return (vel * 36) / 1000; // Convert to kmh + } + + // Unreachable + return -1; +} + +static int16_t osdDJIGet3DSpeed(void) +{ + int16_t vert_speed = getEstimatedActualVelocity(Z); + int16_t hor_speed = gpsSol.groundSpeed; + return (int16_t)sqrtf(sq(hor_speed) + sq(vert_speed)); +} + +/** + * Converts velocity into a string based on the current unit system. + * @param alt Raw velocity (i.e. as taken from gpsSol.groundSpeed in centimeters/seconds) + */ +void osdDJIFormatVelocityStr(char* buff, int32_t vel ) +{ + switch (osdConfig()->units) { + case OSD_UNIT_UK: + FALLTHROUGH; + case OSD_UNIT_IMPERIAL: + tfp_sprintf(buff, "%3d%s", (int)osdConvertVelocityToUnit(vel), "MPH"); + break; + case OSD_UNIT_METRIC: + tfp_sprintf(buff, "%3d%s", (int)osdConvertVelocityToUnit(vel), "KMH"); + break; + } +} +static void osdDJIFormatThrottlePosition(char *buff, bool autoThr ) +{ + int16_t thr = rxGetChannelValue(THROTTLE); + if (autoThr && navigationIsControllingThrottle()) { + thr = rcCommand[THROTTLE]; + } + + tfp_sprintf(buff, "%3d%s", (constrain(thr, PWM_RANGE_MIN, PWM_RANGE_MAX) - PWM_RANGE_MIN) * 100 / (PWM_RANGE_MAX - PWM_RANGE_MIN), "%THR"); +} + +/** + * Converts distance into a string based on the current unit system. + * @param dist Distance in centimeters + */ +static void osdDJIFormatDistanceStr(char *buff, int32_t dist) +{ + int32_t centifeet; + + switch (osdConfig()->units) { + case OSD_UNIT_IMPERIAL: + centifeet = CENTIMETERS_TO_CENTIFEET(dist); + if (abs(centifeet) < FEET_PER_MILE * 100 / 2) { + // Show feet when dist < 0.5mi + tfp_sprintf(buff, "%d%s", (int)(centifeet / 100), "FT"); + } + else { + // Show miles when dist >= 0.5mi + tfp_sprintf(buff, "%d.%02d%s", (int)(centifeet / (100*FEET_PER_MILE)), + (abs(centifeet) % (100 * FEET_PER_MILE)) / FEET_PER_MILE, "Mi"); + } + break; + case OSD_UNIT_UK: + FALLTHROUGH; + case OSD_UNIT_METRIC: + if (abs(dist) < METERS_PER_KILOMETER * 100) { + // Show meters when dist < 1km + tfp_sprintf(buff, "%d%s", (int)(dist / 100), "M"); + } + else { + // Show kilometers when dist >= 1km + tfp_sprintf(buff, "%d.%02d%s", (int)(dist / (100*METERS_PER_KILOMETER)), + (abs(dist) % (100 * METERS_PER_KILOMETER)) / METERS_PER_KILOMETER, "KM"); + } + break; + } +} + +static void osdDJIEfficiencyMahPerKM(char *buff) +{ + // amperage is in centi amps, speed is in cms/s. We want + // mah/km. Values over 999 are considered useless and + // displayed as "---"" + static pt1Filter_t eFilterState; + static timeUs_t efficiencyUpdated = 0; + int32_t value = 0; + timeUs_t currentTimeUs = micros(); + timeDelta_t efficiencyTimeDelta = cmpTimeUs(currentTimeUs, efficiencyUpdated); + + if (STATE(GPS_FIX) && gpsSol.groundSpeed > 0) { + if (efficiencyTimeDelta >= EFFICIENCY_UPDATE_INTERVAL) { + value = pt1FilterApply4(&eFilterState, ((float)getAmperage() / gpsSol.groundSpeed) / 0.0036f, + 1, efficiencyTimeDelta * 1e-6f); + + efficiencyUpdated = currentTimeUs; + } + else { + value = eFilterState.state; + } + } + + if (value > 0 && value <= 999) { + tfp_sprintf(buff, "%3d%s", (int)value, "mAhKM"); + } + else { + tfp_sprintf(buff, "%s", "---mAhKM"); + } +} + +static void djiSerializeCraftNameOverride(sbuf_t *dst, const char * name) +{ + // :W T S E D + // | | | | Distance Trip + // | | | Efficiency mA/KM + // | | S 3dSpeed + // | Throttle + // Warnings + const char *message = " "; + const char *enabledElements = name + 1; + char djibuf[24]; + + // clear name from chars : and leading W + if (enabledElements[0] == 'W') { + enabledElements += 1; + } + + int elemLen = strlen(enabledElements); + + if (elemLen > 0) { + switch (enabledElements[OSD_ALTERNATING_CHOICES(3000, elemLen)]){ + case 'T': + osdDJIFormatThrottlePosition(djibuf,true); + break; + case 'S': + osdDJIFormatVelocityStr(djibuf, osdDJIGet3DSpeed()); + break; + case 'E': + osdDJIEfficiencyMahPerKM(djibuf); + break; + case 'D': + osdDJIFormatDistanceStr(djibuf, getTotalTravelDistance()); + break; + case 'W': + tfp_sprintf(djibuf, "%s", "MAKE_W_FIRST"); + break; + default: + tfp_sprintf(djibuf, "%s", "UNKOWN_ELEM"); + break; + } + + if (djibuf[0] != '\0') { + message = djibuf; + } + } + + if (name[1] == 'W') { + char messageBuf[MAX(SETTING_MAX_NAME_LENGTH, OSD_MESSAGE_LENGTH+1)]; + if (ARMING_FLAG(ARMED)) { + // Aircraft is armed. We might have up to 5 + // messages to show. + const char *messages[5]; + unsigned messageCount = 0; + + if (FLIGHT_MODE(FAILSAFE_MODE)) { + // In FS mode while being armed too + const char *failsafePhaseMessage = osdFailsafePhaseMessage(); + const char *failsafeInfoMessage = osdFailsafeInfoMessage(); + const char *navStateFSMessage = navigationStateMessage(); + + if (failsafePhaseMessage) { + messages[messageCount++] = failsafePhaseMessage; + } + + if (failsafeInfoMessage) { + messages[messageCount++] = failsafeInfoMessage; + } + + if (navStateFSMessage) { + messages[messageCount++] = navStateFSMessage; + } + + if (messageCount > 0) { + message = messages[OSD_ALTERNATING_CHOICES(1000, messageCount)]; + if (message == failsafeInfoMessage) { + // failsafeInfoMessage is not useful for recovering + // a lost model, but might help avoiding a crash. + // Blink to grab user attention. + //doesnt work TEXT_ATTRIBUTES_ADD_BLINK(elemAttr); + } + // We're shoing either failsafePhaseMessage or + // navStateFSMessage. Don't BLINK here since + // having this text available might be crucial + // during a lost aircraft recovery and blinking + // will cause it to be missing from some frames. + } + } + else { + if (FLIGHT_MODE(NAV_RTH_MODE) || FLIGHT_MODE(NAV_WP_MODE) || navigationIsExecutingAnEmergencyLanding()) { + const char *navStateMessage = navigationStateMessage(); + if (navStateMessage) { + messages[messageCount++] = navStateMessage; + } + } + else if (STATE(FIXED_WING_LEGACY) && (navGetCurrentStateFlags() & NAV_CTL_LAUNCH)) { + messages[messageCount++] = "AUTOLAUNCH"; + } + else { + if (FLIGHT_MODE(NAV_ALTHOLD_MODE) && !navigationRequiresAngleMode()) { + // ALTHOLD might be enabled alongside ANGLE/HORIZON/ACRO + // when it doesn't require ANGLE mode (required only in FW + // right now). If if requires ANGLE, its display is handled + // by OSD_FLYMODE. + messages[messageCount++] = "(ALT HOLD)"; + } + if (IS_RC_MODE_ACTIVE(BOXAUTOTRIM)) { + messages[messageCount++] = "(AUTOTRIM)"; + } + if (IS_RC_MODE_ACTIVE(BOXAUTOTUNE)) { + messages[messageCount++] = "(AUTOTUNE)"; + } + if (FLIGHT_MODE(HEADFREE_MODE)) { + messages[messageCount++] = "(HEADFREE)"; + } + } + // Pick one of the available messages. Each message lasts + // a second. + if (messageCount > 0) { + message = messages[OSD_ALTERNATING_CHOICES(1000, messageCount)]; + } + } + } + else if (ARMING_FLAG(ARMING_DISABLED_ALL_FLAGS)) { + unsigned invalidIndex; + // Check if we're unable to arm for some reason + if (ARMING_FLAG(ARMING_DISABLED_INVALID_SETTING) && !settingsValidate(&invalidIndex)) { + if (OSD_ALTERNATING_CHOICES(1000, 2) == 0) { + const setting_t *setting = settingGet(invalidIndex); + settingGetName(setting, messageBuf); + for (int ii = 0; messageBuf[ii]; ii++) { + messageBuf[ii] = sl_toupper(messageBuf[ii]); + } + message = messageBuf; + } + else { + message = "ERR SETTING"; + // TEXT_ATTRIBUTES_ADD_INVERTED(elemAttr); + } + } + else { + if (OSD_ALTERNATING_CHOICES(1000, 2) == 0) { + message = "CANT ARM"; + // TEXT_ATTRIBUTES_ADD_INVERTED(elemAttr); + } else { + // Show the reason for not arming + message = osdArmingDisabledReasonMessage(); + } + } + } + } + + if (message[0] != '\0') { + sbufWriteData(dst, message, strlen(message)); + } +} #endif + static mspResult_e djiProcessMspCommand(mspPacket_t *cmd, mspPacket_t *reply, mspPostProcessFnPtr *mspPostProcessFn) { UNUSED(mspPostProcessFn); @@ -410,10 +931,26 @@ static mspResult_e djiProcessMspCommand(mspPacket_t *cmd, mspPacket_t *reply, ms case DJI_MSP_NAME: { const char * name = systemConfig()->name; - int len = strlen(name); - if (len > 12) len = 12; - sbufWriteData(dst, name, len); + +#if defined(USE_OSD) + if (djiOsdConfig()->use_name_for_messages) { + if (name[0] == ':') { + // If craft name starts with a semicolon - use it as a template for what we want to show + djiSerializeCraftNameOverride(dst, name); + } + else { + // Otherwise fall back to just warnings + djiSerializeCraftNameOverride(dst, ":W"); + } } + else +#endif + { + int len = strlen(name); + sbufWriteData(dst, name, MAX(len, 12)); + break; + } + } break; case DJI_MSP_STATUS: @@ -537,21 +1074,93 @@ static mspResult_e djiProcessMspCommand(mspPacket_t *cmd, mspPacket_t *reply, ms } break; -#if defined(USE_ESC_SENSOR) case DJI_MSP_ESC_SENSOR_DATA: - if (STATE(ESC_SENSOR_ENABLED)) { - sbufWriteU8(dst, getMotorCount()); - for (int i = 0; i < getMotorCount(); i++) { - const escSensorData_t * escSensor = getEscTelemetry(i); - sbufWriteU8(dst, escSensor->temperature); - sbufWriteU16(dst, escSensor->rpm); + if (djiOsdConfig()->proto_workarounds & DJI_OSD_USE_NON_STANDARD_MSP_ESC_SENSOR_DATA) { + // Version 1.00.06 of DJI firmware is not using the standard MSP_ESC_SENSOR_DATA + uint16_t protoRpm = 0; + int16_t protoTemp = 0; + +#if defined(USE_ESC_SENSOR) + if (STATE(ESC_SENSOR_ENABLED) && getMotorCount() > 0) { + uint32_t motorRpmAcc = 0; + int32_t motorTempAcc = 0; + + for (int i = 0; i < getMotorCount(); i++) { + const escSensorData_t * escSensor = getEscTelemetry(i); + motorRpmAcc += escSensor->rpm; + motorTempAcc += escSensor->temperature; + } + + protoRpm = motorRpmAcc / getMotorCount(); + protoTemp = motorTempAcc / getMotorCount(); } +#endif + + switch (djiOsdConfig()->esc_temperature_source) { + // This is ESC temperature (as intended) + case DJI_OSD_TEMP_ESC: + // No-op, temperature is already set to ESC + break; + + // Re-purpose the field for core temperature + case DJI_OSD_TEMP_CORE: + getIMUTemperature(&protoTemp); + protoTemp = protoTemp / 10; + break; + + // Re-purpose the field for baro temperature + case DJI_OSD_TEMP_BARO: + getBaroTemperature(&protoTemp); + protoTemp = protoTemp / 10; + break; + } + + // No motor count, just raw temp and RPM data + sbufWriteU8(dst, protoTemp); + sbufWriteU16(dst, protoRpm); } else { - reply->result = MSP_RESULT_ERROR; + // Use standard MSP_ESC_SENSOR_DATA message + sbufWriteU8(dst, getMotorCount()); + for (int i = 0; i < getMotorCount(); i++) { + uint16_t motorRpm = 0; + int16_t motorTemp = 0; + + // If ESC_SENSOR is enabled, pull the telemetry data and get motor RPM +#if defined(USE_ESC_SENSOR) + if (STATE(ESC_SENSOR_ENABLED)) { + const escSensorData_t * escSensor = getEscTelemetry(i); + motorRpm = escSensor->rpm; + motorTemp = escSensor->temperature; + } +#endif + + // Now populate temperature field (which we may override for different purposes) + switch (djiOsdConfig()->esc_temperature_source) { + // This is ESC temperature (as intended) + case DJI_OSD_TEMP_ESC: + // No-op, temperature is already set to ESC + break; + + // Re-purpose the field for core temperature + case DJI_OSD_TEMP_CORE: + getIMUTemperature(&motorTemp); + motorTemp = motorTemp / 10; + break; + + // Re-purpose the field for baro temperature + case DJI_OSD_TEMP_BARO: + getBaroTemperature(&motorTemp); + motorTemp = motorTemp / 10; + break; + } + + // Add data for this motor to the packet + sbufWriteU8(dst, motorTemp); + sbufWriteU16(dst, motorRpm); + } } break; -#endif case DJI_MSP_OSD_CONFIG: #if defined(USE_OSD) diff --git a/src/main/io/osd_dji_hd.h b/src/main/io/osd_dji_hd.h index d1105783d3..d105b275b6 100644 --- a/src/main/io/osd_dji_hd.h +++ b/src/main/io/osd_dji_hd.h @@ -29,6 +29,8 @@ #include "msp/msp.h" #include "msp/msp_serial.h" +#include "config/parameter_group.h" + #if defined(USE_DJI_HD_OSD) #define DJI_API_VERSION_MAJOR 1 @@ -60,6 +62,24 @@ #define DJI_MSP_SET_PID 202 #define DJI_MSP_SET_RC_TUNING 204 +enum djiOsdTempSource_e { + DJI_OSD_TEMP_ESC = 0, + DJI_OSD_TEMP_CORE = 1, + DJI_OSD_TEMP_BARO = 2 +}; + +enum djiOsdProtoWorkarounds_e { + DJI_OSD_USE_NON_STANDARD_MSP_ESC_SENSOR_DATA = 1 << 0, +}; + +typedef struct djiOsdConfig_s { + uint8_t use_name_for_messages; + uint8_t esc_temperature_source; + uint8_t proto_workarounds; +} djiOsdConfig_t; + +PG_DECLARE(djiOsdConfig_t, djiOsdConfig); + void djiOsdSerialInit(void); void djiOsdSerialProcess(void); diff --git a/src/main/io/osd_grid.c b/src/main/io/osd_grid.c index fe8124b970..971fd1f106 100644 --- a/src/main/io/osd_grid.c +++ b/src/main/io/osd_grid.c @@ -225,7 +225,7 @@ static uint8_t osdUpdateSidebar(osd_sidebar_scroll_e scroll, osd_sidebar_t *side // Scroll between SYM_AH_DECORATION_MIN and SYM_AH_DECORATION_MAX. // Zero scrolling should draw SYM_AH_DECORATION. uint8_t decoration = SYM_AH_DECORATION; - int offset; + int offset = 0; int steps; switch (scroll) { case OSD_SIDEBAR_SCROLL_NONE: @@ -240,8 +240,6 @@ static uint8_t osdUpdateSidebar(osd_sidebar_scroll_e scroll, osd_sidebar_t *side case OSD_SIDEBAR_SCROLL_GROUND_SPEED: #if defined(USE_GPS) offset = gpsSol.groundSpeed; -#else - offset = 0; #endif // Move 1 char for every 20 cm/s steps = offset / 20; @@ -249,8 +247,6 @@ static uint8_t osdUpdateSidebar(osd_sidebar_scroll_e scroll, osd_sidebar_t *side case OSD_SIDEBAR_SCROLL_HOME_DISTANCE: #if defined(USE_GPS) offset = GPS_distanceToHome; -#else - offset = 0; #endif // Move 1 char for every 5m steps = offset / 5; diff --git a/src/main/io/rangefinder_benewake.c b/src/main/io/rangefinder_benewake.c index 08e8d0cdc6..b84ab5cbc5 100644 --- a/src/main/io/rangefinder_benewake.c +++ b/src/main/io/rangefinder_benewake.c @@ -55,15 +55,20 @@ typedef struct __attribute__((packed)) { #define BENEWAKE_PACKET_SIZE sizeof(tfminiPacket_t) #define BENEWAKE_MIN_QUALITY 0 +#define BENEWAKE_TIMEOUT_MS 200 // 200ms static serialPort_t * serialPort = NULL; static serialPortConfig_t * portConfig; static uint8_t buffer[BENEWAKE_PACKET_SIZE]; static unsigned bufferPtr; +static timeMs_t lastProtocolActivityMs; static bool hasNewData = false; static int32_t sensorData = RANGEFINDER_NO_NEW_DATA; +// TFmini command to initiate 100Hz sampling +static const uint8_t initCmd100Hz[] = { 0x42, 0x57, 0x02, 0x00, 0x00, 0x00, 0x01, 0x06 }; + static bool benewakeRangefinderDetect(void) { portConfig = findSerialPortConfig(FUNCTION_RANGEFINDER); @@ -80,16 +85,27 @@ static void benewakeRangefinderInit(void) return; } - serialPort = openSerialPort(portConfig->identifier, FUNCTION_RANGEFINDER, NULL, NULL, baudRates[BAUD_115200], MODE_RX, SERIAL_NOT_INVERTED); + serialPort = openSerialPort(portConfig->identifier, FUNCTION_RANGEFINDER, NULL, NULL, 115200, MODE_RXTX, SERIAL_NOT_INVERTED); if (!serialPort) { return; } + lastProtocolActivityMs = 0; bufferPtr = 0; } static void benewakeRangefinderUpdate(void) { + // Initialize the sensor + if (lastProtocolActivityMs == 0 || (millis() - lastProtocolActivityMs) > BENEWAKE_TIMEOUT_MS) { + // Initialize the sensor to do 100Hz sampling to make sure we get the most recent data always + serialWriteBuf(serialPort, initCmd100Hz, sizeof(initCmd100Hz)); + + // Send the init command every BENEWAKE_TIMEOUT_MS + lastProtocolActivityMs = millis(); + } + + // Process incoming bytes tfminiPacket_t *tfminiPacket = (tfminiPacket_t *)buffer; while (serialRxBytesWaiting(serialPort) > 0) { uint8_t c = serialRead(serialPort); @@ -117,6 +133,7 @@ static void benewakeRangefinderUpdate(void) // Valid packet hasNewData = true; sensorData = (tfminiPacket->distL << 0) | (tfminiPacket->distH << 8); + lastProtocolActivityMs = millis(); uint16_t qual = (tfminiPacket->strengthL << 0) | (tfminiPacket->strengthH << 8); diff --git a/src/main/io/rangefinder_msp.c b/src/main/io/rangefinder_msp.c index b5e5eae113..5c7f728f2f 100644 --- a/src/main/io/rangefinder_msp.c +++ b/src/main/io/rangefinder_msp.c @@ -37,14 +37,12 @@ #include "io/serial.h" #if defined(USE_RANGEFINDER_MSP) + #include "drivers/rangefinder/rangefinder_virtual.h" #include "drivers/time.h" #include "io/rangefinder.h" +#include "msp/msp_protocol_v2_sensor_msg.h" -typedef struct __attribute__((packed)) { - uint8_t quality; // [0;255] - int32_t distanceMm; // Negative value for out of range -} mspRangefinderSensor_t; static bool hasNewData = false; static int32_t sensorData = RANGEFINDER_NO_NEW_DATA; @@ -76,7 +74,7 @@ static int32_t mspRangefinderGetDistance(void) void mspRangefinderReceiveNewData(uint8_t * bufferPtr) { - const mspRangefinderSensor_t * pkt = (const mspRangefinderSensor_t *)bufferPtr; + const mspSensorRangefinderDataMessage_t * pkt = (const mspSensorRangefinderDataMessage_t *)bufferPtr; sensorData = pkt->distanceMm / 10; hasNewData = true; diff --git a/src/main/io/serial_4way.c b/src/main/io/serial_4way.c index 7cf24890b7..a45f41c8bc 100644 --- a/src/main/io/serial_4way.c +++ b/src/main/io/serial_4way.c @@ -72,7 +72,7 @@ // *** change to adapt Revision #define SERIAL_4WAY_VER_MAIN 20 #define SERIAL_4WAY_VER_SUB_1 (uint8_t) 0 -#define SERIAL_4WAY_VER_SUB_2 (uint8_t) 03 +#define SERIAL_4WAY_VER_SUB_2 (uint8_t) 05 #define SERIAL_4WAY_PROTOCOL_VER 107 // *** end @@ -326,14 +326,13 @@ uint16_t _crc_xmodem_update (uint16_t crc, uint8_t data) { #define ATMEL_DEVICE_MATCH ((pDeviceInfo->words[0] == 0x9307) || (pDeviceInfo->words[0] == 0x930A) || \ (pDeviceInfo->words[0] == 0x930F) || (pDeviceInfo->words[0] == 0x940B)) -#define SILABS_DEVICE_MATCH ((pDeviceInfo->words[0] == 0xF310)||(pDeviceInfo->words[0] ==0xF330) || \ +#define SILABS_DEVICE_MATCH ((pDeviceInfo->words[0] == 0xF310)||(pDeviceInfo->words[0] == 0xF330) || \ (pDeviceInfo->words[0] == 0xF410) || (pDeviceInfo->words[0] == 0xF390) || \ (pDeviceInfo->words[0] == 0xF850) || (pDeviceInfo->words[0] == 0xE8B1) || \ (pDeviceInfo->words[0] == 0xE8B2)) -#define ARM_DEVICE_MATCH ((pDeviceInfo->words[0] == 0x1F06) || \ - (pDeviceInfo->words[0] == 0x3306) || (pDeviceInfo->words[0] == 0x3406) || (pDeviceInfo->words[0] == 0x3506) || \ - (pDeviceInfo->words[0] == 0x2B06) || (pDeviceInfo->words[0] == 0x4706)) +// BLHeli_32 MCU ID hi > 0x00 and < 0x90 / lo always = 0x06 +#define ARM_DEVICE_MATCH ((pDeviceInfo->bytes[1] > 0x00) && (pDeviceInfo->bytes[1] < 0x90) && (pDeviceInfo->bytes[0] == 0x06)) static uint8_t CurrentInterfaceMode; diff --git a/src/main/io/smartport_master.c b/src/main/io/smartport_master.c index cc51b4235d..95e1c74b22 100644 --- a/src/main/io/smartport_master.c +++ b/src/main/io/smartport_master.c @@ -300,6 +300,9 @@ static void smartportMasterPoll(void) break; } + default: // should not happen + return; + } } diff --git a/src/main/msp/msp_protocol_v2_sensor.h b/src/main/msp/msp_protocol_v2_sensor.h index e2741555e0..d913723be7 100644 --- a/src/main/msp/msp_protocol_v2_sensor.h +++ b/src/main/msp/msp_protocol_v2_sensor.h @@ -18,4 +18,8 @@ #define MSP2_IS_SENSOR_MESSAGE(x) ((x) >= 0x1F00 && (x) <= 0x1FFF) #define MSP2_SENSOR_RANGEFINDER 0x1F01 -#define MSP2_SENSOR_OPTIC_FLOW 0x1F02 \ No newline at end of file +#define MSP2_SENSOR_OPTIC_FLOW 0x1F02 +#define MSP2_SENSOR_GPS 0x1F03 +#define MSP2_SENSOR_COMPASS 0x1F04 +#define MSP2_SENSOR_BAROMETER 0x1F05 +#define MSP2_SENSOR_AIRSPEED 0x1F06 \ No newline at end of file diff --git a/src/main/msp/msp_protocol_v2_sensor_msg.h b/src/main/msp/msp_protocol_v2_sensor_msg.h new file mode 100644 index 0000000000..4ff0324885 --- /dev/null +++ b/src/main/msp/msp_protocol_v2_sensor_msg.h @@ -0,0 +1,84 @@ +/* + * This file is part of INAV Project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. + * + * Alternatively, the contents of this file may be used under the terms + * of the GNU General Public License Version 3, as described below: + * + * This file is free software: you may copy, redistribute 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 file 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 http://www.gnu.org/licenses/. + */ + +#pragma once + +typedef struct __attribute__((packed)) { + uint8_t quality; // [0;255] + int32_t motionX; + int32_t motionY; +} mspSensorOpflowDataMessage_t; + +typedef struct __attribute__((packed)) { + uint8_t quality; // [0;255] + int32_t distanceMm; // Negative value for out of range +} mspSensorRangefinderDataMessage_t; + +typedef struct __attribute__((packed)) { + uint8_t instance; // sensor instance number to support multi-sensor setups + uint16_t gpsWeek; // GPS week, 0xFFFF if not available + uint32_t msTOW; + uint8_t fixType; + uint8_t satellitesInView; + uint16_t horizontalPosAccuracy; // [cm] + uint16_t verticalPosAccuracy; // [cm] + uint16_t horizontalVelAccuracy; // [cm/s] + uint16_t hdop; + int32_t longitude; + int32_t latitude; + int32_t mslAltitude; // cm + int32_t nedVelNorth; // cm/s + int32_t nedVelEast; + int32_t nedVelDown; + uint16_t groundCourse; // deg * 100, 0..36000 + uint16_t trueYaw; // deg * 100, values of 0..36000 are valid. 65535 = no data available + uint16_t year; + uint8_t month; + uint8_t day; + uint8_t hour; + uint8_t min; + uint8_t sec; +} mspSensorGpsDataMessage_t; + +typedef struct __attribute__((packed)) { + uint8_t instance; + uint32_t timeMs; + float pressurePa; + int16_t temp; // centi-degrees C +} mspSensorBaroDataMessage_t; + +typedef struct __attribute__((packed)) { + uint8_t instance; + uint32_t timeMs; + float diffPressurePa; + int16_t temp; // centi-degrees C +} mspSensorAirspeedDataMessage_t; + +typedef struct __attribute__((packed)) { + uint8_t instance; + uint32_t timeMs; + int16_t magX; // mGauss, front + int16_t magY; // mGauss, right + int16_t magZ; // mGauss, down +} mspSensorCompassDataMessage_t; diff --git a/src/main/navigation/navigation.c b/src/main/navigation/navigation.c index 7a88409071..8991966ebf 100755 --- a/src/main/navigation/navigation.c +++ b/src/main/navigation/navigation.c @@ -83,11 +83,15 @@ PG_REGISTER_ARRAY(navSafeHome_t, MAX_SAFE_HOMES, safeHomeConfig, PG_SAFE_HOME_CO #endif #if defined(USE_NAV) + +// waypoint 254, 255 are special waypoints +STATIC_ASSERT(NAV_MAX_WAYPOINTS < 254, NAV_MAX_WAYPOINTS_exceeded_allowable_range); + #if defined(NAV_NON_VOLATILE_WAYPOINT_STORAGE) PG_REGISTER_ARRAY(navWaypoint_t, NAV_MAX_WAYPOINTS, nonVolatileWaypointList, PG_WAYPOINT_MISSION_STORAGE, 0); #endif -PG_REGISTER_WITH_RESET_TEMPLATE(navConfig_t, navConfig, PG_NAV_CONFIG, 7); +PG_REGISTER_WITH_RESET_TEMPLATE(navConfig_t, navConfig, PG_NAV_CONFIG, 8); PG_RESET_TEMPLATE(navConfig_t, navConfig, .general = { @@ -102,8 +106,9 @@ PG_RESET_TEMPLATE(navConfig_t, navConfig, .rth_tail_first = 0, .disarm_on_landing = 0, .rth_allow_landing = NAV_RTH_ALLOW_LANDING_ALWAYS, + .rth_alt_control_override = 0, //set using nav_rth_alt_control_override .auto_overrides_motor_stop = 1, - .rth_alt_control_override = 0, //set using nav_rth_alt_control_override + .nav_overrides_motor_stop = NOMS_ALL_NAV, }, // General navigation parameters @@ -153,6 +158,8 @@ PG_RESET_TEMPLATE(navConfig_t, navConfig, .max_throttle = 1700, .min_throttle = 1200, .pitch_to_throttle = 10, // pwm units per degree of pitch (10pwm units ~ 1% throttle) + .pitch_to_throttle_smooth = 0, + .pitch_to_throttle_thresh = 0, .loiter_radius = 5000, // 50m //Fixed wing landing @@ -166,6 +173,7 @@ PG_RESET_TEMPLATE(navConfig_t, navConfig, .launch_idle_throttle = 1000, // Motor idle or MOTOR_STOP .launch_motor_timer = 500, // ms .launch_motor_spinup_time = 100, // ms, time to gredually increase throttle from idle to launch + .launch_end_time = 3000, // ms, time to gradually decrease/increase throttle and decrease pitch angle from launch to the current flight mode .launch_min_time = 0, // ms, min time in launch mode .launch_timeout = 5000, // ms, timeout for launch procedure .launch_max_altitude = 0, // cm, altitude where to consider launch ended @@ -1908,13 +1916,13 @@ static fpVector3_t * rthGetHomeTargetPosition(rthTargetMode_e mode) // Control System Design, Lecture Notes for ME 155A by Karl Johan Åström (p.228) // http://www.cds.caltech.edu/~murray/courses/cds101/fa02/caltech/astrom-ch6.pdf float navPidApply3( - pidController_t *pid, - const float setpoint, - const float measurement, - const float dt, - const float outMin, - const float outMax, - const pidControllerFlags_e pidFlags, + pidController_t *pid, + const float setpoint, + const float measurement, + const float dt, + const float outMin, + const float outMax, + const pidControllerFlags_e pidFlags, const float gainScaler, const float dTermScaler ) { @@ -2440,7 +2448,7 @@ static navigationHomeFlags_t navigationActualStateHomeValidity(void) /******************************************************* * Is a safehome being used instead of the arming point? *******************************************************/ -bool isSafeHomeInUse(void) +bool isSafeHomeInUse(void) { return (safehome_used > -1 && safehome_used < MAX_SAFE_HOMES); } @@ -2451,7 +2459,7 @@ bool isSafeHomeInUse(void) **********************************************************/ bool foundNearbySafeHome(void) { - safehome_used = -1; + safehome_used = -1; fpVector3_t safeHome; gpsLocation_t shLLH; shLLH.alt = 0; @@ -2459,7 +2467,7 @@ bool foundNearbySafeHome(void) shLLH.lat = safeHomeConfig(i)->lat; shLLH.lon = safeHomeConfig(i)->lon; geoConvertGeodeticToLocal(&safeHome, &posControl.gpsOrigin, &shLLH, GEO_ALT_RELATIVE); - safehome_distance = calculateDistanceToDestination(&safeHome); + safehome_distance = calculateDistanceToDestination(&safeHome); if (safehome_distance < 20000) { // 200 m safehome_used = i; setHomePosition(&safeHome, 0, NAV_POS_UPDATE_XY | NAV_POS_UPDATE_Z | NAV_POS_UPDATE_HEADING, navigationActualStateHomeValidity()); @@ -2819,6 +2827,20 @@ void getWaypoint(uint8_t wpNumber, navWaypoint_t * wpData) wpData->lon = wpLLH.lon; wpData->alt = wpLLH.alt; } + // WP #254 - special waypoint - get desiredPosition that was set by ground control station if in 3D-guided mode + else if (wpNumber == 254) { + navigationFSMStateFlags_t navStateFlags = navGetStateFlags(posControl.navState); + + if ((posControl.gpsOrigin.valid) && (navStateFlags & NAV_CTL_ALT) && (navStateFlags & NAV_CTL_POS)) { + gpsLocation_t wpLLH; + + geoConvertLocalToGeodetic(&wpLLH, &posControl.gpsOrigin, &posControl.desiredState.pos); + + wpData->lat = wpLLH.lat; + wpData->lon = wpLLH.lon; + wpData->alt = wpLLH.alt; + } + } // WP #1 - #60 - common waypoints - pre-programmed mission else if ((wpNumber >= 1) && (wpNumber <= NAV_MAX_WAYPOINTS)) { if (wpNumber <= posControl.waypointCount) { @@ -2945,7 +2967,7 @@ bool saveNonVolatileWaypointList(void) #if defined(USE_SAFE_HOME) -void resetSafeHomes(void) +void resetSafeHomes(void) { memset(safeHomeConfigMutable(0), 0, sizeof(navSafeHome_t) * MAX_SAFE_HOMES); } @@ -3245,7 +3267,7 @@ static navigationFSMEvent_t selectNavEventFromBoxModeInput(void) return NAV_FSM_EVENT_SWITCH_TO_IDLE; } - // Pilot-activated waypoint mission. Fall-back to RTH in case of no mission loaded + // Pilot-activated waypoint mission. Fall-back to RTH in case of no mission loaded if (IS_RC_MODE_ACTIVE(BOXNAVWP)) { if (FLIGHT_MODE(NAV_WP_MODE) || (canActivateWaypoint && canActivatePosHold && canActivateNavigation && canActivateAltHold && STATE(GPS_FIX_HOME))) return NAV_FSM_EVENT_SWITCH_TO_WAYPOINT; diff --git a/src/main/navigation/navigation.h b/src/main/navigation/navigation.h index 41f4cca7d6..4efea10dc7 100755 --- a/src/main/navigation/navigation.h +++ b/src/main/navigation/navigation.h @@ -124,6 +124,12 @@ typedef enum { NAV_ARMING_BLOCKER_JUMP_WAYPOINT_ERROR = 4, } navArmingBlocker_e; +typedef enum { + NOMS_OFF, + NOMS_AUTO_ONLY, + NOMS_ALL_NAV +} navOverridesMotorStop_e; + typedef struct positionEstimationConfig_s { uint8_t automatic_mag_declination; uint8_t reset_altitude_type; // from nav_reset_type_e @@ -175,8 +181,9 @@ typedef struct navConfig_s { uint8_t disarm_on_landing; // uint8_t rth_allow_landing; // Enable landing as last stage of RTH. Use constants in navRTHAllowLanding_e. uint8_t rth_climb_ignore_emerg; // Option to ignore GPS loss on initial climb stage of RTH - uint8_t auto_overrides_motor_stop; // Autonomous modes override motor_stop setting and user command to stop motor uint8_t rth_alt_control_override; // Set RTH preset climb altitude to Current altutude during climb using AltHold mode switch + uint8_t auto_overrides_motor_stop; // Autonomous modes override motor_stop setting and user command to stop motor + uint8_t nav_overrides_motor_stop; // Autonomous modes override motor_stop setting and user command to stop motor } flags; uint8_t pos_failure_timeout; // Time to wait before switching to emergency landing (0 - disable) @@ -223,6 +230,8 @@ typedef struct navConfig_s { uint16_t min_throttle; // Minimum allowed throttle in auto mode uint16_t max_throttle; // Maximum allowed throttle in auto mode uint8_t pitch_to_throttle; // Pitch angle (in deg) to throttle gain (in 1/1000's of throttle) (*10) + uint16_t pitch_to_throttle_smooth; // How smoothly the autopilot makes pitch to throttle correction inside a deadband defined by pitch_to_throttle_thresh. + uint8_t pitch_to_throttle_thresh; // Threshold from average pitch where momentary pitch_to_throttle correction kicks in. [decidegrees] uint16_t loiter_radius; // Loiter radius when executing PH on a fixed wing int8_t land_dive_angle; uint16_t launch_velocity_thresh; // Velocity threshold for swing launch detection @@ -232,7 +241,8 @@ typedef struct navConfig_s { uint16_t launch_throttle; // Launch throttle uint16_t launch_motor_timer; // Time to wait before setting launch_throttle (ms) uint16_t launch_motor_spinup_time; // Time to speed-up motors from idle to launch_throttle (ESC desync prevention) - uint16_t launch_min_time; // Minimum time in launch mode to prevent possible bump of the sticks from leaving launch mode early + uint16_t launch_end_time; // Time to make the transition from launch angle to leveled and throttle transition from launch throttle to the stick position + uint16_t launch_min_time; // Minimum time in launch mode to prevent possible bump of the sticks from leaving launch mode early uint16_t launch_timeout; // Launch timeout to disable launch mode and swith to normal flight (ms) uint16_t launch_max_altitude; // cm, altitude where to consider launch ended uint8_t launch_climb_angle; // Target climb angle for launch (deg) @@ -462,7 +472,7 @@ bool loadNonVolatileWaypointList(void); bool saveNonVolatileWaypointList(void); float getFinalRTHAltitude(void); -int16_t fixedWingPitchToThrottleCorrection(int16_t pitch); +int16_t fixedWingPitchToThrottleCorrection(int16_t pitch, timeUs_t currentTimeUs); /* Geodetic functions */ typedef enum { @@ -517,6 +527,7 @@ bool navigationRTHAllowsLanding(void); bool isNavLaunchEnabled(void); bool isFixedWingLaunchDetected(void); bool isFixedWingLaunchFinishedOrAborted(void); +const char * fixedWingLaunchStateMessage(void); float calculateAverageSpeed(void); diff --git a/src/main/navigation/navigation_fixedwing.c b/src/main/navigation/navigation_fixedwing.c index ae700e3c1f..dffa74bc02 100755 --- a/src/main/navigation/navigation_fixedwing.c +++ b/src/main/navigation/navigation_fixedwing.c @@ -51,8 +51,8 @@ #include "rx/rx.h" -// Base frequencies for smoothing pitch and roll -#define NAV_FW_BASE_PITCH_CUTOFF_FREQUENCY_HZ 2.0f +// Base frequencies for smoothing pitch and roll +#define NAV_FW_BASE_PITCH_CUTOFF_FREQUENCY_HZ 2.0f #define NAV_FW_BASE_ROLL_CUTOFF_FREQUENCY_HZ 10.0f // If we are going slower than NAV_FW_MIN_VEL_SPEED_BOOST - boost throttle to fight against the wind @@ -70,12 +70,21 @@ static bool isAutoThrottleManuallyIncreased = false; static int32_t navHeadingError; static int8_t loiterDirYaw = 1; -// Calculates the cutoff frequency for smoothing out roll/pitch commands +// Calculates the cutoff frequency for smoothing out roll/pitch commands // control_smoothness valid range from 0 to 9 -// resulting cutoff_freq ranging from baseFreq downwards to ~0.11Hz +// resulting cutoff_freq ranging from baseFreq downwards to ~0.11Hz static float getSmoothnessCutoffFreq(float baseFreq) { uint16_t smoothness = 10 - navConfig()->fw.control_smoothness; + return 0.001f * baseFreq * (float)(smoothness*smoothness*smoothness) + 0.01f; +} + +// Calculates the cutoff frequency for smoothing out pitchToThrottleCorrection +// pitch_to_throttle_smooth valid range from 0 to 9 +// resulting cutoff_freq ranging from baseFreq downwards to ~0.11Hz +static float getPitchToThrottleSmoothnessCutoffFreq(float baseFreq) +{ + uint16_t smoothness = 10 - navConfig()->fw.pitch_to_throttle_smooth; return 0.001f * baseFreq * (float)(smoothness*smoothness*smoothness) + 0.1f; } @@ -205,7 +214,7 @@ static fpVector3_t virtualDesiredPosition; static pt1Filter_t fwPosControllerCorrectionFilterState; /* - * TODO Currently this function resets both FixedWing and Rover & Boat position controller + * TODO Currently this function resets both FixedWing and Rover & Boat position controller */ void resetFixedWingPositionController(void) { @@ -300,9 +309,9 @@ float processHeadingYawController(timeDelta_t deltaMicros, int32_t navHeadingErr const pidControllerFlags_e yawPidFlags = errorIsDecreasing ? PID_SHRINK_INTEGRATOR : 0; const float yawAdjustment = navPidApply2( - &posControl.pids.fw_heading, - 0, - applyDeadband(navHeadingError, navConfig()->fw.yawControlDeadband * 100), + &posControl.pids.fw_heading, + 0, + applyDeadband(navHeadingError, navConfig()->fw.yawControlDeadband * 100), US2S(deltaMicros), -limit, limit, @@ -461,9 +470,25 @@ int16_t applyFixedWingMinSpeedController(timeUs_t currentTimeUs) return throttleSpeedAdjustment; } -int16_t fixedWingPitchToThrottleCorrection(int16_t pitch) +int16_t fixedWingPitchToThrottleCorrection(int16_t pitch, timeUs_t currentTimeUs) { - return DECIDEGREES_TO_DEGREES(pitch) * navConfig()->fw.pitch_to_throttle; + static timeUs_t previousTimePitchToThrCorr = 0; + const timeDelta_t deltaMicrosPitchToThrCorr = currentTimeUs - previousTimePitchToThrCorr; + previousTimePitchToThrCorr = currentTimeUs; + + static pt1Filter_t pitchToThrFilterState; + + // Apply low-pass filter to pitch angle to smooth throttle correction + int16_t filteredPitch = (int16_t)pt1FilterApply4(&pitchToThrFilterState, pitch, getPitchToThrottleSmoothnessCutoffFreq(NAV_FW_BASE_PITCH_CUTOFF_FREQUENCY_HZ), US2S(deltaMicrosPitchToThrCorr)); + + if (ABS(pitch - filteredPitch) > navConfig()->fw.pitch_to_throttle_thresh) { + // Unfiltered throttle correction outside of pitch deadband + return DECIDEGREES_TO_DEGREES(pitch) * navConfig()->fw.pitch_to_throttle; + } + else { + // Filtered throttle correction inside of pitch deadband + return DECIDEGREES_TO_DEGREES(filteredPitch) * navConfig()->fw.pitch_to_throttle; + } } void applyFixedWingPitchRollThrottleController(navigationFSMStateFlags_t navStateFlags, timeUs_t currentTimeUs) @@ -485,7 +510,7 @@ void applyFixedWingPitchRollThrottleController(navigationFSMStateFlags_t navStat // PITCH >0 dive, <0 climb int16_t pitchCorrection = constrain(posControl.rcAdjustment[PITCH], -DEGREES_TO_DECIDEGREES(navConfig()->fw.max_dive_angle), DEGREES_TO_DECIDEGREES(navConfig()->fw.max_climb_angle)); rcCommand[PITCH] = -pidAngleToRcCommand(pitchCorrection, pidProfile()->max_angle_inclination[FD_PITCH]); - int16_t throttleCorrection = fixedWingPitchToThrottleCorrection(pitchCorrection); + int16_t throttleCorrection = fixedWingPitchToThrottleCorrection(pitchCorrection, currentTimeUs); #ifdef NAV_FIXED_WING_LANDING if (navStateFlags & NAV_CTL_LAND) { diff --git a/src/main/navigation/navigation_fw_launch.c b/src/main/navigation/navigation_fw_launch.c index 843d27f650..d87454baa1 100755 --- a/src/main/navigation/navigation_fw_launch.c +++ b/src/main/navigation/navigation_fw_launch.c @@ -33,15 +33,6 @@ #include "config/feature.h" #include "drivers/time.h" -#include "drivers/sensor.h" -#include "drivers/accgyro/accgyro.h" - -#include "sensors/sensors.h" -#include "sensors/rangefinder.h" -#include "sensors/barometer.h" -#include "sensors/acceleration.h" -#include "sensors/boardalignment.h" -#include "sensors/compass.h" #include "io/gps.h" #include "io/beeper.h" @@ -57,25 +48,238 @@ #include "navigation/navigation.h" #include "navigation/navigation_private.h" - -typedef struct FixedWingLaunchState_s { - /* Launch detection */ - timeUs_t launchDetectorPreviousUpdate; - timeUs_t launchDetectionTimeAccum; - bool launchDetected; - - /* Launch progress */ - timeUs_t launchStartedTime; - bool launchFinished; - bool motorControlAllowed; -} FixedWingLaunchState_t; - -static EXTENDED_FASTRAM FixedWingLaunchState_t launchState; - -#define COS_MAX_LAUNCH_ANGLE 0.70710678f // cos(45), just to be safe #define SWING_LAUNCH_MIN_ROTATION_RATE DEGREES_TO_RADIANS(100) // expect minimum 100dps rotation rate -static void updateFixedWingLaunchDetector(timeUs_t currentTimeUs) -{ +#define LAUNCH_MOTOR_IDLE_SPINUP_TIME 1500 // ms +#define UNUSED(x) ((void)(x)) +#define FW_LAUNCH_MESSAGE_TEXT_WAIT_THROTTLE "RAISE THE THROTTLE" +#define FW_LAUNCH_MESSAGE_TEXT_WAIT_DETECTION "READY" +#define FW_LAUNCH_MESSAGE_TEXT_IN_PROGRESS "MOVE THE STICKS TO ABORT" +#define FW_LAUNCH_MESSAGE_TEXT_FINISHING "FINISHING" + +typedef enum { + FW_LAUNCH_MESSAGE_TYPE_NONE = 0, + FW_LAUNCH_MESSAGE_TYPE_WAIT_THROTTLE, + FW_LAUNCH_MESSAGE_TYPE_WAIT_DETECTION, + FW_LAUNCH_MESSAGE_TYPE_IN_PROGRESS, + FW_LAUNCH_MESSAGE_TYPE_FINISHING +} fixedWingLaunchMessage_t; + +typedef enum { + FW_LAUNCH_EVENT_NONE = 0, + FW_LAUNCH_EVENT_SUCCESS, + FW_LAUNCH_EVENT_GOTO_DETECTION, + FW_LAUNCH_EVENT_ABORT, + FW_LAUNCH_EVENT_THROTTLE_LOW, + FW_LAUNCH_EVENT_COUNT +} fixedWingLaunchEvent_t; + +typedef enum { + FW_LAUNCH_STATE_IDLE = 0, + FW_LAUNCH_STATE_WAIT_THROTTLE, + FW_LAUNCH_STATE_MOTOR_IDLE, + FW_LAUNCH_STATE_WAIT_DETECTION, + FW_LAUNCH_STATE_DETECTED, + FW_LAUNCH_STATE_MOTOR_DELAY, + FW_LAUNCH_STATE_MOTOR_SPINUP, + FW_LAUNCH_STATE_IN_PROGRESS, + FW_LAUNCH_STATE_FINISH, + FW_LAUNCH_STATE_COUNT +} fixedWingLaunchState_t; + +static fixedWingLaunchEvent_t fwLaunchState_FW_LAUNCH_STATE_IDLE(timeUs_t currentTimeUs); +static fixedWingLaunchEvent_t fwLaunchState_FW_LAUNCH_STATE_WAIT_THROTTLE(timeUs_t currentTimeUs); +static fixedWingLaunchEvent_t fwLaunchState_FW_LAUNCH_STATE_MOTOR_IDLE(timeUs_t currentTimeUs); +static fixedWingLaunchEvent_t fwLaunchState_FW_LAUNCH_STATE_WAIT_DETECTION(timeUs_t currentTimeUs); +static fixedWingLaunchEvent_t fwLaunchState_FW_LAUNCH_STATE_DETECTED(timeUs_t currentTimeUs); +static fixedWingLaunchEvent_t fwLaunchState_FW_LAUNCH_STATE_MOTOR_DELAY(timeUs_t currentTimeUs); +static fixedWingLaunchEvent_t fwLaunchState_FW_LAUNCH_STATE_MOTOR_SPINUP(timeUs_t currentTimeUs); +static fixedWingLaunchEvent_t fwLaunchState_FW_LAUNCH_STATE_IN_PROGRESS(timeUs_t currentTimeUs); +static fixedWingLaunchEvent_t fwLaunchState_FW_LAUNCH_STATE_FINISH(timeUs_t currentTimeUs); + +typedef struct fixedWingLaunchStateDescriptor_s { + fixedWingLaunchEvent_t (*onEntry)(timeUs_t currentTimeUs); + fixedWingLaunchState_t onEvent[FW_LAUNCH_EVENT_COUNT]; + fixedWingLaunchMessage_t messageType; +} fixedWingLaunchStateDescriptor_t; + +typedef struct fixedWingLaunchData_s { + timeUs_t currentStateTimeUs; + fixedWingLaunchState_t currentState; + uint8_t pitchAngle; // used to smooth the transition of the pitch angle +} fixedWingLaunchData_t; + +static EXTENDED_FASTRAM fixedWingLaunchData_t fwLaunch; + +static const fixedWingLaunchStateDescriptor_t launchStateMachine[FW_LAUNCH_STATE_COUNT] = { + + [FW_LAUNCH_STATE_IDLE] = { + .onEntry = fwLaunchState_FW_LAUNCH_STATE_IDLE, + .onEvent = { + + }, + .messageType = FW_LAUNCH_MESSAGE_TYPE_NONE + }, + [FW_LAUNCH_STATE_WAIT_THROTTLE] = { + .onEntry = fwLaunchState_FW_LAUNCH_STATE_WAIT_THROTTLE, + .onEvent = { + [FW_LAUNCH_EVENT_SUCCESS] = FW_LAUNCH_STATE_MOTOR_IDLE, + [FW_LAUNCH_EVENT_GOTO_DETECTION] = FW_LAUNCH_STATE_WAIT_DETECTION + }, + .messageType = FW_LAUNCH_MESSAGE_TYPE_WAIT_THROTTLE + }, + [FW_LAUNCH_STATE_MOTOR_IDLE] = { + .onEntry = fwLaunchState_FW_LAUNCH_STATE_MOTOR_IDLE, + .onEvent = { + [FW_LAUNCH_EVENT_SUCCESS] = FW_LAUNCH_STATE_WAIT_DETECTION, + [FW_LAUNCH_EVENT_THROTTLE_LOW] = FW_LAUNCH_STATE_WAIT_THROTTLE + }, + .messageType = FW_LAUNCH_MESSAGE_TYPE_WAIT_THROTTLE + }, + [FW_LAUNCH_STATE_WAIT_DETECTION] = { + .onEntry = fwLaunchState_FW_LAUNCH_STATE_WAIT_DETECTION, + .onEvent = { + [FW_LAUNCH_EVENT_SUCCESS] = FW_LAUNCH_STATE_DETECTED, + [FW_LAUNCH_EVENT_THROTTLE_LOW] = FW_LAUNCH_STATE_WAIT_THROTTLE + }, + .messageType = FW_LAUNCH_MESSAGE_TYPE_WAIT_DETECTION + }, + [FW_LAUNCH_STATE_DETECTED] = { + .onEntry = fwLaunchState_FW_LAUNCH_STATE_DETECTED, + .onEvent = { + // waiting for the navigation to move on the next state FW_LAUNCH_STATE_MOTOR_DELAY + }, + .messageType = FW_LAUNCH_MESSAGE_TYPE_WAIT_DETECTION + }, + [FW_LAUNCH_STATE_MOTOR_DELAY] = { + .onEntry = fwLaunchState_FW_LAUNCH_STATE_MOTOR_DELAY, + .onEvent = { + [FW_LAUNCH_EVENT_SUCCESS] = FW_LAUNCH_STATE_MOTOR_SPINUP, + [FW_LAUNCH_EVENT_ABORT] = FW_LAUNCH_STATE_IDLE + }, + .messageType = FW_LAUNCH_MESSAGE_TYPE_IN_PROGRESS + }, + [FW_LAUNCH_STATE_MOTOR_SPINUP] = { + .onEntry = fwLaunchState_FW_LAUNCH_STATE_MOTOR_SPINUP, + .onEvent = { + [FW_LAUNCH_EVENT_SUCCESS] = FW_LAUNCH_STATE_IN_PROGRESS, + [FW_LAUNCH_EVENT_ABORT] = FW_LAUNCH_STATE_IDLE + }, + .messageType = FW_LAUNCH_MESSAGE_TYPE_IN_PROGRESS + }, + [FW_LAUNCH_STATE_IN_PROGRESS] = { + .onEntry = fwLaunchState_FW_LAUNCH_STATE_IN_PROGRESS, + .onEvent = { + [FW_LAUNCH_EVENT_SUCCESS] = FW_LAUNCH_STATE_FINISH, + }, + .messageType = FW_LAUNCH_MESSAGE_TYPE_IN_PROGRESS + }, + [FW_LAUNCH_STATE_FINISH] = { + .onEntry = fwLaunchState_FW_LAUNCH_STATE_FINISH, + .onEvent = { + [FW_LAUNCH_EVENT_SUCCESS] = FW_LAUNCH_STATE_IDLE + }, + .messageType = FW_LAUNCH_MESSAGE_TYPE_FINISHING + } +}; + +/* Current State Handlers */ + +static timeMs_t currentStateElapsedMs(timeUs_t currentTimeUs) { + return US2MS(currentTimeUs - fwLaunch.currentStateTimeUs); +} + +static void setCurrentState(fixedWingLaunchState_t nextState, timeUs_t currentTimeUs) { + fwLaunch.currentState = nextState; + fwLaunch.currentStateTimeUs = currentTimeUs; +} + +/* Wing control Helpers */ + +static bool isThrottleIdleEnabled(void) { + return navConfig()->fw.launch_idle_throttle > getThrottleIdleValue(); +} + +static void applyThrottleIdle(void) { + if (isThrottleIdleEnabled()) { + rcCommand[THROTTLE] = navConfig()->fw.launch_idle_throttle; + } else { + ENABLE_STATE(NAV_MOTOR_STOP_OR_IDLE); // If MOTOR_STOP is enabled mixer will keep motor stopped + rcCommand[THROTTLE] = getThrottleIdleValue(); // If MOTOR_STOP is disabled, motors will spin at minthrottle + } +} + +static inline bool isThrottleLow(void) { + return calculateThrottleStatus(THROTTLE_STATUS_TYPE_RC) == THROTTLE_LOW; +} + +static inline bool isLaunchMaxAltitudeReached(void) { + return (navConfig()->fw.launch_max_altitude > 0) && (getEstimatedActualPosition(Z) >= navConfig()->fw.launch_max_altitude); +} + +static inline bool areSticksMoved(timeMs_t initialTime, timeUs_t currentTimeUs) { + return (initialTime + currentStateElapsedMs(currentTimeUs)) > navConfig()->fw.launch_min_time && areSticksDeflectedMoreThanPosHoldDeadband(); +} + +static void resetPidsIfNeeded(void) { + // Until motors are started don't use PID I-term and reset TPA filter + if (fwLaunch.currentState < FW_LAUNCH_STATE_MOTOR_SPINUP) { + pidResetErrorAccumulators(); + pidResetTPAFilter(); + } +} + +static void updateRcCommand(void) { + // lock roll and yaw and apply needed pitch angle + rcCommand[ROLL] = 0; + rcCommand[PITCH] = pidAngleToRcCommand(-DEGREES_TO_DECIDEGREES(fwLaunch.pitchAngle), pidProfile()->max_angle_inclination[FD_PITCH]); + rcCommand[YAW] = 0; +} + +/* onEntry state handlers */ + +static fixedWingLaunchEvent_t fwLaunchState_FW_LAUNCH_STATE_IDLE(timeUs_t currentTimeUs) { + UNUSED(currentTimeUs); + + return FW_LAUNCH_EVENT_NONE; +} + +static fixedWingLaunchEvent_t fwLaunchState_FW_LAUNCH_STATE_WAIT_THROTTLE(timeUs_t currentTimeUs) { + UNUSED(currentTimeUs); + + if (!isThrottleLow()) { + if (isThrottleIdleEnabled()) { + return FW_LAUNCH_EVENT_SUCCESS; + } else { + fwLaunch.pitchAngle = navConfig()->fw.launch_climb_angle; + return FW_LAUNCH_EVENT_GOTO_DETECTION; + } + } + fwLaunch.pitchAngle = 0; + + return FW_LAUNCH_EVENT_NONE; +} + +static fixedWingLaunchEvent_t fwLaunchState_FW_LAUNCH_STATE_MOTOR_IDLE(timeUs_t currentTimeUs) { + if (isThrottleLow()) { + return FW_LAUNCH_EVENT_THROTTLE_LOW; // go back to FW_LAUNCH_STATE_WAIT_THROTTLE + } + const timeMs_t elapsedTimeMs = currentStateElapsedMs(currentTimeUs); + if (elapsedTimeMs > LAUNCH_MOTOR_IDLE_SPINUP_TIME) { + applyThrottleIdle(); + return FW_LAUNCH_EVENT_SUCCESS; + } else { + rcCommand[THROTTLE] = scaleRangef(elapsedTimeMs, 0.0f, LAUNCH_MOTOR_IDLE_SPINUP_TIME, getThrottleIdleValue(), navConfig()->fw.launch_idle_throttle); + fwLaunch.pitchAngle = scaleRangef(elapsedTimeMs, 0.0f, LAUNCH_MOTOR_IDLE_SPINUP_TIME, 0, navConfig()->fw.launch_climb_angle); + } + + return FW_LAUNCH_EVENT_NONE; +} + +static fixedWingLaunchEvent_t fwLaunchState_FW_LAUNCH_STATE_WAIT_DETECTION(timeUs_t currentTimeUs) { + if (isThrottleLow()) { + return FW_LAUNCH_EVENT_THROTTLE_LOW; // go back to FW_LAUNCH_STATE_WAIT_THROTTLE + } + const float swingVelocity = (fabsf(imuMeasuredRotationBF.z) > SWING_LAUNCH_MIN_ROTATION_RATE) ? (imuMeasuredAccelBF.y / imuMeasuredRotationBF.z) : 0; const bool isForwardAccelerationHigh = (imuMeasuredAccelBF.x > navConfig()->fw.launch_accel_thresh); const bool isAircraftAlmostLevel = (calculateCosTiltAngle() >= cos_approx(DEGREES_TO_RADIANS(navConfig()->fw.launch_max_angle))); @@ -83,156 +287,149 @@ static void updateFixedWingLaunchDetector(timeUs_t currentTimeUs) const bool isBungeeLaunched = isForwardAccelerationHigh && isAircraftAlmostLevel; const bool isSwingLaunched = (swingVelocity > navConfig()->fw.launch_velocity_thresh) && (imuMeasuredAccelBF.x > 0); + applyThrottleIdle(); + if (isBungeeLaunched || isSwingLaunched) { - launchState.launchDetectionTimeAccum += (currentTimeUs - launchState.launchDetectorPreviousUpdate); - launchState.launchDetectorPreviousUpdate = currentTimeUs; - if (launchState.launchDetectionTimeAccum >= MS2US((uint32_t)navConfig()->fw.launch_time_thresh)) { - launchState.launchDetected = true; + if (currentStateElapsedMs(currentTimeUs) > navConfig()->fw.launch_time_thresh) { + return FW_LAUNCH_EVENT_SUCCESS; // the launch is detected now, go to FW_LAUNCH_STATE_DETECTED } + } else { + fwLaunch.currentStateTimeUs = currentTimeUs; // reset the state counter } - else { - launchState.launchDetectorPreviousUpdate = currentTimeUs; - launchState.launchDetectionTimeAccum = 0; + + return FW_LAUNCH_EVENT_NONE; +} + +static fixedWingLaunchEvent_t fwLaunchState_FW_LAUNCH_STATE_DETECTED(timeUs_t currentTimeUs) { + UNUSED(currentTimeUs); + // waiting for the navigation to move it to next step FW_LAUNCH_STATE_MOTOR_DELAY + applyThrottleIdle(); + + return FW_LAUNCH_EVENT_NONE; +} + +static fixedWingLaunchEvent_t fwLaunchState_FW_LAUNCH_STATE_MOTOR_DELAY(timeUs_t currentTimeUs) { + applyThrottleIdle(); + + if (areSticksMoved(0, currentTimeUs)) { + return FW_LAUNCH_EVENT_ABORT; // jump to FW_LAUNCH_STATE_IDLE } -} - -void resetFixedWingLaunchController(timeUs_t currentTimeUs) -{ - launchState.launchDetectorPreviousUpdate = currentTimeUs; - launchState.launchDetectionTimeAccum = 0; - launchState.launchStartedTime = 0; - launchState.launchDetected = false; - launchState.launchFinished = false; - launchState.motorControlAllowed = false; -} - -bool isFixedWingLaunchDetected(void) -{ - return launchState.launchDetected; -} - -void enableFixedWingLaunchController(timeUs_t currentTimeUs) -{ - launchState.launchStartedTime = currentTimeUs; - launchState.motorControlAllowed = true; -} - -bool isFixedWingLaunchFinishedOrAborted(void) -{ - return launchState.launchFinished; -} - -void abortFixedWingLaunch(void) -{ - launchState.launchFinished = true; -} - -#define LAUNCH_MOTOR_IDLE_SPINUP_TIME 1500 //ms - -static void applyFixedWingLaunchIdleLogic(void) -{ - // Until motors are started don't use PID I-term - pidResetErrorAccumulators(); - - // We're not flying yet, reset TPA filter - pidResetTPAFilter(); - - // Throttle control logic - if (navConfig()->fw.launch_idle_throttle <= getThrottleIdleValue()) - { - ENABLE_STATE(NAV_MOTOR_STOP_OR_IDLE); // If MOTOR_STOP is enabled mixer will keep motor stopped - rcCommand[THROTTLE] = getThrottleIdleValue(); // If MOTOR_STOP is disabled, motors will spin at minthrottle + if (currentStateElapsedMs(currentTimeUs) > navConfig()->fw.launch_motor_timer) { + return FW_LAUNCH_EVENT_SUCCESS; } - else - { - static float timeThrottleRaisedMs; - if (calculateThrottleStatus(THROTTLE_STATUS_TYPE_RC) == THROTTLE_LOW) - { - timeThrottleRaisedMs = millis(); - } - else - { - const float timeSinceMotorStartMs = MIN(millis() - timeThrottleRaisedMs, LAUNCH_MOTOR_IDLE_SPINUP_TIME); - rcCommand[THROTTLE] = scaleRangef(timeSinceMotorStartMs, - 0.0f, LAUNCH_MOTOR_IDLE_SPINUP_TIME, - getThrottleIdleValue(), navConfig()->fw.launch_idle_throttle); - } + + return FW_LAUNCH_EVENT_NONE; +} + +static fixedWingLaunchEvent_t fwLaunchState_FW_LAUNCH_STATE_MOTOR_SPINUP(timeUs_t currentTimeUs) { + if (areSticksMoved(navConfig()->fw.launch_motor_timer, currentTimeUs)) { + return FW_LAUNCH_EVENT_ABORT; // jump to FW_LAUNCH_STATE_IDLE } + + const timeMs_t elapsedTimeMs = currentStateElapsedMs(currentTimeUs); + const uint16_t motorSpinUpMs = navConfig()->fw.launch_motor_spinup_time; + const uint16_t launchThrottle = navConfig()->fw.launch_throttle; + + if (elapsedTimeMs > motorSpinUpMs) { + rcCommand[THROTTLE] = launchThrottle; + return FW_LAUNCH_EVENT_SUCCESS; + } else { + const uint16_t minIdleThrottle = MAX(getThrottleIdleValue(), navConfig()->fw.launch_idle_throttle); + rcCommand[THROTTLE] = scaleRangef(elapsedTimeMs, 0.0f, motorSpinUpMs, minIdleThrottle, launchThrottle); + } + + return FW_LAUNCH_EVENT_NONE; } -static inline bool isFixedWingLaunchMaxAltitudeReached(void) -{ - return (navConfig()->fw.launch_max_altitude > 0) && (getEstimatedActualPosition(Z) >= navConfig()->fw.launch_max_altitude); -} -static inline bool isLaunchModeMinTimeElapsed(float timeSinceLaunchMs) -{ - return timeSinceLaunchMs > navConfig()->fw.launch_min_time; +static fixedWingLaunchEvent_t fwLaunchState_FW_LAUNCH_STATE_IN_PROGRESS(timeUs_t currentTimeUs) { + rcCommand[THROTTLE] = navConfig()->fw.launch_throttle; + + if (isLaunchMaxAltitudeReached()) { + return FW_LAUNCH_EVENT_SUCCESS; // cancel the launch and do the FW_LAUNCH_STATE_FINISH state + } + if (areSticksMoved(navConfig()->fw.launch_motor_timer + navConfig()->fw.launch_motor_spinup_time, currentTimeUs)) { + return FW_LAUNCH_EVENT_SUCCESS; // cancel the launch and do the FW_LAUNCH_STATE_FINISH state + } + if (currentStateElapsedMs(currentTimeUs) > navConfig()->fw.launch_timeout) { + return FW_LAUNCH_EVENT_SUCCESS; // launch timeout. go to FW_LAUNCH_STATE_FINISH + } + + return FW_LAUNCH_EVENT_NONE; } -static inline bool isLaunchModeMaxTimeElapsed(float timeSinceLaunchMs) -{ - return timeSinceLaunchMs >= navConfig()->fw.launch_timeout; +static fixedWingLaunchEvent_t fwLaunchState_FW_LAUNCH_STATE_FINISH(timeUs_t currentTimeUs) { + const timeMs_t elapsedTimeMs = currentStateElapsedMs(currentTimeUs); + const timeMs_t endTimeMs = navConfig()->fw.launch_end_time; + + if (elapsedTimeMs > endTimeMs) { + return FW_LAUNCH_EVENT_SUCCESS; + } else { + // make a smooth transition from the launch state to the current state for throttle and the pitch angle + rcCommand[THROTTLE] = scaleRangef(elapsedTimeMs, 0.0f, endTimeMs, navConfig()->fw.launch_throttle, rcCommand[THROTTLE]); + fwLaunch.pitchAngle = scaleRangef(elapsedTimeMs, 0.0f, endTimeMs, navConfig()->fw.launch_climb_angle, rcCommand[PITCH]); + } + + return FW_LAUNCH_EVENT_NONE; } -static inline bool isFixedWingLaunchCompleted(float timeSinceLaunchMs) -{ - return (isLaunchModeMaxTimeElapsed(timeSinceLaunchMs)) || ((isLaunchModeMinTimeElapsed(timeSinceLaunchMs)) && (areSticksDeflectedMoreThanPosHoldDeadband())) || isFixedWingLaunchMaxAltitudeReached(); -} +// Public methods --------------------------------------------------------------- -void applyFixedWingLaunchController(timeUs_t currentTimeUs) -{ +void applyFixedWingLaunchController(timeUs_t currentTimeUs) { // Called at PID rate - - if (launchState.launchDetected) { - bool applyLaunchIdleLogic = true; - - if (launchState.motorControlAllowed) { - // If launch detected we are in launch procedure - control airplane - const float timeElapsedSinceLaunchMs = US2MS(currentTimeUs - launchState.launchStartedTime); - - launchState.launchFinished = isFixedWingLaunchCompleted(timeElapsedSinceLaunchMs); - - // Motor control enabled - if (timeElapsedSinceLaunchMs >= navConfig()->fw.launch_motor_timer) { - // Don't apply idle logic anymore - applyLaunchIdleLogic = false; - - // Increase throttle gradually over `launch_motor_spinup_time` milliseconds - if (navConfig()->fw.launch_motor_spinup_time > 0) { - const float timeSinceMotorStartMs = constrainf(timeElapsedSinceLaunchMs - navConfig()->fw.launch_motor_timer, 0.0f, navConfig()->fw.launch_motor_spinup_time); - const uint16_t minIdleThrottle = MAX(getThrottleIdleValue(), navConfig()->fw.launch_idle_throttle); - rcCommand[THROTTLE] = scaleRangef(timeSinceMotorStartMs, - 0.0f, navConfig()->fw.launch_motor_spinup_time, - minIdleThrottle, navConfig()->fw.launch_throttle); - } - else { - rcCommand[THROTTLE] = navConfig()->fw.launch_throttle; - } - } - } - - if (applyLaunchIdleLogic) { - // Launch idle logic - low throttle and zero out PIDs - applyFixedWingLaunchIdleLogic(); + + // process the current state, set the next state or exit if FW_LAUNCH_EVENT_NONE + while (launchStateMachine[fwLaunch.currentState].onEntry) { + fixedWingLaunchEvent_t newEvent = launchStateMachine[fwLaunch.currentState].onEntry(currentTimeUs); + if (newEvent == FW_LAUNCH_EVENT_NONE) { + break; } + setCurrentState(launchStateMachine[fwLaunch.currentState].onEvent[newEvent], currentTimeUs); } - else { - // We are waiting for launch - update launch detector - updateFixedWingLaunchDetector(currentTimeUs); - // Launch idle logic - low throttle and zero out PIDs - applyFixedWingLaunchIdleLogic(); - } + resetPidsIfNeeded(); + updateRcCommand(); // Control beeper - if (!launchState.launchFinished) { + if (fwLaunch.currentState == FW_LAUNCH_STATE_WAIT_THROTTLE) { + beeper(BEEPER_LAUNCH_MODE_LOW_THROTTLE); + } else { beeper(BEEPER_LAUNCH_MODE_ENABLED); } +} - // Lock out controls - rcCommand[ROLL] = 0; - rcCommand[PITCH] = pidAngleToRcCommand(-DEGREES_TO_DECIDEGREES(navConfig()->fw.launch_climb_angle), pidProfile()->max_angle_inclination[FD_PITCH]); - rcCommand[YAW] = 0; +void resetFixedWingLaunchController(timeUs_t currentTimeUs) { + setCurrentState(FW_LAUNCH_STATE_WAIT_THROTTLE, currentTimeUs); +} + +bool isFixedWingLaunchDetected(void) { + return fwLaunch.currentState == FW_LAUNCH_STATE_DETECTED; +} + +void enableFixedWingLaunchController(timeUs_t currentTimeUs) { + setCurrentState(FW_LAUNCH_STATE_MOTOR_DELAY, currentTimeUs); +} + +bool isFixedWingLaunchFinishedOrAborted(void) { + return fwLaunch.currentState == FW_LAUNCH_STATE_IDLE; +} + +void abortFixedWingLaunch(void) { + setCurrentState(FW_LAUNCH_STATE_IDLE, 0); +} + +const char * fixedWingLaunchStateMessage(void) { + switch (launchStateMachine[fwLaunch.currentState].messageType) { + case FW_LAUNCH_MESSAGE_TYPE_WAIT_THROTTLE: + return FW_LAUNCH_MESSAGE_TEXT_WAIT_THROTTLE; + case FW_LAUNCH_MESSAGE_TYPE_WAIT_DETECTION: + return FW_LAUNCH_MESSAGE_TEXT_WAIT_DETECTION; + case FW_LAUNCH_MESSAGE_TYPE_IN_PROGRESS: + return FW_LAUNCH_MESSAGE_TEXT_IN_PROGRESS; + case FW_LAUNCH_MESSAGE_TYPE_FINISHING: + return FW_LAUNCH_MESSAGE_TEXT_FINISHING; + default: + return NULL; + } } #endif diff --git a/src/main/programming/logic_condition.c b/src/main/programming/logic_condition.c index d63f3639f0..b9b35d810d 100644 --- a/src/main/programming/logic_condition.c +++ b/src/main/programming/logic_condition.c @@ -36,6 +36,7 @@ #include "fc/fc_core.h" #include "fc/rc_controls.h" #include "fc/runtime_config.h" +#include "fc/rc_modes.h" #include "navigation/navigation.h" #include "sensors/battery.h" #include "sensors/pitotmeter.h" @@ -207,6 +208,7 @@ static int logicConditionCompute( break; case LOGIC_CONDITION_SET_VTX_POWER_LEVEL: +#if defined(USE_VTX_SMARTAUDIO) || defined(USE_VTX_TRAMP) if ( logicConditionValuesByType[LOGIC_CONDITION_SET_VTX_POWER_LEVEL] != operandA && vtxCommonGetDeviceCapability(vtxCommonDevice(), &vtxDeviceCapability) @@ -218,6 +220,9 @@ static int logicConditionCompute( return false; } break; +#else + return false; +#endif case LOGIC_CONDITION_SET_VTX_BAND: if ( @@ -451,7 +456,7 @@ static int logicConditionGetFlightOperandValue(int operand) { break; case LOGIC_CONDITION_OPERAND_FLIGHT_IS_FAILSAFE: // 0/1 - return (failsafePhase() == FAILSAFE_RX_LOSS_MONITORING) ? 1 : 0; + return (failsafePhase() != FAILSAFE_IDLE) ? 1 : 0; break; case LOGIC_CONDITION_OPERAND_FLIGHT_STABILIZED_YAW: // @@ -474,6 +479,26 @@ static int logicConditionGetFlightOperandValue(int operand) { return NAV_Status.activeWpAction; break; + case LOGIC_CONDITION_OPERAND_FLIGHT_3D_HOME_DISTANCE: //in m + return constrain(sqrtf(sq(GPS_distanceToHome) + sq(getEstimatedActualPosition(Z)/100)), 0, INT16_MAX); + break; + + case LOGIC_CONDITION_OPERAND_FLIGHT_CRSF_LQ: + #ifdef USE_SERIALRX_CRSF + return rxLinkStatistics.uplinkLQ; + #else + return 0; + #endif + break; + + case LOGIC_CONDITION_OPERAND_FLIGHT_CRSF_SNR: + #ifdef USE_SERIALRX_CRSF + return rxLinkStatistics.uplinkSNR; + #else + return 0; + #endif + break; + default: return 0; break; @@ -520,6 +545,14 @@ static int logicConditionGetFlightModeOperandValue(int operand) { return (bool) FLIGHT_MODE(AIRMODE_ACTIVE); break; + case LOGIC_CONDITION_OPERAND_FLIGHT_MODE_USER1: + return IS_RC_MODE_ACTIVE(BOXUSER1); + break; + + case LOGIC_CONDITION_OPERAND_FLIGHT_MODE_USER2: + return IS_RC_MODE_ACTIVE(BOXUSER2); + break; + default: return 0; break; @@ -629,4 +662,4 @@ int16_t getRcCommandOverride(int16_t command[], uint8_t axis) { } return outputValue; -} \ No newline at end of file +} diff --git a/src/main/programming/logic_condition.h b/src/main/programming/logic_condition.h index e46b8c6c43..75905c51ca 100644 --- a/src/main/programming/logic_condition.h +++ b/src/main/programming/logic_condition.h @@ -112,18 +112,24 @@ typedef enum { LOGIC_CONDITION_OPERAND_FLIGHT_STABILIZED_YAW, // 28 LOGIC_CONDITION_OPERAND_FLIGHT_WAYPOINT_INDEX, // 29 LOGIC_CONDITION_OPERAND_FLIGHT_WAYPOINT_ACTION, // 30 + LOGIC_CONDITION_OPERAND_FLIGHT_3D_HOME_DISTANCE, // 31 + LOGIC_CONDITION_OPERAND_FLIGHT_CRSF_LQ, // 32 + LOGIC_CONDITION_OPERAND_FLIGHT_CRSF_SNR, // 33 + } logicFlightOperands_e; typedef enum { - LOGIC_CONDITION_OPERAND_FLIGHT_MODE_FAILSAFE, - LOGIC_CONDITION_OPERAND_FLIGHT_MODE_MANUAL, - LOGIC_CONDITION_OPERAND_FLIGHT_MODE_RTH, - LOGIC_CONDITION_OPERAND_FLIGHT_MODE_POSHOLD, - LOGIC_CONDITION_OPERAND_FLIGHT_MODE_CRUISE, - LOGIC_CONDITION_OPERAND_FLIGHT_MODE_ALTHOLD, - LOGIC_CONDITION_OPERAND_FLIGHT_MODE_ANGLE, - LOGIC_CONDITION_OPERAND_FLIGHT_MODE_HORIZON, - LOGIC_CONDITION_OPERAND_FLIGHT_MODE_AIR, + LOGIC_CONDITION_OPERAND_FLIGHT_MODE_FAILSAFE, // 0 + LOGIC_CONDITION_OPERAND_FLIGHT_MODE_MANUAL, // 1 + LOGIC_CONDITION_OPERAND_FLIGHT_MODE_RTH, // 2 + LOGIC_CONDITION_OPERAND_FLIGHT_MODE_POSHOLD, // 3 + LOGIC_CONDITION_OPERAND_FLIGHT_MODE_CRUISE, // 4 + LOGIC_CONDITION_OPERAND_FLIGHT_MODE_ALTHOLD, // 5 + LOGIC_CONDITION_OPERAND_FLIGHT_MODE_ANGLE, // 6 + LOGIC_CONDITION_OPERAND_FLIGHT_MODE_HORIZON, // 7 + LOGIC_CONDITION_OPERAND_FLIGHT_MODE_AIR, // 8 + LOGIC_CONDITION_OPERAND_FLIGHT_MODE_USER1, // 9 + LOGIC_CONDITION_OPERAND_FLIGHT_MODE_USER2, // 10 } logicFlightModeOperands_e; typedef enum { diff --git a/src/main/rx/rx.c b/src/main/rx/rx.c index 5c2110f791..fa24d6ceb9 100755 --- a/src/main/rx/rx.c +++ b/src/main/rx/rx.c @@ -61,6 +61,7 @@ #include "rx/rx_spi.h" #include "rx/sbus.h" #include "rx/spektrum.h" +#include "rx/srxl2.h" #include "rx/sumd.h" #include "rx/sumh.h" #include "rx/uib_rx.h" @@ -91,6 +92,7 @@ static bool mspOverrideDataProcessingRequired = false; static bool rxSignalReceived = false; static bool rxFlightChannelsValid = false; static bool rxIsInFailsafeMode = true; +static uint8_t rxChannelCount; static timeUs_t rxNextUpdateAtUs = 0; static timeUs_t needRxSignalBefore = 0; @@ -141,6 +143,8 @@ PG_RESET_TEMPLATE(rxConfig_t, rxConfig, .mspOverrideChannels = 15, #endif .rssi_source = RSSI_SOURCE_AUTO, + .srxl2_unit_id = 1, + .srxl2_baud_fast = 1, ); void resetAllRxChannelRangeConfigurations(void) @@ -187,6 +191,11 @@ bool serialRxInit(const rxConfig_t *rxConfig, rxRuntimeConfig_t *rxRuntimeConfig { bool enabled = false; switch (rxConfig->serialrx_provider) { +#ifdef USE_SERIALRX_SRXL2 + case SERIALRX_SRXL2: + enabled = srxl2RxInit(rxConfig, rxRuntimeConfig); + break; +#endif #ifdef USE_SERIALRX_SPEKTRUM case SERIALRX_SPEKTRUM1024: case SERIALRX_SPEKTRUM2048: @@ -347,6 +356,8 @@ void rxInit(void) mspOverrideInit(); } #endif + + rxChannelCount = MIN(MAX_SUPPORTED_RC_CHANNEL_COUNT, rxRuntimeConfig.channelCount); } void rxUpdateRSSISource(void) @@ -516,7 +527,7 @@ bool calculateRxChannelsAndUpdateFailsafe(timeUs_t currentTimeUs) rxFlightChannelsValid = true; // Read and process channel data - for (int channel = 0; channel < rxRuntimeConfig.channelCount; channel++) { + for (int channel = 0; channel < rxChannelCount; channel++) { const uint8_t rawChannel = calculateChannelRemapping(rxConfig()->rcmap, REMAPPABLE_CHANNEL_COUNT, channel); // sample the channel @@ -549,11 +560,11 @@ bool calculateRxChannelsAndUpdateFailsafe(timeUs_t currentTimeUs) // If receiver is in failsafe (not receiving signal or sending invalid channel values) - last good input values are retained if (rxFlightChannelsValid && rxSignalReceived) { if (rxRuntimeConfig.requireFiltering) { - for (int channel = 0; channel < rxRuntimeConfig.channelCount; channel++) { + for (int channel = 0; channel < rxChannelCount; channel++) { rcChannels[channel].data = applyChannelFiltering(channel, rcStaging[channel]); } } else { - for (int channel = 0; channel < rxRuntimeConfig.channelCount; channel++) { + for (int channel = 0; channel < rxChannelCount; channel++) { rcChannels[channel].data = rcStaging[channel]; } } diff --git a/src/main/rx/rx.h b/src/main/rx/rx.h index af27191bb7..f16a0c0f7f 100644 --- a/src/main/rx/rx.h +++ b/src/main/rx/rx.h @@ -82,6 +82,7 @@ typedef enum { SERIALRX_FPORT = 10, SERIALRX_SBUS_FAST = 11, SERIALRX_FPORT2 = 12, + SERIALRX_SRXL2 = 13, } rxSerialReceiverType_e; #define MAX_SUPPORTED_RC_PPM_CHANNEL_COUNT 16 @@ -128,6 +129,8 @@ typedef struct rxConfig_s { uint8_t rcFilterFrequency; // RC filter cutoff frequency (smoothness vs response sharpness) uint16_t mspOverrideChannels; // Channels to override with MSP RC when BOXMSPRCOVERRIDE is active uint8_t rssi_source; + uint8_t srxl2_unit_id; + uint8_t srxl2_baud_fast; } rxConfig_t; PG_DECLARE(rxConfig_t, rxConfig); diff --git a/src/main/rx/spektrum.c b/src/main/rx/spektrum.c index 42b46c7b3b..8e1263939f 100644 --- a/src/main/rx/spektrum.c +++ b/src/main/rx/spektrum.c @@ -15,10 +15,13 @@ * along with Cleanflight. If not, see . */ +#include #include #include #include +#include "common/maths.h" + #include "platform.h" #ifdef USE_SERIALRX_SPEKTRUM @@ -44,19 +47,13 @@ #include "rx/spektrum.h" // driver for spektrum satellite receiver / sbus - -#define SPEKTRUM_MAX_SUPPORTED_CHANNEL_COUNT 12 -#define SPEKTRUM_2048_CHANNEL_COUNT 12 -#define SPEKTRUM_1024_CHANNEL_COUNT 7 - -#define SPEK_FRAME_SIZE 16 -#define SPEKTRUM_NEEDED_FRAME_INTERVAL 5000 - -#define SPEKTRUM_BAUDRATE 115200 +#define SPEKTRUM_TELEMETRY_FRAME_DELAY_US 1000 // Gap between received Rc frame and transmited TM frame #define SPEKTRUM_MAX_FADE_PER_SEC 40 #define SPEKTRUM_FADE_REPORTS_PER_SEC 2 +bool srxlEnabled = false; + static uint8_t spek_chan_shift; static uint8_t spek_chan_mask; static bool rcFrameComplete = false; @@ -81,6 +78,10 @@ static IO_t BindPin = DEFIO_IO(NONE); static IO_t BindPlug = DEFIO_IO(NONE); #endif +#if defined(USE_TELEMETRY_SRXL) +static uint8_t telemetryBuf[SRXL_FRAME_SIZE_MAX]; +static uint8_t telemetryBufLen = 0; +#endif // Receive ISR callback static void spektrumDataReceive(uint16_t c, void *rxCallbackData) @@ -116,46 +117,67 @@ static uint8_t spektrumFrameStatus(rxRuntimeConfig_t *rxRuntimeConfig) { UNUSED(rxRuntimeConfig); - if (!rcFrameComplete) { - return RX_FRAME_PENDING; - } +#if defined(USE_TELEMETRY_SRXL) + static timeUs_t telemetryFrameRequestedUs = 0; - rcFrameComplete = false; + timeUs_t currentTimeUs = micros(); +#endif - // Fetch the fade count - const uint16_t fade = (spekFrame[0] << 8) + spekFrame[1]; - const uint32_t current_secs = millis() / (1000 / SPEKTRUM_FADE_REPORTS_PER_SEC); + uint8_t result = RX_FRAME_PENDING; - if (spek_fade_last_sec == 0) { - // This is the first frame status received. - spek_fade_last_sec_count = fade; - spek_fade_last_sec = current_secs; - } else if (spek_fade_last_sec != current_secs) { - // If the difference is > 1, then we missed several seconds worth of frames and - // should just throw out the fade calc (as it's likely a full signal loss). - if ((current_secs - spek_fade_last_sec) == 1) { - if (rssi_channel != 0) { - if (spekHiRes) - spekChannelData[rssi_channel] = 2048 - ((fade - spek_fade_last_sec_count) * 2048 / (SPEKTRUM_MAX_FADE_PER_SEC / SPEKTRUM_FADE_REPORTS_PER_SEC)); - else - spekChannelData[rssi_channel] = 1024 - ((fade - spek_fade_last_sec_count) * 1024 / (SPEKTRUM_MAX_FADE_PER_SEC / SPEKTRUM_FADE_REPORTS_PER_SEC)); + if (rcFrameComplete) { + rcFrameComplete = false; + + // Fetch the fade count + const uint16_t fade = (spekFrame[0] << 8) + spekFrame[1]; + const uint32_t current_secs = millis() / (1000 / SPEKTRUM_FADE_REPORTS_PER_SEC); + + if (spek_fade_last_sec == 0) { + // This is the first frame status received. + spek_fade_last_sec_count = fade; + spek_fade_last_sec = current_secs; + } else if (spek_fade_last_sec != current_secs) { + // If the difference is > 1, then we missed several seconds worth of frames and + // should just throw out the fade calc (as it's likely a full signal loss). + if ((current_secs - spek_fade_last_sec) == 1) { + if (rssi_channel != 0) { + if (spekHiRes) + spekChannelData[rssi_channel] = 2048 - ((fade - spek_fade_last_sec_count) * 2048 / (SPEKTRUM_MAX_FADE_PER_SEC / SPEKTRUM_FADE_REPORTS_PER_SEC)); + else + spekChannelData[rssi_channel] = 1024 - ((fade - spek_fade_last_sec_count) * 1024 / (SPEKTRUM_MAX_FADE_PER_SEC / SPEKTRUM_FADE_REPORTS_PER_SEC)); + } + } + spek_fade_last_sec_count = fade; + spek_fade_last_sec = current_secs; + } + + + for (int b = 3; b < SPEK_FRAME_SIZE; b += 2) { + const uint8_t spekChannel = 0x0F & (spekFrame[b - 1] >> spek_chan_shift); + if (spekChannel < rxRuntimeConfigPtr->channelCount && spekChannel < SPEKTRUM_MAX_SUPPORTED_CHANNEL_COUNT) { + if (rssi_channel == 0 || spekChannel != rssi_channel) { + spekChannelData[spekChannel] = ((uint32_t)(spekFrame[b - 1] & spek_chan_mask) << 8) + spekFrame[b]; + } } } - spek_fade_last_sec_count = fade; - spek_fade_last_sec = current_secs; - } - - for (int b = 3; b < SPEK_FRAME_SIZE; b += 2) { - const uint8_t spekChannel = 0x0F & (spekFrame[b - 1] >> spek_chan_shift); - if (spekChannel < rxRuntimeConfigPtr->channelCount && spekChannel < SPEKTRUM_MAX_SUPPORTED_CHANNEL_COUNT) { - if (rssi_channel == 0 || spekChannel != rssi_channel) { - spekChannelData[spekChannel] = ((uint32_t)(spekFrame[b - 1] & spek_chan_mask) << 8) + spekFrame[b]; - } +#if defined(USE_TELEMETRY_SRXL) + if (srxlEnabled && (spekFrame[2] & 0x80) == 0) { + telemetryFrameRequestedUs = currentTimeUs; } - } +#endif - return RX_FRAME_COMPLETE; + result = RX_FRAME_COMPLETE; + } +#if defined(USE_TELEMETRY_SRXL) + if (telemetryBufLen && telemetryFrameRequestedUs && cmpTimeUs(currentTimeUs, telemetryFrameRequestedUs) >= SPEKTRUM_TELEMETRY_FRAME_DELAY_US) { + telemetryFrameRequestedUs = 0; + + result = (result & ~RX_FRAME_PENDING) | RX_FRAME_PROCESSING_REQUIRED; + } +#endif + + return result; } static uint16_t spektrumReadRawRC(const rxRuntimeConfig_t *rxRuntimeConfig, uint8_t chan) @@ -251,6 +273,25 @@ void spektrumBind(rxConfig_t *rxConfig) } #endif // SPEKTRUM_BIND +#if defined(USE_TELEMETRY_SRXL) + +bool srxlTelemetryBufferEmpty(void) +{ + if (telemetryBufLen == 0) { + return true; + } else { + return false; + } +} + +void srxlRxWriteTelemetryData(const void *data, int len) +{ + len = MIN(len, (int)sizeof(telemetryBuf)); + memcpy(telemetryBuf, data, len); + telemetryBufLen = len; +} +#endif + bool spektrumInit(const rxConfig_t *rxConfig, rxRuntimeConfig_t *rxRuntimeConfig) { rxRuntimeConfigPtr = rxRuntimeConfig; @@ -310,4 +351,10 @@ bool spektrumInit(const rxConfig_t *rxConfig, rxRuntimeConfig_t *rxRuntimeConfig return serialPort != NULL; } + +bool srxlRxIsActive(void) +{ + return serialPort != NULL; +} + #endif // USE_SERIALRX_SPEKTRUM diff --git a/src/main/rx/spektrum.h b/src/main/rx/spektrum.h index 44aab64192..c63396b4a9 100644 --- a/src/main/rx/spektrum.h +++ b/src/main/rx/spektrum.h @@ -17,8 +17,26 @@ #pragma once -#define SPEKTRUM_SAT_BIND_DISABLED 0 -#define SPEKTRUM_SAT_BIND_MAX 10 +#define SPEKTRUM_MAX_SUPPORTED_CHANNEL_COUNT 12 +#define SPEKTRUM_2048_CHANNEL_COUNT 12 +#define SPEKTRUM_1024_CHANNEL_COUNT 7 + +#define SPEKTRUM_SAT_BIND_DISABLED 0 +#define SPEKTRUM_SAT_BIND_MAX 10 + +#define SPEK_FRAME_SIZE 16 +#define SRXL_FRAME_OVERHEAD 5 +#define SRXL_FRAME_SIZE_MAX (SPEK_FRAME_SIZE + SRXL_FRAME_OVERHEAD) + +#define SPEKTRUM_NEEDED_FRAME_INTERVAL 5000 + +#define SPEKTRUM_BAUDRATE 115200 + +extern bool srxlEnabled; void spektrumBind(rxConfig_t *rxConfig); bool spektrumInit(const rxConfig_t *rxConfig, rxRuntimeConfig_t *rxRuntimeConfig); + +bool srxlTelemetryBufferEmpty(void); +void srxlRxWriteTelemetryData(const void *data, int len); +bool srxlRxIsActive(void); \ No newline at end of file diff --git a/src/main/rx/srxl2.c b/src/main/rx/srxl2.c new file mode 100644 index 0000000000..221995ed68 --- /dev/null +++ b/src/main/rx/srxl2.c @@ -0,0 +1,580 @@ +/* + * This file is part of Cleanflight and Betaflight. + * + * Cleanflight and Betaflight are free software. You can redistribute + * this software and/or modify this software 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. + * + * Cleanflight and Betaflight are distributed in the hope that they + * 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 software. + * + * If not, see . + */ + +#include + +#include "platform.h" + +#ifdef USE_SERIALRX_SRXL2 + +#include "common/crc.h" +#include "common/maths.h" +#include "common/streambuf.h" + +#include "drivers/nvic.h" +#include "drivers/time.h" +#include "drivers/serial.h" +#include "drivers/serial_uart.h" + +#include "io/serial.h" + +#include "rx/srxl2.h" +#include "rx/srxl2_types.h" + +#ifndef SRXL2_DEBUG +#define SRXL2_DEBUG 0 +#endif + +#if SRXL2_DEBUG +//void cliPrintf(const char *format, ...); +//#define DEBUG_PRINTF(format, ...) cliPrintf(format, __VA_ARGS__) +#define DEBUG_PRINTF(...) //Temporary until a better debug printf can be included +#else +#define DEBUG_PRINTF(...) +#endif + + + +#define SRXL2_MAX_CHANNELS 32 +#define SRXL2_FRAME_PERIOD_US 11000 // 5500 for DSMR +#define SRXL2_CHANNEL_SHIFT 5 +#define SRXL2_CHANNEL_CENTER 0x8000 + +#define SRXL2_PORT_BAUDRATE_DEFAULT 115200 +#define SRXL2_PORT_BAUDRATE_HIGH 400000 +#define SRXL2_PORT_OPTIONS (SERIAL_STOPBITS_1 | SERIAL_PARITY_NO | SERIAL_BIDIR) +#define SRXL2_PORT_MODE MODE_RXTX + +#define SRXL2_REPLY_QUIESCENCE (2 * 10 * 1000000 / SRXL2_PORT_BAUDRATE_DEFAULT) // 2 * (lastIdleTimestamp - lastReceiveTimestamp). Time taken to send 2 bytes + +#define SRXL2_ID 0xA6 +#define SRXL2_MAX_PACKET_LENGTH 80 +#define SRXL2_DEVICE_ID_BROADCAST 0xFF + +#define SRXL2_FRAME_TIMEOUT_US 50000 + +#define SRXL2_LISTEN_FOR_ACTIVITY_TIMEOUT_US 50000 +#define SRXL2_SEND_HANDSHAKE_TIMEOUT_US 50000 +#define SRXL2_LISTEN_FOR_HANDSHAKE_TIMEOUT_US 200000 + +#define SPEKTRUM_PULSE_OFFSET 988 // Offset value to convert digital data into RC pulse + +typedef union { + uint8_t raw[SRXL2_MAX_PACKET_LENGTH]; + Srxl2Header header; +} Srxl2Frame; + +struct rxBuf { + volatile unsigned len; + Srxl2Frame packet; +}; + +static uint8_t unitId = 0; +static uint8_t baudRate = 0; + +static Srxl2State state = Disabled; +static uint32_t timeoutTimestamp = 0; +static uint32_t fullTimeoutTimestamp = 0; +static uint32_t lastValidPacketTimestamp = 0; +static volatile uint32_t lastReceiveTimestamp = 0; +static volatile uint32_t lastIdleTimestamp = 0; + +struct rxBuf readBuffer[2]; +struct rxBuf* readBufferPtr = &readBuffer[0]; +struct rxBuf* processBufferPtr = &readBuffer[1]; +static volatile unsigned readBufferIdx = 0; +static volatile bool transmittingTelemetry = false; +static uint8_t writeBuffer[SRXL2_MAX_PACKET_LENGTH]; +static unsigned writeBufferIdx = 0; + +static serialPort_t *serialPort; + +static uint8_t busMasterDeviceId = 0xFF; +static bool telemetryRequested = false; + +static uint8_t telemetryFrame[22]; + +uint8_t globalResult = 0; + +/* handshake protocol + 1. listen for 50ms for serial activity and go to State::Running if found, autobaud may be necessary + 2. if srxl2_unitId = 0: + send a Handshake with destinationDeviceId = 0 every 50ms for at least 200ms + else: + listen for Handshake for at least 200ms + 3. respond to Handshake as currently implemented in process if rePst received + 4. respond to broadcast Handshake +*/ + +// if 50ms with not activity, go to default baudrate and to step 1 + +bool srxl2ProcessHandshake(const Srxl2Header* header) +{ + const Srxl2HandshakeSubHeader* handshake = (Srxl2HandshakeSubHeader*)(header + 1); + if (handshake->destinationDeviceId == Broadcast) { + DEBUG_PRINTF("broadcast handshake from %x\r\n", handshake->sourceDeviceId); + busMasterDeviceId = handshake->sourceDeviceId; + + if (handshake->baudSupported == 1) { + serialSetBaudRate(serialPort, SRXL2_PORT_BAUDRATE_HIGH); + DEBUG_PRINTF("switching to %d baud\r\n", SRXL2_PORT_BAUDRATE_HIGH); + } + + state = Running; + + return true; + } + + + if (handshake->destinationDeviceId != ((FlightController << 4) | unitId)) { + return true; + } + + DEBUG_PRINTF("FC handshake from %x\r\n", handshake->sourceDeviceId); + + Srxl2HandshakeFrame response = { + .header = *header, + .payload = { + handshake->destinationDeviceId, + handshake->sourceDeviceId, + /* priority */ 10, + /* baudSupported*/ baudRate, + /* info */ 0, + // U_ID_2 + } + }; + + srxl2RxWriteData(&response, sizeof(response)); + + return true; +} + +void srxl2ProcessChannelData(const Srxl2ChannelDataHeader* channelData, rxRuntimeConfig_t *rxRuntimeConfig) { + globalResult = RX_FRAME_COMPLETE; + + if (channelData->rssi >= 0) { + const int rssiPercent = channelData->rssi; + lqTrackerSet(rxRuntimeConfig->lqTracker, scaleRange(constrain(rssiPercent, 0, 100), 0, 100, 0, RSSI_MAX_VALUE)); + //setRssi(scaleRange(rssiPercent, 0, 100, 0, RSSI_MAX_VALUE), RSSI_SOURCE_RX_PROTOCOL); + } + + //If receiver is in a connected state, and a packet is missed, the channel mask will be 0. + if (!channelData->channelMask.u32) { + globalResult |= RX_FRAME_FAILSAFE; + return; + } + + const uint16_t *frameChannels = (const uint16_t *) (channelData + 1); + uint32_t channelMask = channelData->channelMask.u32; + while (channelMask) { + unsigned idx = __builtin_ctz (channelMask); + uint32_t mask = 1 << idx; + rxRuntimeConfig->channelData[idx] = *frameChannels++; + channelMask &= ~mask; + } + + DEBUG_PRINTF("channel data: %d %d %x\r\n", channelData_header->rssi, channelData_header->frameLosses, channelData_header->channelMask.u32); +} + +bool srxl2ProcessControlData(const Srxl2Header* header, rxRuntimeConfig_t *rxRuntimeConfig) +{ + const Srxl2ControlDataSubHeader* controlData = (Srxl2ControlDataSubHeader*)(header + 1); + const uint8_t ownId = (FlightController << 4) | unitId; + if (controlData->replyId == ownId) { + telemetryRequested = true; + DEBUG_PRINTF("command: %x replyId: %x ownId: %x\r\n", controlData->command, controlData->replyId, ownId); + } + + switch (controlData->command) { + case ChannelData: + srxl2ProcessChannelData((const Srxl2ChannelDataHeader *) (controlData + 1), rxRuntimeConfig); + break; + + case FailsafeChannelData: { + globalResult |= RX_FRAME_FAILSAFE; + //setRssiDirect(0, RSSI_SOURCE_RX_PROTOCOL); + lqTrackerSet(rxRuntimeConfig->lqTracker, 0); + // DEBUG_PRINTF("fs channel data\r\n"); + } break; + + case VTXData: { +#if defined(USE_SPEKTRUM_VTX_CONTROL) && defined(USE_VTX_COMMON) + Srxl2VtxData *vtxData = (Srxl2VtxData*)(controlData + 1); + DEBUG_PRINTF("vtx data\r\n"); + DEBUG_PRINTF("vtx band: %x\r\n", vtxData->band); + DEBUG_PRINTF("vtx channel: %x\r\n", vtxData->channel); + DEBUG_PRINTF("vtx pit: %x\r\n", vtxData->pit); + DEBUG_PRINTF("vtx power: %x\r\n", vtxData->power); + DEBUG_PRINTF("vtx powerDec: %x\r\n", vtxData->powerDec); + DEBUG_PRINTF("vtx region: %x\r\n", vtxData->region); + // Pack data as it was used before srxl2 to use existing functions. + // Get the VTX control bytes in a frame + uint32_t vtxControl = (0xE0 << 24) | (0xE0 << 8) | + ((vtxData->band & 0x07) << 21) | + ((vtxData->channel & 0x0F) << 16) | + ((vtxData->pit & 0x01) << 4) | + ((vtxData->region & 0x01) << 3) | + ((vtxData->power & 0x07)); + spektrumHandleVtxControl(vtxControl); +#endif + } break; + } + + return true; +} + +bool srxl2ProcessPacket(const Srxl2Header* header, rxRuntimeConfig_t *rxRuntimeConfig) +{ + switch (header->packetType) { + case Handshake: + return srxl2ProcessHandshake(header); + case ControlData: + return srxl2ProcessControlData(header, rxRuntimeConfig); + default: + DEBUG_PRINTF("Other packet type, ID: %x \r\n", header->packetType); + break; + } + + return false; +} + +// @note assumes packet is fully there +void srxl2Process(rxRuntimeConfig_t *rxRuntimeConfig) +{ + if (processBufferPtr->packet.header.id != SRXL2_ID || processBufferPtr->len != processBufferPtr->packet.header.length) { + DEBUG_PRINTF("invalid header id: %x, or length: %x received vs %x expected \r\n", processBufferPtr->packet.header.id, processBufferPtr->len, processBufferPtr->packet.header.length); + globalResult = RX_FRAME_DROPPED; + return; + } + + const uint16_t calculatedCrc = crc16_ccitt_update(0, processBufferPtr->packet.raw, processBufferPtr->packet.header.length); + + //Invalid if crc non-zero + if (calculatedCrc) { + globalResult = RX_FRAME_DROPPED; + DEBUG_PRINTF("crc mismatch %x\r\n", calculatedCrc); + return; + } + + //Packet is valid only after ID and CRC check out + lastValidPacketTimestamp = micros(); + + if (srxl2ProcessPacket(&processBufferPtr->packet.header, rxRuntimeConfig)) { + return; + } + + DEBUG_PRINTF("could not parse packet: %x\r\n", processBufferPtr->packet.header.packetType); + globalResult = RX_FRAME_DROPPED; +} + + +static void srxl2DataReceive(uint16_t character, void *data) +{ + UNUSED(data); + + lastReceiveTimestamp = microsISR(); + + //If the buffer len is not reset for whatever reason, disable reception + if (readBufferPtr->len > 0 || readBufferIdx >= SRXL2_MAX_PACKET_LENGTH) { + readBufferIdx = 0; + globalResult = RX_FRAME_DROPPED; + } + else { + readBufferPtr->packet.raw[readBufferIdx] = character; + readBufferIdx++; + } +} + +static void srxl2Idle(void) +{ + if(transmittingTelemetry) { // Transmitting telemetry triggers idle interrupt as well. We dont want to change buffers then + transmittingTelemetry = false; + } + else if(readBufferIdx == 0) { // Packet was invalid + readBufferPtr->len = 0; + } + else { + lastIdleTimestamp = microsISR(); + //Swap read and process buffer pointers + if(processBufferPtr == &readBuffer[0]) { + processBufferPtr = &readBuffer[1]; + readBufferPtr = &readBuffer[0]; + } else { + processBufferPtr = &readBuffer[0]; + readBufferPtr = &readBuffer[1]; + } + processBufferPtr->len = readBufferIdx; + } + + readBufferIdx = 0; +} + +static uint8_t srxl2FrameStatus(rxRuntimeConfig_t *rxRuntimeConfig) +{ + UNUSED(rxRuntimeConfig); + + if(serialIsIdle(serialPort)) + { + srxl2Idle(); + } + + globalResult = RX_FRAME_PENDING; + + // len should only be set after an idle interrupt (packet reception complete) + if (processBufferPtr != NULL && processBufferPtr->len) { + srxl2Process(rxRuntimeConfig); + processBufferPtr->len = 0; + } + + uint8_t result = globalResult; + + const uint32_t now = micros(); + + switch (state) { + case Disabled: break; + + case ListenForActivity: { + // activity detected + if (lastValidPacketTimestamp != 0) { + // as ListenForActivity is done at default baud-rate, we don't need to change anything + // @todo if there were non-handshake packets - go to running, + // if there were - go to either Send Handshake or Listen For Handshake + state = Running; + } else if (cmpTimeUs(lastIdleTimestamp, lastReceiveTimestamp) > 0) { + if (baudRate != 0) { + uint32_t currentBaud = serialGetBaudRate(serialPort); + + if(currentBaud == SRXL2_PORT_BAUDRATE_DEFAULT) + serialSetBaudRate(serialPort, SRXL2_PORT_BAUDRATE_HIGH); + else + serialSetBaudRate(serialPort, SRXL2_PORT_BAUDRATE_DEFAULT); + } + } else if (cmpTimeUs(now, timeoutTimestamp) >= 0) { + // @todo if there was activity - detect baudrate and ListenForHandshake + + if (unitId == 0) { + state = SendHandshake; + timeoutTimestamp = now + SRXL2_SEND_HANDSHAKE_TIMEOUT_US; + fullTimeoutTimestamp = now + SRXL2_LISTEN_FOR_HANDSHAKE_TIMEOUT_US; + } else { + state = ListenForHandshake; + timeoutTimestamp = now + SRXL2_LISTEN_FOR_HANDSHAKE_TIMEOUT_US; + } + } + } break; + + case SendHandshake: { + if (cmpTimeUs(now, timeoutTimestamp) >= 0) { + // @todo set another timeout for 50ms tries + // fill write buffer with handshake frame + result |= RX_FRAME_PROCESSING_REQUIRED; + } + + if (cmpTimeUs(now, fullTimeoutTimestamp) >= 0) { + serialSetBaudRate(serialPort, SRXL2_PORT_BAUDRATE_DEFAULT); + DEBUG_PRINTF("case SendHandshake: switching to %d baud\r\n", SRXL2_PORT_BAUDRATE_DEFAULT); + timeoutTimestamp = now + SRXL2_LISTEN_FOR_ACTIVITY_TIMEOUT_US; + result = (result & ~RX_FRAME_PENDING) | RX_FRAME_FAILSAFE; + + state = ListenForActivity; + lastReceiveTimestamp = 0; + } + } break; + + case ListenForHandshake: { + if (cmpTimeUs(now, timeoutTimestamp) >= 0) { + serialSetBaudRate(serialPort, SRXL2_PORT_BAUDRATE_DEFAULT); + DEBUG_PRINTF("case ListenForHandshake: switching to %d baud\r\n", SRXL2_PORT_BAUDRATE_DEFAULT); + timeoutTimestamp = now + SRXL2_LISTEN_FOR_ACTIVITY_TIMEOUT_US; + result = (result & ~RX_FRAME_PENDING) | RX_FRAME_FAILSAFE; + + state = ListenForActivity; + lastReceiveTimestamp = 0; + } + } break; + + case Running: { + // frame timed out, reset state + if (cmpTimeUs(now, lastValidPacketTimestamp) >= SRXL2_FRAME_TIMEOUT_US) { + serialSetBaudRate(serialPort, SRXL2_PORT_BAUDRATE_DEFAULT); + DEBUG_PRINTF("case Running: switching to %d baud: %d %d\r\n", SRXL2_PORT_BAUDRATE_DEFAULT, now, lastValidPacketTimestamp); + timeoutTimestamp = now + SRXL2_LISTEN_FOR_ACTIVITY_TIMEOUT_US; + result = (result & ~RX_FRAME_PENDING) | RX_FRAME_FAILSAFE; + + state = ListenForActivity; + lastReceiveTimestamp = 0; + lastValidPacketTimestamp = 0; + } + } break; + }; + + if (writeBufferIdx) { + result |= RX_FRAME_PROCESSING_REQUIRED; + } + + return result; +} + +static bool srxl2ProcessFrame(const rxRuntimeConfig_t *rxRuntimeConfig) +{ + UNUSED(rxRuntimeConfig); + + if (writeBufferIdx == 0) { + return true; + } + + const uint32_t now = micros(); + + if (cmpTimeUs(lastIdleTimestamp, lastReceiveTimestamp) > 0) { + // time sufficient for at least 2 characters has passed + if (cmpTimeUs(now, lastReceiveTimestamp) > SRXL2_REPLY_QUIESCENCE) { + transmittingTelemetry = true; + serialWriteBuf(serialPort, writeBuffer, writeBufferIdx); + writeBufferIdx = 0; + } else { + DEBUG_PRINTF("not enough time to send 2 characters passed yet, %d us since last receive, %d required\r\n", now - lastReceiveTimestamp, SRXL2_REPLY_QUIESCENCE); + } + } else { + DEBUG_PRINTF("still receiving a frame, %d %d\r\n", lastIdleTimestamp, lastReceiveTimestamp); + } + + return true; +} + +static uint16_t srxl2ReadRawRC(const rxRuntimeConfig_t *rxRuntimeConfig, uint8_t channelIdx) +{ + if (channelIdx >= rxRuntimeConfig->channelCount) { + return 0; + } + + return SPEKTRUM_PULSE_OFFSET + ((rxRuntimeConfig->channelData[channelIdx] >> SRXL2_CHANNEL_SHIFT) >> 1); +} + +void srxl2RxWriteData(const void *data, int len) +{ + const uint16_t crc = crc16_ccitt_update(0, (uint8_t*)data, len - 2); + ((uint8_t*)data)[len-2] = ((uint8_t *) &crc)[1] & 0xFF; + ((uint8_t*)data)[len-1] = ((uint8_t *) &crc)[0] & 0xFF; + + len = MIN(len, (int)sizeof(writeBuffer)); + memcpy(writeBuffer, data, len); + writeBufferIdx = len; +} + +bool srxl2RxInit(const rxConfig_t *rxConfig, rxRuntimeConfig_t *rxRuntimeConfig) +{ + static uint16_t channelData[SRXL2_MAX_CHANNELS]; + for (size_t i = 0; i < SRXL2_MAX_CHANNELS; ++i) { + channelData[i] = SRXL2_CHANNEL_CENTER; + } + + unitId = rxConfig->srxl2_unit_id; + baudRate = rxConfig->srxl2_baud_fast; + + rxRuntimeConfig->channelData = channelData; + rxRuntimeConfig->channelCount = SRXL2_MAX_CHANNELS; + rxRuntimeConfig->rxRefreshRate = SRXL2_FRAME_PERIOD_US; + + rxRuntimeConfig->rcReadRawFn = srxl2ReadRawRC; + rxRuntimeConfig->rcFrameStatusFn = srxl2FrameStatus; + rxRuntimeConfig->rcProcessFrameFn = srxl2ProcessFrame; + + const serialPortConfig_t *portConfig = findSerialPortConfig(FUNCTION_RX_SERIAL); + if (!portConfig) { + return false; + } + + portOptions_t options = SRXL2_PORT_OPTIONS; + if (rxConfig->serialrx_inverted) { + options |= SERIAL_INVERTED; + } + if (rxConfig->halfDuplex) { + options |= SERIAL_BIDIR; + } + + serialPort = openSerialPort(portConfig->identifier, FUNCTION_RX_SERIAL, srxl2DataReceive, + NULL, SRXL2_PORT_BAUDRATE_DEFAULT, SRXL2_PORT_MODE, options); + + if (!serialPort) { + return false; + } + + state = ListenForActivity; + timeoutTimestamp = micros() + SRXL2_LISTEN_FOR_ACTIVITY_TIMEOUT_US; + + //Looks like this needs to be set in cli config + //if (rssiSource == RSSI_SOURCE_NONE) { + // rssiSource = RSSI_SOURCE_RX_PROTOCOL; + //} + + return (bool)serialPort; +} + +bool srxl2RxIsActive(void) +{ + return serialPort; +} + +bool srxl2TelemetryRequested(void) +{ + return telemetryRequested; +} + +void srxl2InitializeFrame(sbuf_t *dst) +{ + dst->ptr = telemetryFrame; + dst->end = ARRAYEND(telemetryFrame); + + sbufWriteU8(dst, SRXL2_ID); + sbufWriteU8(dst, TelemetrySensorData); + sbufWriteU8(dst, ARRAYLEN(telemetryFrame)); + sbufWriteU8(dst, busMasterDeviceId); +} + +void srxl2FinalizeFrame(sbuf_t *dst) +{ + sbufSwitchToReader(dst, telemetryFrame); + // Include 2 additional bytes of length since we're letting the srxl2RxWriteData function add the CRC in + srxl2RxWriteData(sbufPtr(dst), sbufBytesRemaining(dst) + 2); + telemetryRequested = false; +} + +void srxl2Bind(void) +{ + const size_t length = sizeof(Srxl2BindInfoFrame); + + Srxl2BindInfoFrame bind = { + .header = { + .id = SRXL2_ID, + .packetType = BindInfo, + .length = length + }, + .payload = { + .request = EnterBindMode, + .deviceId = busMasterDeviceId, + .bindType = DMSX_11ms, + .options = SRXL_BIND_OPT_TELEM_TX_ENABLE | SRXL_BIND_OPT_BIND_TX_ENABLE, + } + }; + + srxl2RxWriteData(&bind, length); +} + +#endif diff --git a/src/main/rx/srxl2.h b/src/main/rx/srxl2.h new file mode 100644 index 0000000000..5c3bb14276 --- /dev/null +++ b/src/main/rx/srxl2.h @@ -0,0 +1,15 @@ +#pragma once +#include +#include + +#include "rx/rx.h" + +struct sbuf_s; + +bool srxl2RxInit(const rxConfig_t *rxConfig, rxRuntimeConfig_t *rxRuntimeConfig); +bool srxl2RxIsActive(void); +void srxl2RxWriteData(const void *data, int len); +bool srxl2TelemetryRequested(void); +void srxl2InitializeFrame(struct sbuf_s *dst); +void srxl2FinalizeFrame(struct sbuf_s *dst); +void srxl2Bind(void); diff --git a/src/main/rx/srxl2_types.h b/src/main/rx/srxl2_types.h new file mode 100644 index 0000000000..d5edce381b --- /dev/null +++ b/src/main/rx/srxl2_types.h @@ -0,0 +1,138 @@ +#pragma once + +#define PACKED __attribute__((packed)) + +typedef enum { + Disabled, + ListenForActivity, + SendHandshake, + ListenForHandshake, + Running +} Srxl2State; + +typedef enum { + Handshake = 0x21, + BindInfo = 0x41, + ParameterConfiguration = 0x50, + SignalQuality = 0x55, + TelemetrySensorData = 0x80, + ControlData = 0xCD, +} Srxl2PacketType; + +typedef struct { + uint8_t id; + uint8_t packetType; + uint8_t length; +} PACKED Srxl2Header; + +typedef struct { + uint8_t sourceDeviceId; + uint8_t destinationDeviceId; + uint8_t priority; + uint8_t baudSupported; + uint8_t info; + uint32_t uniqueId; +} PACKED Srxl2HandshakeSubHeader; + +typedef struct { + uint8_t command; + uint8_t replyId; +} PACKED Srxl2ControlDataSubHeader; + +typedef enum { + ChannelData = 0x00, + FailsafeChannelData = 0x01, + VTXData = 0x02, +} Srxl2ControlDataCommand; + +typedef struct { + int8_t rssi; + uint16_t frameLosses; + union { + //struct { + // uint8_t channels_0_7; + // uint8_t channels_8_15; + // uint8_t channels_16_23; + // uint8_t channels_24_31; + //} u8; + uint8_t u8[4]; + uint32_t u32; + } channelMask; +} PACKED Srxl2ChannelDataHeader; + +typedef enum { + NoDevice = 0, + RemoteReceiver = 1, + Receiver = 2, + FlightController = 3, + ESC = 4, + Reserved = 5, + SRXLServo = 6, + SRXLServo_2 = 7, + VTX = 8, +} Srxl2DeviceType; + +typedef enum { + FlightControllerDefault = 0x30, + FlightControllerMax = 0x3F, + Broadcast = 0xFF, +} Srxl2DeviceId; + +typedef struct { + Srxl2Header header; + Srxl2HandshakeSubHeader payload; + uint8_t crcHigh; + uint8_t crcLow; +} PACKED Srxl2HandshakeFrame; + +typedef enum { + EnterBindMode = 0xEB, + RequestBindStatus = 0xB5, + BoundDataReport = 0xDB, + SetBindInfo = 0x5B, +} Srxl2BindRequest; + +typedef enum { + NotBound = 0x0, + DSM2_1024_22ms = 0x01, + DSM2_1024_MC24 = 0x02, + DMS2_2048_11ms = 0x12, + DMSX_22ms = 0xA2, + DMSX_11ms = 0xB2, + Surface_DSM2_16_5ms = 0x63, + DSMR_11ms_22ms = 0xE2, + DSMR_5_5ms = 0xE4, +} Srxl2BindType; + +// Bit masks for Options byte +#define SRXL_BIND_OPT_NONE (0x00) +#define SRXL_BIND_OPT_TELEM_TX_ENABLE (0x01) // Set if this device should be enabled as the current telemetry device to tx over RF +#define SRXL_BIND_OPT_BIND_TX_ENABLE (0x02) // Set if this device should reply to a bind request with a Discover packet over RF + +typedef struct { + uint8_t request; + uint8_t deviceId; + uint8_t bindType; + uint8_t options; + uint64_t guid; + uint32_t uid; +} PACKED Srxl2BindInfoPayload; + +typedef struct { + Srxl2Header header; + Srxl2BindInfoPayload payload; + uint8_t crcHigh; + uint8_t crcLow; +} PACKED Srxl2BindInfoFrame; + +// VTX Data +typedef struct { + uint8_t band; // VTX Band (0 = Fatshark, 1 = Raceband, 2 = E, 3 = B, 4 = A) + uint8_t channel; // VTX Channel (0-7) + uint8_t pit; // Pit/Race mode (0 = Race, 1 = Pit). Race = (normal operating) mode. Pit = (reduced power) mode. + uint8_t power; // VTX Power (0 = Off, 1 = 1mw to 14mW, 2 = 15mW to 25mW, 3 = 26mW to 99mW, 4 = 100mW to 299mW, 5 = 300mW to 600mW, 6 = 601mW+, 7 = manual control) + uint16_t powerDec; // VTX Power as a decimal 1mw/unit + uint8_t region; // Region (0 = USA, 1 = EU) +} PACKED Srxl2VtxData; + +#undef PACKED diff --git a/src/main/scheduler/scheduler.h b/src/main/scheduler/scheduler.h index eb11bbdf7c..b4661d16e0 100755 --- a/src/main/scheduler/scheduler.h +++ b/src/main/scheduler/scheduler.h @@ -86,7 +86,7 @@ typedef enum { #ifdef USE_LED_STRIP TASK_LEDSTRIP, #endif -#ifdef USE_PWM_SERVO_DRIVER +#if defined(USE_PWM_SERVO_DRIVER) || defined(USE_SERVO_SBUS) TASK_PWMDRIVER, #endif #ifdef STACK_CHECK diff --git a/src/main/sensors/barometer.c b/src/main/sensors/barometer.c index 49d8d0cc59..3506e9361a 100644 --- a/src/main/sensors/barometer.c +++ b/src/main/sensors/barometer.c @@ -40,6 +40,7 @@ #include "drivers/barometer/barometer_ms56xx.h" #include "drivers/barometer/barometer_spl06.h" #include "drivers/barometer/barometer_dps310.h" +#include "drivers/barometer/barometer_msp.h" #include "drivers/time.h" #include "fc/runtime_config.h" @@ -55,7 +56,7 @@ baro_t baro; // barometer access functions -PG_REGISTER_WITH_RESET_TEMPLATE(barometerConfig_t, barometerConfig, PG_BAROMETER_CONFIG, 1); +PG_REGISTER_WITH_RESET_TEMPLATE(barometerConfig_t, barometerConfig, PG_BAROMETER_CONFIG, 2); #ifdef USE_BARO #define BARO_HARDWARE_DEFAULT BARO_AUTODETECT @@ -64,7 +65,7 @@ PG_REGISTER_WITH_RESET_TEMPLATE(barometerConfig_t, barometerConfig, PG_BAROMETER #endif PG_RESET_TEMPLATE(barometerConfig_t, barometerConfig, .baro_hardware = BARO_HARDWARE_DEFAULT, - .use_median_filtering = 1, + .use_median_filtering = 0, .baro_calibration_tolerance = 150 ); @@ -187,6 +188,20 @@ bool baroDetect(baroDev_t *dev, baroSensor_e baroHardwareToUse) } FALLTHROUGH; + case BARO_MSP: +#ifdef USE_BARO_MSP + // Skip autodetection for MSP baro, only allow manual config + if (baroHardwareToUse != BARO_AUTODETECT && mspBaroDetect(dev)) { + baroHardware = BARO_MSP; + break; + } +#endif + /* If we are asked for a specific sensor - break out, otherwise - fall through and continue */ + if (baroHardwareToUse != BARO_AUTODETECT) { + break; + } + FALLTHROUGH; + case BARO_FAKE: #ifdef USE_FAKE_BARO if (fakeBaroDetect(dev)) { @@ -350,7 +365,7 @@ int32_t baroCalculateAltitude(void) #endif // calculates height from ground via baro readings baro.BaroAlt = pressureToAltitude(baro.baroPressure) - baroGroundAltitude; - } + } return baro.BaroAlt; } diff --git a/src/main/sensors/barometer.h b/src/main/sensors/barometer.h index 6301c79b0b..2e365fb115 100644 --- a/src/main/sensors/barometer.h +++ b/src/main/sensors/barometer.h @@ -32,7 +32,8 @@ typedef enum { BARO_SPL06 = 7, BARO_BMP388 = 8, BARO_DPS310 = 9, - BARO_FAKE = 10, + BARO_MSP = 10, + BARO_FAKE = 11, BARO_MAX = BARO_FAKE } baroSensor_e; diff --git a/src/main/sensors/compass.c b/src/main/sensors/compass.c index 842c508820..90a108109d 100644 --- a/src/main/sensors/compass.c +++ b/src/main/sensors/compass.c @@ -40,6 +40,7 @@ #include "drivers/compass/compass_qmc5883l.h" #include "drivers/compass/compass_mpu9250.h" #include "drivers/compass/compass_lis3mdl.h" +#include "drivers/compass/compass_msp.h" #include "drivers/io.h" #include "drivers/light_led.h" #include "drivers/time.h" @@ -249,6 +250,20 @@ bool compassDetect(magDev_t *dev, magSensor_e magHardwareToUse) } FALLTHROUGH; + case MAG_MSP: +#ifdef USE_MAG_MSP + // Skip autodetection for MSP mag + if (magHardwareToUse != MAG_AUTODETECT && mspMagDetect(dev)) { + magHardware = MAG_MSP; + break; + } +#endif + /* If we are asked for a specific sensor - break out, otherwise - fall through and continue */ + if (magHardwareToUse != MAG_AUTODETECT) { + break; + } + FALLTHROUGH; + case MAG_FAKE: #ifdef USE_FAKE_MAG if (fakeMagDetect(dev)) { diff --git a/src/main/sensors/compass.h b/src/main/sensors/compass.h index 7c9a0fca63..f715638107 100644 --- a/src/main/sensors/compass.h +++ b/src/main/sensors/compass.h @@ -41,7 +41,8 @@ typedef enum { MAG_MPU9250 = 9, MAG_IST8308 = 10, MAG_LIS3MDL = 11, - MAG_FAKE = 12, + MAG_MSP = 12, + MAG_FAKE = 13, MAG_MAX = MAG_FAKE } magSensor_e; diff --git a/src/main/sensors/pitotmeter.c b/src/main/sensors/pitotmeter.c index b86f2c280b..60fbaed019 100644 --- a/src/main/sensors/pitotmeter.c +++ b/src/main/sensors/pitotmeter.c @@ -29,10 +29,11 @@ #include "config/parameter_group.h" #include "config/parameter_group_ids.h" -#include "drivers/pitotmeter.h" -#include "drivers/pitotmeter_ms4525.h" -#include "drivers/pitotmeter_adc.h" -#include "drivers/pitotmeter_virtual.h" +#include "drivers/pitotmeter/pitotmeter.h" +#include "drivers/pitotmeter/pitotmeter_ms4525.h" +#include "drivers/pitotmeter/pitotmeter_adc.h" +#include "drivers/pitotmeter/pitotmeter_msp.h" +#include "drivers/pitotmeter/pitotmeter_virtual.h" #include "drivers/time.h" #include "fc/config.h" @@ -108,6 +109,20 @@ bool pitotDetect(pitotDev_t *dev, uint8_t pitotHardwareToUse) } FALLTHROUGH; + case PITOT_MSP: +#ifdef USE_PITOT_MSP + // Skip autodetection for MSP baro, only allow manual config + if (pitotHardwareToUse != PITOT_AUTODETECT && mspPitotmeterDetect(dev)) { + pitotHardware = PITOT_MSP; + break; + } +#endif + /* If we are asked for a specific sensor - break out, otherwise - fall through and continue */ + if (pitotHardwareToUse != PITOT_AUTODETECT) { + break; + } + FALLTHROUGH; + case PITOT_FAKE: #ifdef USE_PITOT_FAKE if (fakePitotDetect(dev)) { diff --git a/src/main/sensors/pitotmeter.h b/src/main/sensors/pitotmeter.h index 5bdd955ea2..b7fd3c4ca7 100644 --- a/src/main/sensors/pitotmeter.h +++ b/src/main/sensors/pitotmeter.h @@ -21,7 +21,7 @@ #include "common/filter.h" #include "common/calibration.h" -#include "drivers/pitotmeter.h" +#include "drivers/pitotmeter/pitotmeter.h" typedef enum { PITOT_NONE = 0, @@ -30,6 +30,7 @@ typedef enum { PITOT_ADC = 3, PITOT_VIRTUAL = 4, PITOT_FAKE = 5, + PITOT_MSP = 6, } pitotSensor_e; #define PITOT_MAX PITOT_FAKE diff --git a/src/main/target/AIRHEROF3/target.h b/src/main/target/AIRHEROF3/target.h index 9356bf0cb2..74ba97293f 100755 --- a/src/main/target/AIRHEROF3/target.h +++ b/src/main/target/AIRHEROF3/target.h @@ -76,6 +76,10 @@ #define VBAT_ADC_CHANNEL ADC_CHN_1 #define AIRSPEED_ADC_CHANNEL ADC_CHN_2 +#define USE_DJI_HD_OSD +#define USE_OSD +#undef USE_CMS +#undef CMS_MENU_OSD /* #define USE_LED_STRIP diff --git a/src/main/target/MAMBAF405US/target.c b/src/main/target/MAMBAF405US/target.c index d8e1c39129..ffcee4ee53 100644 --- a/src/main/target/MAMBAF405US/target.c +++ b/src/main/target/MAMBAF405US/target.c @@ -27,10 +27,10 @@ const timerHardware_t timerHardware[] = { DEF_TIM(TIM11, CH1, PB9, TIM_USE_PPM, 0, 0 ), // PPM IN - DEF_TIM(TIM1, CH2, PA9, TIM_USE_MC_MOTOR, 0, 1 ), // S4_OUT – D(2, 2, 6) - DEF_TIM(TIM1, CH1, PA8, TIM_USE_MC_MOTOR, 0, 1 ), // S3_OUT – D(2, 1, 6) - DEF_TIM(TIM8, CH4, PC9, TIM_USE_MC_MOTOR, 0, 0 ), // S2_OUT – D(2, 7, 7) - DEF_TIM(TIM8, CH3, PC8, TIM_USE_MC_MOTOR, 0, 0 ), // S1_OUT – D(2, 4, 7) + DEF_TIM(TIM1, CH2, PA9, TIM_USE_MC_MOTOR | TIM_USE_FW_MOTOR, 0, 1 ), // S4_OUT – D(2, 2, 6) + DEF_TIM(TIM1, CH1, PA8, TIM_USE_MC_MOTOR | TIM_USE_FW_MOTOR, 0, 1 ), // S3_OUT – D(2, 1, 6) + DEF_TIM(TIM8, CH4, PC9, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO, 0, 0 ), // S2_OUT – D(2, 7, 7) + DEF_TIM(TIM8, CH3, PC8, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO, 0, 0 ), // S1_OUT – D(2, 4, 7) DEF_TIM(TIM2, CH2, PB3, TIM_USE_LED, 0, 0 ), // LED_STRIP – D(1, 6, 3) }; diff --git a/src/main/target/MAMBAF722/target.c b/src/main/target/MAMBAF722/target.c index 6ed573e6b6..f46df2fa0c 100644 --- a/src/main/target/MAMBAF722/target.c +++ b/src/main/target/MAMBAF722/target.c @@ -27,10 +27,10 @@ const timerHardware_t timerHardware[] = { DEF_TIM(TIM11, CH1, PB9, TIM_USE_PPM, 0, 0 ), // PPM IN - DEF_TIM(TIM8, CH3, PC8, TIM_USE_MC_MOTOR, 0, 0 ), // S1_OUT – D(2, 4, 7) - DEF_TIM(TIM8, CH4, PC9, TIM_USE_MC_MOTOR, 0, 0 ), // S2_OUT – D(2, 7, 7) - DEF_TIM(TIM1, CH1, PA8, TIM_USE_MC_MOTOR, 0, 1 ), // S3_OUT – D(2, 1, 6) - DEF_TIM(TIM1, CH2, PA9, TIM_USE_MC_MOTOR, 0, 1 ), // S4_OUT – D(2, 2, 6) + DEF_TIM(TIM8, CH3, PC8, TIM_USE_MC_MOTOR | TIM_USE_FW_MOTOR, 0, 0 ), // S1_OUT – D(2, 4, 7) + DEF_TIM(TIM8, CH4, PC9, TIM_USE_MC_MOTOR | TIM_USE_FW_MOTOR, 0, 0 ), // S2_OUT – D(2, 7, 7) + DEF_TIM(TIM1, CH1, PA8, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO, 0, 1 ), // S3_OUT – D(2, 1, 6) + DEF_TIM(TIM1, CH2, PA9, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO, 0, 1 ), // S4_OUT – D(2, 2, 6) DEF_TIM(TIM2, CH2, PB3, TIM_USE_LED, 0, 0 ), // LED_STRIP – D(1, 6, 3) }; diff --git a/src/main/target/MATEKF722PX/CMakeLists.txt b/src/main/target/MATEKF722PX/CMakeLists.txt index 0248902846..069c6db389 100644 --- a/src/main/target/MATEKF722PX/CMakeLists.txt +++ b/src/main/target/MATEKF722PX/CMakeLists.txt @@ -1 +1,2 @@ target_stm32f722xe(MATEKF722PX) +target_stm32f722xe(MATEKF722WPX) diff --git a/src/main/target/MATEKF722PX/target.h b/src/main/target/MATEKF722PX/target.h index f2f1bca242..24c471860e 100755 --- a/src/main/target/MATEKF722PX/target.h +++ b/src/main/target/MATEKF722PX/target.h @@ -21,7 +21,7 @@ #define TARGET_BOARD_IDENTIFIER "MF7P" #define USBD_PRODUCT_STRING "MATEKF722PX" -#define LED0 PA14 //Blue SWCLK +#define LED0 PA14 //Blue SWCLK #define LED1 PA13 //Green SWDIO #define BEEPER PC13 @@ -78,11 +78,21 @@ #define SPI2_MISO_PIN PB14 #define SPI2_MOSI_PIN PC3 -#define USE_FLASHFS -#define USE_FLASH_M25P16 -#define M25P16_SPI_BUS BUS_SPI2 -#define M25P16_CS_PIN PB12 -#define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT +//F722-PX,F722-HD +#if defined(MATEKF722PX) + #define USE_FLASHFS + #define USE_FLASH_M25P16 + #define M25P16_SPI_BUS BUS_SPI2 + #define M25P16_CS_PIN PB12 + #define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT +#else +//F722-WPX + #define USE_SDCARD + #define USE_SDCARD_SPI + #define SDCARD_SPI_BUS BUS_SPI2 + #define SDCARD_CS_PIN PC15 + #define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT +#endif // *************** UART ***************************** #define USE_VCP @@ -112,7 +122,7 @@ #define USE_UART6 #define UART6_TX_PIN PC6 #define UART6_RX_PIN PC7 - + #define USE_SOFTSERIAL1 #define SOFTSERIAL_1_TX_PIN PA2 //TX2 pad #define SOFTSERIAL_1_RX_PIN NONE @@ -163,4 +173,3 @@ #define USE_DSHOT #define USE_SERIALSHOT #define USE_ESC_SENSOR - diff --git a/src/main/target/MATEKF765/target.h b/src/main/target/MATEKF765/target.h index 8fefd8d077..48dde29e1e 100644 --- a/src/main/target/MATEKF765/target.h +++ b/src/main/target/MATEKF765/target.h @@ -144,13 +144,13 @@ #define UART8_TX_PIN PE1 #define UART8_RX_PIN PE0 -/* -#define USE_SOFTSERIAL1 -#define SOFTSERIAL_1_TX_PIN PA2 -#define SOFTSERIAL_1_RX_PIN PA2 -*/ -#define SERIAL_PORT_COUNT 8 +#define USE_SOFTSERIAL1 +#define SOFTSERIAL_1_TX_PIN PC6 //TX6 pad +#define SOFTSERIAL_1_RX_PIN PC6 //TX6 pad + + +#define SERIAL_PORT_COUNT 9 #define DEFAULT_RX_TYPE RX_TYPE_SERIAL #define SERIALRX_PROVIDER SERIALRX_SBUS @@ -171,6 +171,8 @@ #define ADC_CHANNEL_2_PIN PC3 #define ADC_CHANNEL_3_PIN PC1 #define ADC_CHANNEL_4_PIN PC0 +#define ADC_CHANNEL_5_PIN PA4 //VBAT2 +#define ADC_CHANNEL_6_PIN PC5 //CURR2 #define VBAT_ADC_CHANNEL ADC_CHN_1 #define CURRENT_METER_ADC_CHANNEL ADC_CHN_2 diff --git a/src/main/target/SPRACINGF3/target.h b/src/main/target/SPRACINGF3/target.h index 05727f5d42..3b506c86b4 100644 --- a/src/main/target/SPRACINGF3/target.h +++ b/src/main/target/SPRACINGF3/target.h @@ -93,6 +93,11 @@ #define CURRENT_METER_ADC_CHANNEL ADC_CHN_2 #define RSSI_ADC_CHANNEL ADC_CHN_3 +#define USE_DJI_HD_OSD +#define USE_OSD +#undef USE_CMS +#undef CMS_MENU_OSD + #define USE_LED_STRIP #define WS2811_PIN PA8 diff --git a/src/main/target/common.h b/src/main/target/common.h index b76bdf4d3b..c403b78ecd 100755 --- a/src/main/target/common.h +++ b/src/main/target/common.h @@ -54,6 +54,7 @@ #define USE_BLACKBOX #define USE_GPS #define USE_GPS_PROTO_UBLOX +#define USE_GPS_PROTO_MSP #define USE_NAV #define USE_TELEMETRY #define USE_TELEMETRY_LTM @@ -93,8 +94,10 @@ #define USE_OPFLOW_CXOF #define USE_OPFLOW_MSP +// Allow default airspeed sensors #define USE_PITOT #define USE_PITOT_MS4525 +#define USE_PITOT_MSP #define USE_1WIRE #define USE_1WIRE_DS2482 @@ -124,6 +127,14 @@ #define USE_I2C_IO_EXPANDER +#define USE_SERIALRX_SRXL2 // Spektrum SRXL2 protocol +#define USE_TELEMETRY_SRXL +#define USE_SPEKTRUM_CMS_TELEMETRY +//#define USE_SPEKTRUM_VTX_CONTROL //Some functions from betaflight still not implemented +#define USE_SPEKTRUM_VTX_TELEMETRY + +#define USE_VTX_COMMON + #else // FLASH_SIZE < 256 #define LOG_LEVEL_MAXIMUM LOG_LEVEL_ERROR #endif diff --git a/src/main/target/common_post.h b/src/main/target/common_post.h index 32b6e3531a..d3c56bc596 100644 --- a/src/main/target/common_post.h +++ b/src/main/target/common_post.h @@ -35,6 +35,15 @@ #define USE_CANVAS #endif +// Enable MSP BARO & MAG drivers if BARO and MAG sensors are compiled in +#if defined(USE_MAG) +#define USE_MAG_MSP +#endif + +#if defined(USE_BARO) +#define USE_BARO_MSP +#endif + #ifdef USE_ESC_SENSOR #define USE_RPM_FILTER #endif diff --git a/src/main/target/link/stm32_flash_F303_128k.ld b/src/main/target/link/stm32_flash_F303_128k.ld deleted file mode 100644 index 4274fb4a45..0000000000 --- a/src/main/target/link/stm32_flash_F303_128k.ld +++ /dev/null @@ -1,30 +0,0 @@ -/* -***************************************************************************** -** -** File : stm32_flash.ld -** -** Abstract : Linker script for STM32F30x Device with -** 128KByte FLASH and 40KByte RAM -** -***************************************************************************** -*/ - -/* Stack & Heap sizes */ -_Min_Heap_Size = 0; -_Min_Stack_Size = 0x1800; - -/* Specify the memory areas. */ -MEMORY -{ - FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 126K - FLASH_CONFIG (r) : ORIGIN = 0x0801F800, LENGTH = 2K - - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 40K - CCM (xrw) : ORIGIN = 0x10000000, LENGTH = 8K - MEMORY_B1 (rx) : ORIGIN = 0x60000000, LENGTH = 0K -} - -REGION_ALIAS("STACKRAM", CCM) -REGION_ALIAS("FASTRAM", CCM) - -INCLUDE "stm32_flash.ld" diff --git a/src/main/target/link/stm32_flash_F303_256k.ld b/src/main/target/link/stm32_flash_F303_256k.ld deleted file mode 100644 index 1917843495..0000000000 --- a/src/main/target/link/stm32_flash_F303_256k.ld +++ /dev/null @@ -1,30 +0,0 @@ -/* -***************************************************************************** -** -** File : stm32_flash.ld -** -** Abstract : Linker script for STM32F30x Device with -** 256KByte FLASH and 40KByte RAM -** -***************************************************************************** -*/ - -/* Stack & Heap sizes */ -_Min_Heap_Size = 0; -_Min_Stack_Size = 0x1800; - -/* Specify the memory areas. */ -MEMORY -{ - FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 250K - FLASH_CONFIG (r) : ORIGIN = 0x0803E800, LENGTH = 6K - - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 40K - CCM (xrw) : ORIGIN = 0x10000000, LENGTH = 8K - MEMORY_B1 (rx) : ORIGIN = 0x60000000, LENGTH = 0K -} - -REGION_ALIAS("STACKRAM", CCM) -REGION_ALIAS("FASTRAM", CCM) - -INCLUDE "stm32_flash.ld" diff --git a/src/main/target/link/stm32_flash_F405.ld b/src/main/target/link/stm32_flash_F405.ld deleted file mode 100644 index 66721aee5f..0000000000 --- a/src/main/target/link/stm32_flash_F405.ld +++ /dev/null @@ -1,40 +0,0 @@ -/* -***************************************************************************** -** -** File : stm32_flash_f405.ld -** -** Abstract : Linker script for STM32F405RG Device with -** 1024KByte FLASH, 128KByte RAM 64KByte CCM (RAM) -** -***************************************************************************** -*/ - -/* Stack & Heap sizes */ -_Min_Heap_Size = 0; -_Min_Stack_Size = 0x1800; - -/* Entry Point */ -ENTRY(Reset_Handler) - -/* -0x08000000 to 0x08100000 1024K full flash, -0x08000000 to 0x080DFFFF 896K firmware, -0x080E0000 to 0x08100000 128K config, // FLASH_Sector_11 -*/ - -/* Specify the memory areas */ -MEMORY -{ - FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 896K - FLASH_CONFIG (r) : ORIGIN = 0x080E0000, LENGTH = 128K - - RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 128K - CCM (rwx) : ORIGIN = 0x10000000, LENGTH = 64K - BACKUP_SRAM (rwx) : ORIGIN = 0x40024000, LENGTH = 4K - MEMORY_B1 (rx) : ORIGIN = 0x60000000, LENGTH = 0K -} - -REGION_ALIAS("STACKRAM", CCM) -REGION_ALIAS("FASTRAM", CCM) - -INCLUDE "stm32_flash.ld" diff --git a/src/main/target/link/stm32_flash_F405_bl.ld b/src/main/target/link/stm32_flash_F405_bl.ld deleted file mode 100644 index 6ae82e6f8a..0000000000 --- a/src/main/target/link/stm32_flash_F405_bl.ld +++ /dev/null @@ -1,43 +0,0 @@ -/* -***************************************************************************** -** -** File : stm32_flash_f405.ld -** -** Abstract : Linker script for STM32F405RG Device with -** 1024KByte FLASH, 128KByte RAM 64KByte CCM (RAM) -** -***************************************************************************** -*/ - -/* Stack & Heap sizes */ -_Min_Heap_Size = 0; -_Min_Stack_Size = 0x1800; - -/* Entry Point */ -ENTRY(Reset_Handler) - -/* -0x08000000 to 0x08100000 1024K full flash, -0x08000000 to 0x080DFFFF 896K firmware, -0x080E0000 to 0x08100000 128K config, // FLASH_Sector_11 -*/ - -/* Specify the memory areas */ -MEMORY -{ - FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 32K - FIRMWARE (rx) : ORIGIN = 0x08008000, LENGTH = 864K - FLASH_CONFIG (r) : ORIGIN = 0x080E0000, LENGTH = 128K - - RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 128K - CCM (rwx) : ORIGIN = 0x10000000, LENGTH = 64K - BACKUP_SRAM (rwx) : ORIGIN = 0x40024000, LENGTH = 4K - MEMORY_B1 (rx) : ORIGIN = 0x60000000, LENGTH = 0K -} - -REGION_ALIAS("STACKRAM", CCM) -REGION_ALIAS("FASTRAM", CCM) - -__firmware_start = ORIGIN(FIRMWARE); - -INCLUDE "stm32_flash.ld" diff --git a/src/main/target/link/stm32_flash_F405_for_bl.ld b/src/main/target/link/stm32_flash_F405_for_bl.ld deleted file mode 100644 index c2a60a1429..0000000000 --- a/src/main/target/link/stm32_flash_F405_for_bl.ld +++ /dev/null @@ -1,42 +0,0 @@ -/* -***************************************************************************** -** -** File : stm32_flash_f405.ld -** -** Abstract : Linker script for STM32F405RG Device with -** 1024KByte FLASH, 128KByte RAM 64KByte CCM (RAM) -** -***************************************************************************** -*/ - -/* Stack & Heap sizes */ -_Min_Heap_Size = 0; -_Min_Stack_Size = 0x1800; - -/* Entry Point */ -ENTRY(Reset_Handler) - -/* -0x08000000 to 0x08100000 1024K full flash, -0x08000000 to 0x080DFFFF 896K firmware, -0x080E0000 to 0x08100000 128K config, // FLASH_Sector_11 -*/ - -/* Specify the memory areas */ -MEMORY -{ - FLASH (rx) : ORIGIN = 0x08008000, LENGTH = 864K - FLASH_CONFIG (r) : ORIGIN = 0x080E0000, LENGTH = 128K - - RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 128K - CCM (rwx) : ORIGIN = 0x10000000, LENGTH = 64K - BACKUP_SRAM (rwx) : ORIGIN = 0x40024000, LENGTH = 4K - MEMORY_B1 (rx) : ORIGIN = 0x60000000, LENGTH = 0K -} - -REGION_ALIAS("STACKRAM", CCM) -REGION_ALIAS("FASTRAM", CCM) - -__firmware_start = ORIGIN(FLASH); - -INCLUDE "stm32_flash.ld" diff --git a/src/main/target/link/stm32_flash_F405_opbl.ld b/src/main/target/link/stm32_flash_F405_opbl.ld deleted file mode 100644 index d12578f7db..0000000000 --- a/src/main/target/link/stm32_flash_F405_opbl.ld +++ /dev/null @@ -1,40 +0,0 @@ -/* -***************************************************************************** -** -** File : stm32_flash_f405.ld -** -** Abstract : Linker script for STM32F405RG Device with -** 1024KByte FLASH, 128KByte RAM 64KByte CCM (RAM) -** -***************************************************************************** -*/ - -/* Stack & Heap sizes */ -_Min_Heap_Size = 0; -_Min_Stack_Size = 0x1800; - -/* Entry Point */ -ENTRY(Reset_Handler) - -/* -0x08000000 to 0x08100000 1024K full flash, -0x08000000 to 0x08004000 16K OPBL, -0x08004000 to 0x080DFFFF 880K firmware, -0x080E0000 to 0x08100000 128K config, // FLASH_Sector_11 -*/ - -/* Specify the memory areas */ -MEMORY -{ - FLASH (rx) : ORIGIN = 0x08004000, LENGTH = 880K - FLASH_CONFIG (r): ORIGIN = 0x080E0000, LENGTH = 128K - - RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 128K - CCM (rwx) : ORIGIN = 0x10000000, LENGTH = 64K - MEMORY_B1 (rx) : ORIGIN = 0x60000000, LENGTH = 0K -} - -REGION_ALIAS("STACKRAM", CCM) -REGION_ALIAS("FASTRAM", CCM) - -INCLUDE "stm32_flash.ld" \ No newline at end of file diff --git a/src/main/target/link/stm32_flash_F411.ld b/src/main/target/link/stm32_flash_F411.ld deleted file mode 100644 index 0326840b34..0000000000 --- a/src/main/target/link/stm32_flash_F411.ld +++ /dev/null @@ -1,40 +0,0 @@ -/* -***************************************************************************** -** -** File : stm32_flash_f411.ld -** -** Abstract : Linker script for STM32F11 Device with -** 512KByte FLASH, 128KByte RAM -** -***************************************************************************** -*/ - -/* Stack & Heap sizes */ -_Min_Heap_Size = 0; -_Min_Stack_Size = 0x1800; - -/* Entry Point */ -ENTRY(Reset_Handler) - -/* -0x08000000 to 0x0807FFFF 512K full flash, -0x08000000 to 0x08003FFF 16K isr vector, startup code, -0x08004000 to 0x08007FFF 16K config, // FLASH_Sector_1 -0x08008000 to 0x0807FFFF 480K firmware, -*/ - -/* Specify the memory areas */ -MEMORY -{ - FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 16K - FLASH_CONFIG (r) : ORIGIN = 0x08004000, LENGTH = 16K - FLASH1 (rx) : ORIGIN = 0x08008000, LENGTH = 480K - - RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 128K - MEMORY_B1 (rx) : ORIGIN = 0x60000000, LENGTH = 0K -} - -REGION_ALIAS("STACKRAM", RAM) -REGION_ALIAS("FASTRAM", RAM) - -INCLUDE "stm32_flash_split.ld" diff --git a/src/main/target/link/stm32_flash_F411_opbl.ld b/src/main/target/link/stm32_flash_F411_opbl.ld deleted file mode 100644 index af264a87e1..0000000000 --- a/src/main/target/link/stm32_flash_F411_opbl.ld +++ /dev/null @@ -1,40 +0,0 @@ -/* -***************************************************************************** -** -** File : stm32_flash_f411.ld -** -** Abstract : Linker script for STM32F411 Device with -** 512KByte FLASH, 128KByte RAM -** -***************************************************************************** -*/ - -/* Stack & Heap sizes */ -_Min_Heap_Size = 0; -_Min_Stack_Size = 0x1800; - -/* Entry Point */ -ENTRY(Reset_Handler) - -/* -0x08000000 to 0x08080000 512K full flash, -0x08000000 to 0x08004000 16K OPBL, -0x08004000 to 0x0805FFFF 368K firmware, -0x08060000 to 0x08080000 128K config, -*/ - -/* Specify the memory areas */ -MEMORY -{ - FLASH (rx) : ORIGIN = 0x08004000, LENGTH = 368K - FLASH_CONFIG (r) : ORIGIN = 0x08060000, LENGTH = 128K - - RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 128K - CCM (xrw) : ORIGIN = 0x10000000, LENGTH = 64K - MEMORY_B1 (rx) : ORIGIN = 0x60000000, LENGTH = 0K -} - -REGION_ALIAS("STACKRAM", CCM) -REGION_ALIAS("FASTRAM", CCM) - -INCLUDE "stm32_flash.ld" \ No newline at end of file diff --git a/src/main/target/link/stm32_flash_F427.ld b/src/main/target/link/stm32_flash_F427.ld deleted file mode 100644 index 8c080f38e7..0000000000 --- a/src/main/target/link/stm32_flash_F427.ld +++ /dev/null @@ -1,59 +0,0 @@ -/* -***************************************************************************** -** -** File : stm32_flash.ld -** -** Abstract : Linker script for STM32F427 Device with -** 2048 KByte FLASH, 192KByte RAM -** -** Set heap size, stack size and stack location according -** to application requirements. -** -** Set memory bank area and size if external memory is used. -** -** Target : STMicroelectronics STM32 -** -** Environment : Atollic TrueSTUDIO(R) -** -** Distribution: The file is distributed as is, without any warranty -** of any kind. -** -** (c)Copyright Atollic AB. -** You may use this file as-is or modify it according to the needs of your -** project. Distribution of this file (unmodified or modified) is not -** permitted. Atollic AB permit registered Atollic TrueSTUDIO(R) users the -** rights to distribute the assembled, compiled & linked contents of this -** file as part of an application binary file, provided that it is built -** using the Atollic TrueSTUDIO(R) toolchain. -** -***************************************************************************** -*/ - -/* Stack & Heap sizes */ -_Min_Heap_Size = 0; -_Min_Stack_Size = 0x1800; - -/* Entry Point */ -ENTRY(Reset_Handler) - -/* -0x08000000 to 0x08100000 1024K full flash, -0x08000000 to 0x080DFFFF 896K firmware, -0x080E0000 to 0x08100000 128K config, // FLASH_Sector_11 -*/ - -/* Specify the memory areas */ -MEMORY -{ - FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 896K - FLASH_CONFIG (r) : ORIGIN = 0x080E0000, LENGTH = 128K - - RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 128K - CCM (rwx) : ORIGIN = 0x10000000, LENGTH = 64K - MEMORY_B1 (rx) : ORIGIN = 0x60000000, LENGTH = 0K -} - -REGION_ALIAS("STACKRAM", CCM) -REGION_ALIAS("FASTRAM", CCM) - -INCLUDE "stm32_flash.ld" diff --git a/src/main/target/link/stm32_flash_F446.ld b/src/main/target/link/stm32_flash_F446.ld deleted file mode 100644 index 1128fa3506..0000000000 --- a/src/main/target/link/stm32_flash_F446.ld +++ /dev/null @@ -1,40 +0,0 @@ -/* -***************************************************************************** -** -** File : stm32_flash_f411.ld -** -** Abstract : Linker script for STM32F11 Device with -** 512KByte FLASH, 128KByte RAM -** -***************************************************************************** -*/ - -/* Stack & Heap sizes */ -_Min_Heap_Size = 0; -_Min_Stack_Size = 0x1800; - -/* Entry Point */ -ENTRY(Reset_Handler) - -/* -0x08000000 to 0x0807FFFF 512K full flash, -0x08000000 to 0x08003FFF 16K isr vector, startup code, -0x08004000 to 0x08007FFF 16K config, // FLASH_Sector_1 -0x08008000 to 0x0807FFFF 480K firmware, -*/ - -/* Specify the memory areas */ -MEMORY -{ - FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 16K - FLASH_CONFIG (r) : ORIGIN = 0x08004000, LENGTH = 16K - FLASH1 (rx) : ORIGIN = 0x08008000, LENGTH = 480K - - RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 128K - MEMORY_B1 (rx) : ORIGIN = 0x60000000, LENGTH = 0K -} - -REGION_ALIAS("STACKRAM", RAM) -REGION_ALIAS("FASTRAM", RAM) - -INCLUDE "stm32_flash_split.ld" \ No newline at end of file diff --git a/src/main/target/link/stm32_flash_F746.ld b/src/main/target/link/stm32_flash_F746.ld deleted file mode 100644 index 443c72837a..0000000000 --- a/src/main/target/link/stm32_flash_F746.ld +++ /dev/null @@ -1,47 +0,0 @@ -/* -***************************************************************************** -** -** File : stm32_flash_f746.ld -** -** Abstract : Linker script for STM32F746VGTx Device with -** 1024KByte FLASH, 320KByte RAM -** -***************************************************************************** -*/ - -/* Stack & Heap sizes */ -_Min_Heap_Size = 0; -_Min_Stack_Size = 0x1800; - -/* Entry Point */ -ENTRY(Reset_Handler) - -/* -0x08000000 to 0x080FFFFF 1024K full flash, -0x08000000 to 0x08007FFF 32K isr vector, startup code, -0x08008000 to 0x0800FFFF 32K config, // FLASH_Sector_1 -0x08010000 to 0x080FFFFF 960K firmware, -*/ - -/* Specify the memory areas */ -MEMORY -{ - ITCM_RAM (rx) : ORIGIN = 0x00000000, LENGTH = 16K - ITCM_FLASH (rx) : ORIGIN = 0x00200000, LENGTH = 32K - /* config occupies the entire flash sector 1 for the ease of erasure, 32K on F74x */ - ITCM_FLASH_CONFIG (r) : ORIGIN = 0x00208000, LENGTH = 32K - ITCM_FLASH1 (rx) : ORIGIN = 0x00210000, LENGTH = 960K - - FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 32K - FLASH_CONFIG (r) : ORIGIN = 0x08008000, LENGTH = 32K - FLASH1 (rx) : ORIGIN = 0x08010000, LENGTH = 960K - - TCM (rwx) : ORIGIN = 0x20000000, LENGTH = 64K - RAM (rwx) : ORIGIN = 0x20010000, LENGTH = 256K - MEMORY_B1 (rx) : ORIGIN = 0x60000000, LENGTH = 0K -} -/* note CCM could be used for stack */ -REGION_ALIAS("STACKRAM", TCM) -REGION_ALIAS("FASTRAM", TCM) - -INCLUDE "stm32_flash_f7_split.ld" diff --git a/src/main/target/link/stm32_flash_F7x2.ld b/src/main/target/link/stm32_flash_F7x2.ld deleted file mode 100644 index 296708678d..0000000000 --- a/src/main/target/link/stm32_flash_F7x2.ld +++ /dev/null @@ -1,48 +0,0 @@ -/* -***************************************************************************** -** -** File : stm32_flash_f722.ld -** -** Abstract : Linker script for STM32F722RETx Device with -** 512KByte FLASH, 256KByte RAM -** -***************************************************************************** -*/ - -/* Stack & Heap sizes */ -_Min_Heap_Size = 0; -_Min_Stack_Size = 0x1800; - -/* Entry Point */ -ENTRY(Reset_Handler) - -/* -0x08000000 to 0x0807FFFF 512K full flash, -0x08000000 to 0x08003FFF 16K isr vector, startup code, -0x08004000 to 0x08007FFF 16K config, // FLASH_Sector_1 -0x08008000 to 0x0807FFFF 480K firmware, -*/ - -/* Specify the memory areas */ -MEMORY -{ - ITCM_RAM (rwx) : ORIGIN = 0x00000000, LENGTH = 16K - - ITCM_FLASH (rx) : ORIGIN = 0x00200000, LENGTH = 16K - /* config occupies the entire flash sector 1 for the ease of erasure, 16K on F72x */ - ITCM_FLASH_CONFIG (r) : ORIGIN = 0x00204000, LENGTH = 16K - ITCM_FLASH1 (rx) : ORIGIN = 0x00208000, LENGTH = 480K - - FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 16K - FLASH_CONFIG (r) : ORIGIN = 0x08004000, LENGTH = 16K - FLASH1 (rx) : ORIGIN = 0x08008000, LENGTH = 480K - - TCM (rwx) : ORIGIN = 0x20000000, LENGTH = 64K - RAM (rwx) : ORIGIN = 0x20010000, LENGTH = 192K - MEMORY_B1 (rx) : ORIGIN = 0x60000000, LENGTH = 0K -} - -REGION_ALIAS("STACKRAM", TCM) -REGION_ALIAS("FASTRAM", TCM) - -INCLUDE "stm32_flash_f7_split.ld" diff --git a/src/main/target/link/stm32_flash_F7x2_bl.ld b/src/main/target/link/stm32_flash_F7x2_bl.ld deleted file mode 100644 index 5bfd3ba491..0000000000 --- a/src/main/target/link/stm32_flash_F7x2_bl.ld +++ /dev/null @@ -1,50 +0,0 @@ -/* -***************************************************************************** -** -** File : stm32_flash_f722.ld -** -** Abstract : Linker script for STM32F722RETx Device with -** 512KByte FLASH, 256KByte RAM -** -***************************************************************************** -*/ - -/* Stack & Heap sizes */ -_Min_Heap_Size = 0; -_Min_Stack_Size = 0x1800; - -/* Entry Point */ -ENTRY(Reset_Handler) - -/* -0x08000000 to 0x0807FFFF 512K full flash, -0x08000000 to 0x08003FFF 16K isr vector, startup code, -0x08004000 to 0x08007FFF 16K config, // FLASH_Sector_1 -0x08008000 to 0x0807FFFF 480K firmware, -*/ - -/* Specify the memory areas */ -MEMORY -{ - ITCM_RAM (rwx) : ORIGIN = 0x00000000, LENGTH = 16K - - ITCM_FLASH (rx) : ORIGIN = 0x00200000, LENGTH = 16K - /* config occupies the entire flash sector 1 for the ease of erasure, 16K on F72x */ - ITCM_FLASH_CONFIG (r) : ORIGIN = 0x00204000, LENGTH = 16K - ITCM_FLASH1 (rx) : ORIGIN = 0x00208000, LENGTH = 480K - - FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 32K - FIRMWARE (rx) : ORIGIN = 0x08008000, LENGTH = 16K - FLASH_CONFIG (r) : ORIGIN = 0x0800c000, LENGTH = 16K - - TCM (rwx) : ORIGIN = 0x20000000, LENGTH = 64K - RAM (rwx) : ORIGIN = 0x20010000, LENGTH = 192K - MEMORY_B1 (rx) : ORIGIN = 0x60000000, LENGTH = 0K -} - -REGION_ALIAS("STACKRAM", TCM) -REGION_ALIAS("FASTRAM", TCM) - -__firmware_start = ORIGIN(FIRMWARE); - -INCLUDE "stm32_flash_f7.ld" diff --git a/src/main/target/link/stm32_flash_F7x2_for_bl.ld b/src/main/target/link/stm32_flash_F7x2_for_bl.ld deleted file mode 100644 index 83c9a43fc5..0000000000 --- a/src/main/target/link/stm32_flash_F7x2_for_bl.ld +++ /dev/null @@ -1,50 +0,0 @@ -/* -***************************************************************************** -** -** File : stm32_flash_f722.ld -** -** Abstract : Linker script for STM32F722RETx Device with -** 512KByte FLASH, 256KByte RAM -** -***************************************************************************** -*/ - -/* Stack & Heap sizes */ -_Min_Heap_Size = 0; -_Min_Stack_Size = 0x1800; - -/* Entry Point */ -ENTRY(Reset_Handler) - -/* -0x08000000 to 0x0807FFFF 512K full flash, -0x08000000 to 0x08003FFF 16K isr vector, startup code, -0x08004000 to 0x08007FFF 16K config, // FLASH_Sector_1 -0x08008000 to 0x0807FFFF 480K firmware, -*/ - -/* Specify the memory areas */ -MEMORY -{ - ITCM_RAM (rwx) : ORIGIN = 0x00000000, LENGTH = 16K - - /*ITCM_FLASH (rx) : ORIGIN = 0x00200000, LENGTH = 16K*/ - /* config occupies the entire flash sector 1 for the ease of erasure, 16K on F72x */ - /*ITCM_FLASH_CONFIG (r) : ORIGIN = 0x00204000, LENGTH = 16K*/ - /*ITCM_FLASH1 (rx) : ORIGIN = 0x00208000, LENGTH = 480K*/ - - FLASH (rx) : ORIGIN = 0x08008000, LENGTH = 16K - FLASH_CONFIG (r) : ORIGIN = 0x0800c000, LENGTH = 16K - FLASH1 (rx) : ORIGIN = 0x08010000, LENGTH = 448K - - TCM (rwx) : ORIGIN = 0x20000000, LENGTH = 64K - RAM (rwx) : ORIGIN = 0x20010000, LENGTH = 192K - MEMORY_B1 (rx) : ORIGIN = 0x60000000, LENGTH = 0K -} - -REGION_ALIAS("STACKRAM", TCM) -REGION_ALIAS("FASTRAM", TCM) - -__firmware_start = ORIGIN(FLASH); - -INCLUDE "stm32_flash_f7_split.ld" diff --git a/src/main/target/link/stm32_flash_F7x5xG.ld b/src/main/target/link/stm32_flash_F7x5xG.ld deleted file mode 100644 index a83374e4e4..0000000000 --- a/src/main/target/link/stm32_flash_F7x5xG.ld +++ /dev/null @@ -1,48 +0,0 @@ -/* -***************************************************************************** -** -** File : stm32_flash_f745.ld -** -** Abstract : Linker script for STM32F745VGTx Device with -** 1024KByte FLASH, 320KByte RAM -** -***************************************************************************** -*/ - -/* Stack & Heap sizes */ -_Min_Heap_Size = 0; -_Min_Stack_Size = 0x1800; - -/* Entry Point */ -ENTRY(Reset_Handler) - -/* -0x00000000 to 0x00003FFF 16K ITCM RAM, -0x08000000 to 0x080FFFFF 1024K full flash, -0x08000000 to 0x08007FFF 32K isr vector, startup code, -0x08008000 to 0x0800FFFF 32K config, // FLASH_Sector_1 -0x08010000 to 0x080FFFFF 960K firmware, -*/ - -/* Specify the memory areas */ -MEMORY -{ - ITCM_RAM (rx) : ORIGIN = 0x00000000, LENGTH = 16K - ITCM_FLASH (rx) : ORIGIN = 0x00200000, LENGTH = 32K - /* config occupies the entire flash sector 1 for the ease of erasure, 32K on F74x */ - ITCM_FLASH_CONFIG (r) : ORIGIN = 0x00208000, LENGTH = 32K - ITCM_FLASH1 (rx) : ORIGIN = 0x00210000, LENGTH = 960K - - FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 32K - FLASH_CONFIG (r) : ORIGIN = 0x08008000, LENGTH = 32K - FLASH1 (rx) : ORIGIN = 0x08010000, LENGTH = 960K - - TCM (rwx) : ORIGIN = 0x20000000, LENGTH = 64K - RAM (rwx) : ORIGIN = 0x20010000, LENGTH = 256K - MEMORY_B1 (rx) : ORIGIN = 0x60000000, LENGTH = 0K -} -/* note CCM could be used for stack */ -REGION_ALIAS("STACKRAM", TCM) -REGION_ALIAS("FASTRAM", TCM) - -INCLUDE "stm32_flash_f7_split.ld" diff --git a/src/main/target/link/stm32_flash_F7x5xG_bl.ld b/src/main/target/link/stm32_flash_F7x5xG_bl.ld deleted file mode 100644 index d357aad98d..0000000000 --- a/src/main/target/link/stm32_flash_F7x5xG_bl.ld +++ /dev/null @@ -1,50 +0,0 @@ -/* -***************************************************************************** -** -** File : stm32_flash_f745.ld -** -** Abstract : Linker script for STM32F745VGTx Device with -** 1024KByte FLASH, 320KByte RAM -** -***************************************************************************** -*/ - -/* Stack & Heap sizes */ -_Min_Heap_Size = 0; -_Min_Stack_Size = 0x1800; - -/* Entry Point */ -ENTRY(Reset_Handler) - -/* -0x00000000 to 0x00003FFF 16K ITCM RAM, -0x08000000 to 0x080FFFFF 1024K full flash, -0x08000000 to 0x08007FFF 32K isr vector, startup code, -0x08008000 to 0x0800FFFF 32K config, // FLASH_Sector_1 -0x08010000 to 0x080FFFFF 960K firmware, -*/ - -/* Specify the memory areas */ -MEMORY -{ - ITCM_RAM (rx) : ORIGIN = 0x00000000, LENGTH = 16K - ITCM_FLASH (rx) : ORIGIN = 0x00200000, LENGTH = 32K - /* config occupies the entire flash sector 1 for the ease of erasure, 32K on F74x */ - ITCM_FLASH_CONFIG (r) : ORIGIN = 0x00208000, LENGTH = 32K - ITCM_FLASH1 (rx) : ORIGIN = 0x00210000, LENGTH = 928K - - FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 32K - FIRMWARE (rx) : ORIGIN = 0x08008000, LENGTH = 32K - FLASH_CONFIG (r) : ORIGIN = 0x08010000, LENGTH = 32K - - TCM (rwx) : ORIGIN = 0x20000000, LENGTH = 64K - RAM (rwx) : ORIGIN = 0x20010000, LENGTH = 256K - MEMORY_B1 (rx) : ORIGIN = 0x60000000, LENGTH = 0K -} -/* note CCM could be used for stack */ -REGION_ALIAS("STACKRAM", TCM) -REGION_ALIAS("FASTRAM", TCM) - -__firmware_start = ORIGIN(FIRMWARE); - -INCLUDE "stm32_flash_f7.ld" diff --git a/src/main/target/link/stm32_flash_F7x5xG_for_bl.ld b/src/main/target/link/stm32_flash_F7x5xG_for_bl.ld deleted file mode 100644 index c7667d1dc2..0000000000 --- a/src/main/target/link/stm32_flash_F7x5xG_for_bl.ld +++ /dev/null @@ -1,50 +0,0 @@ -/* -***************************************************************************** -** -** File : stm32_flash_f745.ld -** -** Abstract : Linker script for STM32F745VGTx Device with -** 1024KByte FLASH, 320KByte RAM -** -***************************************************************************** -*/ - -/* Stack & Heap sizes */ -_Min_Heap_Size = 0; -_Min_Stack_Size = 0x1800; - -/* Entry Point */ -ENTRY(Reset_Handler) - -/* -0x00000000 to 0x00003FFF 16K ITCM RAM, -0x08000000 to 0x080FFFFF 1024K full flash, -0x08000000 to 0x08007FFF 32K isr vector, startup code, -0x08008000 to 0x0800FFFF 32K config, // FLASH_Sector_1 -0x08010000 to 0x080FFFFF 960K firmware, -*/ - -/* Specify the memory areas */ -MEMORY -{ - ITCM_RAM (rx) : ORIGIN = 0x00000000, LENGTH = 16K - ITCM_FLASH (rx) : ORIGIN = 0x00200000, LENGTH = 32K - /* config occupies the entire flash sector 1 for the ease of erasure, 32K on F74x */ - ITCM_FLASH_CONFIG (r) : ORIGIN = 0x00208000, LENGTH = 32K - ITCM_FLASH1 (rx) : ORIGIN = 0x00210000, LENGTH = 960K - - FLASH (rx) : ORIGIN = 0x08008000, LENGTH = 32K - FLASH_CONFIG (r) : ORIGIN = 0x08010000, LENGTH = 32K - FLASH1 (rx) : ORIGIN = 0x08018000, LENGTH = 928K - - TCM (rwx) : ORIGIN = 0x20000000, LENGTH = 64K - RAM (rwx) : ORIGIN = 0x20010000, LENGTH = 256K - MEMORY_B1 (rx) : ORIGIN = 0x60000000, LENGTH = 0K -} -/* note CCM could be used for stack */ -REGION_ALIAS("STACKRAM", TCM) -REGION_ALIAS("FASTRAM", TCM) - -__firmware_start = ORIGIN(FLASH); - -INCLUDE "stm32_flash_f7_split.ld" diff --git a/src/main/telemetry/mavlink.c b/src/main/telemetry/mavlink.c old mode 100755 new mode 100644 index 2a6f4f8b5a..b5725a19b2 --- a/src/main/telemetry/mavlink.c +++ b/src/main/telemetry/mavlink.c @@ -23,6 +23,7 @@ #include #include #include +#include #include "platform.h" @@ -35,16 +36,21 @@ #include "common/color.h" #include "common/maths.h" #include "common/utils.h" +#include "common/string_light.h" #include "config/feature.h" #include "drivers/serial.h" #include "drivers/time.h" +#include "drivers/display.h" +#include "drivers/osd_symbols.h" #include "fc/config.h" #include "fc/fc_core.h" #include "fc/rc_controls.h" +#include "fc/rc_modes.h" #include "fc/runtime_config.h" +#include "fc/settings.h" #include "flight/failsafe.h" #include "flight/imu.h" @@ -55,8 +61,10 @@ #include "io/gps.h" #include "io/ledstrip.h" #include "io/serial.h" +#include "io/osd.h" #include "navigation/navigation.h" +#include "navigation/navigation_private.h" #include "rx/rx.h" @@ -66,11 +74,18 @@ #include "sensors/boardalignment.h" #include "sensors/gyro.h" #include "sensors/pitotmeter.h" +#include "sensors/diagnostics.h" #include "sensors/sensors.h" +#include "sensors/temperature.h" +#include "sensors/esc_sensor.h" #include "telemetry/mavlink.h" #include "telemetry/telemetry.h" +#include "blackbox/blackbox_io.h" + +#include "scheduler/scheduler.h" + // mavlink library uses unnames unions that's causes GCC to complain if -Wpedantic is used // until this is resolved in mavlink library - ignore -Wpedantic for mavlink code #pragma GCC diagnostic push @@ -148,7 +163,8 @@ static uint8_t mavRates[] = { [MAV_DATA_STREAM_RC_CHANNELS] = 5, // 5Hz [MAV_DATA_STREAM_POSITION] = 2, // 2Hz [MAV_DATA_STREAM_EXTRA1] = 10, // 10Hz - [MAV_DATA_STREAM_EXTRA2] = 2 // 2Hz + [MAV_DATA_STREAM_EXTRA2] = 2, // 2Hz + [MAV_DATA_STREAM_EXTRA3] = 1 // 1Hz }; #define MAXSTREAMS (sizeof(mavRates) / sizeof(mavRates[0])) @@ -162,7 +178,7 @@ static mavlink_status_t mavRecvStatus; static uint8_t mavSystemId = 1; static uint8_t mavComponentId = MAV_COMP_ID_SYSTEM_CONTROL; -APM_COPTER_MODE inavToArduCopterMap(flightModeForTelemetry_e flightMode) +static APM_COPTER_MODE inavToArduCopterMap(flightModeForTelemetry_e flightMode) { switch (flightMode) { @@ -175,12 +191,22 @@ APM_COPTER_MODE inavToArduCopterMap(flightModeForTelemetry_e flightMode) case FLM_RTH: return COPTER_MODE_RTL; case FLM_MISSION: return COPTER_MODE_AUTO; case FLM_LAUNCH: return COPTER_MODE_THROW; - case FLM_FAILSAFE: return COPTER_MODE_RTL; + case FLM_FAILSAFE: + { + if (failsafePhase() == FAILSAFE_RETURN_TO_HOME) { + return COPTER_MODE_RTL; + } else if (failsafePhase() == FAILSAFE_LANDING) { + return COPTER_MODE_LAND; + } else { + // There is no valid mapping to ArduCopter + return COPTER_MODE_ENUM_END; + } + } default: return COPTER_MODE_ENUM_END; } } -APM_PLANE_MODE inavToArduPlaneMap(flightModeForTelemetry_e flightMode) +static APM_PLANE_MODE inavToArduPlaneMap(flightModeForTelemetry_e flightMode) { switch (flightMode) { @@ -195,13 +221,23 @@ APM_PLANE_MODE inavToArduPlaneMap(flightModeForTelemetry_e flightMode) case FLM_MISSION: return PLANE_MODE_AUTO; case FLM_CRUISE: return PLANE_MODE_CRUISE; case FLM_LAUNCH: return PLANE_MODE_TAKEOFF; - case FLM_FAILSAFE: return PLANE_MODE_RTL; + case FLM_FAILSAFE: + { + if (failsafePhase() == FAILSAFE_RETURN_TO_HOME) { + return PLANE_MODE_RTL; + } + else if (failsafePhase() == FAILSAFE_LANDING) { + return PLANE_MODE_AUTO; + } + else { + // There is no valid mapping to ArduPlane + return PLANE_MODE_ENUM_END; + } + } default: return PLANE_MODE_ENUM_END; } } - - static int mavlinkStreamTrigger(enum MAV_DATA_STREAM streamNum) { uint8_t rate = (uint8_t) mavRates[streamNum]; @@ -265,6 +301,7 @@ static void configureMAVLinkStreamRates(void) mavRates[MAV_DATA_STREAM_POSITION] = telemetryConfig()->mavlink.position_rate; mavRates[MAV_DATA_STREAM_EXTRA1] = telemetryConfig()->mavlink.extra1_rate; mavRates[MAV_DATA_STREAM_EXTRA2] = telemetryConfig()->mavlink.extra2_rate; + mavRates[MAV_DATA_STREAM_EXTRA3] = telemetryConfig()->mavlink.extra3_rate; } void checkMAVLinkTelemetryState(void) @@ -294,35 +331,126 @@ static void mavlinkSendMessage(void) void mavlinkSendSystemStatus(void) { - uint32_t onboardControlAndSensors = 35843; + // Receiver is assumed to be always present + uint32_t onboard_control_sensors_present = (MAV_SYS_STATUS_SENSOR_RC_RECEIVER); + // GYRO and RC are assumed as minimium requirements + uint32_t onboard_control_sensors_enabled = (MAV_SYS_STATUS_SENSOR_3D_GYRO | MAV_SYS_STATUS_SENSOR_RC_RECEIVER); + uint32_t onboard_control_sensors_health = 0; - /* - onboard_control_sensors_present Bitmask - fedcba9876543210 - 1000110000000011 For all = 35843 - 0001000000000100 With Mag = 4100 - 0010000000001000 With Baro = 8200 - 0100000000100000 With GPS = 16416 - 0000001111111111 - */ + if (getHwGyroStatus() == HW_SENSOR_OK) { + onboard_control_sensors_present |= MAV_SYS_STATUS_SENSOR_3D_GYRO; + // Missing presence will report as sensor unhealthy + onboard_control_sensors_health |= MAV_SYS_STATUS_SENSOR_3D_GYRO; + } - if (sensors(SENSOR_MAG)) onboardControlAndSensors |= 4100; - if (sensors(SENSOR_BARO)) onboardControlAndSensors |= 8200; - if (sensors(SENSOR_GPS)) onboardControlAndSensors |= 16416; + hardwareSensorStatus_e accStatus = getHwAccelerometerStatus(); + if (accStatus == HW_SENSOR_OK) { + onboard_control_sensors_present |= MAV_SYS_STATUS_SENSOR_3D_ACCEL; + onboard_control_sensors_enabled |= MAV_SYS_STATUS_SENSOR_3D_ACCEL; + onboard_control_sensors_health |= MAV_SYS_STATUS_SENSOR_3D_ACCEL; + } else if (accStatus == HW_SENSOR_UNHEALTHY) { + onboard_control_sensors_present |= MAV_SYS_STATUS_SENSOR_3D_ACCEL; + onboard_control_sensors_enabled |= MAV_SYS_STATUS_SENSOR_3D_ACCEL; + } else if (accStatus == HW_SENSOR_UNAVAILABLE) { + onboard_control_sensors_enabled |= MAV_SYS_STATUS_SENSOR_3D_ACCEL; + } + + hardwareSensorStatus_e compassStatus = getHwCompassStatus(); + if (compassStatus == HW_SENSOR_OK) { + onboard_control_sensors_present |= MAV_SYS_STATUS_SENSOR_3D_MAG; + onboard_control_sensors_enabled |= MAV_SYS_STATUS_SENSOR_3D_MAG; + onboard_control_sensors_health |= MAV_SYS_STATUS_SENSOR_3D_MAG; + } else if (compassStatus == HW_SENSOR_UNHEALTHY) { + onboard_control_sensors_present |= MAV_SYS_STATUS_SENSOR_3D_MAG; + onboard_control_sensors_enabled |= MAV_SYS_STATUS_SENSOR_3D_MAG; + } else if (compassStatus == HW_SENSOR_UNAVAILABLE) { + onboard_control_sensors_enabled |= MAV_SYS_STATUS_SENSOR_3D_MAG; + } + + hardwareSensorStatus_e baroStatus = getHwBarometerStatus(); + if (baroStatus == HW_SENSOR_OK) { + onboard_control_sensors_present |= MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE; + onboard_control_sensors_enabled |= MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE; + onboard_control_sensors_health |= MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE; + } else if (baroStatus == HW_SENSOR_UNHEALTHY) { + onboard_control_sensors_present |= MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE; + onboard_control_sensors_enabled |= MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE; + } else if (baroStatus == HW_SENSOR_UNAVAILABLE) { + onboard_control_sensors_enabled |= MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE; + } + + hardwareSensorStatus_e pitotStatus = getHwPitotmeterStatus(); + if (pitotStatus == HW_SENSOR_OK) { + onboard_control_sensors_present |= MAV_SYS_STATUS_SENSOR_DIFFERENTIAL_PRESSURE; + onboard_control_sensors_enabled |= MAV_SYS_STATUS_SENSOR_DIFFERENTIAL_PRESSURE; + onboard_control_sensors_health |= MAV_SYS_STATUS_SENSOR_DIFFERENTIAL_PRESSURE; + } else if (pitotStatus == HW_SENSOR_UNHEALTHY) { + onboard_control_sensors_present |= MAV_SYS_STATUS_SENSOR_DIFFERENTIAL_PRESSURE; + onboard_control_sensors_enabled |= MAV_SYS_STATUS_SENSOR_DIFFERENTIAL_PRESSURE; + } else if (pitotStatus == HW_SENSOR_UNAVAILABLE) { + onboard_control_sensors_enabled |= MAV_SYS_STATUS_SENSOR_DIFFERENTIAL_PRESSURE; + } + + hardwareSensorStatus_e gpsStatus = getHwGPSStatus(); + if (gpsStatus == HW_SENSOR_OK) { + onboard_control_sensors_present |= MAV_SYS_STATUS_SENSOR_GPS; + onboard_control_sensors_enabled |= MAV_SYS_STATUS_SENSOR_GPS; + onboard_control_sensors_health |= MAV_SYS_STATUS_SENSOR_GPS; + } else if (gpsStatus == HW_SENSOR_UNHEALTHY) { + onboard_control_sensors_present |= MAV_SYS_STATUS_SENSOR_GPS; + onboard_control_sensors_enabled |= MAV_SYS_STATUS_SENSOR_GPS; + } else if (gpsStatus == HW_SENSOR_UNAVAILABLE) { + onboard_control_sensors_enabled |= MAV_SYS_STATUS_SENSOR_GPS; + } + + hardwareSensorStatus_e opFlowStatus = getHwOpticalFlowStatus(); + if (opFlowStatus == HW_SENSOR_OK) { + onboard_control_sensors_present |= MAV_SYS_STATUS_SENSOR_OPTICAL_FLOW; + onboard_control_sensors_enabled |= MAV_SYS_STATUS_SENSOR_OPTICAL_FLOW; + onboard_control_sensors_health |= MAV_SYS_STATUS_SENSOR_OPTICAL_FLOW; + } else if (opFlowStatus == HW_SENSOR_UNHEALTHY) { + onboard_control_sensors_present |= MAV_SYS_STATUS_SENSOR_OPTICAL_FLOW; + onboard_control_sensors_enabled |= MAV_SYS_STATUS_SENSOR_OPTICAL_FLOW; + } else if (opFlowStatus == HW_SENSOR_UNAVAILABLE) { + onboard_control_sensors_enabled |= MAV_SYS_STATUS_SENSOR_OPTICAL_FLOW; + } + + hardwareSensorStatus_e rangefinderStatus = getHwRangefinderStatus(); + if (rangefinderStatus == HW_SENSOR_OK) { + onboard_control_sensors_present |= MAV_SYS_STATUS_SENSOR_LASER_POSITION; + onboard_control_sensors_enabled |= MAV_SYS_STATUS_SENSOR_LASER_POSITION; + onboard_control_sensors_health |= MAV_SYS_STATUS_SENSOR_LASER_POSITION; + } else if (rangefinderStatus == HW_SENSOR_UNHEALTHY) { + onboard_control_sensors_present |= MAV_SYS_STATUS_SENSOR_LASER_POSITION; + onboard_control_sensors_enabled |= MAV_SYS_STATUS_SENSOR_LASER_POSITION; + } else if (rangefinderStatus == HW_SENSOR_UNAVAILABLE) { + onboard_control_sensors_enabled |= MAV_SYS_STATUS_SENSOR_LASER_POSITION; + } + + if (rxIsReceivingSignal() && rxAreFlightChannelsValid()) { + onboard_control_sensors_health |= MAV_SYS_STATUS_SENSOR_RC_RECEIVER; + } + +#ifdef USE_BLACKBOX + // BLACKBOX is assumed enabled and present for boards with capability + onboard_control_sensors_present |= MAV_SYS_STATUS_LOGGING; + onboard_control_sensors_enabled |= MAV_SYS_STATUS_LOGGING; + // Unhealthy only for cases with not enough space to record + if (!isBlackboxDeviceFull()) { + onboard_control_sensors_health |= MAV_SYS_STATUS_LOGGING; + } +#endif mavlink_msg_sys_status_pack(mavSystemId, mavComponentId, &mavSendMsg, // onboard_control_sensors_present 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 - onboardControlAndSensors, + //Value of 0: not present. Value of 1: present. Indices according MAV_SYS_STATUS_SENSOR + onboard_control_sensors_present, // onboard_control_sensors_enabled Bitmask showing which onboard controllers and sensors are enabled - onboardControlAndSensors, + onboard_control_sensors_enabled, // onboard_control_sensors_health Bitmask showing which onboard controllers and sensors are operational or have an error. - onboardControlAndSensors & 1023, + onboard_control_sensors_health, // load Maximum usage in percent of the mainloop time, (0%: 0, 100%: 1000) should be always below 1000 - 0, + constrain(averageSystemLoadPercent*10, 0, 1000), // voltage_battery Battery voltage, in millivolts (1 = 1 millivolt) feature(FEATURE_VBAT) ? getBatteryVoltage() * 10 : 0, // current_battery Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current @@ -431,14 +559,14 @@ void mavlinkSendPosition(timeUs_t currentTimeUs) #else gpsSol.llh.alt * 10, #endif - // Ground X Speed (Latitude), expressed as m/s * 100 - 0, - // Ground Y Speed (Longitude), expressed as m/s * 100 - 0, - // Ground Z Speed (Altitude), expressed as m/s * 100 - 0, - // heading Current heading in degrees, in compass units (0..360, 0=north) - DECIDEGREES_TO_DEGREES(attitude.values.yaw) + // [cm/s] Ground X Speed (Latitude, positive north) + getEstimatedActualVelocity(X), + // [cm/s] Ground Y Speed (Longitude, positive east) + getEstimatedActualVelocity(Y), + // [cm/s] Ground Z Speed (Altitude, positive down) + getEstimatedActualVelocity(Z), + // [cdeg] Vehicle heading (yaw angle) (0.0..359.99 degrees, 0=north) + DECIDEGREES_TO_CENTIDEGREES(attitude.values.yaw) ); mavlinkSendMessage(); @@ -507,6 +635,11 @@ void mavlinkSendHUDAndHeartbeat(void) } #endif + + int16_t thr = rxGetChannelValue(THROTTLE); + if (navigationIsControllingThrottle()) { + thr = rcCommand[THROTTLE]; + } mavlink_msg_vfr_hud_pack(mavSystemId, mavComponentId, &mavSendMsg, // airspeed Current airspeed in m/s mavAirSpeed, @@ -515,7 +648,7 @@ void mavlinkSendHUDAndHeartbeat(void) // heading Current heading in degrees, in compass units (0..360, 0=north) DECIDEGREES_TO_DEGREES(attitude.values.yaw), // throttle Current throttle setting in integer percent, 0 to 100 - scaleRange(constrain(rxGetChannelValue(THROTTLE), PWM_RANGE_MIN, PWM_RANGE_MAX), PWM_RANGE_MIN, PWM_RANGE_MAX, 0, 100), + scaleRange(constrain(thr, PWM_RANGE_MIN, PWM_RANGE_MAX), PWM_RANGE_MIN, PWM_RANGE_MAX, 0, 100), // alt Current altitude (MSL), in meters, if we have surface or baro use them, otherwise use GPS (less accurate) mavAltitude, // climb Current climb rate in meters/second @@ -602,6 +735,82 @@ void mavlinkSendHUDAndHeartbeat(void) mavlinkSendMessage(); } +void mavlinkSendBatteryTemperatureStatusText(void) +{ + uint16_t batteryVoltages[MAVLINK_MSG_BATTERY_STATUS_FIELD_VOLTAGES_LEN]; + memset(batteryVoltages, UINT16_MAX, sizeof(batteryVoltages)); + if (feature(FEATURE_VBAT)) { + uint8_t batteryCellCount = getBatteryCellCount(); + if (batteryCellCount > 0) { + for (int cell=0; (cell < batteryCellCount) && (cell < MAVLINK_MSG_BATTERY_STATUS_FIELD_VOLTAGES_LEN); cell++) { + batteryVoltages[cell] = getBatteryAverageCellVoltage() * 10; + } + } + else { + batteryVoltages[0] = getBatteryVoltage() * 10; + } + } + else { + batteryVoltages[0] = 0; + } + + mavlink_msg_battery_status_pack(mavSystemId, mavComponentId, &mavSendMsg, + // id Battery ID + 0, + // battery_function Function of the battery + MAV_BATTERY_FUNCTION_UNKNOWN, + // type Type (chemistry) of the battery + MAV_BATTERY_TYPE_UNKNOWN, + // temperature Temperature of the battery in centi-degrees celsius. INT16_MAX for unknown temperature + INT16_MAX, + // voltages Battery voltage of cells, in millivolts (1 = 1 millivolt). Cells above the valid cell count for this battery should have the UINT16_MAX value. + batteryVoltages, + // current_battery Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current + isAmperageConfigured() ? getAmperage() : -1, + // current_consumed Consumed charge, in milliampere hours (1 = 1 mAh), -1: autopilot does not provide mAh consumption estimate + isAmperageConfigured() ? getMAhDrawn() : -1, + // energy_consumed Consumed energy, in 100*Joules (intergrated U*I*dt) (1 = 100 Joule), -1: autopilot does not provide energy consumption estimate + isAmperageConfigured() ? getMWhDrawn()*36 : -1, + // battery_remaining Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot does not estimate the remaining battery); + feature(FEATURE_VBAT) ? calculateBatteryPercentage() : -1); + + mavlinkSendMessage(); + + + int16_t temperature; + sensors(SENSOR_BARO) ? getBaroTemperature(&temperature) : getIMUTemperature(&temperature); + mavlink_msg_scaled_pressure_pack(mavSystemId, mavComponentId, &mavSendMsg, + millis(), + 0, + 0, + temperature * 10); + + mavlinkSendMessage(); + + +// FIXME - Status text is limited to boards with USE_OSD +#ifdef USE_OSD + char buff[MAVLINK_MSG_STATUSTEXT_FIELD_TEXT_LEN] = {" "}; + textAttributes_t elemAttr = osdGetSystemMessage(buff, sizeof(buff), false); + if (buff[0] != SYM_BLANK) { + MAV_SEVERITY severity = MAV_SEVERITY_NOTICE; + if (TEXT_ATTRIBUTES_HAVE_BLINK(elemAttr)) { + severity = MAV_SEVERITY_CRITICAL; + } else if TEXT_ATTRIBUTES_HAVE_INVERTED(elemAttr) { + severity = MAV_SEVERITY_WARNING; + } + + mavlink_msg_statustext_pack(mavSystemId, mavComponentId, &mavSendMsg, + (uint8_t)severity, + buff); + + mavlinkSendMessage(); + } +#endif + + +} + void processMAVLinkTelemetry(timeUs_t currentTimeUs) { // is executed @ TELEMETRY_MAVLINK_MAXRATE rate @@ -626,6 +835,11 @@ void processMAVLinkTelemetry(timeUs_t currentTimeUs) if (mavlinkStreamTrigger(MAV_DATA_STREAM_EXTRA2)) { mavlinkSendHUDAndHeartbeat(); } + + if (mavlinkStreamTrigger(MAV_DATA_STREAM_EXTRA3)) { + mavlinkSendBatteryTemperatureStatusText(); + } + } static bool handleIncoming_MISSION_CLEAR_ALL(void) diff --git a/src/main/telemetry/srxl.c b/src/main/telemetry/srxl.c new file mode 100644 index 0000000000..8e01e47ef8 --- /dev/null +++ b/src/main/telemetry/srxl.c @@ -0,0 +1,812 @@ +/* + * This file is part of Cleanflight and Betaflight. + * + * Cleanflight and Betaflight are free software. You can redistribute + * this software and/or modify this software 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. + * + * Cleanflight and Betaflight are distributed in the hope that they + * 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 software. + * + * If not, see . + */ + +#include +#include +#include + +#include "platform.h" + +#if defined(USE_TELEMETRY_SRXL) + +#include "build/version.h" + +#include "cms/cms.h" +#include "io/displayport_srxl.h" + +#include "common/crc.h" +#include "common/streambuf.h" +#include "common/utils.h" + +#include "config/feature.h" + +#include "io/gps.h" +#include "io/serial.h" + +//#include "config/config.h" +#include "fc/config.h" +#include "fc/rc_controls.h" +#include "fc/runtime_config.h" + +#include "flight/imu.h" +#include "flight/mixer.h" + +#include "io/gps.h" + +//#include "pg/motor.h" + +#include "rx/rx.h" +#include "rx/spektrum.h" +#include "rx/srxl2.h" + +#include "sensors/battery.h" +//#include "sensors/adcinternal.h" +#include "sensors/esc_sensor.h" + +#include "telemetry/telemetry.h" +#include "telemetry/srxl.h" + +#include "drivers/vtx_common.h" +//#include "drivers/dshot.h" + +#include "io/vtx_tramp.h" +#include "io/vtx_smartaudio.h" + +#define SRXL_ADDRESS_FIRST 0xA5 +#define SRXL_ADDRESS_SECOND 0x80 +#define SRXL_PACKET_LENGTH 0x15 + +#define SRXL_FRAMETYPE_TELE_QOS 0x7F +#define SRXL_FRAMETYPE_TELE_RPM 0x7E +#define SRXL_FRAMETYPE_POWERBOX 0x0A +#define SRXL_FRAMETYPE_TELE_FP_MAH 0x34 +#define TELE_DEVICE_VTX 0x0D // Video Transmitter Status +#define SRXL_FRAMETYPE_SID 0x00 +#define SRXL_FRAMETYPE_GPS_LOC 0x16 // GPS Location Data (Eagle Tree) +#define SRXL_FRAMETYPE_GPS_STAT 0x17 + +static bool srxlTelemetryEnabled; +static bool srxl2 = false; +static uint8_t srxlFrame[SRXL_FRAME_SIZE_MAX]; + +static void srxlInitializeFrame(sbuf_t *dst) +{ + if (srxl2) { +#if defined(USE_SERIALRX_SRXL2) + srxl2InitializeFrame(dst); +#endif + } else { + dst->ptr = srxlFrame; + dst->end = ARRAYEND(srxlFrame); + + sbufWriteU8(dst, SRXL_ADDRESS_FIRST); + sbufWriteU8(dst, SRXL_ADDRESS_SECOND); + sbufWriteU8(dst, SRXL_PACKET_LENGTH); + } +} + +static void srxlFinalize(sbuf_t *dst) +{ + if (srxl2) { +#if defined(USE_SERIALRX_SRXL2) + srxl2FinalizeFrame(dst); +#endif + } else { + crc16_ccitt_sbuf_append(dst, &srxlFrame[3]); // start at byte 3, since CRC does not include device address and packet length + sbufSwitchToReader(dst, srxlFrame); + // write the telemetry frame to the receiver. + srxlRxWriteTelemetryData(sbufPtr(dst), sbufBytesRemaining(dst)); + } +} + +/* +SRXL frame has the structure: +<0xA5><0x80><16-byte telemetry packet><2 Byte CRC of payload> +The shall be 0x15 (length of the 16-byte telemetry packet + overhead). +*/ + +/* +typedef struct +{ + UINT8 identifier; // Source device = 0x7F + UINT8 sID; // Secondary ID + UINT16 A; + UINT16 B; + UINT16 L; + UINT16 R; + UINT16 F; + UINT16 H; + UINT16 rxVoltage; // Volts, 0.01V increments +} STRU_TELE_QOS; +*/ + +#define STRU_TELE_QOS_EMPTY_FIELDS_COUNT 14 +#define STRU_TELE_QOS_EMPTY_FIELDS_VALUE 0xff + +bool srxlFrameQos(sbuf_t *dst, timeUs_t currentTimeUs) +{ + UNUSED(currentTimeUs); + + sbufWriteU8(dst, SRXL_FRAMETYPE_TELE_QOS); + sbufWriteU8(dst, SRXL_FRAMETYPE_SID); + + sbufFill(dst, STRU_TELE_QOS_EMPTY_FIELDS_VALUE, STRU_TELE_QOS_EMPTY_FIELDS_COUNT); // Clear remainder + + // Mandatory frame, send it unconditionally. + return true; +} + + +/* +typedef struct +{ + UINT8 identifier; // Source device = 0x7E + UINT8 sID; // Secondary ID + UINT16 microseconds; // microseconds between pulse leading edges + UINT16 volts; // 0.01V increments + INT16 temperature; // degrees F + INT8 dBm_A, // Average signal for A antenna in dBm + INT8 dBm_B; // Average signal for B antenna in dBm. + // If only 1 antenna, set B = A +} STRU_TELE_RPM; +*/ + +#define STRU_TELE_RPM_EMPTY_FIELDS_COUNT 8 +#define STRU_TELE_RPM_EMPTY_FIELDS_VALUE 0xff + +#define SPEKTRUM_RPM_UNUSED 0xffff +#define SPEKTRUM_TEMP_UNUSED 0x7fff +#define MICROSEC_PER_MINUTE 60000000 + +//Original range of 1 - 65534 uSec gives an RPM range of 915 - 60000000rpm, 60MegaRPM +#define SPEKTRUM_MIN_RPM 999 // Min RPM to show the user, indicating RPM is really below 999 +#define SPEKTRUM_MAX_RPM 60000000 + +uint16_t getMotorAveragePeriod(void) +{ + +#if defined( USE_ESC_SENSOR_TELEMETRY) || defined( USE_DSHOT_TELEMETRY) + uint32_t rpm = 0; + uint16_t period_us = SPEKTRUM_RPM_UNUSED; + +#if defined( USE_ESC_SENSOR_TELEMETRY) + escSensorData_t *escData = getEscSensorData(ESC_SENSOR_COMBINED); + if (escData != NULL) { + rpm = escData->rpm; + } +#endif + +#if defined(USE_DSHOT_TELEMETRY) + if (useDshotTelemetry) { + uint16_t motors = getMotorCount(); + + if (motors > 0) { + for (int motor = 0; motor < motors; motor++) { + rpm += getDshotTelemetry(motor); + } + rpm = 100.0f / (motorConfig()->motorPoleCount / 2.0f) * rpm; // convert erpm freq to RPM. + rpm /= motors; // Average combined rpm + } + } +#endif + + if (rpm > SPEKTRUM_MIN_RPM && rpm < SPEKTRUM_MAX_RPM) { + period_us = MICROSEC_PER_MINUTE / rpm; // revs/minute -> microSeconds + } else { + period_us = MICROSEC_PER_MINUTE / SPEKTRUM_MIN_RPM; + } + + return period_us; +#else + return SPEKTRUM_RPM_UNUSED; +#endif +} + +bool srxlFrameRpm(sbuf_t *dst, timeUs_t currentTimeUs) +{ + int16_t coreTemp = SPEKTRUM_TEMP_UNUSED; +#if defined(USE_ADC_INTERNAL) + coreTemp = getCoreTemperatureCelsius(); + coreTemp = coreTemp * 9 / 5 + 32; // C -> F +#endif + + UNUSED(currentTimeUs); + + sbufWriteU8(dst, SRXL_FRAMETYPE_TELE_RPM); + sbufWriteU8(dst, SRXL_FRAMETYPE_SID); + sbufWriteU16BigEndian(dst, getMotorAveragePeriod()); // pulse leading edges + if (telemetryConfig()->report_cell_voltage) { + sbufWriteU16BigEndian(dst, getBatteryAverageCellVoltage()); // Cell voltage is in units of 0.01V + } else { + sbufWriteU16BigEndian(dst, getBatteryVoltage()); // vbat is in units of 0.01V + } + sbufWriteU16BigEndian(dst, coreTemp); // temperature + sbufFill(dst, STRU_TELE_RPM_EMPTY_FIELDS_VALUE, STRU_TELE_RPM_EMPTY_FIELDS_COUNT); + + // Mandatory frame, send it unconditionally. + return true; +} + +#if defined(USE_GPS) + +// From Frsky implementation +static void GPStoDDDMM_MMMM(int32_t mwiigps, gpsCoordinateDDDMMmmmm_t *result) +{ + int32_t absgps, deg, min; + absgps = ABS(mwiigps); + deg = absgps / GPS_DEGREES_DIVIDER; + absgps = (absgps - deg * GPS_DEGREES_DIVIDER) * 60; // absgps = Minutes left * 10^7 + min = absgps / GPS_DEGREES_DIVIDER; // minutes left + result->dddmm = deg * 100 + min; + result->mmmm = (absgps - min * GPS_DEGREES_DIVIDER) / 1000; +} + +// BCD conversion +static uint32_t dec2bcd(uint16_t dec) +{ + uint32_t result = 0; + uint8_t counter = 0; + + while (dec) { + result |= (dec % 10) << counter * 4; + counter++; + dec /= 10; + } + return result; +} + +/* +typedef struct +{ + UINT8 identifier; // Source device = 0x16 + UINT8 sID; // Secondary ID + UINT16 altitudeLow; // BCD, meters, format 3.1 (Low order of altitude) + UINT32 latitude; // BCD, format 4.4, Degrees * 100 + minutes, less than 100 degrees + UINT32 longitude; // BCD, format 4.4 , Degrees * 100 + minutes, flag indicates > 99 degrees + UINT16 course; // BCD, 3.1 + UINT8 HDOP; // BCD, format 1.1 + UINT8 GPSflags; // see definitions below +} STRU_TELE_GPS_LOC; +*/ + +// GPS flags definitions +#define GPS_FLAGS_IS_NORTH_BIT 0x01 +#define GPS_FLAGS_IS_EAST_BIT 0x02 +#define GPS_FLAGS_LONGITUDE_GREATER_99_BIT 0x04 +#define GPS_FLAGS_GPS_FIX_VALID_BIT 0x08 +#define GPS_FLAGS_GPS_DATA_RECEIVED_BIT 0x10 +#define GPS_FLAGS_3D_FIX_BIT 0x20 +#define GPS_FLAGS_NEGATIVE_ALT_BIT 0x80 + +bool srxlFrameGpsLoc(sbuf_t *dst, timeUs_t currentTimeUs) +{ + UNUSED(currentTimeUs); + gpsCoordinateDDDMMmmmm_t coordinate; + uint32_t latitudeBcd, longitudeBcd, altitudeLo; + uint16_t altitudeLoBcd, groundCourseBcd, hdop; + uint8_t hdopBcd, gpsFlags; + + if (!feature(FEATURE_GPS) || !STATE(GPS_FIX) || gpsSol.numSat < 6) { + return false; + } + + // lattitude + GPStoDDDMM_MMMM(gpsSol.llh.lat, &coordinate); + latitudeBcd = (dec2bcd(coordinate.dddmm) << 16) | dec2bcd(coordinate.mmmm); + + // longitude + GPStoDDDMM_MMMM(gpsSol.llh.lon, &coordinate); + longitudeBcd = (dec2bcd(coordinate.dddmm) << 16) | dec2bcd(coordinate.mmmm); + + // altitude (low order) + altitudeLo = ABS(gpsSol.llh.alt) / 10; + altitudeLoBcd = dec2bcd(altitudeLo % 100000); + + // Ground course + groundCourseBcd = dec2bcd(gpsSol.groundCourse); + + // HDOP + hdop = gpsSol.hdop / 10; + hdop = (hdop > 99) ? 99 : hdop; + hdopBcd = dec2bcd(hdop); + + // flags + gpsFlags = GPS_FLAGS_GPS_DATA_RECEIVED_BIT | GPS_FLAGS_GPS_FIX_VALID_BIT | GPS_FLAGS_3D_FIX_BIT; + gpsFlags |= (gpsSol.llh.lat > 0) ? GPS_FLAGS_IS_NORTH_BIT : 0; + gpsFlags |= (gpsSol.llh.lon > 0) ? GPS_FLAGS_IS_EAST_BIT : 0; + gpsFlags |= (gpsSol.llh.alt < 0) ? GPS_FLAGS_NEGATIVE_ALT_BIT : 0; + gpsFlags |= (gpsSol.llh.lon / GPS_DEGREES_DIVIDER > 99) ? GPS_FLAGS_LONGITUDE_GREATER_99_BIT : 0; + + // SRXL frame + sbufWriteU8(dst, SRXL_FRAMETYPE_GPS_LOC); + sbufWriteU8(dst, SRXL_FRAMETYPE_SID); + sbufWriteU16(dst, altitudeLoBcd); + sbufWriteU32(dst, latitudeBcd); + sbufWriteU32(dst, longitudeBcd); + sbufWriteU16(dst, groundCourseBcd); + sbufWriteU8(dst, hdopBcd); + sbufWriteU8(dst, gpsFlags); + + return true; +} + +/* +typedef struct +{ + UINT8 identifier; // Source device = 0x17 + UINT8 sID; // Secondary ID + UINT16 speed; // BCD, knots, format 3.1 + UINT32 UTC; // BCD, format HH:MM:SS.S, format 6.1 + UINT8 numSats; // BCD, 0-99 + UINT8 altitudeHigh; // BCD, meters, format 2.0 (High bits alt) +} STRU_TELE_GPS_STAT; +*/ + +#define STRU_TELE_GPS_STAT_EMPTY_FIELDS_VALUE 0xff +#define STRU_TELE_GPS_STAT_EMPTY_FIELDS_COUNT 6 +#define SPEKTRUM_TIME_UNKNOWN 0xFFFFFFFF + +bool srxlFrameGpsStat(sbuf_t *dst, timeUs_t currentTimeUs) +{ + UNUSED(currentTimeUs); + uint32_t timeBcd; + uint16_t speedKnotsBcd, speedTmp; + uint8_t numSatBcd, altitudeHighBcd; + bool timeProvided = false; + + if (!feature(FEATURE_GPS) || !STATE(GPS_FIX) || gpsSol.numSat < 6) { + return false; + } + + // Number of sats and altitude (high bits) + numSatBcd = (gpsSol.numSat > 99) ? dec2bcd(99) : dec2bcd(gpsSol.numSat); + altitudeHighBcd = dec2bcd(gpsSol.llh.alt / 100000); + + // Speed (knots) + speedTmp = gpsSol.groundSpeed * 1944 / 1000; + speedKnotsBcd = (speedTmp > 9999) ? dec2bcd(9999) : dec2bcd(speedTmp); + +#ifdef USE_RTC_TIME + dateTime_t dt; + // RTC + if (rtcHasTime()) { + rtcGetDateTime(&dt); + timeBcd = dec2bcd(dt.hours); + timeBcd = timeBcd << 8; + timeBcd = timeBcd | dec2bcd(dt.minutes); + timeBcd = timeBcd << 8; + timeBcd = timeBcd | dec2bcd(dt.seconds); + timeBcd = timeBcd << 4; + timeBcd = timeBcd | dec2bcd(dt.millis / 100); + timeProvided = true; + } +#endif + timeBcd = (timeProvided) ? timeBcd : SPEKTRUM_TIME_UNKNOWN; + + // SRXL frame + sbufWriteU8(dst, SRXL_FRAMETYPE_GPS_STAT); + sbufWriteU8(dst, SRXL_FRAMETYPE_SID); + sbufWriteU16(dst, speedKnotsBcd); + sbufWriteU32(dst, timeBcd); + sbufWriteU8(dst, numSatBcd); + sbufWriteU8(dst, altitudeHighBcd); + sbufFill(dst, STRU_TELE_GPS_STAT_EMPTY_FIELDS_VALUE, STRU_TELE_GPS_STAT_EMPTY_FIELDS_COUNT); + + return true; +} + +#endif + +/* +typedef struct +{ + UINT8 identifier; // Source device = 0x34 + UINT8 sID; // Secondary ID + INT16 current_A; // Instantaneous current, 0.1A (0-3276.8A) + INT16 chargeUsed_A; // Integrated mAh used, 1mAh (0-32.766Ah) + UINT16 temp_A; // Temperature, 0.1C (0-150C, 0x7FFF indicates not populated) + INT16 current_B; // Instantaneous current, 0.1A (0-3276.8A) + INT16 chargeUsed_B; // Integrated mAh used, 1mAh (0-32.766Ah) + UINT16 temp_B; // Temperature, 0.1C (0-150C, 0x7FFF indicates not populated) + UINT16 spare; // Not used +} STRU_TELE_FP_MAH; +*/ +#define STRU_TELE_FP_EMPTY_FIELDS_COUNT 2 +#define STRU_TELE_FP_EMPTY_FIELDS_VALUE 0xff + +#define SPEKTRUM_AMPS_UNUSED 0x7fff +#define SPEKTRUM_AMPH_UNUSED 0x7fff + +#define FP_MAH_KEEPALIVE_TIME_OUT 2000000 // 2s + +bool srxlFrameFlightPackCurrent(sbuf_t *dst, timeUs_t currentTimeUs) +{ + uint16_t amps = getAmperage() / 10; + uint16_t mah = getMAhDrawn(); + static uint16_t sentAmps; + static uint16_t sentMah; + static timeUs_t lastTimeSentFPmAh = 0; + + timeUs_t keepAlive = currentTimeUs - lastTimeSentFPmAh; + + if ( amps != sentAmps || + mah != sentMah || + keepAlive > FP_MAH_KEEPALIVE_TIME_OUT ) { + + sbufWriteU8(dst, SRXL_FRAMETYPE_TELE_FP_MAH); + sbufWriteU8(dst, SRXL_FRAMETYPE_SID); + sbufWriteU16(dst, amps); + sbufWriteU16(dst, mah); + sbufWriteU16(dst, SPEKTRUM_TEMP_UNUSED); // temp A + sbufWriteU16(dst, SPEKTRUM_AMPS_UNUSED); // Amps B + sbufWriteU16(dst, SPEKTRUM_AMPH_UNUSED); // mAH B + sbufWriteU16(dst, SPEKTRUM_TEMP_UNUSED); // temp B + + sbufFill(dst, STRU_TELE_FP_EMPTY_FIELDS_VALUE, STRU_TELE_FP_EMPTY_FIELDS_COUNT); + + sentAmps = amps; + sentMah = mah; + lastTimeSentFPmAh = currentTimeUs; + return true; + } + return false; +} + +#if defined (USE_SPEKTRUM_CMS_TELEMETRY) && defined (USE_CMS) + +// Betaflight CMS using Spektrum Tx telemetry TEXT_GEN sensor as display. + +#define SPEKTRUM_SRXL_DEVICE_TEXTGEN (0x0C) // Text Generator +#define SPEKTRUM_SRXL_DEVICE_TEXTGEN_ROWS (9) // Text Generator ROWS +#define SPEKTRUM_SRXL_DEVICE_TEXTGEN_COLS (13) // Text Generator COLS + +/* +typedef struct +{ + UINT8 identifier; + UINT8 sID; // Secondary ID + UINT8 lineNumber; // Line number to display (0 = title, 1-8 for general, 254 = Refresh backlight, 255 = Erase all text on screen) + char text[13]; // 0-terminated text when < 13 chars +} STRU_SPEKTRUM_SRXL_TEXTGEN; +*/ + +#if ( SPEKTRUM_SRXL_TEXTGEN_BUFFER_COLS > SPEKTRUM_SRXL_DEVICE_TEXTGEN_COLS ) +static char srxlTextBuff[SPEKTRUM_SRXL_TEXTGEN_BUFFER_ROWS][SPEKTRUM_SRXL_TEXTGEN_BUFFER_COLS]; +static bool lineSent[SPEKTRUM_SRXL_TEXTGEN_BUFFER_ROWS]; +#else +static char srxlTextBuff[SPEKTRUM_SRXL_DEVICE_TEXTGEN_ROWS][SPEKTRUM_SRXL_DEVICE_TEXTGEN_COLS]; +static bool lineSent[SPEKTRUM_SRXL_DEVICE_TEXTGEN_ROWS]; +#endif + +//************************************************************************** +// API Running in external client task context. E.g. in the CMS task +int spektrumTmTextGenPutChar(uint8_t col, uint8_t row, char c) +{ + if (row < SPEKTRUM_SRXL_TEXTGEN_BUFFER_ROWS && col < SPEKTRUM_SRXL_TEXTGEN_BUFFER_COLS) { + // Only update and force a tm transmision if something has actually changed. + if (srxlTextBuff[row][col] != c) { + srxlTextBuff[row][col] = c; + lineSent[row] = false; + } + } + return 0; +} +//************************************************************************** + +bool srxlFrameText(sbuf_t *dst, timeUs_t currentTimeUs) +{ + UNUSED(currentTimeUs); + static uint8_t lineNo = 0; + int lineCount = 0; + + // Skip already sent lines... + while (lineSent[lineNo] && + lineCount < SPEKTRUM_SRXL_DEVICE_TEXTGEN_ROWS) { + lineNo = (lineNo + 1) % SPEKTRUM_SRXL_DEVICE_TEXTGEN_ROWS; + lineCount++; + } + + sbufWriteU8(dst, SPEKTRUM_SRXL_DEVICE_TEXTGEN); + sbufWriteU8(dst, SRXL_FRAMETYPE_SID); + sbufWriteU8(dst, lineNo); + sbufWriteData(dst, srxlTextBuff[lineNo], SPEKTRUM_SRXL_DEVICE_TEXTGEN_COLS); + + lineSent[lineNo] = true; + lineNo = (lineNo + 1) % SPEKTRUM_SRXL_DEVICE_TEXTGEN_ROWS; + + // Always send something, Always one user frame after the two mandatory frames + // I.e. All of the three frame prep routines QOS, RPM, TEXT should always return true + // too keep the "Waltz" sequence intact. + return true; +} +#endif + +#if defined(USE_SPEKTRUM_VTX_TELEMETRY) && defined(USE_SPEKTRUM_VTX_CONTROL) && defined(USE_VTX_COMMON) + +static uint8_t vtxDeviceType; + +static void collectVtxTmData(spektrumVtx_t * vtx) +{ + const vtxDevice_t *vtxDevice = vtxCommonDevice(); + vtxDeviceType = vtxCommonGetDeviceType(vtxDevice); + + // Collect all data from VTX, if VTX is ready + unsigned vtxStatus; + if (vtxDevice == NULL || !(vtxCommonGetBandAndChannel(vtxDevice, &vtx->band, &vtx->channel) && + vtxCommonGetStatus(vtxDevice, &vtxStatus) && + vtxCommonGetPowerIndex(vtxDevice, &vtx->power)) ) + { + vtx->band = 0; + vtx->channel = 0; + vtx->power = 0; + vtx->pitMode = 0; + } else { + vtx->pitMode = (vtxStatus & VTX_STATUS_PIT_MODE) ? 1 : 0; + } + + vtx->powerValue = 0; +#ifdef USE_SPEKTRUM_REGION_CODES + vtx->region = SpektrumRegion; +#else + vtx->region = SPEKTRUM_VTX_REGION_NONE; +#endif +} + +// Reverse lookup, device power index to Spektrum power range index. +static void convertVtxPower(spektrumVtx_t * vtx) + { + uint8_t const * powerIndexTable = NULL; + + vtxCommonLookupPowerValue(vtxCommonDevice(), vtx->power, &vtx->powerValue); + switch (vtxDeviceType) { + +#if defined(USE_VTX_TRAMP) + case VTXDEV_TRAMP: + powerIndexTable = vtxTrampPi; + break; +#endif +#if defined(USE_VTX_SMARTAUDIO) + case VTXDEV_SMARTAUDIO: + powerIndexTable = vtxSaPi; + break; +#endif +#if defined(USE_VTX_RTC6705) + case VTXDEV_RTC6705: + powerIndexTable = vtxRTC6705Pi; + break; +#endif + + case VTXDEV_UNKNOWN: + case VTXDEV_UNSUPPORTED: + default: + break; + + } + + if (powerIndexTable != NULL) { + for (int i = 0; i < SPEKTRUM_VTX_POWER_COUNT; i++) + if (powerIndexTable[i] >= vtx->power) { + vtx->power = i; // Translate device power index to Spektrum power index. + break; + } + } + } + +static void convertVtxTmData(spektrumVtx_t * vtx) +{ + // Convert from internal band indexes to Spektrum indexes + for (int i = 0; i < SPEKTRUM_VTX_BAND_COUNT; i++) { + if (spek2commonBand[i] == vtx->band) { + vtx->band = i; + break; + } + } + + // De-bump channel no 1 based interally, 0-based in Spektrum. + vtx->channel--; + + // Convert Power index to Spektrum ranges, different per brand. + convertVtxPower(vtx); +} + +/* +typedef struct +{ + UINT8 identifier; + UINT8 sID; // Secondary ID + UINT8 band; // VTX Band (0 = Fatshark, 1 = Raceband, 2 = E, 3 = B, 4 = A, 5-7 = Reserved) + UINT8 channel; // VTX Channel (0-7) + UINT8 pit; // Pit/Race mode (0 = Race, 1 = Pit). Race = (normal operating) mode. Pit = (reduced power) mode. When PIT is set, it overrides all other power settings + UINT8 power; // VTX Power (0 = Off, 1 = 1mw to 14mW, 2 = 15mW to 25mW, 3 = 26mW to 99mW, 4 = 100mW to 299mW, 5 = 300mW to 600mW, 6 = 601mW+, 7 = manual control) + UINT16 powerDec; // VTX Power as a decimal 1mw/unit + UINT8 region; // Region (0 = USA, 1 = EU, 0xFF = N/A) + UINT8 rfu[7]; // reserved +} STRU_TELE_VTX; +*/ + +#define STRU_TELE_VTX_EMPTY_COUNT 7 +#define STRU_TELE_VTX_EMPTY_VALUE 0xff + +#define VTX_KEEPALIVE_TIME_OUT 2000000 // uS + +static bool srxlFrameVTX(sbuf_t *dst, timeUs_t currentTimeUs) +{ + static timeUs_t lastTimeSentVtx = 0; + static spektrumVtx_t vtxSent; + + spektrumVtx_t vtx; + collectVtxTmData(&vtx); + + if ((vtxDeviceType != VTXDEV_UNKNOWN) && vtxDeviceType != VTXDEV_UNSUPPORTED) { + convertVtxTmData(&vtx); + + if ((memcmp(&vtxSent, &vtx, sizeof(spektrumVtx_t)) != 0) || + ((currentTimeUs - lastTimeSentVtx) > VTX_KEEPALIVE_TIME_OUT) ) { + // Fill in the VTX tm structure + sbufWriteU8(dst, TELE_DEVICE_VTX); + sbufWriteU8(dst, SRXL_FRAMETYPE_SID); + sbufWriteU8(dst, vtx.band); + sbufWriteU8(dst, vtx.channel); + sbufWriteU8(dst, vtx.pitMode); + sbufWriteU8(dst, vtx.power); + sbufWriteU16(dst, vtx.powerValue); + sbufWriteU8(dst, vtx.region); + + sbufFill(dst, STRU_TELE_VTX_EMPTY_VALUE, STRU_TELE_VTX_EMPTY_COUNT); + + memcpy(&vtxSent, &vtx, sizeof(spektrumVtx_t)); + lastTimeSentVtx = currentTimeUs; + return true; + } + } + return false; +} +#endif // USE_SPEKTRUM_VTX_TELEMETRY && USE_SPEKTRUM_VTX_CONTROL && USE_VTX_COMMON + + +// Schedule array to decide how often each type of frame is sent +// The frames are scheduled in sets of 3 frames, 2 mandatory and 1 user frame. +// The user frame type is cycled for each set. +// Example. QOS, RPM,.CURRENT, QOS, RPM, TEXT. QOS, RPM, CURRENT, etc etc + +#define SRXL_SCHEDULE_MANDATORY_COUNT 2 // Mandatory QOS and RPM sensors + +#define SRXL_FP_MAH_COUNT 1 + +#if defined(USE_GPS) +#define SRXL_GPS_LOC_COUNT 1 +#define SRXL_GPS_STAT_COUNT 1 +#else +#define SRXL_GPS_LOC_COUNT 0 +#define SRXL_GPS_STAT_COUNT 0 +#endif + +#if defined (USE_SPEKTRUM_CMS_TELEMETRY) && defined (USE_CMS) +#define SRXL_SCHEDULE_CMS_COUNT 1 +#else +#define SRXL_SCHEDULE_CMS_COUNT 0 +#endif + +#if defined(USE_SPEKTRUM_VTX_TELEMETRY) && defined(USE_SPEKTRUM_VTX_CONTROL) && defined(USE_VTX_COMMON) +#define SRXL_VTX_TM_COUNT 1 +#else +#define SRXL_VTX_TM_COUNT 0 +#endif + +#define SRXL_SCHEDULE_USER_COUNT (SRXL_FP_MAH_COUNT + SRXL_SCHEDULE_CMS_COUNT + SRXL_VTX_TM_COUNT + SRXL_GPS_LOC_COUNT + SRXL_GPS_STAT_COUNT) +#define SRXL_SCHEDULE_COUNT_MAX (SRXL_SCHEDULE_MANDATORY_COUNT + 1) +#define SRXL_TOTAL_COUNT (SRXL_SCHEDULE_MANDATORY_COUNT + SRXL_SCHEDULE_USER_COUNT) + +typedef bool (*srxlScheduleFnPtr)(sbuf_t *dst, timeUs_t currentTimeUs); + +const srxlScheduleFnPtr srxlScheduleFuncs[SRXL_TOTAL_COUNT] = { + /* must send srxlFrameQos, Rpm and then alternating items of our own */ + srxlFrameQos, + srxlFrameRpm, + srxlFrameFlightPackCurrent, +#if defined(USE_GPS) + srxlFrameGpsStat, + srxlFrameGpsLoc, +#endif +#if defined(USE_SPEKTRUM_VTX_TELEMETRY) && defined(USE_SPEKTRUM_VTX_CONTROL) && defined(USE_VTX_COMMON) + srxlFrameVTX, +#endif +#if defined (USE_SPEKTRUM_CMS_TELEMETRY) && defined (USE_CMS) + srxlFrameText, +#endif +}; + + +static void processSrxl(timeUs_t currentTimeUs) +{ + static uint8_t srxlScheduleIndex = 0; + static uint8_t srxlScheduleUserIndex = 0; + + sbuf_t srxlPayloadBuf; + sbuf_t *dst = &srxlPayloadBuf; + srxlScheduleFnPtr srxlFnPtr; + + if (srxlScheduleIndex < SRXL_SCHEDULE_MANDATORY_COUNT) { + srxlFnPtr = srxlScheduleFuncs[srxlScheduleIndex]; + } else { + srxlFnPtr = srxlScheduleFuncs[srxlScheduleIndex + srxlScheduleUserIndex]; + srxlScheduleUserIndex = (srxlScheduleUserIndex + 1) % SRXL_SCHEDULE_USER_COUNT; + +#if defined (USE_SPEKTRUM_CMS_TELEMETRY) && defined (USE_CMS) + // Boost CMS performance by sending nothing else but CMS Text frames when in a CMS menu. + // Sideeffect, all other reports are still not sent if user leaves CMS without a proper EXIT. + if (cmsInMenu && + (cmsDisplayPortGetCurrent() == &srxlDisplayPort)) { + srxlFnPtr = srxlFrameText; + } +#endif + + } + + if (srxlFnPtr) { + srxlInitializeFrame(dst); + if (srxlFnPtr(dst, currentTimeUs)) { + srxlFinalize(dst); + } + } + srxlScheduleIndex = (srxlScheduleIndex + 1) % SRXL_SCHEDULE_COUNT_MAX; +} + +void initSrxlTelemetry(void) +{ + // check if there is a serial port open for SRXL telemetry (ie opened by the SRXL RX) + // and feature is enabled, if so, set SRXL telemetry enabled + if (srxlRxIsActive()) { + srxlTelemetryEnabled = true; + srxl2 = false; +#if defined(USE_SERIALRX_SRXL2) + } else if (srxl2RxIsActive()) { + srxlTelemetryEnabled = true; + srxl2 = true; +#endif + } else { + srxlTelemetryEnabled = false; + srxl2 = false; + } + } + +bool checkSrxlTelemetryState(void) +{ + return srxlTelemetryEnabled; +} + +/* + * Called periodically by the scheduler + */ +void handleSrxlTelemetry(timeUs_t currentTimeUs) +{ + if (srxl2) { +#if defined(USE_SERIALRX_SRXL2) + if (srxl2TelemetryRequested()) { + processSrxl(currentTimeUs); + } +#endif + } else { + if (srxlTelemetryBufferEmpty()) { + processSrxl(currentTimeUs); + } + } +} +#endif diff --git a/src/main/telemetry/srxl.h b/src/main/telemetry/srxl.h new file mode 100644 index 0000000000..7719c58f2b --- /dev/null +++ b/src/main/telemetry/srxl.h @@ -0,0 +1,35 @@ +/* + * This file is part of Cleanflight and Betaflight. + * + * Cleanflight and Betaflight are free software. You can redistribute + * this software and/or modify this software 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. + * + * Cleanflight and Betaflight are distributed in the hope that they + * 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 software. + * + * If not, see . + */ + +#pragma once + +#include "common/time.h" + +void srxlCollectTelemetryNow(void); +void initSrxlTelemetry(void); +bool checkSrxlTelemetryState(void); +void handleSrxlTelemetry(timeUs_t currentTimeUs); + +#define SPEKTRUM_SRXL_TEXTGEN_BUFFER_ROWS 9 +#define SPEKTRUM_SRXL_TEXTGEN_BUFFER_COLS 12 // Airware 1.20 +//#define SPEKTRUM_SRXL_TEXTGEN_BUFFER_COLS 13 // Airware 1.21 +#define SPEKTRUM_SRXL_TEXTGEN_CLEAR_SCREEN 255 + +int spektrumTmTextGenPutChar(uint8_t col, uint8_t row, char c); diff --git a/src/main/telemetry/telemetry.c b/src/main/telemetry/telemetry.c index 9949906092..5022a0192e 100644 --- a/src/main/telemetry/telemetry.c +++ b/src/main/telemetry/telemetry.c @@ -48,6 +48,7 @@ #include "telemetry/jetiexbus.h" #include "telemetry/ibus.h" #include "telemetry/crsf.h" +#include "telemetry/srxl.h" #include "telemetry/sim.h" @@ -81,7 +82,8 @@ PG_RESET_TEMPLATE(telemetryConfig_t, telemetryConfig, .rc_channels_rate = 5, .position_rate = 2, .extra1_rate = 10, - .extra2_rate = 2 + .extra2_rate = 2, + .extra3_rate = 1 } ); @@ -123,6 +125,10 @@ void telemetryInit(void) initCrsfTelemetry(); #endif +#ifdef USE_TELEMETRY_SRXL + initSrxlTelemetry(); +#endif + telemetryCheckState(); } @@ -184,6 +190,10 @@ void telemetryCheckState(void) #if defined(USE_SERIALRX_CRSF) && defined(USE_TELEMETRY_CRSF) checkCrsfTelemetryState(); #endif + +#ifdef USE_TELEMETRY_SRXL + checkSrxlTelemetryState(); +#endif } void telemetryProcess(timeUs_t currentTimeUs) @@ -225,6 +235,10 @@ void telemetryProcess(timeUs_t currentTimeUs) #if defined(USE_SERIALRX_CRSF) && defined(USE_TELEMETRY_CRSF) handleCrsfTelemetry(currentTimeUs); #endif + +#ifdef USE_TELEMETRY_SRXL + handleSrxlTelemetry(currentTimeUs); +#endif } #endif diff --git a/src/main/telemetry/telemetry.h b/src/main/telemetry/telemetry.h index 9b0dc2cb2a..717e9fec03 100644 --- a/src/main/telemetry/telemetry.h +++ b/src/main/telemetry/telemetry.h @@ -82,6 +82,7 @@ typedef struct telemetryConfig_s { uint8_t position_rate; uint8_t extra1_rate; uint8_t extra2_rate; + uint8_t extra3_rate; } mavlink; } telemetryConfig_t; diff --git a/src/utils/settings.rb b/src/utils/settings.rb index 3f02725be4..10deeab1c7 100644 --- a/src/utils/settings.rb +++ b/src/utils/settings.rb @@ -749,7 +749,27 @@ class Generator add_condition = -> (c) { if c && !conditions.include?(c) conditions.add(c) - buf << "#ifdef #{c}\n" + buf << "#if " + in_word = false + c.split('').each do |ch| + if in_word + if !ch.match(/^[a-zA-Z0-9_]$/) + in_word = false + buf << ")" + end + buf << ch + else + if ch.match(/^[a-zA-Z_]$/) + in_word = true + buf << "defined(" + end + buf << ch + end + end + if in_word + buf << ")" + end + buf << "\n" buf << "#pragma message(#{c.inspect})\n" buf << "#endif\n" end