1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-19 22:35:19 +03:00

Merge branch 'master' of https://github.com/dragnea/inav into dragnea_autolaunch_refactor

This commit is contained in:
root 2020-10-17 13:47:12 +03:00
commit 91e69c9614
579 changed files with 17653 additions and 10892 deletions

View file

@ -1,2 +1,7 @@
.git/
.vagrant/
obj/
.vscode/
/build/
/obj/
/tools/
/downloads/

View file

@ -9,11 +9,12 @@ jobs:
runs-on: ubuntu-18.04
strategy:
matrix:
start: [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100]
count: [10]
id: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: sudo apt-get update && sudo apt-get -y install ninja-build
- name: Setup environment
run: |
# This is the hash of the commit for the PR
@ -25,44 +26,27 @@ jobs:
# why we try github.event.pull_request.head.sha first
COMMIT_ID=${COMMIT_ID:-${{ github.sha }}}
BUILD_SUFFIX=ci-$(date '+%Y%m%d')-$(git rev-parse --short ${COMMIT_ID})
echo "::set-env name=TARGETS::$(./src/utils/build-targets.sh -n -s ${{ matrix.start }} -c ${{ matrix.count }})"
VERSION=$(grep project CMakeLists.txt|awk -F VERSION '{ gsub(/^[ \t]+|[ \t\)]+$/, "", $2); print $2 }')
echo "::set-env name=BUILD_SUFFIX::${BUILD_SUFFIX}"
echo "::set-env name=BUILD_NAME::inav-$(make print_version)-${BUILD_SUFFIX}"
echo "::set-env name=IS_LAST_JOB::$([ $(expr ${{ strategy.job-index }} + 1) = ${{ strategy.job-total }} ] && echo yes)"
- name: Ensure all targets will be tested
if: ${{ env.IS_LAST_JOB }}
run: |
UNTESTED=$(./src/utils/build-targets.sh -n -s $(expr ${{ matrix.start }} + ${{ matrix.count }}) -c 10000)
if ! [ -z "${UNTESTED}" ]; then
echo "Untested targets: ${UNTESTED}" >&2
exit 1
fi
echo "::set-env name=BUILD_NAME::inav-${VERSION}-${BUILD_SUFFIX}"
- uses: actions/cache@v1
with:
path: downloads
key: ${{ runner.os }}-downloads-${{ hashFiles('Makefile') }}-${{ hashFiles('**/make/*.mk')}}
- name: Install ARM toolchain
run: make arm_sdk_install
- name: Build targets (${{ matrix.start }})
if: ${{ env.TARGETS }}
run: ./src/utils/build-targets.sh -s ${{ matrix.start }} -c ${{ matrix.count }} -S ${{ env.BUILD_SUFFIX }}
key: ${{ runner.os }}-downloads-${{ hashFiles('CMakeLists.txt') }}-${{ hashFiles('**/cmake/*')}}
- name: Build targets (${{ matrix.id }})
run: mkdir -p build && cd build && cmake -DWARNINGS_AS_ERRORS=ON -DCI_JOB_INDEX=${{ matrix.id }} -DCI_JOB_COUNT=${{ strategy.job-total }} -DBUILD_SUFFIX=${{ env.BUILD_SUFFIX }} -G Ninja .. && ninja ci
- name: Upload artifacts
if: ${{ env.TARGETS }}
uses: actions/upload-artifact@v2-preview
with:
name: ${{ env.BUILD_NAME }}.zip
path: ./obj/dist/*.hex
path: ./build/*.hex
test:
needs: [build]
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v1
with:
path: downloads
key: ${{ runner.os }}-downloads-${{ hashFiles('Makefile') }}-${{ hashFiles('**/make/*.mk')}}
- name: Install ARM toolchain
run: make arm_sdk_install
- name: Install dependencies
run: sudo apt-get update && sudo apt-get -y install ninja-build
- name: Run Tests
run: make test
run: mkdir -p build && cd build && cmake -DTOOLCHAIN=none -G Ninja .. && ninja check

1
.gitignore vendored
View file

@ -8,6 +8,7 @@
.project
.settings
.cproject
__pycache__
startup_stm32f10x_md_gcc.s
.vagrant/
.vscode/

View file

@ -37,6 +37,7 @@ Hyon Lim
James Harrison
Jan Staal
Jeremy Waters
Joe Hermaszewski
Joe Poser
Joel Fuster
Johannes Kasberger

View file

@ -1,17 +1,37 @@
cmake_minimum_required(VERSION 3.17)
cmake_minimum_required(VERSION 3.13...3.18)
set(TOOLCHAIN_OPTIONS "arm-none-eabi")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
set(MAIN_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
set(MAIN_LIB_DIR "${CMAKE_CURRENT_SOURCE_DIR}/lib")
set(MAIN_UTILS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/utils")
set(MAIN_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/main")
set(SVD_DIR "${CMAKE_CURRENT_SOURCE_DIR}/dev/svd")
set(DOWNLOADS_DIR "${MAIN_DIR}/downloads")
set(TOOLS_DIR "${MAIN_DIR}/tools")
set(TOOLCHAIN_OPTIONS none arm-none-eabi)
set(TOOLCHAIN "arm-none-eabi" CACHE STRING "Toolchain to use. Available: ${TOOLCHAIN_OPTIONS}")
set_property(CACHE TOOLCHAIN PROPERTY STRINGS ${TOOLCHAIN_OPTIONS})
if("" STREQUAL TOOLCHAIN)
set(TOOLCHAIN none)
endif()
if (NOT ${TOOLCHAIN} IN_LIST TOOLCHAIN_OPTIONS)
message(FATAL_ERROR "Invalid toolchain ${TOOLCHAIN}")
message(FATAL_ERROR "Invalid toolchain ${TOOLCHAIN}. Valid options are: ${TOOLCHAIN_OPTIONS}")
endif()
set(CMAKE_TOOLCHAIN_FILE "${CMAKE_CURRENT_SOURCE_DIR}/cmake/${TOOLCHAIN}.cmake")
option(COMPILER_VERSION_CHECK "Ensure the compiler matches the expected version" ON)
project(INAV VERSION 2.5.0)
if(TOOLCHAIN STREQUAL none)
add_subdirectory(src/test)
else()
set(CMAKE_TOOLCHAIN_FILE "${CMAKE_CURRENT_SOURCE_DIR}/cmake/${TOOLCHAIN}.cmake")
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/${TOOLCHAIN}-checks.cmake")
endif()
ENABLE_LANGUAGE(ASM)
project(INAV VERSION 2.6.0)
enable_language(ASM)
set(CMAKE_C_STANDARD 99)
set(CMAKE_C_EXTENSIONS ON)
@ -25,23 +45,23 @@ if (NOT RUBY_EXECUTABLE)
message(FATAL_ERROR "Could not find ruby")
endif()
execute_process(COMMAND git rev-parse --short HEAD
OUTPUT_STRIP_TRAILING_WHITESPACE
RESULT_VARIABLE NO_GIT_HASH
OUTPUT_VARIABLE GIT_SHORT_HASH)
if (NO_GIT_HASH)
message(FATAL_ERROR "Could not find git revision. Is git installed?")
if(CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
set(IS_RELEASE_BUILD ON)
endif()
set(INAV_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
set(INAV_LIB_DIR "${CMAKE_CURRENT_SOURCE_DIR}/lib")
set(INAV_UTILS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/utils")
set(INAV_MAIN_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/main")
include(GetGitRevisionDescription)
get_git_head_revision(GIT_REFSPEC GIT_SHA1)
string(SUBSTRING ${GIT_SHA1} 0 8 GIT_REV)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
set(FIRMWARE_VERSION ${PROJECT_VERSION})
option(WARNINGS_AS_ERRORS "Make all warnings into errors")
message("-- toolchain: ${TOOLCHAIN}, WARNINGS_AS_ERRORS: ${WARNINGS_AS_ERRORS}")
include(settings)
include(inav)
include(openocd)
include(svd)
include(main)
include(stm32)
add_subdirectory(src)
@ -49,3 +69,4 @@ add_subdirectory(src)
collect_targets()
message("-- Build type: ${CMAKE_BUILD_TYPE}")
include(ci)

View file

@ -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"]

549
Makefile
View file

@ -1,549 +0,0 @@
###############################################################################
# "THE BEER-WARE LICENSE" (Revision 42):
# <msmith@FreeBSD.ORG> wrote this file. As long as you retain this notice you
# can do whatever you want with this stuff. If we meet some day, and you think
# this stuff is worth it, you can buy me a beer in return
###############################################################################
#
# Makefile for building the iNav firmware.
#
# Invoke this with 'make help' to see the list of supported targets.
#
###############################################################################
# Root directory
ROOT := $(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST))))
# developer preferences, edit these at will, they'll be gitignored
-include $(ROOT)/make/local.mk
# Things that the user might override on the commandline
#
# The target to build, see VALID_TARGETS below
TARGET ?= REVO
# Compile-time options
OPTIONS ?=
# Debugger optons, must be empty or GDB
DEBUG ?=
SEMIHOSTING ?=
# Build suffix
BUILD_SUFFIX ?=
# Serial port/Device for flashing
SERIAL_DEVICE ?= $(firstword $(wildcard /dev/ttyUSB*) no-port-found)
# Flash size (KB). Some low-end chips actually have more flash than advertised, use this to override.
FLASH_SIZE ?=
## V : Set verbosity level based on the V= parameter
## V=0 Low
## V=1 High
export AT := @
ifndef V
export V0 :=
export V1 := $(AT)
export STDOUT :=
else ifeq ($(V), 0)
export V0 := $(AT)
export V1 := $(AT)
export STDOUT:= "> /dev/null"
export MAKE := $(MAKE) --no-print-directory
else ifeq ($(V), 1)
export V0 :=
export V1 :=
export STDOUT :=
endif
###############################################################################
# Things that need to be maintained as the source changes
#
# Working directories
SRC_DIR := $(ROOT)/src/main
BL_SRC_DIR := $(ROOT)/src/bl
OBJECT_DIR := $(ROOT)/obj/main
BL_OBJECT_DIR := $(ROOT)/obj/bl
BIN_DIR := $(ROOT)/obj
CMSIS_DIR := $(ROOT)/lib/main/CMSIS
INCLUDE_DIRS := $(SRC_DIR) \
$(ROOT)/src/main/target
LINKER_DIR := $(ROOT)/src/main/target/link
# import macros common to all supported build systems
include $(ROOT)/make/system-id.mk
# default xtal value for F4 targets
HSE_VALUE = 8000000
MHZ_VALUE ?=
# used for turning on features like VCP and SDCARD
FEATURES =
include $(ROOT)/make/version.mk
include $(ROOT)/make/targets.mk
BUILD_DATE = $(shell date +%Y%m%d)
# Search path for sources
FATFS_DIR = $(ROOT)/lib/main/FatFS
FATFS_SRC = $(notdir $(wildcard $(FATFS_DIR)/*.c))
VPATH := $(SRC_DIR):$(SRC_DIR)/startup
VPATH := $(VPATH):$(ROOT)/make/mcu
VPATH := $(VPATH):$(ROOT)/make
VPATH := $(VPATH):$(BL_SRC_DIR)
CSOURCES := $(shell find $(SRC_DIR) -name '*.c')
# start specific includes
include $(ROOT)/make/mcu/STM32.mk
include $(ROOT)/make/mcu/$(TARGET_MCU_GROUP).mk
BL_LD_SCRIPT := $(basename $(LD_SCRIPT))_bl.ld
ifneq ($(FOR_BL),)
LD_SCRIPT := $(basename $(LD_SCRIPT))_for_bl.ld
endif
# Configure default flash sizes for the targets (largest size specified gets hit first) if flash not specified already.
ifeq ($(FLASH_SIZE),)
ifneq ($(TARGET_FLASH),)
FLASH_SIZE := $(TARGET_FLASH)
else
$(error FLASH_SIZE not configured for target $(TARGET))
endif
endif
# Configure devide and target-specific defines and compiler flags
DEVICE_FLAGS := $(DEVICE_FLAGS) -DFLASH_SIZE=$(FLASH_SIZE)
TARGET_FLAGS := $(TARGET_FLAGS) -D$(TARGET_MCU) -D$(TARGET_MCU_GROUP) -D$(TARGET)
ifneq ($(HSE_VALUE),)
DEVICE_FLAGS := $(DEVICE_FLAGS) -DHSE_VALUE=$(HSE_VALUE)
endif
ifneq ($(MHZ_VALUE),)
DEVICE_FLAGS := $(DEVICE_FLAGS) -DMHZ_VALUE=$(MHZ_VALUE)
endif
ifneq ($(BASE_TARGET), $(TARGET))
TARGET_FLAGS := $(TARGET_FLAGS) -D$(BASE_TARGET)
endif
TARGET_DIR = $(ROOT)/src/main/target/$(BASE_TARGET)
TARGET_DIR_SRC = $(notdir $(wildcard $(TARGET_DIR)/*.c))
INCLUDE_DIRS := $(INCLUDE_DIRS) \
$(ROOT)/lib/main/MAVLink
INCLUDE_DIRS := $(INCLUDE_DIRS) \
$(TARGET_DIR)
VPATH := $(VPATH):$(TARGET_DIR)
.DEFAULT_GOAL := hex
include $(ROOT)/make/source.mk
include $(ROOT)/make/release.mk
###############################################################################
#
# Toolchain installer
#
TOOLS_DIR := $(ROOT)/tools
DL_DIR := $(ROOT)/downloads
include $(ROOT)/make/tools.mk
#
# Tool names
#
CROSS_CC = $(ARM_SDK_PREFIX)gcc
OBJCOPY = $(ARM_SDK_PREFIX)objcopy
SIZE = $(ARM_SDK_PREFIX)size
COMBINE_TOOL := src/utils/combine_tool
#
# Tool options.
#
# Save original CFLAGS before modifying them, so we don't
# add them twice when calling this Makefile recursively
# for each target
SAVED_CFLAGS := $(CFLAGS)
ifeq ($(DEBUG),GDB)
LTO_FLAGS =
else
LTO_FLAGS = -flto -fuse-linker-plugin
endif
ifneq ($(SEMIHOSTING),)
SEMIHOSTING_CFLAGS = -DSEMIHOSTING
SEMIHOSTING_LDFLAGS = --specs=rdimon.specs -lc -lrdimon
SYSLIB :=
else
SEMIHOSTING_CFLAGS =
SEMIHOSTING_LDFLAGS =
SYSLIB := -lnosys
endif
DEBUG_FLAGS = -ggdb3 -DDEBUG
CFLAGS += $(ARCH_FLAGS) \
$(LTO_FLAGS) \
$(addprefix -D,$(OPTIONS)) \
$(addprefix -I,$(INCLUDE_DIRS)) \
$(DEBUG_FLAGS) \
$(SEMIHOSTING_CFLAGS) \
-std=gnu99 \
-Wall -Wextra -Wunsafe-loop-optimizations -Wdouble-promotion \
-Wstrict-prototypes \
-Werror=switch \
-ffunction-sections \
-fdata-sections \
-fno-common \
$(DEVICE_FLAGS) \
-DUSE_STDPERIPH_DRIVER \
$(TARGET_FLAGS) \
-D'__FORKNAME__="$(FORKNAME)"' \
-D'__TARGET__="$(TARGET)"' \
-D'__REVISION__="$(REVISION)"' \
-save-temps=obj \
-MMD -MP
BL_CFLAGS = -DMSP_FIRMWARE_UPDATE -DBOOTLOADER
ifneq ($(FOR_BL),)
CFLAGS += -DMSP_FIRMWARE_UPDATE
endif
ASFLAGS = $(ARCH_FLAGS) \
-x assembler-with-cpp \
$(addprefix -I,$(INCLUDE_DIRS)) \
-D$(TARGET) \
-MMD -MP
LDFLAGS = -lm \
-nostartfiles \
--specs=nano.specs \
-lc \
$(SYSLIB) \
$(ARCH_FLAGS) \
$(LTO_FLAGS) \
$(DEBUG_FLAGS) \
$(SEMIHOSTING_LDFLAGS) \
-static \
-Wl,-gc-sections,-Map,$(TARGET_MAP) \
-Wl,-L$(LINKER_DIR) \
-Wl,--cref \
-Wl,--no-wchar-size-warning \
-Wl,--print-memory-usage \
-T$(LD_SCRIPT)
BL_LDFLAGS = -lm \
-nostartfiles \
--specs=nano.specs \
-lc \
$(SYSLIB) \
$(ARCH_FLAGS) \
$(LTO_FLAGS) \
$(DEBUG_FLAGS) \
$(SEMIHOSTING_LDFLAGS) \
-static \
-Wl,-gc-sections,-Map,$(TARGET_BL_MAP) \
-Wl,-L$(LINKER_DIR) \
-Wl,--cref \
-Wl,--no-wchar-size-warning \
-Wl,--print-memory-usage \
-T$(BL_LD_SCRIPT)
###############################################################################
# No user-serviceable parts below
###############################################################################
CPPCHECK = cppcheck $(CSOURCES) --enable=all --platform=unix64 \
--std=c99 --inline-suppr --quiet --force \
$(addprefix -I,$(INCLUDE_DIRS)) \
-I/usr/include -I/usr/include/linux
#
# Things we will build
#
TARGET_BIN := $(BIN_DIR)/$(FORKNAME)_$(FC_VER)
TARGET_BIN := $(TARGET_BIN)_$(TARGET)
TARGET_BL_BIN := $(TARGET_BIN)_bl
ifneq ($(BUILD_SUFFIX),)
TARGET_BIN := $(TARGET_BIN)_$(BUILD_SUFFIX)
TARGET_BL_BIN := $(TARGET_BL_BIN)_$(BUILD_SUFFIX)
endif
TARGET_BIN := $(TARGET_BIN).bin
TARGET_BL_BIN := $(TARGET_BL_BIN).bin
TARGET_HEX = $(TARGET_BIN:.bin=.hex)
TARGET_BL_HEX = $(TARGET_BL_BIN:.bin=.hex)
TARGET_COMBINED_HEX = $(basename $(TARGET_HEX))_combined.hex
TARGET_OBJ_DIR = $(OBJECT_DIR)/$(TARGET)
TARGET_BL_OBJ_DIR = $(BL_OBJECT_DIR)/$(TARGET)
TARGET_ELF = $(OBJECT_DIR)/$(FORKNAME)_$(TARGET).elf
TARGET_BL_ELF = $(BL_OBJECT_DIR)/$(FORKNAME)_$(TARGET).elf
TARGET_OBJS = $(addsuffix .o,$(addprefix $(TARGET_OBJ_DIR)/,$(basename $(TARGET_SRC))))
TARGET_BL_OBJS = $(addsuffix .o,$(addprefix $(TARGET_BL_OBJ_DIR)/,$(basename $(TARGET_BL_SRC))))
TARGET_DEPS = $(addsuffix .d,$(addprefix $(TARGET_OBJ_DIR)/,$(basename $(TARGET_SRC))))
TARGET_BL_DEPS = $(addsuffix .d,$(addprefix $(TARGET_BL_OBJ_DIR)/,$(basename $(TARGET_BL_SRC))))
TARGET_MAP = $(OBJECT_DIR)/$(FORKNAME)_$(TARGET).map
TARGET_BL_MAP = $(OBJECT_DIR)/$(FORKNAME)_$(TARGET)_bl.map
CLEAN_ARTIFACTS := $(TARGET_BIN)
CLEAN_ARTIFACTS += $(TARGET_HEX)
CLEAN_ARTIFACTS += $(TARGET_ELF)
CLEAN_ARTIFACTS += $(TARGET_OBJS) $(TARGET_MAP)
CLEAN_ARTIFACTS += $(TARGET_BL_BIN) $(TARGET_BL_HEX) $(TARGET_BL_ELF) $(TARGET_BL_OBJS) $(TARGET_BL_MAP)
include $(ROOT)/make/stamp.mk
include $(ROOT)/make/settings.mk
include $(ROOT)/make/svd.mk
# Make sure build date and revision is updated on every incremental build
$(TARGET_OBJ_DIR)/build/version.o $(TARGET_BL_OBJ_DIR)/build/version.o: $(TARGET_SRC)
# CFLAGS used for ASM generation. These can't include the LTO related options
# since they prevent proper ASM generation. Since $(LTO_FLAGS) includes the
# optization level, we have to add it back. -g is required to make interleaved
# source/ASM work.
ASM_CFLAGS=-g $(OPTIMZE) $(filter-out $(LTO_FLAGS) -save-temps=obj, $(CFLAGS))
# List of buildable ELF files and their object dependencies.
# It would be nice to compute these lists, but that seems to be just beyond make.
$(TARGET_HEX): $(TARGET_ELF)
$(V0) $(OBJCOPY) -O ihex --set-start $(FLASH_ORIGIN) $< $@
$(TARGET_BIN): $(TARGET_ELF)
$(V0) $(OBJCOPY) -O binary $< $@
$(TARGET_ELF): $(TARGET_OBJS)
$(V1) echo Linking $(TARGET)
$(V1) $(CROSS_CC) -o $@ $(filter %.o, $^) $(LDFLAGS)
$(V0) $(SIZE) $(TARGET_ELF)
$(TARGET_BL_HEX): $(TARGET_BL_ELF)
$(V0) $(OBJCOPY) -O ihex --set-start $(FLASH_ORIGIN) $< $@
$(TARGET_BL_BIN): $(TARGET_BL_ELF)
$(V0) $(OBJCOPY) -O binary $< $@
$(TARGET_BL_ELF): $(TARGET_BL_OBJS)
$(V1) echo Linking $(TARGET) bl
$(V1) $(CROSS_CC) -o $@ $(filter %.o, $^) $(BL_LDFLAGS)
$(V0) $(SIZE) $(TARGET_BL_ELF)
OPTIMIZE_FLAG_SPEED := "-Os"
OPTIMIZE_FLAG_SIZE := "-Os"
OPTIMIZE_FLAG_NORMAL := "-Os"
ifneq ($(TARGET_MCU_GROUP), STM32F3)
OPTIMIZE_FLAG_SPEED := "-Ofast"
OPTIMIZE_FLAG_SIZE := "-Os"
OPTIMIZE_FLAG_NORMAL := "-O2"
endif
define compile_file
echo "%% $(1) $(2) $<" "$(STDOUT)" && \
$(CROSS_CC) -c -o $@ $(CFLAGS) $(2) $<
endef
define compile_bl_file
echo "%% $(1) $(2) $<" "$(STDOUT)" && \
$(CROSS_CC) -c -o $@ $(CFLAGS) $(BL_CFLAGS) $(2) $<
endef
# Compile
$(TARGET_OBJ_DIR)/%.o: %.c
$(V1) mkdir -p $(dir $@)
$(V1) $(if $(findstring $<,$(SIZE_OPTIMISED_SRC)), \
$(call compile_file,(size),$(OPTIMIZE_FLAG_SIZE)) \
, \
$(if $(findstring $<,$(SPEED_OPTIMISED_SRC)), \
$(call compile_file,(speed),$(OPTIMIZE_FLAG_SPEED)) \
, \
$(call compile_file,(normal),$(OPTIMIZE_FLAG_NORMAL)) \
) \
)
ifeq ($(GENERATE_ASM), 1)
$(V1) $(CROSS_CC) -S -fverbose-asm -Wa,-aslh -o $(patsubst %.o,%.txt.S,$@) -g $(ASM_CFLAGS) $<
endif
$(TARGET_BL_OBJ_DIR)/%.o: %.c
$(V1) mkdir -p $(dir $@)
$(V1) $(if $(findstring $<,$(SIZE_OPTIMISED_SRC)), \
$(call compile_bl_file,(size),$(OPTIMIZE_FLAG_SIZE)) \
, \
$(if $(findstring $<,$(SPEED_OPTIMISED_SRC)), \
$(call compile_bl_file,(speed),$(OPTIMIZE_FLAG_SPEED)) \
, \
$(call compile_bl_file,(normal),$(OPTIMIZE_FLAG_NORMAL)) \
) \
)
ifeq ($(GENERATE_ASM), 1)
$(V1) $(CROSS_CC) -S -fverbose-asm -Wa,-aslh -o $(patsubst %.o,%.txt.S,$@) -g $(ASM_CFLAGS) $(BL_CFLAGS) $<
endif
# Assemble
$(TARGET_OBJ_DIR)/%.o $(TARGET_BL_OBJ_DIR)/%.o: %.s
$(V1) mkdir -p $(dir $@)
$(V1) echo %% $(notdir $<) "$(STDOUT)"
$(V1) $(CROSS_CC) -c -o $@ $(ASFLAGS) $<
$(TARGET_OBJ_DIR)/%.o $(TARGET_BL_OBJ_DIR)/%.o: %.S
$(V1) mkdir -p $(dir $@)
$(V1) echo %% $(notdir $<) "$(STDOUT)"
$(V1) $(CROSS_CC) -c -o $@ $(ASFLAGS) $<
# mkdirs
$(DL_DIR):
mkdir -p $@
$(TOOLS_DIR):
mkdir -p $@
## all : Build all valid targets
all: $(VALID_TARGETS)
## targets-group-rest: build targets specified in release-targets list
release: $(RELEASE_TARGETS)
$(VALID_TARGETS):
$(V0) echo "" && \
echo "Building $@" && \
CFLAGS=$(SAVED_CFLAGS) $(MAKE) -j 8 TARGET=$@ && \
echo "Building $@ succeeded."
$(VALID_BL_TARGETS):
$(V0) echo "" && \
echo "Building $@" && \
CFLAGS=$(SAVED_CFLAGS) $(MAKE) -j 8 TARGET=$(@:%_bl=%) bl_binary bl_hex && \
echo "Building $(@:%_bl=%) bl succeeded."
$(VALID_TARGETS_FOR_BL):
$(V0) echo "" && \
echo "Building $@" && \
CFLAGS=$(SAVED_CFLAGS) $(MAKE) -j 8 TARGET=$(@:%_for_bl=%) FOR_BL=1 binary hex && \
echo "Building $(@:%_for_bl=%) for bl succeeded."
$(VALID_TARGETS_WITH_BL):
$(V0) echo "" && \
echo "Building $@ with bl" && \
CFLAGS=$(SAVED_CFLAGS) $(MAKE) TARGET=$(@:%_with_bl=%) combined_hex && \
echo "Building $(@:%_with_bl=%) with bl succeeded."
combined_hex:
$(V1) echo "Building combined BL+MAIN hex" && \
CFLAGS=$(SAVED_CFLAGS) $(MAKE) -j 8 TARGET=$(TARGET) bl_binary && \
CFLAGS=$(SAVED_CFLAGS) $(MAKE) -j 8 TARGET=$(TARGET) binary FOR_BL=1 && \
echo "Combining MAIN+BL in $(TARGET_COMBINED_HEX)" && \
$(COMBINE_TOOL) $(TARGET_BL_BIN) $(TARGET_BIN) $(TARGET_COMBINED_HEX)
## clean : clean up all temporary / machine-generated files
clean:
$(V0) echo "Cleaning $(TARGET)"
$(V0) rm -f $(CLEAN_ARTIFACTS)
$(V0) rm -rf $(TARGET_OBJ_DIR)
$(V0) echo "Cleaning $(TARGET) succeeded."
## clean_test : clean up all temporary / machine-generated files (tests)
clean_test:
$(V0) $(RM) -r src/test/build
## clean_<TARGET> : clean up one specific target
$(CLEAN_TARGETS) :
$(V0) $(MAKE) -j 8 TARGET=$(subst clean_,,$@) clean
## <TARGET>_clean : clean up one specific target (alias for above)
$(TARGETS_CLEAN) :
$(V0) $(MAKE) -j 8 TARGET=$(subst _clean,,$@) clean
## clean_all : clean all valid targets
clean_all:$(CLEAN_TARGETS)
## all_clean : clean all valid targets (alias for above)
all_clean:$(TARGETS_CLEAN)
flash_$(TARGET): $(TARGET_HEX)
$(V0) stty -F $(SERIAL_DEVICE) raw speed 115200 -crtscts cs8 -parenb -cstopb -ixon
$(V0) echo -n 'R' >$(SERIAL_DEVICE)
$(V0) stm32flash -w $(TARGET_HEX) -v -g 0x0 -b 115200 $(SERIAL_DEVICE)
## flash : flash firmware (.hex) onto flight controller
flash: flash_$(TARGET)
$(STFLASH_TARGETS) :
$(V0) $(MAKE) -j 8 TARGET=$(subst st-flash_,,$@) st-flash
## st-flash : flash firmware (.bin) onto flight controller
st-flash: $(TARGET_BIN)
$(V0) st-flash --reset write $< $(FLASH_ORIGIN)
elf: $(TARGET_ELF)
binary: $(TARGET_BIN)
hex: $(TARGET_HEX)
bl_elf: $(TARGET_BL_ELF)
bl_binary: $(TARGET_BL_BIN)
bl_hex: $(TARGET_BL_HEX)
unbrick_$(TARGET): $(TARGET_HEX)
$(V0) stty -F $(SERIAL_DEVICE) raw speed 115200 -crtscts cs8 -parenb -cstopb -ixon
$(V0) stm32flash -w $(TARGET_HEX) -v -g 0x0 -b 115200 $(SERIAL_DEVICE)
## unbrick : unbrick flight controller
unbrick: unbrick_$(TARGET)
## cppcheck : run static analysis on C source code
cppcheck: $(CSOURCES)
$(V0) $(CPPCHECK)
cppcheck-result.xml: $(CSOURCES)
$(V0) $(CPPCHECK) --xml-version=2 2> cppcheck-result.xml
## help : print this help message and exit
help: Makefile
$(V0) @echo ""
$(V0) @echo "Makefile for the $(FORKNAME) firmware"
$(V0) @echo ""
$(V0) @echo "Usage:"
$(V0) @echo " make [TARGET=<target>] [OPTIONS=\"<options>\"]"
$(V0) @echo "Or:"
$(V0) @echo " make <target> [OPTIONS=\"<options>\"]"
$(V0) @echo ""
$(V0) @echo "Valid TARGET values are: $(VALID_TARGETS)"
$(V0) @echo ""
$(V0) @sed -n 's/^## //p' $<
## test : run the cleanflight test suite
test:
$(V0) mkdir -p src/test/build && cd src/test/build && cmake .. && $(MAKE) check
# rebuild everything when makefile changes
# Make the generated files and the build stamp order only prerequisites,
# so they will be generated before TARGET_OBJS but regenerating them
# won't cause all TARGET_OBJS to be rebuilt.
$(TARGET_OBJS) : Makefile | $(GENERATED_FILES) $(STAMP)
# include auto-generated dependencies
-include $(TARGET_DEPS)
# Developer tools
include $(ROOT)/make/openocd.mk
include $(ROOT)/make/gdb.mk

View file

@ -1,12 +1,32 @@
if [ -z "$1" ]; then
echo "Usage syntax: ./build.sh <TARGET>"
set -e
if [[ $# == 0 ]]; then
echo -e "\
Usage syntax: ./build.sh <TARGET>
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

View file

@ -0,0 +1,172 @@
# - Returns a version string from Git
#
# These functions force a re-configure on each git commit so that you can
# trust the values of the variables in your build system.
#
# get_git_head_revision(<refspecvar> <hashvar> [<additional arguments to git describe> ...])
#
# Returns the refspec and sha hash of the current head revision
#
# git_describe(<var> [<additional arguments to git describe> ...])
#
# Returns the results of git describe on the source tree, and adjusting
# the output so that it tests false if an error occurs.
#
# git_get_exact_tag(<var> [<additional arguments to git describe> ...])
#
# Returns the results of git describe --exact-match on the source tree,
# and adjusting the output so that it tests false if there was no exact
# matching tag.
#
# git_local_changes(<var>)
#
# Returns either "CLEAN" or "DIRTY" with respect to uncommitted changes.
# Uses the return code of "git diff-index --quiet HEAD --".
# Does not regard untracked files.
#
# Requires CMake 2.6 or newer (uses the 'function' command)
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
if(__get_git_revision_description)
return()
endif()
set(__get_git_revision_description YES)
# We must run the following at "include" time, not at function call time,
# to find the path to this module rather than the path to a calling list file
get_filename_component(_gitdescmoddir ${CMAKE_CURRENT_LIST_FILE} PATH)
function(get_git_head_revision _refspecvar _hashvar)
set(GIT_PARENT_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
set(GIT_DIR "${GIT_PARENT_DIR}/.git")
while(NOT EXISTS "${GIT_DIR}") # .git dir not found, search parent directories
set(GIT_PREVIOUS_PARENT "${GIT_PARENT_DIR}")
get_filename_component(GIT_PARENT_DIR ${GIT_PARENT_DIR} PATH)
if(GIT_PARENT_DIR STREQUAL GIT_PREVIOUS_PARENT)
# We have reached the root directory, we are not in git
set(${_refspecvar} "GITDIR-NOTFOUND" PARENT_SCOPE)
set(${_hashvar} "GITDIR-NOTFOUND" PARENT_SCOPE)
return()
endif()
set(GIT_DIR "${GIT_PARENT_DIR}/.git")
endwhile()
# check if this is a submodule
if(NOT IS_DIRECTORY ${GIT_DIR})
file(READ ${GIT_DIR} submodule)
string(REGEX REPLACE "gitdir: (.*)\n$" "\\1" GIT_DIR_RELATIVE ${submodule})
get_filename_component(SUBMODULE_DIR ${GIT_DIR} PATH)
get_filename_component(GIT_DIR ${SUBMODULE_DIR}/${GIT_DIR_RELATIVE} ABSOLUTE)
endif()
if(NOT IS_DIRECTORY "${GIT_DIR}")
file(READ ${GIT_DIR} worktree)
string(REGEX REPLACE "gitdir: (.*)worktrees(.*)\n$" "\\1" GIT_DIR ${worktree})
endif()
set(GIT_DATA "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/git-data")
if(NOT EXISTS "${GIT_DATA}")
file(MAKE_DIRECTORY "${GIT_DATA}")
endif()
if(NOT EXISTS "${GIT_DIR}/HEAD")
return()
endif()
set(HEAD_FILE "${GIT_DATA}/HEAD")
configure_file("${GIT_DIR}/HEAD" "${HEAD_FILE}" COPYONLY)
configure_file("${_gitdescmoddir}/GetGitRevisionDescription.cmake.in"
"${GIT_DATA}/grabRef.cmake"
@ONLY)
include("${GIT_DATA}/grabRef.cmake")
set(${_refspecvar} "${HEAD_REF}" PARENT_SCOPE)
set(${_hashvar} "${HEAD_HASH}" PARENT_SCOPE)
endfunction()
function(git_describe _var)
if(NOT GIT_FOUND)
find_package(Git QUIET)
endif()
get_git_head_revision(refspec hash)
if(NOT GIT_FOUND)
set(${_var} "GIT-NOTFOUND" PARENT_SCOPE)
return()
endif()
if(NOT hash)
set(${_var} "HEAD-HASH-NOTFOUND" PARENT_SCOPE)
return()
endif()
# TODO sanitize
#if((${ARGN}" MATCHES "&&") OR
# (ARGN MATCHES "||") OR
# (ARGN MATCHES "\\;"))
# message("Please report the following error to the project!")
# message(FATAL_ERROR "Looks like someone's doing something nefarious with git_describe! Passed arguments ${ARGN}")
#endif()
#message(STATUS "Arguments to execute_process: ${ARGN}")
execute_process(COMMAND
"${GIT_EXECUTABLE}"
describe
${hash}
${ARGN}
WORKING_DIRECTORY
"${CMAKE_CURRENT_SOURCE_DIR}"
RESULT_VARIABLE
res
OUTPUT_VARIABLE
out
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT res EQUAL 0)
set(out "${out}-${res}-NOTFOUND")
endif()
set(${_var} "${out}" PARENT_SCOPE)
endfunction()
function(git_get_exact_tag _var)
git_describe(out --exact-match ${ARGN})
set(${_var} "${out}" PARENT_SCOPE)
endfunction()
function(git_local_changes _var)
if(NOT GIT_FOUND)
find_package(Git QUIET)
endif()
get_git_head_revision(refspec hash)
if(NOT GIT_FOUND)
set(${_var} "GIT-NOTFOUND" PARENT_SCOPE)
return()
endif()
if(NOT hash)
set(${_var} "HEAD-HASH-NOTFOUND" PARENT_SCOPE)
return()
endif()
execute_process(COMMAND
"${GIT_EXECUTABLE}"
diff-index --quiet HEAD --
WORKING_DIRECTORY
"${CMAKE_CURRENT_SOURCE_DIR}"
RESULT_VARIABLE
res
OUTPUT_VARIABLE
out
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(res EQUAL 0)
set(${_var} "CLEAN" PARENT_SCOPE)
else()
set(${_var} "DIRTY" PARENT_SCOPE)
endif()
endfunction()

View file

@ -0,0 +1,41 @@
#
# Internal file for GetGitRevisionDescription.cmake
#
# Requires CMake 2.6 or newer (uses the 'function' command)
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
set(HEAD_HASH)
file(READ "@HEAD_FILE@" HEAD_CONTENTS LIMIT 1024)
string(STRIP "${HEAD_CONTENTS}" HEAD_CONTENTS)
if(HEAD_CONTENTS MATCHES "ref")
# named branch
string(REPLACE "ref: " "" HEAD_REF "${HEAD_CONTENTS}")
if(EXISTS "@GIT_DIR@/${HEAD_REF}")
configure_file("@GIT_DIR@/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY)
else()
configure_file("@GIT_DIR@/packed-refs" "@GIT_DATA@/packed-refs" COPYONLY)
file(READ "@GIT_DATA@/packed-refs" PACKED_REFS)
if(${PACKED_REFS} MATCHES "([0-9a-z]*) ${HEAD_REF}")
set(HEAD_HASH "${CMAKE_MATCH_1}")
endif()
endif()
else()
# detached HEAD
configure_file("@GIT_DIR@/HEAD" "@GIT_DATA@/head-ref" COPYONLY)
endif()
if(NOT HEAD_HASH)
file(READ "@GIT_DATA@/head-ref" HEAD_HASH LIMIT 1024)
string(STRIP "${HEAD_HASH}" HEAD_HASH)
endif()

View file

@ -0,0 +1,119 @@
include(gcc)
set(arm_none_eabi_triplet "arm-none-eabi")
# Keep version in sync with the distribution files below
set(arm_none_eabi_gcc_version "9.2.1")
set(arm_none_eabi_base_url "https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2019q4/gcc-arm-none-eabi-9-2019-q4-major")
# suffix and sha1
set(arm_none_eabi_win32 "win32.zip" 60f364ecf2e8717a58d352db95b388eee508b727)
set(arm_none_eabi_linux_amd64 "x86_64-linux.tar.bz2" 3829ff61b2601c6cf061a5a275c2538a96a8d521)
set(arm_none_eabi_linux_aarch64 "aarch64-linux.tar.bz2" fdb6fe7058927ad897f63d2d245f825a9587a1c5)
set(arm_none_eabi_gcc_macos "mac.tar.bz2" 26fe33e0c25d9a2947c0373ea48c00ef46eacd58)
function(arm_none_eabi_gcc_distname var)
string(REPLACE "/" ";" url_parts ${arm_none_eabi_base_url})
list(LENGTH url_parts n)
math(EXPR last "${n} - 1")
list(GET url_parts ${last} basename)
set(${var} ${basename} PARENT_SCOPE)
endfunction()
function(host_uname_machine var)
# We need to call uname -m manually, since at the point
# this file is included CMAKE_HOST_SYSTEM_PROCESSOR is
# empty because we haven't called project() yet.
execute_process(COMMAND uname -m
OUTPUT_STRIP_TRAILING_WHITESPACE
OUTPUT_VARIABLE machine)
set(${var} ${machine} PARENT_SCOPE)
endfunction()
function(arm_none_eabi_gcc_install)
set(dist "")
if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
set(dist ${arm_none_eabi_win32})
elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_HOST_SYSTEM_NAME STREQUAL "FreeBSD")
if(NOT CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")
message("-- no compiler binaries available for ${CMAKE_HOST_SYSTEM_NAME}, using Linux binaries as a fallback")
endif()
host_uname_machine(machine)
# Linux returns x86_64, FreeBSD returns amd64
if(machine STREQUAL "x86_64" OR machine STREQUAL "amd64")
set(dist ${arm_none_eabi_linux_amd64})
elseif(machine STREQUAL "aarch64")
set(dist ${arm_none_eabi_linux_aarch64})
else()
message("-- no precompiled ${arm_none_eabi_triplet} toolchain for machine ${machine}")
endif()
elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")
set(dist ${arm_none_eabi_gcc_macos})
endif()
if(dist STREQUAL "")
message(FATAL_ERROR "could not install ${arm_none_eabi_triplet}-gcc automatically")
endif()
list(GET dist 0 dist_suffix)
list(GET dist 1 dist_sha1)
set(dist_url "${arm_none_eabi_base_url}-${dist_suffix}")
string(REPLACE "/" ";" url_parts ${dist_url})
list(LENGTH url_parts n)
math(EXPR last "${n} - 1")
list(GET url_parts ${last} basename)
set(output "${DOWNLOADS_DIR}/${basename}")
message("-- downloading ${arm_none_eabi_triplet}-gcc ${arm_none_eabi_gcc_version} from ${dist_url}")
file(DOWNLOAD ${dist_url} ${output}
INACTIVITY_TIMEOUT 30
STATUS status
SHOW_PROGRESS
EXPECTED_HASH SHA1=${dist_sha1}
TLS_VERIFY ON
)
list(GET status 0 status_code)
if(NOT status_code EQUAL 0)
list(GET status 1 status_message)
message(FATAL_ERROR "error downloading ${basename}: ${status_message}")
endif()
message("-- extracting ${basename}")
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${TOOLS_DIR})
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xf ${output}
RESULT_VARIABLE status
WORKING_DIRECTORY ${TOOLS_DIR}
)
if(NOT status EQUAL 0)
message(FATAL_ERROR "error extracting ${basename}: ${status}")
endif()
endfunction()
function(arm_none_eabi_gcc_add_path)
arm_none_eabi_gcc_distname(dist_name)
set(gcc_path "${TOOLS_DIR}/${dist_name}/bin")
if(CMAKE_HOST_SYSTEM MATCHES ".*Windows.*")
set(sep "\\;")
else()
set(sep ":")
endif()
set(ENV{PATH} "${gcc_path}${sep}$ENV{PATH}")
endfunction()
function(arm_none_eabi_gcc_check)
gcc_get_version(version
TRIPLET ${arm_none_eabi_triplet}
PROGRAM_NAME prog
PROGRAM_PATH prog_path
)
if(NOT version)
message("-- could not find ${prog}")
arm_none_eabi_gcc_install()
return()
endif()
message("-- found ${prog} ${version} at ${prog_path}")
if(COMPILER_VERSION_CHECK AND NOT arm_none_eabi_gcc_version STREQUAL version)
message("-- expecting ${prog} version ${arm_none_eabi_gcc_version}, but got version ${version} instead")
arm_none_eabi_gcc_install()
return()
endif()
endfunction()
arm_none_eabi_gcc_add_path()
arm_none_eabi_gcc_check()

View file

@ -6,35 +6,16 @@ if(WIN32)
endif()
set(TARGET_TRIPLET "arm-none-eabi")
set(gcc "${TARGET_TRIPLET}-gcc${TOOL_EXECUTABLE_SUFFIX}")
find_program(GCC "${gcc}")
if (NOT GCC)
message(FATAL_ERROR "Could not find ${gcc}")
endif()
set(ARM_NONE_EABI_GCC_VERSION 9.2.1)
execute_process(COMMAND "${GCC}" -dumpversion
OUTPUT_STRIP_TRAILING_WHITESPACE
OUTPUT_VARIABLE GCC_VERSION)
if (NOT ${ARM_NONE_EABI_GCC_VERSION} STREQUAL ${GCC_VERSION})
# TODO: Show how to override on cmdline or install builtin compiler
message(FATAL_ERROR "Expecting gcc version ${ARM_NONE_EABI_GCC_VERSION}, but found ${GCC_VERSION}")
endif()
get_filename_component(TOOLCHAIN_BIN_DIR "${GCC}" DIRECTORY)
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
set(CMAKE_ASM_COMPILER "${TOOLCHAIN_BIN_DIR}/${TARGET_TRIPLET}-gcc${TOOL_EXECUTABLE_SUFFIX}" CACHE INTERNAL "asm compiler")
set(CMAKE_C_COMPILER "${TOOLCHAIN_BIN_DIR}/${TARGET_TRIPLET}-gcc${TOOL_EXECUTABLE_SUFFIX}" CACHE INTERNAL "c compiler")
set(CMAKE_CXX_COMPILER "${TOOLCHAIN_BIN_DIR}/${TARGET_TRIPLET}-g++${TOOL_EXECUTABLE_SUFFIX}" CACHE INTERNAL "c++ compiler")
set(CMAKE_OBJCOPY "${TOOLCHAIN_BIN_DIR}/${TARGET_TRIPLET}-objcopy${TOOL_EXECUTABLE_SUFFIX}" CACHE INTERNAL "objcopy tool")
set(CMAKE_OBJDUMP "${TOOLCHAIN_BIN_DIR}/${TARGET_TRIPLET}-objdump${TOOL_EXECUTABLE_SUFFIX}" CACHE INTERNAL "objdump tool")
set(CMAKE_SIZE "${TOOLCHAIN_BIN_DIR}/${TARGET_TRIPLET}-size${TOOL_EXECUTABLE_SUFFIX}" CACHE INTERNAL "size tool")
set(CMAKE_DEBUGER "${TOOLCHAIN_BIN_DIR}/${TARGET_TRIPLET}-gdb${TOOL_EXECUTABLE_SUFFIX}" CACHE INTERNAL "debuger")
set(CMAKE_CPPFILT "${TOOLCHAIN_BIN_DIR}/${TARGET_TRIPLET}-c++filt${TOOL_EXECUTABLE_SUFFIX}" CACHE INTERNAL "c++filt")
set(CMAKE_ASM_COMPILER "${TARGET_TRIPLET}-gcc${TOOL_EXECUTABLE_SUFFIX}" CACHE INTERNAL "asm compiler")
set(CMAKE_C_COMPILER "${TARGET_TRIPLET}-gcc${TOOL_EXECUTABLE_SUFFIX}" CACHE INTERNAL "c compiler")
set(CMAKE_CXX_COMPILER "${TARGET_TRIPLET}-g++${TOOL_EXECUTABLE_SUFFIX}" CACHE INTERNAL "c++ compiler")
set(CMAKE_OBJCOPY "${TARGET_TRIPLET}-objcopy${TOOL_EXECUTABLE_SUFFIX}" CACHE INTERNAL "objcopy tool")
set(CMAKE_OBJDUMP "${TARGET_TRIPLET}-objdump${TOOL_EXECUTABLE_SUFFIX}" CACHE INTERNAL "objdump tool")
set(CMAKE_SIZE "${TARGET_TRIPLET}-size${TOOL_EXECUTABLE_SUFFIX}" CACHE INTERNAL "size tool")
set(CMAKE_DEBUGGER "${TARGET_TRIPLET}-gdb${TOOL_EXECUTABLE_SUFFIX}" CACHE INTERNAL "debugger")
set(CMAKE_CPPFILT "${TARGET_TRIPLET}-c++filt${TOOL_EXECUTABLE_SUFFIX}" CACHE INTERNAL "c++filt")
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
@ -43,21 +24,25 @@ set(CMAKE_EXECUTABLE_SUFFIX ".elf")
if(NOT CMAKE_CONFIGURATION_TYPES)
set(CMAKE_CONFIGURATION_TYPES Debug Release RelWithDebInfo)
endif()
set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Build Type" FORCE)
if(CMAKE_BUILD_TYPE STREQUAL "")
set(CMAKE_BUILD_TYPE RelWithDebInfo)
endif()
set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "Build Type" FORCE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${CMAKE_CONFIGURATION_TYPES})
set(arm_none_eabi_debug "-Og -g")
set(arm_none_eabi_release "-O2 -DNDEBUG -flto -fuse-linker-plugin")
# We set -Os or -O2 depending on the MCU family
set(arm_none_eabi_release "-DNDEBUG")
set(arm_none_eabi_relwithdebinfo "-ggdb3 ${arm_none_eabi_release}")
SET(CMAKE_C_FLAGS_DEBUG ${arm_none_eabi_debug} CACHE INTERNAL "c compiler flags debug")
SET(CMAKE_CXX_FLAGS_DEBUG ${arm_none_eabi_debug} CACHE INTERNAL "c++ compiler flags debug")
SET(CMAKE_ASM_FLAGS_DEBUG ${arm_none_eabi_debug} CACHE INTERNAL "asm compiler flags debug")
set(CMAKE_C_FLAGS_DEBUG ${arm_none_eabi_debug} CACHE INTERNAL "c compiler flags debug")
set(CMAKE_CXX_FLAGS_DEBUG ${arm_none_eabi_debug} CACHE INTERNAL "c++ compiler flags debug")
set(CMAKE_ASM_FLAGS_DEBUG ${arm_none_eabi_debug} CACHE INTERNAL "asm compiler flags debug")
SET(CMAKE_C_FLAGS_RELEASE ${arm_none_eabi_release} CACHE INTERNAL "c compiler flags release")
SET(CMAKE_CXX_FLAGS_RELEASE ${arm_none_eabi_release} CACHE INTERNAL "cxx compiler flags release")
SET(CMAKE_ASM_FLAGS_RELEASE ${arm_none_eabi_release} CACHE INTERNAL "asm compiler flags release")
set(CMAKE_C_FLAGS_RELEASE ${arm_none_eabi_release} CACHE INTERNAL "c compiler flags release")
set(CMAKE_CXX_FLAGS_RELEASE ${arm_none_eabi_release} CACHE INTERNAL "cxx compiler flags release")
set(CMAKE_ASM_FLAGS_RELEASE ${arm_none_eabi_release} CACHE INTERNAL "asm compiler flags release")
SET(CMAKE_C_FLAGS_RELWITHDEBINFO ${arm_none_eabi_relwithdebinfo} CACHE INTERNAL "c compiler flags release")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO ${arm_none_eabi_relwithdebinfo} CACHE INTERNAL "cxx compiler flags release")
SET(CMAKE_ASM_FLAGS_RELWITHDEBINFO ${arm_none_eabi_relwithdebinfo} CACHE INTERNAL "asm compiler flags release")
set(CMAKE_C_FLAGS_RELWITHDEBINFO ${arm_none_eabi_relwithdebinfo} CACHE INTERNAL "c compiler flags release")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO ${arm_none_eabi_relwithdebinfo} CACHE INTERNAL "cxx compiler flags release")
set(CMAKE_ASM_FLAGS_RELWITHDEBINFO ${arm_none_eabi_relwithdebinfo} CACHE INTERNAL "asm compiler flags release")

15
cmake/ci.cmake Normal file
View file

@ -0,0 +1,15 @@
if(DEFINED CI_JOB_INDEX AND DEFINED CI_JOB_COUNT)
math(EXPR job_name "${CI_JOB_INDEX}+1")
message("-- configuring CI job ${job_name}/${CI_JOB_COUNT}")
get_property(targets GLOBAL PROPERTY RELEASE_TARGETS)
list(LENGTH targets count)
math(EXPR per_job "(${count}+${CI_JOB_COUNT}-1)/${CI_JOB_COUNT}")
message("-- ${per_job} targets per job")
math(EXPR start "${CI_JOB_INDEX}*${per_job}")
list(SUBLIST targets ${start} ${per_job} ci_targets)
message("-- will build targets: ${ci_targets}")
add_custom_target(ci
${CMAKE_COMMAND} -E true
DEPENDS ${ci_targets}
)
endif()

23
cmake/cortex-m4f.cmake Normal file
View file

@ -0,0 +1,23 @@
set(CORTEX_M4F_COMMON_OPTIONS
-mthumb
-mcpu=cortex-m4
-march=armv7e-m
-mfloat-abi=hard
-mfpu=fpv4-sp-d16
-fsingle-precision-constant
-Wdouble-promotion
)
set(CORTEX_M4F_COMPILE_OPTIONS
)
set(CORTEX_M4F_LINK_OPTIONS
)
set(CORTEX_M4F_DEFINITIONS
__FPU_PRESENT=1
ARM_MATH_CM4
ARM_MATH_MATRIX_CHECK
ARM_MATH_ROUNDING
UNALIGNED_SUPPORT_DISABLE
)

22
cmake/cortex-m7.cmake Normal file
View file

@ -0,0 +1,22 @@
set(CORTEX_M7_COMMON_OPTIONS
-mthumb
-mcpu=cortex-m7
-mfloat-abi=hard
-mfpu=fpv5-sp-d16
-fsingle-precision-constant
-Wdouble-promotion
)
set(CORTEX_M7_COMPILE_OPTIONS
)
set(CORTEX_M7_LINK_OPTIONS
)
set(CORTEX_M7_DEFINITIONS
__FPU_PRESENT=1
ARM_MATH_CM7
ARM_MATH_MATRIX_CHECK
ARM_MATH_ROUNDING
UNALIGNED_SUPPORT_DISABLE
)

29
cmake/docker.sh Executable file
View file

@ -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 "$@"

34
cmake/gcc.cmake Normal file
View file

@ -0,0 +1,34 @@
function(gcc_get_version var)
cmake_parse_arguments(args
""
"TRIPLET;PROGRAM_NAME;PROGRAM_PATH"
""
${ARGN}
)
set(prog "gcc")
if(args_TRIPLET)
set(prog "${args_TRIPLET}-${prog}")
endif()
if(args_PROGRAM_NAME)
set(${args_PROGRAM_NAME} ${prog} PARENT_SCOPE)
endif()
find_program(gcc ${prog})
if (NOT gcc)
set(${var} OFF PARENT_SCOPE)
endif()
if(args_PROGRAM_PATH)
set(${args_PROGRAM_PATH} ${gcc} PARENT_SCOPE)
endif()
execute_process(COMMAND "${gcc}" -dumpversion
OUTPUT_STRIP_TRAILING_WHITESPACE
OUTPUT_VARIABLE version)
if("" STREQUAL version)
set(${var} OFF PARENT_SCOPE)
else()
set(${var} ${version} PARENT_SCOPE)
endif()
endfunction()

View file

@ -1,65 +0,0 @@
set(INAV_INCLUDE_DIRS
"${INAV_LIB_DIR}"
"${INAV_MAIN_SRC_DIR}"
"${INAV_LIB_DIR}/main/MAVLink"
)
# TODO: We need a way to override HSE_VALUE
set(INAV_DEFINITIONS
__FORKNAME__=inav
__REVISION__="${GIT_SHORT_HASH}"
HSE_VALUE=8000000
)
set(INAV_COMPILE_OPTIONS
-Wall
-Wextra
-Wunsafe-loop-optimizations
-Wdouble-promotion
-Wstrict-prototypes
-Werror=switch
)
macro(main_sources) # list-var
list(TRANSFORM ${ARGV0} PREPEND "${INAV_MAIN_SRC_DIR}/")
endmacro()
macro(exclude_basenames) # list-var excludes-var
set(_filtered "")
foreach(item ${${ARGV0}})
get_filename_component(basename ${item} NAME)
if (NOT ${basename} IN_LIST ${ARGV1})
list(APPEND _filtered ${item})
endif()
endforeach()
set(${ARGV0} ${_filtered})
endmacro()
macro(glob_except) # var-name pattern excludes-var
file(GLOB ${ARGV0} ${ARGV1})
exclude_basenames(${ARGV0} ${ARGV2})
endmacro()
function(setup_firmware_target name)
target_compile_options(${name} PRIVATE ${INAV_COMPILE_OPTIONS})
target_include_directories(${name} PRIVATE ${INAV_INCLUDE_DIRS})
target_compile_definitions(${name} PRIVATE ${INAV_DEFINITIONS} __TARGET__="${name}")
enable_settings(${name})
# XXX: Don't make SETTINGS_GENERATED_C part of the build,
# since it's compiled via #include in settings.c. This will
# change once we move off PGs
target_sources(${name} PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/${name}/${SETTINGS_GENERATED_H}")
set_target_properties(${name} PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
)
get_property(targets GLOBAL PROPERTY VALID_TARGETS)
set_property(GLOBAL PROPERTY VALID_TARGETS "${targets} ${name}")
endfunction()
function(collect_targets)
get_property(targets GLOBAL PROPERTY VALID_TARGETS)
list(SORT targets)
add_custom_target("targets"
COMMAND cmake -E echo "Valid targets: ${targets}")
set_property(TARGET "targets" PROPERTY TARGET_MESSAGES OFF)
endfunction()

121
cmake/main.cmake Normal file
View file

@ -0,0 +1,121 @@
set(MAIN_INCLUDE_DIRS
"${MAIN_LIB_DIR}"
"${MAIN_SRC_DIR}"
"${MAIN_LIB_DIR}/main/MAVLink"
)
set(MAIN_DEFINITIONS
__FORKNAME__=inav
__REVISION__="${GIT_REV}"
)
set(MAIN_COMPILE_OPTIONS
-Wall
-Wextra
-Wunsafe-loop-optimizations
-Wdouble-promotion
-Wstrict-prototypes
-Werror=switch
)
macro(main_sources var) # list-var src-1...src-n
set(${var} ${ARGN})
list(TRANSFORM ${var} PREPEND "${MAIN_SRC_DIR}/")
endmacro()
function(exclude_basenames var excludes)
set(filtered "")
foreach(item ${${var}})
get_filename_component(basename ${item} NAME)
if (NOT ${basename} IN_LIST excludes)
list(APPEND filtered ${item})
endif()
endforeach()
set(${var} ${filtered} PARENT_SCOPE)
endfunction()
function(glob_except var pattern excludes)
file(GLOB results ${pattern})
list(LENGTH results count)
if(count EQUAL 0)
message(FATAL_ERROR "glob with pattern '${pattern}' returned no results")
endif()
exclude_basenames(results "${excludes}")
set(${var} ${results} PARENT_SCOPE)
endfunction()
function(get_generated_files_dir output target_name)
set(${output} ${CMAKE_CURRENT_BINARY_DIR}/${target_name} PARENT_SCOPE)
endfunction()
function(setup_executable exe name)
get_generated_files_dir(generated_dir ${name})
target_compile_options(${exe} PRIVATE ${MAIN_COMPILE_OPTIONS})
target_include_directories(${exe} PRIVATE ${generated_dir} ${MAIN_INCLUDE_DIRS})
target_compile_definitions(${exe} PRIVATE ${MAIN_DEFINITIONS} __TARGET__="${name}" ${name})
# XXX: Don't make SETTINGS_GENERATED_C part of the build,
# since it's compiled via #include in settings.c. This will
# change once we move off PGs
target_sources(${exe} PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/${name}/${SETTINGS_GENERATED_H}")
set_target_properties(${exe} PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
)
if(IS_RELEASE_BUILD)
set_target_properties(${exe} PROPERTIES
INTERPROCEDURAL_OPTIMIZATION ON
)
endif()
endfunction()
function(setup_firmware_target exe name)
setup_executable(${exe} ${name})
enable_settings(${exe} ${name})
get_property(targets GLOBAL PROPERTY VALID_TARGETS)
list(APPEND targets ${name})
set_property(GLOBAL PROPERTY VALID_TARGETS "${targets}")
setup_openocd(${exe} ${name})
setup_svd(${exe} ${name})
cmake_parse_arguments(args "SKIP_RELEASES" "" "" ${ARGN})
if(args_SKIP_RELEASES)
set_target_properties(${exe} ${name} PROPERTIES SKIP_RELEASES ON)
endif()
endfunction()
function(exclude_from_all target)
set_property(TARGET ${target} PROPERTY
TARGET_MESSAGES OFF
EXCLUDE_FROM_ALL 1
EXCLUDE_FROM_DEFAULT_BUILD 1)
endfunction()
function(collect_targets)
get_property(targets GLOBAL PROPERTY VALID_TARGETS)
list(SORT targets)
set(release_targets)
foreach(target ${targets})
get_target_property(skip_releases ${target} SKIP_RELEASES)
if(NOT skip_releases)
list(APPEND release_targets ${target})
endif()
endforeach()
list(JOIN targets " " target_names)
list(JOIN release_targets " " release_targets_names)
set_property(GLOBAL PROPERTY RELEASE_TARGETS ${release_targets})
set(list_target_name "targets")
add_custom_target(${list_target_name}
COMMAND ${CMAKE_COMMAND} -E echo "Valid targets: ${target_names}"
COMMAND ${CMAKE_COMMAND} -E echo "Release targets: ${release_targets_names}"
)
exclude_from_all(${list_target_name})
set(release_target_name "release")
add_custom_target(${release_target_name}
${CMAKE_COMMAND} -E true
DEPENDS ${release_targets}
)
list(LENGTH targets target_count)
list(LENGTH release_targets release_target_count)
message("-- ${target_count} targets (${release_target_count} for release) found for toolchain ${TOOLCHAIN}")
endfunction()

84
cmake/openocd.cmake Normal file
View file

@ -0,0 +1,84 @@
set(OPENOCD "" CACHE STRING "path to openocd (default: search for it)")
set(OPENOCD_CFG "" CACHE STRING "path to openocd configuration (default: generate automatically)")
set(OPENOCD_INTERFACE "" CACHE STRING "openocd interface name (default: automatic depending on target)")
if (OPENOCD)
set(OPENOCD_PATH ${OPENOCD})
else()
find_program(OPENOCD_FOUND_PATH NAMES openocd openocd.exe)
if (NOT OPENOCD_FOUND_PATH)
message(STATUS "Could not find openocd, debugging won't be available")
else()
set(OPENOCD_PATH ${OPENOCD_FOUND_PATH})
endif()
endif()
if(OPENOCD_PATH)
# Retrieve version number as a sanity check
execute_process(COMMAND ${OPENOCD_PATH} -v
OUTPUT_QUIET
ERROR_VARIABLE OPENOCD_HELP
RESULT_VARIABLE OPENOCD_RESULT)
string(REPLACE "\n" ";" OPENOCD_HELP_LINES ${OPENOCD_HELP})
list(GET OPENOCD_HELP_LINES 0 OPENOCD_FIRST_HELP_LINE)
string(REPLACE "\r" "" OPENOCD_HELP_LINE ${OPENOCD_FIRST_HELP_LINE})
if (NOT OPENOCD_RESULT EQUAL 0)
# User provided an incorrect path
message(FATAL_ERROR "error executing ${OPENOCD_PATH} (${OPENOCD_RESULT})")
endif()
message(STATUS "using openocd: ${OPENOCD_HELP_LINE}")
add_custom_target(openocd ${OPENOCD_PATH} -f ${OPENOCD_CFG}
COMMENT "Run openocd using OPENOCD_CFG=(${OPENOCD_CFG}) as configuration"
USES_TERMINAL
)
endif()
function(setup_openocd target_exe target_name)
if(OPENOCD_INTERFACE)
set(openocd_interface ${OPENOCD_INTERFACE})
else()
get_property(openocd_interface TARGET ${target_exe} PROPERTY OPENOCD_DEFAULT_INTERFACE)
endif()
get_property(openocd_target TARGET ${target_exe} PROPERTY OPENOCD_TARGET)
if(OPENOCD_CFG OR (openocd_target AND openocd_interface))
set(openocd_run_target "openocd_${target_name}")
if (OPENOCD_CFG AND NOT OPENOCD_CFG STREQUAL "")
get_filename_component(openocd_cfg_path ${OPENOCD_CFG}
ABSOLUTE
BASE_DIR ${CMAKE_BINARY_DIR})
else()
set(openocd_cfg_path ${CMAKE_BINARY_DIR}/openocd/${target_name}.cfg)
add_custom_command(
OUTPUT ${openocd_cfg_path}
COMMENT "Generating openocd configuration for ${openocd_target} via ${openocd_interface}"
COMMAND ${CMAKE_COMMAND} -P ${MAIN_DIR}/cmake/openocd_cfg.cmake
${openocd_target} ${openocd_interface} ${openocd_cfg_path}
)
endif()
# Target for openocd configuration
set(openocd_cfg_target "openocd_cfg_${target_name}")
add_custom_target(${openocd_cfg_target} DEPENDS ${openocd_cfg_path})
exclude_from_all(${openocd_cfg_target})
# Target for running openocd
add_custom_target(${openocd_run_target} ${OPENOCD_PATH} -f ${openocd_cfg_path}
COMMENT "Running openocd for target ${target_name} via ${openocd_interface}"
DEPENDS ${openocd_cfg_path}
USES_TERMINAL
)
exclude_from_all(${openocd_run_target})
# Target for flashing via openocd
set(openocd_flash_target "openocd_flash_${target_name}")
add_custom_target(${openocd_flash_target} ${CMAKE_COMMAND} -E env
OPENOCD_CMD=${OPENOCD_PATH}
${MAIN_UTILS_DIR}/openocd_flash.py -f
${openocd_cfg_path} $<TARGET_FILE:${target_exe}>
COMMENT "Flashing ${target_name} with openocd"
DEPENDS ${openocd_cfg_path} ${target_exe}
)
exclude_from_all(${openocd_flash_target})
endif()
endfunction()

20
cmake/openocd_cfg.cmake Normal file
View file

@ -0,0 +1,20 @@
# This is called from the targets that build the
# openocd.cfg file
if(NOT CMAKE_ARGC EQUAL 6)
message(FATAL_ERROR "usage: cmake -P openocd_cfg.cmake <target> <interface> <output>")
endif()
set(OPENOCD_TARGET ${CMAKE_ARGV3})
set(OPENOCD_INTERFACE ${CMAKE_ARGV4})
set(OUTPUT ${CMAKE_ARGV5})
set(opencd_cfg)
list(APPEND openocd_cfg "source [find interface/${OPENOCD_INTERFACE}.cfg]")
list(APPEND openocd_cfg "source [find target/${OPENOCD_TARGET}.cfg]")
list(APPEND openocd_cfg "init")
list(APPEND openocd_cfg "arm semihosting enable")
list(APPEND openocd_cfg "reset halt")
list(JOIN openocd_cfg "\n" contents)
set(contents "${contents}\n")
file(WRITE ${OUTPUT} ${contents})

View file

@ -1,16 +1,16 @@
set(SETTINGS_GENERATED "settings_generated")
set(SETTINGS_GENERATED_C "${SETTINGS_GENERATED}.c")
set(SETTINGS_GENERATED_H "${SETTINGS_GENERATED}.h")
set(SETTINGS_FILE "${INAV_MAIN_SRC_DIR}/fc/settings.yaml")
set(SETTINGS_GENERATOR "${INAV_UTILS_DIR}/settings.rb")
set(SETTINGS_FILE "${MAIN_SRC_DIR}/fc/settings.yaml")
set(SETTINGS_GENERATOR "${MAIN_UTILS_DIR}/settings.rb")
function(enable_settings target)
set(dir "${CMAKE_CURRENT_BINARY_DIR}/${target}")
target_include_directories(${target} PRIVATE ${dir})
get_target_property(options ${target} COMPILE_OPTIONS)
get_target_property(includes ${target} INCLUDE_DIRECTORIES)
function(enable_settings exe name)
get_generated_files_dir(dir ${name})
get_target_property(options ${exe} COMPILE_OPTIONS)
get_target_property(includes ${exe} INCLUDE_DIRECTORIES)
list(TRANSFORM includes PREPEND "-I")
get_target_property(defs ${target} COMPILE_DEFINITIONS)
get_target_property(defs ${exe} COMPILE_DEFINITIONS)
list(TRANSFORM defs PREPEND "-D")
list(APPEND cflags ${options})
list(APPEND cflags ${includes})
@ -18,8 +18,8 @@ function(enable_settings target)
add_custom_command(
OUTPUT ${dir}/${SETTINGS_GENERATED_H} ${dir}/${SETTINGS_GENERATED_C}
COMMAND
${CMAKE_COMMAND} -E env CFLAGS="${cflags}" TARGET=${target}
${RUBY_EXECUTABLE} ${SETTINGS_GENERATOR} ${INAV_DIR} ${SETTINGS_FILE} -o "${dir}"
${CMAKE_COMMAND} -E env CFLAGS="${cflags}" TARGET=${name} PATH=$ENV{PATH}
${RUBY_EXECUTABLE} ${SETTINGS_GENERATOR} ${MAIN_DIR} ${SETTINGS_FILE} -o "${dir}"
DEPENDS ${SETTINGS_GENERATOR} ${SETTINGS_FILE}
)
endfunction()

View file

@ -0,0 +1,30 @@
main_sources(BOOTLOADER_SOURCES
common/log.c
common/log.h
common/printf.c
common/printf.h
common/string_light.c
common/string_light.h
common/typeconversion.c
common/typeconversion.h
drivers/bus.c
drivers/bus_busdev_i2c.c
drivers/bus_busdev_spi.c
drivers/bus_i2c_soft.c
drivers/io.c
drivers/light_led.c
drivers/persistent.c
drivers/rcc.c
drivers/serial.c
drivers/system.c
drivers/time.c
drivers/timer.c
fc/firmware_update_common.c
fc/firmware_update_common.h
target/common_hardware.c
)
list(APPEND BOOTLOADER_SOURCES ${MAIN_DIR}/src/bl/bl_main.c)

View file

@ -0,0 +1,4 @@
main_sources(STM32_STDPERIPH_SRC
drivers/bus_spi.c
drivers/serial_uart.c
)

View file

@ -1,65 +0,0 @@
set(STM32_STDPERIPH_USBOTG_DIR "${INAV_LIB_DIR}/main/STM32_USB_OTG_Driver")
set(STM32_STDPERIPH_USBCORE_DIR "${INAV_LIB_DIR}/main/STM32_USB_Device_Library/Core")
set(STM32_STDPERIPH_USBCDC_DIR "${INAV_LIB_DIR}/main/STM32_USB_Device_Library/Class/cdc")
set(STM32_STDPERIPH_USBHID_DIR "${INAV_LIB_DIR}/main/STM32_USB_Device_Library/Class/hid")
set(STM32_STDPERIPH_USBWRAPPER_DIR "${INAV_LIB_DIR}/main/STM32_USB_Device_Library/Class/hid_cdc_wrapper")
set(STM32_STDPERIPH_USBMSC_DIR "${INAV_LIB_DIR}/main/STM32_USB_Device_Library/Class/msc")
set(STM32_STDPERIPH_USBFS_DIR "${INAV_LIB_DIR}/main/STM32_USB-FS-Device_Driver")
set(STM32_STDPERIPH_USB_INCLUDE_DIRS
"${STM32_STDPERIPH_USBOTG_DIR}/inc"
"${STM32_STDPERIPH_USBCORE_DIR}/inc"
"${STM32_STDPERIPH_USBCDC_DIR}/inc"
"${STM32_STDPERIPH_USBHID_DIR}/inc"
"${STM32_STDPERIPH_USBWRAPPER_DIR}/inc"
"${STM32_STDPERIPH_USBMSC_DIR}/inc"
"${STM32_STDPERIPH_USBFS_DIR}/inc"
)
SET(STM32_STDPERIPH_USBOTG_SRC_EXCLUDES
usb_bsp_template.c
usb_conf_template.c
usb_hcd_int.c
usb_hcd.c
usb_otg.c
)
set(STM32_STDPERIPH_USBOTG_SRC
usb_core.c
usb_dcd.c
usb_dcd_int.c
)
list(TRANSFORM STM32_STDPERIPH_USBOTG_SRC PREPEND "${STM32_STDPERIPH_USBOTG_DIR}/src/")
set(STM32_STDPERIPH_USBCORE_SRC
usbd_core.c
usbd_ioreq.c
usbd_req.c
)
list(TRANSFORM STM32_STDPERIPH_USBCORE_SRC PREPEND "${STM32_STDPERIPH_USBCORE_DIR}/src/")
set(STM32_STDPERIPH_USBCDC_SRC
"${STM32_STDPERIPH_USBCDC_DIR}/src/usbd_cdc_core.c"
)
set(STM32_STDPERIPH_USBHID_SRC
"${STM32_STDPERIPH_USBHID_DIR}/src/usbd_hid_core.c"
)
set(STM32_STDPERIPH_USBWRAPPER_SRC
"${STM32_STDPERIPH_USBWRAPPER_DIR}/src/usbd_hid_cdc_wrapper.c"
)
set(STM32_STDPERIPH_USBMSC_SRC
usbd_msc_bot.c
usbd_msc_core.c
usbd_msc_data.c
usbd_msc_scsi.c
)
list(TRANSFORM STM32_STDPERIPH_USBMSC_SRC PREPEND "${STM32_STDPERIPH_USBMSC_DIR}/src/")
list(APPEND STM32_STDPERIPH_USB_SRC ${STM32_STDPERIPH_USBOTG_SRC})
list(APPEND STM32_STDPERIPH_USB_SRC ${STM32_STDPERIPH_USBCORE_SRC})
list(APPEND STM32_STDPERIPH_USB_SRC ${STM32_STDPERIPH_USBCDC_SRC})
list(APPEND STM32_STDPERIPH_USB_SRC ${STM32_STDPERIPH_USBHID_SRC})
list(APPEND STM32_STDPERIPH_USB_SRC ${STM32_STDPERIPH_USBWRAPPER_SRC})
list(APPEND STM32_STDPERIPH_USB_SRC ${STM32_STDPERIPH_USBMSC_SRC})

View file

@ -1,9 +1,18 @@
include(arm-none-eabi)
include(stm32-usb)
include(stm32-bootloader)
include(stm32f3)
include(stm32f4)
include(stm32f7)
set(CMSIS_DIR "${INAV_LIB_DIR}/main/CMSIS")
include(CMakeParseArguments)
option(DEBUG_HARDFAULTS "Enable debugging of hard faults via custom handler")
option(SEMIHOSTING "Enable semihosting")
message("-- DEBUG_HARDFAULTS: ${DEBUG_HARDFAULTS}, SEMIHOSTING: ${SEMIHOSTING}")
set(CMSIS_DIR "${MAIN_LIB_DIR}/main/CMSIS")
set(CMSIS_INCLUDE_DIR "${CMSIS_DIR}/Core/Include")
set(CMSIS_DSP_DIR "${INAV_LIB_DIR}/main/CMSIS/DSP")
set(CMSIS_DSP_DIR "${MAIN_LIB_DIR}/main/CMSIS/DSP")
set(CMSIS_DSP_INCLUDE_DIR "${CMSIS_DSP_DIR}/Include")
set(CMSIS_DSP_SRC
@ -19,175 +28,90 @@ set(CMSIS_DSP_SRC
)
list(TRANSFORM CMSIS_DSP_SRC PREPEND "${CMSIS_DSP_DIR}/Source/")
set(STM32_STARTUP_DIR "${INAV_MAIN_SRC_DIR}/startup")
set(STM32_STARTUP_DIR "${MAIN_SRC_DIR}/startup")
set(STM32_VCP_SRC
main_sources(STM32_VCP_SRC
drivers/serial_usb_vcp.c
drivers/usb_io.c
)
main_sources(STM32_VCP_SRC)
set(STM32_MSC_SRC
msc/usbd_msc_desc.c
main_sources(STM32_SDCARD_SRC
drivers/sdcard/sdcard.c
drivers/sdcard/sdcard_spi.c
drivers/sdcard/sdcard_sdio.c
drivers/sdcard/sdcard_standard.c
)
# XXX: This code is not STM32 specific
main_sources(STM32_ASYNCFATFS_SRC
io/asyncfatfs/asyncfatfs.c
io/asyncfatfs/fat_standard.c
)
main_sources(STM32_MSC_SRC
msc/usbd_storage.c
)
main_sources(STM32_MSC_SRC)
set(STM32_MSC_FLASH_SRC
main_sources(STM32_MSC_FLASH_SRC
msc/usbd_storage_emfat.c
msc/emfat.c
msc/emfat_file.c
)
main_sources(STM32_MSC_FLASH_SRC)
set(STM32F4_STDPERIPH_DIR "${INAV_LIB_DIR}/main/STM32F4/Drivers/STM32F4xx_StdPeriph_Driver")
set(STM32F4_CMSIS_DEVICE_DIR "${INAV_LIB_DIR}/main/STM32F4/Drivers/CMSIS/Device/ST/STM32F4xx")
set(STM32F4_CMSIS_DRIVERS_DIR "${INAV_LIB_DIR}/main/STM32F4/Drivers/CMSIS")
set(STM32F4_VCP_DIR "${INAV_MAIN_SRC_DIR}/vcpf4")
set(STM32F4_STDPERIPH_SRC_EXCLUDES
stm32f4xx_can.c
stm32f4xx_cec.c
stm32f4xx_crc.c
stm32f4xx_cryp.c
stm32f4xx_cryp_aes.c
stm32f4xx_cryp_des.c
stm32f4xx_cryp_tdes.c
stm32f4xx_dbgmcu.c
stm32f4xx_dsi.c
stm32f4xx_flash_ramfunc.c
stm32f4xx_fmpi2c.c
stm32f4xx_fmc.c
stm32f4xx_hash.c
stm32f4xx_hash_md5.c
stm32f4xx_hash_sha1.c
stm32f4xx_lptim.c
stm32f4xx_qspi.c
stm32f4xx_sai.c
stm32f4xx_spdifrx.c
)
set(STM32F4_STDPERIPH_SRC_DIR "${STM32F4_STDPERIPH_DIR}/Src")
glob_except(STM32F4_STDPERIPH_SRC "${STM32F4_STDPERIPH_SRC_DIR}/*.c" STM32F4_STDPERIPH_SRC_EXCLUDES)
set(STM32F4_VCP_SRC
stm32f4xx_it.c
usb_bsp.c
usbd_desc.c
usbd_usr.c
usbd_cdc_vcp.c
)
list(TRANSFORM STM32F4_VCP_SRC PREPEND "${STM32F4_VCP_DIR}/")
set(STM32F4_MSC_SRC
drivers/usb_msc_f4xx.c
)
main_sources(STM32F4_MSC_SRC)
set(STM32F4_INCLUDE_DIRS
"${CMSIS_INCLUDE_DIR}"
"${CMSIS_DSP_INCLUDE_DIR}"
"${STM32F4_STDPERIPH_DIR}/inc"
"${STM32F4_CMSIS_DEVICE_DIR}"
"${STM32F4_CMSIS_DRIVERS_DIR}"
"${STM32F4_VCP_DIR}"
main_sources(STM32_MSC_SDCARD_SRC
msc/usbd_storage_sd_spi.c
)
set(STM32_INCLUDE_DIRS
"${INAV_MAIN_SRC_DIR}/target"
"${CMSIS_INCLUDE_DIR}"
"${CMSIS_DSP_INCLUDE_DIR}"
"${MAIN_SRC_DIR}/target"
)
set(STM32_LINKER_DIR "${INAV_MAIN_SRC_DIR}/target/link")
#if(SEMIHOSTING)
# set(SEMIHOSTING_DEFINITIONS "SEMIHOSTING")
# set(SEMIHOSTING_LDFLAGS
# --specs=rdimon.specs
# -lc
# -lrdimon
# )
#else()
# set(SYS)
#endif()
#ifneq ($(SEMIHOSTING),)
#SEMIHOSTING_CFLAGS = -DSEMIHOSTING
#SEMIHOSTING_LDFLAGS = --specs=rdimon.specs -lc -lrdimon
#SYSLIB :=
#else
#SEMIHOSTING_LDFLAGS =
#SEMIHOSTING_CFLAGS =
#SYSLIB := -lnosys
#endif
set(STM32_DEFINITIONS
)
set(STM32_DEFAULT_HSE_MHZ 8)
set(STM32_LINKER_DIR "${MAIN_SRC_DIR}/target/link")
set(STM32_COMPILE_OPTIONS
-ffunction-sections
-fdata-sections
-fno-common
)
set(STM32_LINK_LIBRARIES
-lm
-lc
)
if(SEMIHOSTING)
list(APPEND STM32_LINK_LIBRARIES --specs=rdimon.specs -lrdimon)
list(APPEND STM32_DEFINITIONS SEMIHOSTING)
else()
list(APPEND STM32_LINK_LIBRARIES -lnosys)
endif()
set(STM32_LINK_OPTIONS
-nostartfiles
--specs=nano.specs
-static
-Wl,-gc-sections,-Map,target.map
-Wl,-gc-sections
-Wl,-L${STM32_LINKER_DIR}
-Wl,--cref
-Wl,--no-wchar-size-warning
-Wl,--print-memory-usage
)
set(STM32F4_SRC
target/system_stm32f4xx.c
drivers/accgyro/accgyro.c
drivers/accgyro/accgyro_mpu.c
drivers/adc_stm32f4xx.c
drivers/adc_stm32f4xx.c
drivers/bus_i2c_stm32f40x.c
drivers/serial_softserial.c
drivers/serial_uart_stm32f4xx.c
drivers/system_stm32f4xx.c
drivers/timer.c
drivers/timer_impl_stdperiph.c
drivers/timer_stm32f4xx.c
drivers/uart_inverter.c
drivers/dma_stm32f4xx.c
drivers/sdcard/sdmmc_sdio_f4xx.c
)
macro(get_stm32_target_features output_var dir target_name)
execute_process(COMMAND "${CMAKE_C_COMPILER}" -E -dD -D${ARGV2} "${ARGV1}/target.h"
ERROR_VARIABLE _errors
RESULT_VARIABLE _result
OUTPUT_STRIP_TRAILING_WHITESPACE
OUTPUT_VARIABLE _contents)
main_sources(STM32F4_SRC)
if(NOT _result EQUAL 0)
message(FATAL_ERROR "error extracting features for stm32 target ${ARGV2}: ${_errors}")
endif()
set(STM32F4_DEFINITIONS
STM32F4
USE_STDPERIPH_DRIVER
ARM_MATH_MATRIX_CHECK
ARM_MATH_ROUNDING
__FPU_PRESENT=1
UNALIGNED_SUPPORT_DISABLE
ARM_MATH_CM4
)
set(STM32F4_COMMON_OPTIONS
-mthumb
-mcpu=cortex-m4
-march=armv7e-m
-mfloat-abi=hard
-mfpu=fpv4-sp-d16
-fsingle-precision-constant
)
set(STM32F4_COMPILE_OPTIONS
)
set(SETM32F4_LINK_OPTIONS
)
set(STM32F411_STDPERIPH_SRC_EXCLUDES "stm32f4xx_fsmc.c")
set(STM32F411_COMPILE_DEFINITIONS
FLASH_SIZE=512
)
macro(get_stm32_target_features) # out-var dir
file(READ "${ARGV1}/target.h" _contents)
string(REGEX MATCH "#define[\t ]+USE_VCP" HAS_VCP ${_contents})
if(HAS_VCP)
list(APPEND ${ARGV0} VCP)
@ -196,68 +120,317 @@ macro(get_stm32_target_features) # out-var dir
if(HAS_FLASHFS)
list(APPEND ${ARGV0} FLASHFS)
endif()
if (HAS_FLASHFS) # || SDCARD
string(REGEX MATCH "define[\t ]+USE_SDCARD" HAS_SDCARD ${_contents})
if (HAS_SDCARD)
list(APPEND ${ARGV0} SDCARD)
string(REGEX MATCH "define[\t ]+USE_SDCARD_SDIO" HAS_SDIO ${_contents})
if (HAS_SDIO)
list(APPEND ${ARGV0} SDIO)
endif()
endif()
if(HAS_FLASHFS OR HAS_SDCARD)
list(APPEND ${ARGV0} MSC)
endif()
endmacro()
function(target_stm32 name)
# Main .elf target
add_executable(${name} ${COMMON_SRC} ${CMSIS_DSP_SRC})
function(get_stm32_flash_size out size)
# 4: 16, 6: 32, 8: 64, B: 128, C: 256, D: 384, E: 512, F: 768, G: 1024, H: 1536, I: 2048 KiB
string(TOUPPER ${size} s)
if(${s} STREQUAL "4")
set(${out} 16 PARENT_SCOPE)
return()
endif()
if(${s} STREQUAL "6")
set(${out} 32 PARENT_SCOPE)
return()
endif()
if(${s} STREQUAL "8")
set(${out} 64 PARENT_SCOPE)
return()
endif()
if(${s} STREQUAL "8")
set(${out} 64 PARENT_SCOPE)
return()
endif()
if(${s} STREQUAL "B")
set(${out} 128 PARENT_SCOPE)
return()
endif()
if(${s} STREQUAL "C")
set(${out} 256 PARENT_SCOPE)
return()
endif()
if(${s} STREQUAL "D")
set(${out} 384 PARENT_SCOPE)
return()
endif()
if(${s} STREQUAL "E")
set(${out} 512 PARENT_SCOPE)
return()
endif()
if(${s} STREQUAL "F")
set(${out} 768 PARENT_SCOPE)
return()
endif()
if(${s} STREQUAL "G")
set(${out} 1024 PARENT_SCOPE)
return()
endif()
if(${s} STREQUAL "H")
set(${out} 1536 PARENT_SCOPE)
return()
endif()
if(${s} STREQUAL "I")
set(${out} 2048 PARENT_SCOPE)
return()
endif()
endfunction()
function(add_hex_target name exe hex)
add_custom_target(${name} ALL
cmake -E env PATH=$ENV{PATH}
# TODO: Overriding the start address with --set-start 0x08000000
# seems to be required due to some incorrect assumptions about .hex
# files in the configurator. Verify wether that's the case and fix
# the bug in configurator or delete this comment.
${CMAKE_OBJCOPY} -Oihex --set-start 0x08000000 $<TARGET_FILE:${exe}> ${hex}
BYPRODUCTS ${hex}
)
endfunction()
function(add_bin_target name exe bin)
add_custom_target(${name}
cmake -E env PATH=$ENV{PATH}
${CMAKE_OBJCOPY} -Obinary $<TARGET_FILE:${exe}> ${bin}
BYPRODUCTS ${bin}
)
endfunction()
function(generate_map_file target)
if(CMAKE_VERSION VERSION_LESS 3.15)
set(map "$<TARGET_FILE:${target}>.map")
else()
set(map "$<TARGET_FILE_DIR:${target}>/$<TARGET_FILE_BASE_NAME:${target}>.map")
endif()
target_link_options(${target} PRIVATE "-Wl,-Map,${map}")
endfunction()
function(set_linker_script target script)
set(script_path ${STM32_LINKER_DIR}/${args_LINKER_SCRIPT}.ld)
if(NOT EXISTS ${script_path})
message(FATAL_ERROR "linker script ${script_path} doesn't exist")
endif()
set_target_properties(${target} PROPERTIES LINK_DEPENDS ${script_path})
target_link_options(${elf_target} PRIVATE -T${script_path})
endfunction()
function(add_stm32_executable)
cmake_parse_arguments(
args
# Boolean arguments
""
# Single value arguments
"FILENAME;NAME;OPTIMIZATION;OUTPUT_BIN_FILENAME;OUTPUT_HEX_FILENAME;OUTPUT_TARGET_NAME"
# Multi-value arguments
"COMPILE_DEFINITIONS;COMPILE_OPTIONS;INCLUDE_DIRECTORIES;LINK_OPTIONS;LINKER_SCRIPT;SOURCES"
# Start parsing after the known arguments
${ARGN}
)
set(elf_target ${args_NAME}.elf)
add_executable(${elf_target})
target_sources(${elf_target} PRIVATE ${args_SOURCES})
target_include_directories(${elf_target} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${args_INCLUDE_DIRECTORIES} ${STM32_INCLUDE_DIRS})
target_compile_definitions(${elf_target} PRIVATE ${args_COMPILE_DEFINITIONS})
target_compile_options(${elf_target} PRIVATE ${STM32_COMPILE_OPTIONS} ${args_COMPILE_OPTIONS})
if(WARNINGS_AS_ERRORS)
target_compile_options(${elf_target} PRIVATE -Werror)
endif()
if (IS_RELEASE_BUILD)
target_compile_options(${elf_target} PRIVATE ${args_OPTIMIZATION})
target_link_options(${elf_target} PRIVATE ${args_OPTIMIZATION})
endif()
target_link_libraries(${elf_target} PRIVATE ${STM32_LINK_LIBRARIES})
target_link_options(${elf_target} PRIVATE ${STM32_LINK_OPTIONS} ${args_LINK_OPTIONS})
generate_map_file(${elf_target})
set_linker_script(${elf_target} ${args_LINKER_SCRIPT})
if(args_FILENAME)
set(basename ${CMAKE_BINARY_DIR}/${args_FILENAME})
set(hex_filename ${basename}.hex)
add_hex_target(${args_NAME} ${elf_target} ${hex_filename})
set(bin_filename ${basename}.bin)
add_bin_target(${args_NAME}.bin ${elf_target} ${bin_filename})
endif()
if(args_OUTPUT_BIN_FILENAME)
set(${args_OUTPUT_BIN_FILENAME} ${bin_filename} PARENT_SCOPE)
endif()
if(args_OUTPUT_TARGET_NAME)
set(${args_OUTPUT_TARGET_NAME} ${elf_target} PARENT_SCOPE)
endif()
if(args_OUTPUT_HEX_FILENAME)
set(${args_OUTPUT_HEX_FILENAME} ${hex_filename} PARENT_SCOPE)
endif()
endfunction()
function(target_stm32)
if(NOT arm-none-eabi STREQUAL TOOLCHAIN)
return()
endif()
# Parse keyword arguments
cmake_parse_arguments(
args
# Boolean arguments
"DISABLE_MSC;BOOTLOADER"
# Single value arguments
"HSE_MHZ;LINKER_SCRIPT;NAME;OPENOCD_TARGET;OPTIMIZATION;STARTUP;SVD"
# Multi-value arguments
"COMPILE_DEFINITIONS;COMPILE_OPTIONS;INCLUDE_DIRECTORIES;LINK_OPTIONS;SOURCES;MSC_SOURCES;MSC_INCLUDE_DIRECTORIES;VCP_SOURCES;VCP_INCLUDE_DIRECTORIES"
# Start parsing after the known arguments
${ARGN}
)
set(name ${args_NAME})
if (args_HSE_MHZ)
set(hse_mhz ${args_HSE_MHZ})
else()
set(hse_mhz ${STM32_DEFAULT_HSE_MHZ})
endif()
set(target_sources ${STM32_STARTUP_DIR}/${args_STARTUP})
list(APPEND target_sources ${args_SOURCES})
file(GLOB target_c_sources "${CMAKE_CURRENT_SOURCE_DIR}/*.c")
file(GLOB target_h_sources "${CMAKE_CURRENT_SOURCE_DIR}/*.h")
target_sources(${name} PRIVATE ${target_c_sources} ${target_h_sources})
target_include_directories(${name} PRIVATE . ${STM32_INCLUDE_DIRS})
target_link_libraries(${name} PRIVATE ${STM32_LINK_LIBRARIES})
target_link_options(${name} PRIVATE ${STM32_LINK_OPTIONS})
get_stm32_target_features(features "${CMAKE_CURRENT_SOURCE_DIR}")
set_property(TARGET ${name} PROPERTY FEATURES ${features})
list(APPEND target_sources ${target_c_sources} ${target_h_sources})
set(target_include_directories ${args_INCLUDE_DIRECTORIES})
set(target_definitions ${STM32_DEFINITIONS})
get_stm32_target_features(features "${CMAKE_CURRENT_SOURCE_DIR}" ${name})
set_property(TARGET ${elf_target} PROPERTY FEATURES ${features})
if(VCP IN_LIST features)
target_sources(${name} PRIVATE ${STM32_VCP_SRC})
list(APPEND target_sources ${STM32_VCP_SRC} ${args_VCP_SOURCES})
list(APPEND target_include_directories ${args_VCP_INCLUDE_DIRECTORIES})
endif()
if(MSC IN_LIST features)
target_sources(${name} PRIVATE ${STM32_MSC_SRC})
if (FLASHFS IN_LIST features)
target_sources(${name} PRIVATE ${STM32_MSC_FLASH_SRC})
if(SDCARD IN_LIST features)
list(APPEND target_sources ${STM32_SDCARD_SRC} ${STM32_ASYNCFATFS_SRC})
endif()
set(msc_sources)
if(NOT args_DISABLE_MSC AND MSC IN_LIST features)
list(APPEND target_include_directories ${args_MSC_INCLUDE_DIRECTORIES})
list(APPEND msc_sources ${STM32_MSC_SRC} ${args_MSC_SOURCES})
list(APPEND target_definitions USE_USB_MSC)
if(FLASHFS IN_LIST features)
list(APPEND msc_sources ${STM32_MSC_FLASH_SRC})
endif()
if (SDCARD IN_LIST features)
list(APPEND msc_sources ${STM32_MSC_SDCARD_SRC})
endif()
endif()
# Generate .hex
set(hexdir "${CMAKE_BINARY_DIR}/hex")
set(hex "${hexdir}/$<TARGET_FILE_PREFIX:${name}>.hex")
add_custom_command(TARGET ${name} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory "${hexdir}"
COMMAND ${CMAKE_OBJCOPY} -Oihex $<TARGET_FILE:${name}> "${hex}")
math(EXPR hse_value "${hse_mhz} * 1000000")
list(APPEND target_definitions "HSE_VALUE=${hse_value}")
if(args_COMPILE_DEFINITIONS)
list(APPEND target_definitions ${args_COMPILE_DEFINITIONS})
endif()
if(DEBUG_HARDFAULTS)
list(APPEND target_definitions DEBUG_HARDFAULTS)
endif()
string(TOLOWER ${PROJECT_NAME} lowercase_project_name)
set(binary_name ${lowercase_project_name}_${FIRMWARE_VERSION}_${name})
if(DEFINED BUILD_SUFFIX AND NOT "" STREQUAL "${BUILD_SUFFIX}")
set(binary_name "${binary_name}_${BUILD_SUFFIX}")
endif()
# Main firmware
add_stm32_executable(
NAME ${name}
FILENAME ${binary_name}
SOURCES ${target_sources} ${msc_sources} ${CMSIS_DSP_SRC} ${COMMON_SRC}
COMPILE_DEFINITIONS ${target_definitions}
COMPILE_OPTIONS ${args_COMPILE_OPTIONS}
INCLUDE_DIRECTORIES ${target_include_directories}
LINK_OPTIONS ${args_LINK_OPTIONS}
LINKER_SCRIPT ${args_LINKER_SCRIPT}
OPTIMIZATION ${args_OPTIMIZATION}
OUTPUT_HEX_FILENAME main_hex_filename
OUTPUT_TARGET_NAME main_target_name
)
set_property(TARGET ${main_target_name} PROPERTY OPENOCD_TARGET ${args_OPENOCD_TARGET})
set_property(TARGET ${main_target_name} PROPERTY OPENOCD_DEFAULT_INTERFACE stlink)
set_property(TARGET ${main_target_name} PROPERTY SVD ${args_SVD})
setup_firmware_target(${main_target_name} ${name} ${ARGN})
if(args_BOOTLOADER)
# Bootloader for the target
set(bl_suffix _bl)
add_stm32_executable(
NAME ${name}${bl_suffix}
FILENAME ${binary_name}${bl_suffix}
SOURCES ${target_sources} ${BOOTLOADER_SOURCES}
COMPILE_DEFINITIONS ${target_definitions} BOOTLOADER MSP_FIRMWARE_UPDATE
COMPILE_OPTIONS ${args_COMPILE_OPTIONS}
INCLUDE_DIRECTORIES ${target_include_directories}
LINK_OPTIONS ${args_LINK_OPTIONS}
LINKER_SCRIPT ${args_LINKER_SCRIPT}${bl_suffix}
OPTIMIZATION ${args_OPTIMIZATION}
OUTPUT_BIN_FILENAME bl_bin_filename
OUTPUT_HEX_FILENAME bl_hex_filename
OUTPUT_TARGET_NAME bl_target_name
)
setup_executable(${bl_target_name} ${name})
# Main firmware, but for running with the bootloader
set(for_bl_suffix _for_bl)
add_stm32_executable(
NAME ${name}${for_bl_suffix}
FILENAME ${binary_name}${for_bl_suffix}
SOURCES ${target_sources} ${msc_sources} ${CMSIS_DSP_SRC} ${COMMON_SRC}
COMPILE_DEFINITIONS ${target_definitions} MSP_FIRMWARE_UPDATE
COMPILE_OPTIONS ${args_COMPILE_OPTIONS}
INCLUDE_DIRECTORIES ${target_include_directories}
LINK_OPTIONS ${args_LINK_OPTIONS}
LINKER_SCRIPT ${args_LINKER_SCRIPT}${for_bl_suffix}
OPTIMIZATION ${args_OPTIMIZATION}
OUTPUT_BIN_FILENAME for_bl_bin_filename
OUTPUT_HEX_FILENAME for_bl_hex_filename
OUTPUT_TARGET_NAME for_bl_target_name
)
setup_executable(${for_bl_target_name} ${name})
# Combined with bootloader and main firmware
set(with_bl_suffix _with_bl)
set(combined_hex ${CMAKE_BINARY_DIR}/${binary_name}${with_bl_suffix}.hex)
set(with_bl_target ${name}${with_bl_suffix})
add_custom_target(${with_bl_target}
${CMAKE_SOURCE_DIR}/src/utils/combine_tool ${bl_bin_filename} ${for_bl_bin_filename} ${combined_hex}
BYPRODUCTS ${combined_hex}
)
add_dependencies(${with_bl_target} ${bl_target_name} ${for_bl_target_name})
endif()
# clean_<target>
set(generator_cmd "")
if (CMAKE_GENERATOR STREQUAL "Unix Makefiles")
set(generator_cmd "make")
elseif(CMAKE_GENERATOR STREQUAL "Ninja")
set(generator_cmd "ninja")
endif()
if (NOT generator_cmd STREQUAL "")
set(clean_target "clean_${name}")
add_custom_target(${clean_target}
COMMAND cmake -E rm -r "${CMAKE_CURRENT_BINARY_DIR}"
COMMENT "Removeng intermediate files for ${name}")
set_property(TARGET ${clean_target} PROPERTY TARGET_MESSAGES OFF)
endfunction()
function(target_stm32f4xx name)
target_stm32(${name})
target_sources(${name} PRIVATE ${STM32F4_SRC})
target_compile_options(${name} PRIVATE ${STM32F4_COMMON_OPTIONS} ${STM32F4_COMPILE_OPTIONS})
target_include_directories(${name} PRIVATE ${STM32_STDPERIPH_USB_INCLUDE_DIRS} ${STM32F4_INCLUDE_DIRS})
target_compile_definitions(${name} PRIVATE ${STM32F4_DEFINITIONS})
target_link_options(${name} PRIVATE ${STM32F4_COMMON_OPTIONS} ${STM32F4_LINK_OPTIONS})
get_property(features TARGET ${name} PROPERTY FEATURES)
if(VCP IN_LIST features)
target_sources(${name} PRIVATE ${STM32_STDPERIPH_USB_SRC} ${STM32F4_VCP_SRC})
endif()
if(MSC IN_LIST features)
target_sources(${name} PRIVATE ${STM32F4_MSC_SRC})
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMAND ${generator_cmd} clean
COMMENT "Removing intermediate files for ${name}")
set_property(TARGET ${clean_target} PROPERTY
EXCLUDE_FROM_ALL 1
EXCLUDE_FROM_DEFAULT_BUILD 1)
endif()
endfunction()
function(target_stm32f411 name)
target_stm32f4xx(${name})
set(STM32F411_STDPERIPH_SRC ${STM32F4_STDPERIPH_SRC})
exclude_basenames(STM32F411_STDPERIPH_SRC STM32F411_STDPERIPH_SRC_EXCLUDES)
target_sources(${name} PRIVATE "${STM32_STARTUP_DIR}/startup_stm32f411xe.s" ${STM32F411_STDPERIPH_SRC})
target_link_options(${name} PRIVATE "-T${STM32_LINKER_DIR}/stm32_flash_f411.ld")
target_compile_definitions(${name} PRIVATE STM32F411xE ${STM32F411_COMPILE_DEFINITIONS})
setup_firmware_target(${name})
endfunction()

16
cmake/stm32f3-usb.cmake Normal file
View file

@ -0,0 +1,16 @@
set(STM32_USBFS_DIR "${MAIN_LIB_DIR}/main/STM32_USB-FS-Device_Driver")
set(STM32_USBFS_SRC
usb_core.c
usb_init.c
usb_int.c
usb_mem.c
usb_regs.c
usb_sil.c
)
list(TRANSFORM STM32_USBFS_SRC PREPEND "${STM32_USBFS_DIR}/src/")
set(STM32F3_USB_INCLUDE_DIRS
${STM32_USBFS_DIR}/inc
)
set(STM32F3_USB_SRC ${STM32_USBFS_SRC})

92
cmake/stm32f3.cmake Normal file
View file

@ -0,0 +1,92 @@
include(cortex-m4f)
include(stm32-stdperiph)
include(stm32f3-usb)
set(STM32F3_STDPERIPH_DIR "${MAIN_LIB_DIR}/main/STM32F3/Drivers/STM32F30x_StdPeriph_Driver")
set(STM32F3_CMSIS_DEVICE_DIR "${MAIN_LIB_DIR}/main/STM32F3/Drivers/CMSIS/Device/ST/STM32F30x")
set(STM32F3_CMSIS_DRIVERS_DIR "${MAIN_LIB_DIR}/main/STM32F3/Drivers/CMSIS")
set(STM32F3_VCP_DIR "${MAIN_SRC_DIR}/vcp")
set(STM32F3_STDPERIPH_SRC_EXCLUDES
stm32f30x_crc.c
stm32f30x_can.c
)
set(STM32F3_STDPERIPH_SRC_DIR "${STM32F3_STDPERIPH_DIR}/src")
glob_except(STM32F3_STDPERIPH_SRC "${STM32F3_STDPERIPH_SRC_DIR}/*.c" "${STM32F3_STDPERIPH_SRC_EXCLUDES}")
main_sources(STM32F3_SRC
target/system_stm32f30x.c
drivers/adc_stm32f30x.c
drivers/bus_i2c_stm32f30x.c
drivers/dma_stm32f3xx.c
drivers/serial_uart_stm32f30x.c
drivers/system_stm32f30x.c
drivers/timer_impl_stdperiph.c
drivers/timer_stm32f30x.c
)
set(STM32F3_VCP_SRC
hw_config.c
stm32_it.c
usb_desc.c
usb_endp.c
usb_istr.c
usb_prop.c
usb_pwr.c
)
list(TRANSFORM STM32F3_VCP_SRC PREPEND "${STM32F3_VCP_DIR}/")
set(STM32F3_INCLUDE_DIRS
"${CMSIS_INCLUDE_DIR}"
"${CMSIS_DSP_INCLUDE_DIR}"
"${STM32F3_STDPERIPH_DIR}/inc"
"${STM32F3_CMSIS_DEVICE_DIR}"
"${STM32F3_CMSIS_DRIVERS_DIR}"
"${STM32F3_VCP_DIR}"
)
set(STM32F3_DEFINITIONS
${CORTEX_M4F_DEFINITIONS}
STM32F3
USE_STDPERIPH_DRIVER
)
set(STM32F303CC_DEFINITIONS
STM32F303
STM32F303xC
FLASH_SIZE=256
)
function(target_stm32f3xx)
# F3 targets don't support MSC and use -Os instead of -O2 to save size
target_stm32(
SOURCES ${STM32_STDPERIPH_SRC} ${STM32F3_STDPERIPH_SRC} ${STM32F3_SRC}
COMPILE_DEFINITIONS ${STM32F3_DEFINITIONS}
COMPILE_OPTIONS ${CORTEX_M4F_COMMON_OPTIONS} ${CORTEX_M4F_COMPILE_OPTIONS}
INCLUDE_DIRECTORIES ${STM32F3_INCLUDE_DIRS}
LINK_OPTIONS ${CORTEX_M4F_COMMON_OPTIONS} ${CORTEX_M4F_LINK_OPTIONS}
VCP_SOURCES ${STM32F3_USB_SRC} ${STM32F3_VCP_SRC}
VCP_INCLUDE_DIRECTORIES ${STM32F3_USB_INCLUDE_DIRS}
DISABLE_MSC
OPTIMIZATION -Os
OPENOCD_TARGET stm32f3x
${ARGN}
)
endfunction()
function(target_stm32f303xc name)
target_stm32f3xx(
NAME ${name}
STARTUP startup_stm32f30x_md_gcc.S
COMPILE_DEFINITIONS ${STM32F303CC_DEFINITIONS}
LINKER_SCRIPT stm32_flash_f303xc
SVD STM32F303
${ARGN}
)
endfunction()

59
cmake/stm32f4-usb.cmake Normal file
View file

@ -0,0 +1,59 @@
set(STM32_USBOTG_DIR "${MAIN_LIB_DIR}/main/STM32_USB_OTG_Driver")
set(STM32_USBCORE_DIR "${MAIN_LIB_DIR}/main/STM32_USB_Device_Library/Core")
set(STM32_USBCDC_DIR "${MAIN_LIB_DIR}/main/STM32_USB_Device_Library/Class/cdc")
set(STM32_USBHID_DIR "${MAIN_LIB_DIR}/main/STM32_USB_Device_Library/Class/hid")
set(STM32_USBWRAPPER_DIR "${MAIN_LIB_DIR}/main/STM32_USB_Device_Library/Class/hid_cdc_wrapper")
set(STM32_USBMSC_DIR "${MAIN_LIB_DIR}/main/STM32_USB_Device_Library/Class/msc")
set(STM32F4_USB_INCLUDE_DIRS
"${STM32_USBOTG_DIR}/inc"
"${STM32_USBCORE_DIR}/inc"
"${STM32_USBCDC_DIR}/inc"
"${STM32_USBHID_DIR}/inc"
"${STM32_USBWRAPPER_DIR}/inc"
"${STM32_USBMSC_DIR}/inc"
)
set(STM32_USBOTG_SRC
usb_core.c
usb_dcd.c
usb_dcd_int.c
)
list(TRANSFORM STM32_USBOTG_SRC PREPEND "${STM32_USBOTG_DIR}/src/")
set(STM32_USBCORE_SRC
usbd_core.c
usbd_ioreq.c
usbd_req.c
)
list(TRANSFORM STM32_USBCORE_SRC PREPEND "${STM32_USBCORE_DIR}/src/")
set(STM32_USBCDC_SRC
"${STM32_USBCDC_DIR}/src/usbd_cdc_core.c"
)
set(STM32_USBHID_SRC
"${STM32_USBHID_DIR}/src/usbd_hid_core.c"
)
set(STM32_USBWRAPPER_SRC
"${STM32_USBWRAPPER_DIR}/src/usbd_hid_cdc_wrapper.c"
)
set(STM32F4_USBMSC_SRC
usbd_msc_bot.c
usbd_msc_core.c
usbd_msc_data.c
usbd_msc_scsi.c
)
main_sources(STM32F4_MSC_SRC
msc/usbd_msc_desc.c
)
list(TRANSFORM STM32F4_USBMSC_SRC PREPEND "${STM32_USBMSC_DIR}/src/")
list(APPEND STM32F4_USBMSC_SRC ${STM32F4_MSC_SRC})
list(APPEND STM32F4_USB_SRC ${STM32_USBOTG_SRC})
list(APPEND STM32F4_USB_SRC ${STM32_USBCORE_SRC})
list(APPEND STM32F4_USB_SRC ${STM32_USBCDC_SRC})
list(APPEND STM32F4_USB_SRC ${STM32_USBHID_SRC})
list(APPEND STM32F4_USB_SRC ${STM32_USBWRAPPER_SRC})

152
cmake/stm32f4.cmake Normal file
View file

@ -0,0 +1,152 @@
include(cortex-m4f)
include(stm32-stdperiph)
include(stm32f4-usb)
set(STM32F4_STDPERIPH_DIR "${MAIN_LIB_DIR}/main/STM32F4/Drivers/STM32F4xx_StdPeriph_Driver")
set(STM32F4_CMSIS_DEVICE_DIR "${MAIN_LIB_DIR}/main/STM32F4/Drivers/CMSIS/Device/ST/STM32F4xx")
set(STM32F4_CMSIS_DRIVERS_DIR "${MAIN_LIB_DIR}/main/STM32F4/Drivers/CMSIS")
set(STM32F4_VCP_DIR "${MAIN_SRC_DIR}/vcpf4")
set(STM32F4_STDPERIPH_SRC_EXCLUDES
stm32f4xx_can.c
stm32f4xx_cec.c
stm32f4xx_crc.c
stm32f4xx_cryp.c
stm32f4xx_cryp_aes.c
stm32f4xx_cryp_des.c
stm32f4xx_cryp_tdes.c
stm32f4xx_dbgmcu.c
stm32f4xx_dsi.c
stm32f4xx_flash_ramfunc.c
stm32f4xx_fmpi2c.c
stm32f4xx_fmc.c
stm32f4xx_hash.c
stm32f4xx_hash_md5.c
stm32f4xx_hash_sha1.c
stm32f4xx_lptim.c
stm32f4xx_qspi.c
stm32f4xx_sai.c
stm32f4xx_spdifrx.c
)
set(STM32F4_STDPERIPH_SRC_DIR "${STM32F4_STDPERIPH_DIR}/src")
glob_except(STM32F4_STDPERIPH_SRC "${STM32F4_STDPERIPH_SRC_DIR}/*.c" "${STM32F4_STDPERIPH_SRC_EXCLUDES}")
main_sources(STM32F4_SRC
target/system_stm32f4xx.c
drivers/adc_stm32f4xx.c
drivers/adc_stm32f4xx.c
drivers/bus_i2c_stm32f40x.c
drivers/serial_uart_stm32f4xx.c
drivers/system_stm32f4xx.c
drivers/timer.c
drivers/timer_impl_stdperiph.c
drivers/timer_stm32f4xx.c
drivers/uart_inverter.c
drivers/dma_stm32f4xx.c
drivers/sdcard/sdmmc_sdio_f4xx.c
)
set(STM32F4_VCP_SRC
stm32f4xx_it.c
usb_bsp.c
usbd_desc.c
usbd_usr.c
usbd_cdc_vcp.c
)
list(TRANSFORM STM32F4_VCP_SRC PREPEND "${STM32F4_VCP_DIR}/")
main_sources(STM32F4_MSC_SRC
drivers/usb_msc_f4xx.c
)
set(STM32F4_INCLUDE_DIRS
"${CMSIS_INCLUDE_DIR}"
"${CMSIS_DSP_INCLUDE_DIR}"
"${STM32F4_STDPERIPH_DIR}/inc"
"${STM32F4_CMSIS_DEVICE_DIR}"
"${STM32F4_CMSIS_DRIVERS_DIR}"
"${STM32F4_VCP_DIR}"
)
set(STM32F4_DEFINITIONS
${CORTEX_M4F_DEFINITIONS}
STM32F4
USE_STDPERIPH_DRIVER
)
function(target_stm32f4xx)
target_stm32(
SOURCES ${STM32_STDPERIPH_SRC} ${STM32F4_SRC}
COMPILE_DEFINITIONS ${STM32F4_DEFINITIONS}
COMPILE_OPTIONS ${CORTEX_M4F_COMMON_OPTIONS} ${CORTEX_M4F_COMPILE_OPTIONS}
INCLUDE_DIRECTORIES ${STM32F4_INCLUDE_DIRS}
LINK_OPTIONS ${CORTEX_M4F_COMMON_OPTIONS} ${CORTEX_M4F_LINK_OPTIONS}
MSC_SOURCES ${STM32F4_USBMSC_SRC} ${STM32F4_MSC_SRC}
VCP_SOURCES ${STM32F4_USB_SRC} ${STM32F4_VCP_SRC}
VCP_INCLUDE_DIRECTORIES ${STM32F4_USB_INCLUDE_DIRS}
OPTIMIZATION -O2
OPENOCD_TARGET stm32f4x
${ARGN}
)
endfunction()
set(STM32F405_COMPILE_DEFINITIONS
STM32F40_41xxx
STM32F405xx
FLASH_SIZE=1024
)
function(target_stm32f405xg name)
target_stm32f4xx(
NAME ${name}
STARTUP startup_stm32f40xx.s
SOURCES ${STM32F4_STDPERIPH_SRC}
COMPILE_DEFINITIONS ${STM32F405_COMPILE_DEFINITIONS}
LINKER_SCRIPT stm32_flash_f405xg
SVD STM32F405
BOOTLOADER
${ARGN}
)
endfunction()
set(STM32F411_OR_F427_STDPERIPH_SRC ${STM32F4_STDPERIPH_SRC})
set(STM32F411_OR_F427_STDPERIPH_SRC_EXCLUDES "stm32f4xx_fsmc.c")
exclude_basenames(STM32F411_OR_F427_STDPERIPH_SRC ${STM32F411_OR_F427_STDPERIPH_SRC_EXCLUDES})
set(STM32F411_COMPILE_DEFINITIONS
STM32F411xE
FLASH_SIZE=512
)
function(target_stm32f411xe name)
target_stm32f4xx(
NAME ${name}
STARTUP startup_stm32f411xe.s
SOURCES ${STM32F411_OR_F427_STDPERIPH_SRC}
COMPILE_DEFINITIONS ${STM32F411_COMPILE_DEFINITIONS}
LINKER_SCRIPT stm32_flash_f411xe
SVD STM32F411
${ARGN}
)
endfunction()
set(STM32F427_COMPILE_DEFINITIONS
STM32F427_437xx
FLASH_SIZE=1024
)
function(target_stm32f427xg name)
target_stm32f4xx(
NAME ${name}
STARTUP startup_stm32f427xx.s
SOURCES ${STM32F411_OR_F427_STDPERIPH_SRC}
COMPILE_DEFINITIONS ${STM32F427_COMPILE_DEFINITIONS}
LINKER_SCRIPT stm32_flash_f427xg
SVD STM32F411
${ARGN}
)
endfunction()

48
cmake/stm32f7-usb.cmake Normal file
View file

@ -0,0 +1,48 @@
set(STM32F7_USBCORE_DIR "${MAIN_LIB_DIR}/main/STM32F7/Middlewares/ST/STM32_USB_Device_Library/Core")
set(STM32F7_USBCORE_SRC
usbd_core.c
usbd_ctlreq.c
usbd_ioreq.c
)
list(TRANSFORM STM32F7_USBCORE_SRC PREPEND "${STM32F7_USBCORE_DIR}/Src/")
set(STM32F7_USBCDC_DIR "${MAIN_LIB_DIR}/main/STM32F7/Middlewares/ST/STM32_USB_Device_Library/Class/CDC")
set(STM32F7_USBCDC_SRC
usbd_cdc.c
)
list(TRANSFORM STM32F7_USBCDC_SRC PREPEND "${STM32F7_USBCDC_DIR}/Src/")
set(STM32F7_USBHID_DIR "${MAIN_LIB_DIR}/main/STM32F7/Middlewares/ST/STM32_USB_Device_Library/Class/HID")
set(STM32F7_USBHID_SRC
usbd_hid.c
)
list(TRANSFORM STM32F7_USBHID_SRC PREPEND "${STM32F7_USBHID_DIR}/Src/")
set(STM32F7_USBCDCHID_DIR "${MAIN_LIB_DIR}/main/STM32F7/Middlewares/ST/STM32_USB_Device_Library/Class/CDC_HID")
set(STM32F7_USBCDCHID_SRC
usbd_cdc_hid.c
)
list(TRANSFORM STM32F7_USBCDCHID_SRC PREPEND "${STM32F7_USBCDCHID_DIR}/Src/")
set(STM32F7_USBMSC_DIR "${MAIN_LIB_DIR}/main/STM32F7/Middlewares/ST/STM32_USB_Device_Library/Class/MSC")
set(STM32F7_USBMSC_SRC
usbd_msc.c
usbd_msc_bot.c
usbd_msc_data.c
usbd_msc_scsi.c
)
list(TRANSFORM STM32F7_USBMSC_SRC PREPEND "${STM32F7_USBMSC_DIR}/Src/")
set(STM32F7_USB_INCLUDE_DIRS
"${STM32F7_USBCORE_DIR}/Inc"
"${STM32F7_USBCDC_DIR}/Inc"
"${STM32F7_USBHID_DIR}/Inc"
"${STM32F7_USBCDCHID_DIR}/Inc"
"${STM32F7_USBMSC_DIR}/Inc"
)
list(APPEND STM32F7_USB_SRC ${STM32F7_USBCORE_SRC})
list(APPEND STM32F7_USB_SRC ${STM32F7_USBCDC_SRC})
list(APPEND STM32F7_USB_SRC ${STM32F7_USBHID_SRC})
list(APPEND STM32F7_USB_SRC ${STM32F7_USBCDCHID_SRC})
list(APPEND STM32F7_USB_SRC ${STM32F7_USBMSC_SRC})

132
cmake/stm32f7.cmake Normal file
View file

@ -0,0 +1,132 @@
include(cortex-m7)
include(stm32f7-usb)
set(STM32F7_HAL_DIR "${MAIN_LIB_DIR}/main/STM32F7/Drivers/STM32F7xx_HAL_Driver")
set(STM32F7_HAL_SRC
stm32f7xx_hal.c
stm32f7xx_hal_adc.c
stm32f7xx_hal_adc_ex.c
stm32f7xx_hal_cortex.c
stm32f7xx_hal_dac.c
stm32f7xx_hal_dac_ex.c
stm32f7xx_hal_dma.c
stm32f7xx_hal_dma_ex.c
stm32f7xx_hal_flash.c
stm32f7xx_hal_flash_ex.c
stm32f7xx_hal_gpio.c
stm32f7xx_hal_i2c.c
stm32f7xx_hal_i2c_ex.c
stm32f7xx_hal_pcd.c
stm32f7xx_hal_pcd_ex.c
stm32f7xx_hal_pwr.c
stm32f7xx_hal_pwr_ex.c
stm32f7xx_hal_rcc.c
stm32f7xx_hal_rcc_ex.c
stm32f7xx_hal_rtc.c
stm32f7xx_hal_rtc_ex.c
stm32f7xx_hal_spi.c
stm32f7xx_hal_tim.c
stm32f7xx_hal_tim_ex.c
stm32f7xx_hal_uart.c
stm32f7xx_hal_usart.c
stm32f7xx_ll_dma.c
stm32f7xx_ll_dma2d.c
stm32f7xx_ll_gpio.c
stm32f7xx_ll_rcc.c
stm32f7xx_ll_spi.c
stm32f7xx_ll_tim.c
stm32f7xx_ll_usb.c
stm32f7xx_ll_utils.c
)
list(TRANSFORM STM32F7_HAL_SRC PREPEND "${STM32F7_HAL_DIR}/Src/")
set(STM32F7_CMSIS_DEVICE_DIR "${MAIN_LIB_DIR}/main/STM32F7/Drivers/CMSIS/Device/ST/STM32F7xx")
set(STM32F7_VCP_DIR "${MAIN_SRC_DIR}/vcp_hal")
set(STM32F7_VCP_SRC
usbd_desc.c
usbd_conf.c
usbd_cdc_interface.c
)
list(TRANSFORM STM32F7_VCP_SRC PREPEND "${STM32F7_VCP_DIR}/")
set(STM32F7_INCLUDE_DIRS
${STM32F7_HAL_DIR}/Inc
${STM32F7_CMSIS_DEVICE_DIR}/Include
)
main_sources(STM32F7_SRC
target/system_stm32f7xx.c
drivers/adc_stm32f7xx.c
drivers/bus_i2c_hal.c
drivers/dma_stm32f7xx.c
drivers/bus_spi_hal.c
drivers/timer.c
drivers/timer_impl_hal.c
drivers/timer_stm32f7xx.c
drivers/system_stm32f7xx.c
drivers/serial_uart_stm32f7xx.c
drivers/serial_uart_hal.c
drivers/sdcard/sdmmc_sdio_f7xx.c
)
main_sources(STM32F7_MSC_SRC
drivers/usb_msc_f7xx.c
)
set(STM32F7_DEFINITIONS
${CORTEX_M7_DEFINITIONS}
USE_HAL_DRIVER
USE_FULL_LL_DRIVER
)
function(target_stm32f7xx)
target_stm32(
SOURCES ${STM32F7_HAL_SRC} ${STM32F7_SRC}
COMPILE_DEFINITIONS ${STM32F7_DEFINITIONS}
COMPILE_OPTIONS ${CORTEX_M7_COMMON_OPTIONS} ${CORTEX_M7_COMPILE_OPTIONS}
INCLUDE_DIRECTORIES ${STM32F7_INCLUDE_DIRS}
LINK_OPTIONS ${CORTEX_M7_COMMON_OPTIONS} ${CORTEX_M7_LINK_OPTIONS}
MSC_SOURCES ${STM32F7_USBMSC_SRC} ${STM32F7_MSC_SRC}
VCP_SOURCES ${STM32F7_USB_SRC} ${STM32F7_VCP_SRC}
VCP_INCLUDE_DIRECTORIES ${STM32F7_USB_INCLUDE_DIRS} ${STM32F7_VCP_DIR}
OPTIMIZATION -O2
OPENOCD_TARGET stm32f7x
BOOTLOADER
${ARGN}
)
endfunction()
macro(define_target_stm32f7 subfamily size)
function(target_stm32f7${subfamily}x${size} name)
set(func_ARGV ARGV)
string(TOUPPER ${size} upper_size)
get_stm32_flash_size(flash_size ${size})
set(definitions
STM32F7
STM32F7${subfamily}xx
STM32F7${subfamily}x${upper_size}
FLASH_SIZE=${flash_size}
)
target_stm32f7xx(
NAME ${name}
STARTUP startup_stm32f7${subfamily}xx.s
COMPILE_DEFINITIONS ${definitions}
LINKER_SCRIPT stm32_flash_f7${subfamily}x${size}
${${func_ARGV}}
)
endfunction()
endmacro()
define_target_stm32f7(22 e)
define_target_stm32f7(45 g)
define_target_stm32f7(46 g)
define_target_stm32f7(65 g)
define_target_stm32f7(65 i)

16
cmake/svd.cmake Normal file
View file

@ -0,0 +1,16 @@
function(setup_svd target_exe target_name)
get_property(svd_name TARGET ${target_exe} PROPERTY SVD)
set(svd_target_name "svd_${target_name}")
if (svd_name AND NOT svd_name STREQUAL "")
add_custom_target(${svd_target_name}
COMMAND ${CMAKE_COMMAND} -E copy
${SVD_DIR}/${svd_name}.svd
${CMAKE_BINARY_DIR}/svd/${target_name}.svd
)
else()
add_custom_target(${svd_target_name}
${CMAKE_COMMAND} -E echo "target ${target_name} does not declare an SVD filename"
COMMAND ${CMAKE_COMMAND} -E false)
endif()
exclude_from_all(${svd_target_name})
endfunction()

View file

@ -2,22 +2,27 @@
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
// ******* INAV ********
// Define the following values in settings.json
// - BUILD_DIR: Relative path to the build directory
// - TARGET: Target name that you want to launch
"version": "0.2.0",
"configurations": [
{
"name": "Cortex Debug",
"cwd": "${workspaceRoot}",
"executable": "./obj/main/INAV_${config:TARGET}.elf",
"executable": "${config:BUILD_DIR}/bin/${config:TARGET}.elf",
"request": "launch",
"type": "cortex-debug",
"servertype": "openocd",
"device": "${config:TARGET}",
"configFiles": [
"./obj/main/${config:TARGET}/openocd.cfg"
"${config:BUILD_DIR}/openocd/${config:TARGET}.cfg"
],
"preLaunchCommands": ["monitor arm semihosting enable"],
"preLaunchTask": "openocd-debug-prepare",
"svdFile": "./obj/main/${config:TARGET}/svd.svd"
"svdFile": "${config:BUILD_DIR}/svd/${config:TARGET}.svd",
}
]
}

View file

@ -5,14 +5,13 @@
"options": {
"env": {
"TARGET": "${config:TARGET}",
"SEMIHOSTING": "${config:SEMIHOSTING}"
}
},
"tasks": [
{
"label": "hex",
"label": "target",
"type": "shell",
"command": "make", "args": ["hex"],
"command": "make", "args": ["-C", "${config:BUILD_DIR}", "${config:TARGET}"],
"problemMatcher": "$gcc",
"group": {
"kind": "build",
@ -25,45 +24,27 @@
}
},
{
"label": "elf",
"label": "flash",
"type": "shell",
"command": "make", "args": ["elf"],
"problemMatcher": "$gcc",
"group": "build",
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
}
},
{
"label": "openocd-flash",
"type": "shell",
"command": "make", "args": ["openocd-flash"],
"command": "make", "args": ["-C", "${config:BUILD_DIR}", "openocd_flash_${config:TARGET}"],
"dependsOn": "elf"
},
{
"label": "clean",
"type": "shell",
"command": "make", "args": ["clean"],
"problemMatcher": []
},
{
"label": "svd",
"type": "shell",
"command": "make", "args": ["svd"],
"command": "make", "args": ["-C", "${config:BUILD_DIR}", "svd_${config:TARGET}"],
"problemMatcher": []
},
{
"label": "openocd-cfg",
"type": "shell",
"command": "make", "args": ["openocd-cfg"],
"command": "make", "args": ["-C", "${config:BUILD_DIR}", "openocd_cfg_${config:TARGET}"],
"problemMatcher": []
},
{
"label": "openocd-debug-prepare",
"type": "shell",
"dependsOn": ["svd", "openocd-cfg", "openocd-flash"],
"dependsOn": ["svd", "openocd-cfg", "flash"],
"problemMatcher": []
}
]

View file

@ -95,31 +95,41 @@ After restoring it's always a good idea to `dump` or `diff` the settings once ag
### serial
The syntax of the `serial` command is `serial <id> <functions> <msp-baudrate> <gps-baudrate> <telemetry-baudate> <peripheral-baudrate>`.
The syntax of the `serial` command is `serial <id> <function_value> <msp-baudrate> <gps-baudrate> <telemetry-baudate> <peripheral-baudrate>`.
A shorter form is also supported to enable and disable functions using `serial <id> +n` and
`serial <id> -n`, where n is the a serial function identifier. The following values are available:
A shorter form is also supported to enable and disable a single function using `serial <id> +n` and `serial <id> -n`, where n is the a serial function identifier. The following values are available:
| Function | Identifier |
|-----------------------|---------------|
| MSP | 0 |
| GPS | 1 |
| TELEMETRY_FRSKY | 2 |
| TELEMETRY_HOTT | 3 |
| TELEMETRY_LTM | 4 |
| TELEMETRY_SMARTPORT | 5 |
| RX_SERIAL | 6 |
| BLACKBOX | 7 |
| TELEMETRY_MAVLINK | 8 |
| TELEMETRY_IBUS | 9 |
| RCDEVICE | 10 |
| VTX_SMARTAUDIO | 11 |
| VTX_TRAMP | 12 |
| UAV_INTERCONNECT | 13 |
| OPTICAL_FLOW | 14 |
| LOG | 15 |
| RANGEFINDER | 16 |
| VTX_FFPV | 17 |
| Function | Bit Identifier | Numeric value |
|-----------------------|---------------|----------------|
| MSP | 0 | 1 |
| GPS | 1 | 2 |
| TELEMETRY_FRSKY | 2 | 4 |
| TELEMETRY_HOTT | 3 | 8 |
| TELEMETRY_LTM | 4 | 16 |
| TELEMETRY_SMARTPORT | 5 | 32 |
| RX_SERIAL | 6 | 64 |
| BLACKBOX | 7 | 128 |
| TELEMETRY_MAVLINK | 8 | 256 |
| TELEMETRY_IBUS | 9 | 512 |
| RCDEVICE | 10 | 1024 |
| VTX_SMARTAUDIO | 11 | 2048 |
| VTX_TRAMP | 12 | 4096 |
| UAV_INTERCONNECT | 13 | 8192 |
| OPTICAL_FLOW | 14 | 16384 |
| LOG | 15 | 32768 |
| RANGEFINDER | 16 | 65536 |
| VTX_FFPV | 17 | 131072 |
Thus, to enable MSP and LTM on a port, one would use the function **value** of 17 (1 << 0)+(1<<4), aka 1+16, aka 17.
```
serial 0 17 57600 57600 57600 57600
```
but to remove LTM using the +/- shorthand, use the **bit Id** (4, TELEMETRY_LTM):
```
serial 0 -4
```
`serial` can also be used without any argument to print the current configuration of all the serial ports.

View file

@ -0,0 +1,25 @@
# INAV PID Controller
What you have to know about INAV PID/PIFF/PIDCD controllers:
1. INAV PID uses floating-point math
1. Rate/Angular Velocity controllers work in dps [degrees per second]
1. P, I, D and Multirotor CD gains are scaled like Betafligfht equivalents, but actual mechanics are different, and PID response might be different
1. Depending on platform type, different controllers are used
1. Fixed-wing uses **PIFF**:
1. Error is computed with a formula `const float rateError = pidState->rateTarget - pidState->gyroRate;`
1. P-term with a formula `rateError * pidState->kP`
1. Simple I-term without Iterm Relax. I-term limit based on stick position is used instead. I-term is no allowed to grow if stick (roll/pitch/yaw) is deflected above threshold defined in `fw_iterm_limit_stick_position`. `pidState->errorGyroIf += rateError * pidState->kI * dT;`
1. No D-term
1. FF-term (Feed Forward) is computed from the controller input with a formula `pidState->rateTarget * pidState->kFF`. Bear in mind, this is not a **FeedForward** from Betaflight!
1. Multirotor uses **PIDCD**:
1. Error is computed with a formula `const float rateError = pidState->rateTarget - pidState->gyroRate;`
1. P-term with a formula `rateError * pidState->kP`
1. I-term
1. Iterm Relax is used to dynamically attenuate I-term during fast stick movements
1. I-term formula `pidState->errorGyroIf += (itermErrorRate * pidState->kI * antiWindupScaler * dT) + ((newOutputLimited - newOutput) * pidState->kT * antiWindupScaler * dT);`
1. I-term can be limited when motor output is saturated
1. D-term is computed only from gyro measurement
1. There are 2 LPF filters on D-term
1. D-term can by boosted during fast maneuvers using D-Boost. D-Boost is an equivalent of Betaflight D_min
1. **Control Derivative**, CD, or CD-term is a derivative computed from the setpoint that helps to boost PIDCD controller during fast stick movements. `newCDTerm = rateTargetDeltaFiltered * (pidState->kCD / dT);` It is an equivalent of Betaflight Feed Forward

View file

@ -113,45 +113,45 @@ this reason ensure that you define enough ranges to cover the range channel's us
| 8 | PITCH_ROLL_D |
| 9 | YAW_P |
| 10 | YAW_I |
| 11 | YAW_D |
| 11 | YAW_D_FF |
| 12 | RATE_PROFILE | Switch between 3 rate profiles using a 3 position switch. |
| 13 | PITCH_RATE |
| 14 | ROLL_RATE |
| 15 | PITCH_P |
| 16 | PITCH_I |
| 17 | PITCH_D |
| 17 | PITCH_D_FF |
| 18 | ROLL_P |
| 19 | ROLL_I |
| 20 | RC_YAW_EXPO |
| 21 | MANUAL_RC_EXPO |
| 22 | MANUAL_RC_YAW_EXPO |
| 23 | MANUAL_PITCH_ROLL_RATE |
| 24 | MANUAL_ROLL_RATE |
| 25 | MANUAL_PITCH_RATE |
| 26 | MANUAL_YAW_RATE |
| 27 | NAV_FW_CRUISE_THROTTLE |
| 28 | NAV_FW_PITCH2THR |
| 29 | ROLL_BOARD_ALIGNMENT |
| 30 | PITCH_BOARD_ALIGNMENT |
| 31 | LEVEL_P |
| 32 | LEVEL_I |
| 33 | LEVEL_D |
| 34 | POS_XY_P |
| 35 | POS_XY_I |
| 36 | POS_XY_D |
| 37 | POS_Z_P |
| 38 | POS_Z_I |
| 39 | POS_Z_D |
| 40 | HEADING_P |
| 41 | VEL_XY_P |
| 42 | VEL_XY_I |
| 43 | VEL_XY_D |
| 44 | VEL_Z_P |
| 20 | ROLL_D_FF |
| 21 | RC_YAW_EXPO |
| 22 | MANUAL_RC_EXPO |
| 23 | MANUAL_RC_YAW_EXPO |
| 24 | MANUAL_PITCH_ROLL_RATE |
| 25 | MANUAL_ROLL_RATE |
| 26 | MANUAL_PITCH_RATE |
| 27 | MANUAL_YAW_RATE |
| 28 | NAV_FW_CRUISE_THROTTLE |
| 29 | NAV_FW_PITCH2THR |
| 30 | ROLL_BOARD_ALIGNMENT |
| 31 | PITCH_BOARD_ALIGNMENT |
| 32 | LEVEL_P |
| 33 | LEVEL_I |
| 34 | LEVEL_D |
| 35 | POS_XY_P |
| 36 | POS_XY_I |
| 37 | POS_XY_D |
| 38 | POS_Z_P |
| 39 | POS_Z_I |
| 40 | POS_Z_D |
| 41 | HEADING_P |
| 42 | VEL_XY_P |
| 43 | VEL_XY_I |
| 44 | VEL_XY_D |
| 45 | VEL_Z_P |
| 46 | VEL_Z_I |
| 47 | VEL_Z_D |
| 48 | FW_MIN_THROTTLE_DOWN_PITCH_ANGLE |
| 49 | PROFILE | Switch between 3 rate profiles using a 3 position switch. |
| 49 | ADJUSTMENT_VTX_POWER_LEVEL |
## Examples

View file

@ -63,6 +63,11 @@ IPF can be edited using INAV Configurator user interface, of via CLI
| 30 | SET_VTX_BAND | Sets VTX band. Accepted values are `1-5` |
| 31 | SET_VTX_CHANNEL | Sets VTX channel. Accepted values are `1-8` |
| 32 | SET_OSD_LAYOUT | Sets OSD layout. Accepted values are `0-3` |
| 33 | SIN | Computes SIN of `Operand A` value in degrees. Output is multiplied by `Operand B` value. If `Operand B` is `0`, result is multiplied by `500` |
| 34 | COS | Computes COS of `Operand A` value in degrees. Output is multiplied by `Operand B` value. If `Operand B` is `0`, result is multiplied by `500` |
| 35 | TAN | Computes TAN of `Operand A` value in degrees. Output is multiplied by `Operand B` value. If `Operand B` is `0`, result is multiplied by `500` |
| 36 | MAP_INPUT | Scales `Operand A` from [`0` : `Operand B`] to [`0` : `1000`]. Note: input will be constrained and then scaled |
| 37 | MAP_OUTPUT | Scales `Operand A` from [`0` : `1000`] to [`0` : `Operand B`]. Note: input will be constrained and then scaled |
### Operands
@ -106,6 +111,24 @@ IPF can be edited using INAV Configurator user interface, of via CLI
| 23 | IS_WP | boolean `0`/`1` |
| 24 | IS_LANDING | boolean `0`/`1` |
| 25 | IS_FAILSAFE | boolean `0`/`1` |
| 26 | STABILIZED_ROLL | Roll PID controller output `[-500:500]` |
| 27 | STABILIZED_PITCH | Pitch PID controller output `[-500:500]` |
| 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 |
##### ACTIVE_WAYPOINT_ACTION
| Action | Value |
|---- |---- |
| WAYPOINT | 1 |
| HOLD_TIME | 3 |
| RTH | 4 |
| SET_POI | 5 |
| JUMP | 6 |
| SET_HEAD | 7 |
| LAND | 8 |
#### FLIGHT_MODE
@ -173,3 +196,36 @@ Sets Thhrottle output to about `50%` when Logic Condition `0` evaluates as `true
If Logic Condition `0` evaluates as `true`, motor throttle control is bound to RC channel 7 instead of throttle channel
### Set VTX channel with a POT
Set VTX channel with a POT on the radio assigned to RC channel 6
```
logic 0 1 -1 15 1 6 0 1000 0
logic 1 1 -1 37 4 0 0 7 0
logic 2 1 -1 14 4 1 0 1 0
logic 3 1 -1 31 4 2 0 0 0
```
Steps:
1. Normalize range `[1000:2000]` to `[0:1000]` by substracting `1000`
2. Scale range `[0:1000]` to `[0:7]`
3. Increase range by `1` to have the range of `[1:8]`
4. Assign LC#2 to VTX channel function
### Set VTX power with a POT
Set VTX power with a POT on the radio assigned to RC channel 6. In this example we scale POT to 4 power level `[1:4]`
```
logic 0 1 -1 15 1 6 0 1000 0
logic 1 1 -1 37 4 0 0 3 0
logic 2 1 -1 14 4 1 0 1 0
logic 3 1 -1 25 4 2 0 0 0
```
Steps:
1. Normalize range [1000:2000] to [0:1000] by substracting `1000`
2. Scale range [0:1000] to [0:3]
3. Increase range by `1` to have the range of [1:4]
4. Assign LC#2 to VTX power function

View file

@ -95,9 +95,20 @@ Just connect the S.Port wire from the receiver to the TX pad of a free UART on y
#### Configuration
For INAV 2.6 and newer versions, the default configuration should just work. However, if you're
upgrading from a previous version you might need to set the following settings to their
default values:
```
set serialrx_inverted = true
set serialrx_halfduplex = true
set serialrx_inverted = OFF
set serialrx_halfduplex = AUTO
```
For INAV versions prior to 2.6, you need to change the following settings:
```
set serialrx_inverted = ON
set serialrx_halfduplex = ON
```
### XBUS

70
docs/Safehomes.md Normal file
View file

@ -0,0 +1,70 @@
# INav - Safehomes
## Introduction
The "Home" position is used for the landing point when landing is enabled or in an emergency situation. It is usually determined by the GPS location where the aircraft is armed.
For airplanes, the landing procedure is explained very well by Pawel Spychalski [here.](https://quadmeup.com/inav-1-8-automated-landing-for-fixed-wings/)
<img src="https://quadmeup.com/wp-content/uploads/2017/06/fixed-wing-landing-1024x683.png" width="600">
One potential risk when landing is that there might be buildings, trees and other obstacles in the way as the airplance circles lower toward the ground at the arming point. Most people don't go the middle of the field when arming their airplanes.
## Safehome
Safehomes are a list of GPS coordinates that identify safe landing points. When the flight controller is armed, it checks the list of safehomes. The first one that is enabled and within 200m of the current position will be selected. Otherwise, it reverts to the old behaviour of using your current GPS position as home.
You can define up to 8 safehomes for different locations you fly at.
When you are choosing safehome locations, ensure that the location is clear of obstructions for a radius more than 50m (`nav_fw_loiter_radius`). As the plane descends, the circles aren't always symmetrical, as wind direction could result in some wider or tighter turns. Also, the direction and length of the final landing stage is also unknown. You want to choose a point that has provides a margin for variation and the final landing.
## OSD Message when Armed
When the aircraft is armed, the OSD briefly shows `ARMED` and the current GPS position and current date and time.
If a safehome is selected, an additional message appears:
```
H - DIST -> SAFEHOME n <- New message
n is the Safehome index (0-7)
ARMED DIST is the distance from
GPS LATITUDE your current position to this safehome
GPS LONGITUDE
GPS PLUS CODE
CURRENT DATE
CURRENT TIME
```
The GPS details are those of the selected safehome.
To draw your attention to "HOME" being replaced, the message flashes and stays visible longer.
## CLI command `safehome` to manage safehomes
`safehome` - List all safehomes
`safehome reset` - Clears all safehomes.
`safehome <n> <enabled> <lat> <lon>` - Set the parameters of a safehome with index `<n>`.
Parameters:
* `<enabled>` - 0 is disabled, 1 is enabled.
* `<lat>` - Latitude (WGS84), in degrees * 1E7 (for example 123456789 means 12.3456789).
* `<lon>` - Longitude.
Safehomes are saved along with your regular settings and will appear in `diff` and `dump` output. Use `save` to save any changes, as with other settings.
### `safehome` example
```
# safehome
safehome 0 1 543533193 -45179273
safehome 1 1 435464846 -78654544
safehome 2 0 0 0
safehome 3 0 0 0
safehome 4 0 0 0
safehome 5 0 0 0
safehome 6 0 0 0
safehome 7 0 0 0
```

View file

@ -12,6 +12,8 @@
| acc_hardware | AUTO | Selection of acc hardware. See Wiki Sensor auto detect and hardware failure detection for more info |
| acc_lpf_hz | 15 | Software-based filter to remove mechanical vibrations from the accelerometer measurements. Value is cutoff frequency (Hz). For larger frames with bigger props set to lower value. |
| acc_lpf_type | BIQUAD | Specifies the type of the software LPF of the acc signals. BIQUAD gives better filtering and more delay, PT1 less filtering and less delay, so use only on clean builds. |
| acc_notch_cutoff | | |
| acc_notch_hz | | |
| accgain_x | 4096 | Calculated value after '6 position avanced calibration'. Uncalibrated value is 4096. See Wiki page. |
| accgain_y | 4096 | Calculated value after '6 position avanced calibration'. Uncalibrated value is 4096. See Wiki page. |
| accgain_z | 4096 | Calculated value after '6 position avanced calibration'. Uncalibrated value is 4096. See Wiki page. |
@ -33,6 +35,7 @@
| antigravity_accelerator | 1 | |
| antigravity_cutoff_lpf_hz | 15 | Antigravity cutoff frequenct for Throtte filter. Antigravity is based on the difference between actual and filtered throttle input. The bigger is the difference, the bigger Antigravity gain |
| antigravity_gain | 1 | Max Antigravity gain. `1` means Antigravity is disabled, `2` means Iterm is allowed to double during rapid throttle movements |
| applied_defaults | 0 | Internal (configurator) hint. Should not be changed manually |
| baro_cal_tolerance | 150 | Baro calibration tolerance in cm. The default should allow the noisiest baro to complete calibration [cm]. |
| baro_hardware | AUTO | Selection of baro hardware. See Wiki Sensor auto detect and hardware failure detection for more info |
| baro_median_filter | ON | 3-point median filtering for barometer readouts. No reason to change this setting |
@ -51,7 +54,11 @@
| current_meter_offset | 0 | This sets the output offset voltage of the current sensor in millivolts. |
| current_meter_scale | 400 | This sets the output voltage to current scaling for the current sensor in 0.1 mV/A steps. 400 is 40mV/A such as the ACS756 sensor outputs. 183 is the setting for the uberdistro with a 0.25mOhm shunt. |
| current_meter_type | ADC | ADC , VIRTUAL, NONE. The virtual current sensor, once calibrated, estimates the current value from throttle position. |
| d_boost_factor | | |
| d_boost_gyro_delta_lpf_hz | | |
| d_boost_max_at_acceleration | | |
| deadband | 5 | These are values (in us) by how much RC input can be different before it's considered valid. For transmitters with jitter on outputs, this value can be increased. Defaults are zero, but can be increased up to 10 or so if rc inputs twitch while idle. |
| debug_mode | NONE | Defines debug values exposed in debug variables (developer / debugging setting) |
| disarm_kill_switch | ON | Disarms the motors independently of throttle value. Setting to OFF reverts to the old behaviour of disarming only when the throttle is low. Only applies when arming and disarming with an AUX channel. |
| display_force_sw_blink | OFF | OFF = OSD hardware blink / ON = OSD software blink. If OSD warning text/values are invisible, try setting this to ON |
| dterm_lpf2_hz | 0 | Cutoff frequency for stage 2 D-term low pass filter |
@ -62,6 +69,14 @@
| dynamic_gyro_notch_min_hz | 150 | Minimum frequency for dynamic notches. Default value of `150` works best with 5" multirors. Should be lowered with increased size of propellers. Values around `100` work fine on 7" drones. 10" can go down to `60` - `70` |
| dynamic_gyro_notch_q | 120 | Q factor for dynamic notches |
| dynamic_gyro_notch_range | `MEDIUM` | Range for dynamic gyro notches. `MEDIUM` for 5", `HIGH` for 3" and `MEDIUM`/`LOW` for 7" and bigger propellers |
| eleres_freq | | |
| eleres_loc_delay | | |
| eleres_loc_en | | |
| eleres_loc_power | | |
| eleres_signature | | |
| eleres_telemetry_en | | |
| eleres_telemetry_power | | |
| esc_sensor_listen_only | | |
| failsafe_delay | 5 | Time in deciseconds to wait before activating failsafe when signal is lost. See [Failsafe documentation](Failsafe.md#failsafe_delay). |
| failsafe_fw_pitch_angle | 100 | Amount of dive/climb when `SET-THR` failsafe is active on a fixed-wing machine. In 1/10 deg (deci-degrees). Negative values = climb |
| failsafe_fw_roll_angle | -200 | Amount of banking when `SET-THR` failsafe is active on a fixed-wing machine. In 1/10 deg (deci-degrees). Negative values = left roll |
@ -80,6 +95,7 @@
| failsafe_throttle_low_delay | 100 | If failsafe activated when throttle is low for this much time - bypass failsafe and disarm, in 10th of seconds. 0 = No timeout |
| fixed_wing_auto_arm | OFF | Auto-arm fixed wing aircraft on throttle above min_check, and disarming with stick commands are disabled, so power cycle is required to disarm. Requires enabled motorstop and no arm switch configured. |
| flaperon_throw_offset | 200 | Defines throw range in us for both ailerons that will be passed to servo mixer via input source 14 (`FEATURE FLAPS`) when FLAPERON mode is activated. |
| fpv_mix_degrees | | |
| frsky_coordinates_format | 0 | D-Series telemetry only: FRSKY_FORMAT_DMS (default), FRSKY_FORMAT_NMEA |
| frsky_default_latitude | 0.000 | D-Series telemetry only: OpenTX needs a valid set of coordinates to show compass value. A fake value defined in this setting is sent while no fix is acquired. |
| frsky_default_longitude | 0.000 | D-Series telemetry only: OpenTX needs a valid set of coordinates to show compass value. A fake value defined in this setting is sent while no fix is acquired. |
@ -120,9 +136,12 @@
| gyro_hardware_lpf | 42HZ | Hardware lowpass filter for gyro. Allowed values depend on the driver - For example MPU6050 allows 10HZ,20HZ,42HZ,98HZ,188HZ,256Hz (8khz mode). If you have to set gyro lpf below 42Hz generally means the frame is vibrating too much, and that should be fixed first. |
| gyro_lpf_hz | 60 | Software-based filter to remove mechanical vibrations from the gyro signal. Value is cutoff frequency (Hz). For larger frames with bigger props set to lower value. |
| gyro_lpf_type | BIQUAD | Specifies the type of the software LPF of the gyro signals. BIQUAD gives better filtering and more delay, PT1 less filtering and less delay, so use only on clean builds. |
| gyro_notch_cutoff | | |
| gyro_notch_hz | | |
| gyro_stage2_lowpass_hz | 0 | Software based second stage lowpass filter for gyro. Value is cutoff frequency (Hz) |
| gyro_stage2_lowpass_type | `BIQUAD` | Defines the type of stage 2 gyro LPF filter. Possible values: `PT1`, `BIQUAD`. `PT1` offers faster filter response while `BIQUAD` better attenuation. |
| gyro_sync | OFF | This option enables gyro_sync feature. In this case the loop will be synced to gyro refresh rate. Loop will always wait for the newest gyro measurement. Maximum gyro refresh rate is determined by gyro_hardware_lpf |
| gyro_to_use | | |
| has_flaps | OFF | Defines is UAV is capable of having flaps. If ON and AIRPLANE `platform_type` is used, **FLAPERON** flight mode will be available for the pilot |
| heading_hold_rate_limit | 90 | This setting limits yaw rotation rate that HEADING_HOLD controller can request from PID inner loop controller. It is independent from manual yaw rate and used only when HEADING_HOLD flight mode is enabled by pilot, RTH or WAYPOINT modes. |
| hott_alarm_sound_interval | 5 | Battery alarm delay in seconds for Hott telemetry |
@ -135,6 +154,7 @@
| imu_dcm_ki_mag | 0 | Inertial Measurement Unit KI Gain for compass measurements |
| imu_dcm_kp | 2500 | Inertial Measurement Unit KP Gain for accelerometer measurements |
| imu_dcm_kp_mag | 10000 | Inertial Measurement Unit KP Gain for compass measurements |
| inav_allow_dead_reckoning | OFF | Defines if inav will dead-reckon over short GPS outages. May also be useful for indoors OPFLOW navigation |
| inav_auto_mag_decl | ON | Automatic setting of magnetic declination based on GPS position. When used manual magnetic declination is ignored. |
| inav_baro_epv | 100.000 | Uncertainty value for barometric sensor [cm] |
| inav_gravity_cal_tolerance | 5 | Unarmed gravity calibration tolerance level. Won't finish the calibration until estimated gravity error falls below this value. |
@ -142,23 +162,34 @@
| inav_max_surface_altitude | 200 | Max allowed altitude for surface following mode. [cm] |
| inav_reset_altitude | FIRST_ARM | Defines when relative estimated altitude is reset to zero. Variants - `NEVER` (once reference is acquired it's used regardless); `FIRST_ARM` (keep altitude at zero until firstly armed), `EACH_ARM` (altitude is reset to zero on each arming) |
| inav_reset_home | FIRST_ARM | Allows to chose when the home position is reset. Can help prevent resetting home position after accidental mid-air disarm. Possible values are: NEVER, FIRST_ARM and EACH_ARM |
| inav_use_gps_no_baro | | |
| inav_use_gps_velned | ON | Defined if iNav should use velocity data provided by GPS module for doing position and speed estimation. If set to OFF iNav will fallback to calculating velocity from GPS coordinates. Using native velocity data may improve performance on some GPS modules. Some GPS modules introduce significant delay and using native velocity may actually result in much worse performance. |
| inav_w_acc_bias | 0.010 | Weight for accelerometer drift estimation |
| inav_w_xy_flow_p | | |
| inav_w_xy_flow_v | | |
| inav_w_xy_gps_p | 1.000 | Weight of GPS coordinates in estimated UAV position and speed. |
| inav_w_xy_gps_v | 2.000 | Weight of GPS velocity data in estimated UAV speed |
| inav_w_xy_res_v | 0.500 | Decay coefficient for estimated velocity when GPS reference for position is lost |
| inav_w_xyz_acc_p | | |
| inav_w_z_baro_p | 0.350 | Weight of barometer measurements in estimated altitude and climb rate |
| inav_w_z_gps_p | 0.200 | Weight of GPS altitude measurements in estimated altitude. Setting is used only of airplanes |
| inav_w_z_gps_v | 0.500 | Weight of GPS climb rate measurements in estimated climb rate. Setting is used on both airplanes and multirotors. If GPS doesn't support native climb rate reporting (i.e. NMEA GPS) you may consider setting this to zero |
| inav_w_z_res_v | 0.500 | Decay coefficient for estimated climb rate when baro/GPS reference for altitude is lost |
| inav_w_z_surface_p | | |
| inav_w_z_surface_v | | |
| iterm_windup | 50 | Used to prevent Iterm accumulation on during maneuvers. Iterm will be dampened when motors are reaching it's limit (when requested motor correction range is above percentage specified by this parameter) |
| ledstrip_visual_beeper | OFF | |
| log_level | `ERROR` | Defines serial debugging log level. See `docs/development/serial_printf_debugging.md` for usage. |
| log_topics | 0 | Defines serial debugging log topic. See `docs/development/serial_printf_debugging.md` for usage. |
| looptime | 1000 | This is the main loop time (in us). Changing this affects PID effect with some PID controllers (see PID section for details). A very conservative value of 3500us/285Hz should work for everyone. Setting it to zero does not limit loop time, so it will go as fast as possible. |
| ltm_update_rate | NORMAL | Defines the LTM update rate (use of bandwidth [NORMAL/MEDIUM/SLOW]). See Telemetry.md, LTM section for details. |
| mag_calibration_time | 30 | Adjust how long time the Calibration of mag will last. |
| mag_declination | 0 | Current location magnetic declination in format. For example, -6deg 37min = -637 for Japan. Leading zero in ddd not required. Get your local magnetic declination here: http://magnetic-declination.com/ . Not in use if inav_auto_mag_decl is turned on and you acquire valid GPS fix. |
| mag_hardware | AUTO | Selection of mag hardware. See Wiki Sensor auto detect and hardware failure detection for more info |
| mag_to_use | | Allow to chose between built-in and external compass sensor if they are connected to separate buses. Currently only for REVO target |
| maggain_x | 0 | Magnetometer calibration X gain. If 0, no calibration or calibration failed |
| maggain_y | 0 | Magnetometer calibration Y gain. If 0, no calibration or calibration failed |
| maggain_z | 0 | Magnetometer calibration Z gain. If 0, no calibration or calibration failed |
| magzero_x | 0 | Magnetometer calibration X offset. If its 0 none offset has been applied and calibration is failed. |
| magzero_y | 0 | Magnetometer calibration Y offset. If its 0 none offset has been applied and calibration is failed. |
| magzero_z | 0 | Magnetometer calibration Z offset. If its 0 none offset has been applied and calibration is failed. |
@ -167,6 +198,11 @@
| manual_rc_yaw_expo | 20 | Exposition value used for the YAW axis by the `MANUAL` flight mode [0-100] |
| manual_roll_rate | 100 | Servo travel multiplier for the ROLL axis in `MANUAL` flight mode [0-100]% |
| manual_yaw_rate | 100 | Servo travel multiplier for the YAW axis in `MANUAL` flight mode [0-100]% |
| mavlink_ext_status_rate | | |
| mavlink_extra1_rate | | |
| mavlink_extra2_rate | | |
| mavlink_pos_rate | | |
| mavlink_rc_chan_rate | | |
| max_angle_inclination_pit | 300 | Maximum inclination in level (angle) mode (PITCH axis). 100=10° |
| max_angle_inclination_rll | 300 | Maximum inclination in level (angle) mode (ROLL axis). 100=10° |
| max_check | 1900 | These are min/max values (in us) which, when a channel is smaller (min) or larger (max) than the value will activate various RC commands, such as arming, or stick configuration. Normally, every RC channel should be set so that min = 1000us, max = 2000us. On most transmitters this usually means 125% endpoints. Default check values are 100us above/below this value. |
@ -185,6 +221,8 @@
| mc_i_pitch | 30 | Multicopter rate stabilisation I-gain for PITCH |
| mc_i_roll | 30 | Multicopter rate stabilisation I-gain for ROLL |
| mc_i_yaw | 45 | Multicopter rate stabilisation I-gain for YAW |
| mc_iterm_relax | | |
| mc_iterm_relax_cutoff | | |
| mc_p_level | 20 | Multicopter attitude stabilisation P-gain |
| mc_p_pitch | 40 | Multicopter rate stabilisation P-gain for PITCH |
| mc_p_roll | 40 | Multicopter rate stabilisation P-gain for ROLL |
@ -197,8 +235,10 @@
| motor_accel_time | 0 | Minimum time for the motor(s) to accelerate from 0 to 100% throttle (ms) [0-1000] |
| motor_decel_time | 0 | Minimum time for the motor(s) to deccelerate from 100 to 0% throttle (ms) [0-1000] |
| motor_direction_inverted | OFF | Use if you need to inverse yaw motor direction. |
| motor_poles | | |
| motor_pwm_protocol | STANDARD | Protocol that is used to send motor updates to ESCs. Possible values - STANDARD, ONESHOT125, ONESHOT42, MULTISHOT, DSHOT150, DSHOT300, DSHOT600, DSHOT1200, BRUSHED |
| motor_pwm_rate | 400 | Output frequency (in Hz) for motor pins. Default is 400Hz for motor with motor_pwm_protocol set to STANDARD. For *SHOT (e.g. ONESHOT125) values of 1000 and 2000 have been tested by the development team and are supported. It may be possible to use higher values. For BRUSHED values of 8000 and above should be used. Setting to 8000 will use brushed mode at 8kHz switching frequency. Up to 32kHz is supported for brushed. Default is 16000 for boards with brushed motors. Note, that in brushed mode, minthrottle is offset to zero. For brushed mode, set max_throttle to 2000. |
| msp_override_channels | 0 | Mask of RX channels that may be overridden by MSP `SET_RAW_RC`. Note that this requires custom firmware with `USE_RX_MSP` and `USE_MSP_RC_OVERRIDE` compile options and the `MSP RC Override` flight mode. |
| name | Empty string | Craft name |
| nav_auto_climb_rate | 500 | Maximum climb/descent rate that UAV is allowed to reach during navigation modes. [cm/s] |
| nav_auto_speed | 300 | Maximum velocity firmware is allowed in full auto modes (RTH, WP) [cm/s] [Multirotor only] |
@ -248,7 +288,8 @@
| nav_landing_speed | 200 | Vertical descent velocity during the RTH landing phase. [cm/s] |
| nav_manual_climb_rate | 200 | Maximum climb/descent rate firmware is allowed when processing pilot input for ALTHOLD control mode [cm/s] |
| nav_manual_speed | 500 | Maximum velocity firmware is allowed when processing pilot input for POSHOLD/CRUISE control mode [cm/s] [Multirotor only] |
| nav_mc_auto_disarm_delay | 2000 | |
| nav_max_terrain_follow_alt | | |
| nav_mc_auto_disarm_delay | 2000 | Delay before multi-rotor disarms when `nav_disarm_on_landing` is set (m/s) |
| nav_mc_bank_angle | 30 | Maximum banking angle (deg) that multicopter navigation is allowed to set. Machine must be able to satisfy this angle without loosing altitude |
| nav_mc_braking_bank_angle | 40 | max angle that MR is allowed to bank in BOOST mode |
| nav_mc_braking_boost_disengage_speed | 100 | BOOST will be disabled when speed goes below this value |
@ -265,6 +306,11 @@
| nav_mc_pos_xy_p | 65 | Controls how fast the drone will fly towards the target position. This is a multiplier to convert displacement to target velocity |
| nav_mc_pos_z_p | 50 | P gain of altitude PID controller (Multirotor) |
| nav_mc_vel_xy_d | 100 | D gain of Position-Rate (Velocity to Acceleration) PID controller. It can damp P and I. Increasing D might help when drone overshoots target. |
| nav_mc_vel_xy_dterm_attenuation | 90 | Maximum D-term attenution percentage for horizontal velocity PID controller (Multirotor). It allows to smooth the PosHold CRUISE, WP and RTH when Multirotor is traveling at full speed. Dterm is not attenuated at low speeds, breaking and accelerating. |
| nav_mc_vel_xy_dterm_attenuation_end | 60 | A point (in percent of both target and current horizontal velocity) where nav_mc_vel_xy_dterm_attenuation reaches maximum |
| nav_mc_vel_xy_dterm_attenuation_start | 10" | A point (in percent of both target and current horizontal velocity) where nav_mc_vel_xy_dterm_attenuation begins |
| nav_mc_vel_xy_dterm_lpf_hz | | |
| nav_mc_vel_xy_ff | | |
| nav_mc_vel_xy_i | 15 | I gain of Position-Rate (Velocity to Acceleration) PID controller. Used for drift compensation (caused by wind for example). Higher I means stronger response to drift. Too much I gain might cause target overshot |
| nav_mc_vel_xy_p | 40 | P gain of Position-Rate (Velocity to Acceleration) PID controller. Higher P means stronger response when position error occurs. Too much P might cause "nervous" behavior and oscillations |
| nav_mc_vel_z_d | 10 | D gain of velocity PID controller |
@ -280,35 +326,62 @@
| nav_rth_climb_first | ON | 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. |
| nav_rth_climb_ignore_emerg | OFF | If set to ON, aircraft will execute initial climb regardless of position sensor (GPS) status. |
| nav_rth_home_altitude | 0 | Aircraft will climb/descend to this altitude after reaching home if landing is not enabled. Set to 0 to stay at `nav_rth_altitude` (default) [cm] |
| nav_rth_home_offset_direction | 0 | Direction offset from GPS established home to "safe" position used for RTH (degrees, 0=N, 90=E, 180=S, 270=W, requires non-zero offset distance) |
| nav_rth_home_offset_distance | 0 | Distance offset from GPS established home to "safe" position used for RTH (cm, 0 disables) |
| nav_rth_tail_first | OFF | If set to ON drone will return tail-first. Obviously meaningless for airplanes. |
| nav_use_fw_yaw_control | OFF | Enables or Disables the use of the heading PID controller on fixed wing. Heading PID controller is always enabled for rovers and boats |
| nav_use_midthr_for_althold | OFF | If set to OFF, the FC remembers your throttle stick position when enabling ALTHOLD and treats it as a neutral midpoint for holding altitude |
| nav_user_control_mode | ATTI | Defines how Pitch/Roll input from RC receiver affects flight in POSHOLD mode: ATTI - pitch/roll controls attitude like in ANGLE mode; CRUISE - pitch/roll controls velocity in forward and right direction. |
| nav_wp_radius | 100 | Waypoint radius [cm]. Waypoint would be considered reached if machine is within this radius |
| nav_wp_safe_distance | 10000 | First waypoint in the mission should be closer than this value [cm]. A value of 0 disables this check. |
| opflow_hardware | | Selection of OPFLOW hardware. |
| opflow_scale | | |
| osd_ahi_bordered | OFF | Shows a border/corners around the AHI region (pixel OSD only) |
| osd_ahi_height | 162 | AHI height in pixels (pixel OSD only) |
| osd_ahi_style | DEFAULT | Sets OSD Artificial Horizon style "DEFAULT" or "LINE" for the FrSky Graphical OSD. |
| osd_ahi_vertical_offset | 0 | AHI vertical offset from center (pixel OSD only) |
| osd_ahi_width | 132 | AHI width in pixels (pixel OSD only) |
| osd_alt_alarm | 100 | Value above which to make the OSD relative altitude indicator blink (meters) |
| osd_artificial_horizon_max_pitch | 20 | Max pitch, in degrees, for OSD artificial horizon |
| osd_artificial_horizon_reverse_roll | | |
| osd_baro_temp_alarm_max | 600 | Temperature above which the baro temperature OSD element will start blinking (decidegrees centigrade) |
| osd_baro_temp_alarm_min | -200 | Temperature under which the baro temperature OSD element will start blinking (decidegrees centigrade) |
| osd_camera_fov_h | 135 | Horizontal field of view for the camera in degres |
| osd_camera_fov_v | 85 | Vertical field of view for the camera in degres |
| osd_camera_uptilt | 0 | Set the camera uptilt for the FPV camera in degres, positive is up, negative is down, relative to the horizontal |
| osd_coordinate_digits | | |
| osd_crosshairs_style | DEFAULT | To set the visual type for the crosshair |
| osd_current_alarm | 0 | Value above which the OSD current consumption element will start blinking. Measured in full Amperes. |
| osd_dist_alarm | 1000 | Value above which to make the OSD distance from home indicator blink (meters) |
| osd_esc_temp_alarm_max | 900 | Temperature above which the IMU temperature OSD element will start blinking (decidegrees centigrade) |
| osd_esc_temp_alarm_min | -200 | Temperature under which the IMU temperature OSD element will start blinking (decidegrees centigrade) |
| osd_estimations_wind_compensation | ON | Use wind estimation for remaining flight time/distance estimation |
| osd_failsafe_switch_layout | OFF | If enabled the OSD automatically switches to the first layout during failsafe |
| osd_force_grid | OFF | Force OSD to work in grid mode even if the OSD device supports pixel level access (mainly used for development) |
| osd_gforce_alarm | 5 | Value above which the OSD g force indicator will blink (g) |
| osd_gforce_axis_alarm_max | 5 | Value above which the OSD axis g force indicators will blink (g) |
| osd_gforce_axis_alarm_min | -5 | Value under which the OSD axis g force indicators will blink (g) |
| osd_hud_wp_disp | OFF | Controls display of the next waypoints in the HUD. |
| osd_horizon_offset | 0 | To vertically adjust the whole OSD and AHI and scrolling bars |
| osd_hud_homepoint | 0 | To 3D-display the home point location in the hud |
| osd_hud_homing | 0 | To display little arrows around the crossair showing where the home point is in the hud |
| osd_hud_margin_h | 3 | Left and right margins for the hud area |
| osd_hud_margin_v | 3 | Top and bottom margins for the hud area |
| osd_hud_radar_disp | 0 | Maximum count of nearby aircrafts or points of interest to display in the hud, as sent from an ESP32 LoRa module. Set to 0 to disable (show nothing). The nearby aircrafts will appear as markers A, B, C, etc |
| osd_hud_radar_nearest | 0 | To display an extra bar of informations at the bottom of the hud area for the closest radar aircraft found, if closest than the set value, in meters. Shows relative altitude (meters or feet, with an up or down arrow to indicate if above or below), speed (in m/s or f/s), and absolute heading (in °, 0 is north, 90 is east, 180 is south, 270 is west). Set to 0 (zero) to disable. |
| osd_hud_radar_range_max | 4000" | In meters, radar aircrafts further away than this will not be displayed in the hud |
| osd_hud_radar_range_min | 3 | In meters, radar aircrafts closer than this will not be displayed in the hud |
| osd_hud_wp_disp | 0 | How many navigation waypoints are displayed, set to 0 (zero) to disable. As sample, if set to 2, and you just passed the 3rd waypoint of the mission, you'll see markers for the 4th waypoint (marked 1) and the 5th waypoint (marked 2) |
| osd_imu_temp_alarm_max | 600 | Temperature above which the IMU temperature OSD element will start blinking (decidegrees centigrade) |
| osd_imu_temp_alarm_min | -200 | Temperature under which the IMU temperature OSD element will start blinking (decidegrees centigrade) |
| osd_left_sidebar_scroll | | |
| osd_left_sidebar_scroll_step | 0 | How many units each sidebar step represents. 0 means the default value for the scroll type. |
| osd_main_voltage_decimals | 1 | Number of decimals for the battery voltages displayed in the OSD [1-2]. |
| osd_neg_alt_alarm | 5 | Value bellow which (negative altitude) to make the OSD relative altitude indicator blink (meters) |
| osd_plus_code_digits | | |
| osd_right_sidebar_scroll | | |
| osd_right_sidebar_scroll_step | 0 | Same as left_sidebar_scroll_step, but for the right sidebar |
| osd_row_shiftdown | 0 | Number of rows to shift the OSD display (increase if top rows are cut off) |
| osd_rssi_alarm | 20 | Value bellow which to make the OSD RSSI indicator blink |
| osd_sidebar_horizontal_offset | 0 | Sidebar horizontal offset from default position. Positive values move the sidebars closer to the edges. |
| osd_sidebar_scroll_arrows | | |
| osd_stats_energy_unit | MAH | Unit used for the drawn energy in the OSD stats [MAH/WH] (milliAmpere hour/ Watt hour) |
| osd_temp_label_align | LEFT | Allows to chose between left and right alignment for the OSD temperature sensor labels. Valid values are `LEFT` and `RIGHT` |
| osd_time_alarm | 10 | Value above which to make the OSD flight time indicator blink (minutes) |
@ -317,9 +390,17 @@
| pid_type | | Allows to set type of PID controller used in control loop. Possible values: `NONE`, `PID`, `PIFF`, `AUTO`. Change only in case of experimental platforms like VTOL, tailsitters, rovers, boats, etc. Airplanes should always use `PIFF` and multirotors `PID` |
| pidsum_limit | 500 | A limitation to overall amount of correction Flight PID can request on each axis (Roll/Pitch). If when doing a hard maneuver on one axis machine looses orientation on other axis - reducing this parameter may help |
| pidsum_limit_yaw | 400 | A limitation to overall amount of correction Flight PID can request on each axis (Yaw). If when doing a hard maneuver on one axis machine looses orientation on other axis - reducing this parameter may help |
| pinio_box1 | | |
| pinio_box2 | | |
| pinio_box3 | | |
| pinio_box4 | | |
| pitch_rate | 20 | Defines rotation rate on PITCH 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. |
| pitot_hardware | NONE | Selection of pitot hardware. |
| pitot_lpf_milli_hz | | |
| pitot_scale | | |
| platform_type | "MULTIROTOR" | Defines UAV platform type. Allowed values: "MULTIROTOR", "AIRPLANE", "HELICOPTER", "TRICOPTER", "ROVER", "BOAT". Currently only MULTIROTOR, AIRPLANE and TRICOPTER types are implemented |
| pos_hold_deadband | 20 | Stick deadband in [r/c points], applied after r/c deadband and expo |
| rangefinder_hardware | NONE | Selection of rangefinder hardware. |
| rangefinder_median_filter | OFF | 3-point median filtering for rangefinder readouts |
| rate_accel_limit_roll_pitch | 0 | Limits acceleration of ROLL/PITCH rotation speed that can be requested by stick input. In degrees-per-second-squared. Small and powerful UAV flies great with high acceleration limit ( > 5000 dps^2 and even > 10000 dps^2). Big and heavy multirotors will benefit from low acceleration limit (~ 360 dps^2). When set correctly, it greatly improves stopping performance. Value of 0 disables limiting. |
| rate_accel_limit_yaw | 10000 | Limits acceleration of YAW rotation speed that can be requested by stick input. In degrees-per-second-squared. Small and powerful UAV flies great with high acceleration limit ( > 10000 dps^2). Big and heavy multirotors will benefit from low acceleration limit (~ 180 dps^2). When set correctly, it greatly improves stopping performance and general stability during yaw turns. Value of 0 disables limiting. |
@ -327,6 +408,7 @@
| rc_filter_frequency | 50 | RC data biquad filter cutoff frequency. Lower cutoff frequencies result in smoother response at expense of command control delay. Practical values are 20-50. Set to zero to disable entirely and use unsmoothed RC stick values |
| rc_yaw_expo | 20 | Exposition value used for the YAW axis by all the stabilized flights modes (all but `MANUAL`) |
| reboot_character | 82 | Special character used to trigger reboot |
| receiver_type | `TARGET dependent` | Selection of receiver (RX) type. Additional configuration of a `serialrx_provider` and a UART will be needed for `SERIAL` |
| report_cell_voltage | OFF | S.Port, D-Series, and IBUS telemetry: Send the average cell voltage if set to ON |
| roll_rate | 20 | Defines rotation rate on ROLL 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. |
| rpm_gyro_filter_enabled | `OFF` | Enables gyro RPM filtere. Set to `ON` only when ESC telemetry is working and rotation speed of the motors is correctly reported to INAV |
@ -341,14 +423,22 @@
| rth_energy_margin | 5 | Energy margin wanted after getting home (percent of battery energy capacity). Use for the remaining flight time/distance calculation |
| rx_max_usec | 2115 | Defines the longest pulse width value used when ensuring the channel value is valid. If the receiver gives a pulse value higher than this value then the channel will be marked as bad and will default to the value of mid_rc. |
| rx_min_usec | 885 | 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. |
| rx_spi_id | | |
| rx_spi_protocol | | |
| rx_spi_rf_channel_count | | |
| sbus_sync_interval | | |
| sdcard_detect_inverted | `TARGET dependent` | This setting drives the way SD card is detected in card slot. On some targets (AnyFC F7 clone) different card slot was used and depending of hardware revision ON or OFF setting might be required. If card is not detected, change this value. |
| serialrx_halfduplex | OFF | Allow serial receiver to operate on UART TX pin. With some receivers will allow control and telemetry over a single wire |
| serialrx_halfduplex | AUTO | Allow serial receiver to operate on UART TX pin. With some receivers will allow control and telemetry over a single wire. |
| serialrx_inverted | OFF | Reverse the serial inversion of the serial RX protocol. When this value is OFF, each protocol will use its default signal (e.g. SBUS will use an inverted signal). Some OpenLRS receivers produce a non-inverted SBUS signal. This setting supports this type of receivers (including modified FrSKY). |
| serialrx_provider | SPEK1024 | When feature SERIALRX is enabled, this allows connection to several receivers which output data via digital interface resembling serial. See RX section. |
| servo_center_pulse | 1500 | Servo midpoint |
| servo_lpf_hz | 20 | Selects the servo PWM output cutoff frequency. Value is in [Hz] |
| servo_protocol | PWM | An option to chose the protocol/option that would be used to output servo data. Possible options `PWM` (FC servo outputs), `SERVO_DRIVER` (I2C PCA9685 peripheral), `SBUS` (S.Bus protocol output via a configured serial port) |
| servo_pwm_rate | 50 | Output frequency (in Hz) servo pins. When using tricopters or gimbal with digital servo, this rate can be increased. Max of 498Hz (for 500Hz pwm period), and min of 50Hz. Most digital servos will support for example 330Hz. |
| setpoint_kalman_enabled | OFF | Enable Kalman filter on the PID controller setpoint |
| setpoint_kalman_q | 100 | Quality factor of the setpoint Kalman filter. Higher values means less filtering and lower phase delay. On 3-7 inch multirotors can be usually increased to 200-300 or even higher of clean builds |
| setpoint_kalman_sharpness | 100 | Dynamic factor for the setpoint Kalman filter. In general, the higher the value, the more dynamic Kalman filter gets |
| setpoint_kalman_w | 4 | Window size for the setpoint Kalman filter. Wider the window, more samples are used to compute variance. In general, wider window results in smoother filter response |
| sim_ground_station_number | Empty string | Number of phone that is used to communicate with SIM module. Messages / calls from other numbers are ignored. If undefined, can be set by calling or sending a message to the module. |
| sim_low_altitude | 0 | Threshold for low altitude warning messages sent by SIM module when the 'L' transmit flag is set in `sim_transmit_flags`. |
| sim_pin | Empty string | PIN code for the SIM module |
@ -356,9 +446,12 @@
| sim_transmit_interval | 60 | Text message transmission interval in seconds for SIM module. Minimum value: 10 |
| small_angle | 25 | If the aircraft tilt angle exceed this value the copter will refuse to arm. |
| smartport_fuel_unit | MAH | S.Port telemetry only: Unit of the value sent with the `FUEL` ID (FrSky D-Series always sends percent). [PERCENT/MAH/MWH] |
| smartport_master_halfduplex | | |
| smartport_master_inverted | | |
| spektrum_sat_bind | 0 | 0 = disabled. Used to bind the spektrum satellite to RX |
| stats | OFF | General switch of the statistics recording feature (a.k.a. odometer) |
| stats_total_dist | 0 | Total flight distance [in meters]. The value is updated on every disarm when "stats" are enabled. |
| stats_total_energy | | |
| stats_total_time | 0 | Total flight time [in seconds]. The value is updated on every disarm when "stats" are enabled. |
| switch_disarm_delay | 250 | Delay before disarming when requested by switch (ms) [0-1000] |
| telemetry_halfduplex | OFF | S.Port telemetry only: Turn UART into UNIDIR for usage on F1 and F4 target. See Telemetry.md for details |
@ -386,6 +479,8 @@
| vtx_channel | 1 | Channel to use within the configured `vtx_band`. Valid values are [1, 8]. |
| vtx_halfduplex | ON | Use half duplex UART to communicate with the VTX, using only a TX pin in the FC. |
| vtx_low_power_disarm | OFF | When the craft is disarmed, set the VTX to its lowest power. `ON` will set the power to its minimum value on startup, increase it to `vtx_power` when arming and change it back to its lowest setting after disarming. `UNTIL_FIRST_ARM` will start with minimum power, but once the craft is armed it will increase to `vtx_power` and it will never decrease until the craft is power cycled. |
| vtx_max_power_override | 0 | Some VTXes may report max power incorrectly (i.e. 200mW for a 600mW VTX). Use this to override max supported power. 0 to disable and use whatever VTX reports as its capabilities |
| vtx_pit_mode_chan | | |
| vtx_power | 1 | VTX RF power level to use. The exact number of mw depends on the VTX hardware. |
| yaw_deadband | 5 | These are values (in us) by how much RC input can be different before it's considered valid. For transmitters with jitter on outputs, this value can be increased. Defaults are zero, but can be increased up to 10 or so if rc inputs twitch while idle. |
| yaw_lpf_hz | 30 | Yaw low pass filter cutoff frequency. Should be disabled (set to `0`) on small multirotors (7 inches and below) |

View file

@ -12,6 +12,10 @@ This assigns the device to the plugdev group(a standard group in Ubuntu). To che
```
sudo usermod -a -G plugdev <username>
```
On Arch and its derivatives the group would be uucp and the command:
```
sudo usermod -a -G uucp <username>
```
## 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/).

View file

@ -83,11 +83,5 @@ Data rate 496Hz 35806 bytes/s 358100 baud
```
## Developer Notes
Providing MSC for a target requires that the `.mk` file includes in `FEATURES` the key `MSC` and at least one of `ONBOARDFLASH` and /or `SDCARD`.
For F4 and F7 targets, `USE_USB_MSC` is set unconditionally in `common.h`; if your target does not support blackbox logging to either SD card or internal flash, you should over-ride this in `target.h`
```
#ifdef USE_USB_MSC
# undef USE_USB_MSC
#endif
```
Providing MSC is automatically enabled for all F4 and up targets that support
`ONBOARDFLASH` and /or `SDCARD`.

View file

@ -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 <PATH_TO_REPO>:/home/src/ inav-build make TARGET=<TARGET>`
2. `docker run --rm -it -v <PATH_TO_REPO>:/src inav-build <TARGET>`
+ Where `<PATH_TO_REPO>` must be replaced with the absolute path of where you cloned this repo (see above), and `<TARGET>` 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.

View file

@ -1,50 +0,0 @@
# Short Version
Install the latest Eclipse Standard/SDK and install the **C/C++ developments Tools** plugins
![plugin eclipse](http://i.imgur.com/IdJ8ki1.png)
Import the project using the wizard **Existing Code as Makefile Project**
![](http://i.imgur.com/XsVCwe2.png)
Adjust your build option if necessary
![](https://camo.githubusercontent.com/64a1d32400d6be64dd4b5d237df1e7f1b817f61b/687474703a2f2f692e696d6775722e636f6d2f6641306d30784d2e706e67)
Make sure you have a valid ARM toolchain and Ruby in the path
![](http://i.imgur.com/dAbscJo.png)
# Long version
* First you need an ARM toolchain. Good choices are **GCC ARM Embedded** (https://launchpad.net/gcc-arm-embedded) or **Yagarto** (http://www.yagarto.de).
* Install Ruby (see the document for your operating system).
* Now download Eclipse and unpack it somewhere. At the time of writing Eclipse 4.2 was the latest stable version.
* To work with ARM projects in Eclipse you need a few plugins:
+ **Eclipse C Development Tools** (CDT) (available via *Help > Install new Software*).
+ **Zylin Embedded CDT Plugin** (http://opensource.zylin.com/embeddedcdt.html).
+ **GNU ARM Eclipse** (http://sourceforge.net/projects/gnuarmeclipse/).
+ If you want to hook up an SWD debugger you also need the **GDB Hardware Debugging** plugin (Also available via *Install new Software*).
* Now clone the project to your harddrive.
* Create a new C project in Eclipse and choose ARM Cross Target Application and your ARM toolchain.
* Import the Git project into the C project in Eclipse via *File > Import > General > File System*.
* Activate Git via *Project > Team > Share Project*.
* Switch to the development branch in Eclipse (*Project > Team > Switch To > development*).
* The next thing you need to do is adjust the project configuration. There is a Makefile included that works but you might want to use GNU ARM Eclipse's automatic Makefile generation. Open the Project configuration and go to *C/C++ Build > Settings*
* Under *Target Processor* choose "cortex-m3"
* Under *ARM Yagarto [Windows/Mac OS] Linker > General* (or whatever toolchain you chose)
+ Browse to the Script file *stm32_flash.ld*
+ Uncheck "Do not use standard start files"
+ Check "Remove unused sections"
* Under *ARM Yagarto [Windows/Mac OS] Linker > Libraries*
+ Add "m" for the math library
* Under *ARM Yagarto [Windows/Mac OS] Compiler > Preprocessor* add the following 2 items to "Defined Symbols":
+ STM32F10X_MD
+ USE_STDPERIPH_DRIVER
* Under *ARM Yagarto [Windows/Mac OS] Compiler > Directories* add the following 3 items
+ ${workspace_loc:/${ProjName}/lib/CMSIS/CM3/CoreSupport}
+ ${workspace_loc:/${ProjName}/lib/CMSIS/CM3/DeviceSupport/ST/STM32F10x}
+ ${workspace_loc:/${ProjName}/lib/STM32F10x_StdPeriph_Driver/inc}
* Under *ARM Yagarto [Windows/Mac OS] Compiler > Miscellaneous* add the following item to "Other flags":
+ -fomit-frame-pointer
* The code in the support directory is for uploading firmware to the board and is meant for your host machine. Hence, it must not be included in the build process. Just right-click on it to open its properties and choose "Exclude from build" under *C/C++ Build > Settings*
* The last thing you need to do is adding your toolchain to the PATH environment variable.
+ Go to *Project > Properties > C/C++ Build > Environment*, add a variable named "PATH" and fill in the full path of your toolchain's binaries.
+ Make sure "Append variables to native environment" is selected.
* Try to build the project via *Project > Build Project*.
* **Note**: If you're getting "...could not be resolved" errors for data types like int32_t etc. try to disable and re-enable the Indexer under *Project > Properties > C/C++ General > Indexer*.

View file

@ -0,0 +1,12 @@
# Building in FreeBSD
In order to build the inav firmware in FreeBSD, it is recommended to install [Linux Binary Emulation](https://www.freebsd.org/doc/handbook/linuxemu.html). This will enable you to use the project recommended ARM cross-compiler. The cross-compiler available in Ports tends to be too old to build inav firmware.
* Install Linux binary emulation
* Install the following packages (`pkg` provides suitable versions)
- `git`
- `cmake`
- `make`
- `ruby`
* Follow the [Building in Linux](Building%20in%20Linux.md) guide.

View file

@ -0,0 +1,156 @@
# Generic Linux development tools
## Overview
This article endeavours to provide a generic guide for compiling inav on Linux for inav 2.6 and later.
inav requires a reasonably modern `gcc-arm-none-eabi` cross-compiler. Different Linux distros will provide different versions of the cross-compiler. This will range from obsolete versions (e.g. Debian, Ubuntu LTS) to the latest stable release (Arch Linux).
In order to provide a uniform and reasonably modern cross compiler, inav provides for the installation of a "known good / working" cross compiler, as well as a mechanism to override this if your distro provides a more modern option (e.g Arch Linux). In general, from a security perspective, Linux distros discourage the installation of software from sources other than the official distribution repositories and 'approved' sources (Ubuntu PPA, Arch AUR). The inav approach of providing a recommended compiler is however both sound and justified:
* The cross-compiler is installed from a reputable source (ARM, the company that makes the CPUs used in our flight controllers)
* Disto cross-compilers are often older than the recommended inav compiler
* The installed cross-compiler is only used to build inav and it not obviously / generally available outside of the inav build environment.
There are a however some specific cases for using the distro cross-compiler in preference to that installed by inav:
* You are using a distro that installs a more modern compiler (Arch)
* You are using a host platform for which ARM does not provide a compiler (e.g. Linux ia32).
## Prerequisites
In addition to a cross-compiler, it is necessary to install some other tools:
* `git` : clone and manage the inav code repository
* `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.
### Ubuntu / Debian
```
# make sure the system is updated first
sudo apt update && sudo apt upgrade
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 gcc
```
### Arch
```
# make sure the system is updated first
sudo pacman -Syu
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.
## Cloning the repository
```
git clone https://github.com/iNavFlight/inav.git
```
Note: If you have a Github account with registered ssh key you can replace the `git clone` command with `git clone git@github.com:iNavFlight/inav.git` instead of the https link.
The `git clone` creates an `inav` directory; we can enter this directory, configure the build environment and build firmware.
## Build tooling
For 2.6 and later, inav uses `cmake` as its primary build tool. `cmake` simplies various platform and hardware dependencies required to cross compile multiple targets. `cmake` still uses GNU `make` to invoke the actual compiler. It is necessary to configure the build enviroment with `cmake` before we can build any firmware.
## Using `cmake`
The canonanical method of using `cmake` is to create a `build` directory and run the `cmake` and `make` commands from within the `build` directory. So, assuming we've cloned the firmware repository into an `inav` directory, we can issue the following commands to set up the build environment.
```
cd inav
# first time only, create the build directory
mkdir build
cd build
cmake ..
# note the "..", this is required as it tells cmake where to find its ruleset
```
`cmake` will check for the presence of an inav-embedded cross-compiler; if this cross-compiler is not found it will attempt to download the vendor (ARM) GCC cross-compiler.
Note. If you want to use your own cross-compiler, either because you're running a distro (e.g. Arch Linux) that ships a more recent cross-compiler, or you're on a platform for which ARM doesn't provide a cross-compiler (e.g. 32bit Linux), the you should run the `cmake` command as:
```
cmake -DCOMPILER_VERSION_CHECK=OFF ..
```
`cmake` will generate a number of files in your `build` directory, including a cache of generated build settings `CMakeCache.txt` and a `Makefile`.
## Bulding the firmware
Once `cmake` has generated the `build/Makefile`, this `Makfile` (with `make`) is used to build the firmware, again from the `build` directory. It is not necessary to re-run `cmake` unless the inav cmake configuration is changed (i.e. a new release) or you wish to swap between the ARM SDK compiler and a distro or other external compiler.
The generated `Makefile` uses different a target selection mechanism from the older (pre 2.6) top level `Makefile`; you can generate a list of targets with `make help` (or, as the list is extremely long), pipe this into a pager, e.g. `make help | less`.
Typically, to build a single target, just pass the target name to `make`; note that unlike eariler releases, `make` without a target specified will build **all** targets.
```
# Build the MATEKF405 firmware
make MATEKF405
```
One can also build multiple targets from a sinlge `make` command:
```
make MATEKF405 MATEKF722
```
The resultant hex file are in the `build` directory.
You can then use the INAV Configurator to flash the local `build/inav_x.y.z_TARGET.hex` file, or use `stm32flash` or `dfu-util` directly from the command line.
[msp-tool](https://github.com/fiam/msp-tool) and [flash.sh](https://github.com/stronnag/mwptools/blob/master/docs/MiscTools.asciidoc#flashsh) provide / describe 3rd party helper tools for command line flashing.
### Cleaning
You can clean out the built files, either for all targets or selectively; a selective clean target is simply defined by prefixing the target name with `clean_`:
```
# clean out every thing
make clean
# clean out single target
make clean_MATEKF405
# or multiple targets
make clean_MATEKF405 clean_MATEKF722
```
### `cmake` cache maintainance
`cmake` caches the build environment, so you don't need to rerun `cmake` each time you build a target. Two `make` options are provided to maintain the `cmake` cache.
* `make edit_cache`
* `make rebuild_cache`
It is unlikely that the typical user will need to employ these options, other than perhaps to change between the embedded ARM and distro compilers.
## Updating and rebuilding
In order to update your local firmware build:
* Navigate to the local iNav repository
* Use the following steps to pull the latest changes and rebuild your local version of inav firmware from the `build` directory:
```
$ cd inav
$ git pull
$ cd build
$ make <TARGET>
```
## Advanced Usage
For more advanced development information and `git` usage, please refer to the [development guide](https://github.com/iNavFlight/inav/blob/master/docs/development/Development.md).

View file

@ -3,7 +3,7 @@
Building in Mac OS X can be accomplished in just a few steps:
* Install general development tools (clang, make, git)
* Install ARM GCC 7.2 series compiler or higher
* Install cmake
* Checkout INAV sourcecode through git
* Build the code
@ -35,41 +35,24 @@ installation, open up XCode and enter its preferences menu. Go to the "downloads
[from the App Store]: https://itunes.apple.com/us/app/xcode/id497799835
## Install ARM GCC 7.2 series or higher compiler
## Install cmake
INAV is built using series 7.2 or above GCC compiler provided by the [GNU Tools for ARM Embedded Processors project][].
The easiest way to install cmake's command line executable is via
[Homebrew](https://brew.sh) (a package manager for macOS). Go to their site
and follow their installation instructions.
Grab the Mac installation tarball for the latest version in the 7.2 series or above (e.g. gcc-arm-none-eabi-7-2017-q4-major-mac.tar.bz2). Move it somewhere useful
such as a `~/development` folder (in your home directory) and double click it to unpack it. You should end up with a
folder with a name similar to `~/development/gcc-arm-none-eabi-7-2017-q4-major/`.
Once Homebrew is installed, type `brew install cmake` in a terminal to install
cmake.
Now you just need to add the `bin/` directory from inside the GCC directory to your system's path. Run `nano ~/.profile`. Add a
new line at the end of the file which adds the path for the `bin/` folder to your path, like so:
Alternatively, cmake binaries for macOS are available from
[cmake.org](https://cmake.org/download/). If you prefer installing it this way,
you'd have to manually add cmake's command line binary to your `$PATH`. Assuming
`CMake.app` has been copied to `/Applications`, adding the following line to
`~/.zshrc` would make the cmake command available.
```sh
export PATH=$PATH:/Applications/CMake.app/Contents/bin
```
export PATH=$PATH:~/development/gcc-arm-none-eabi-7-2017-q4-major/bin
```
Press CTRL+X to exit nano, and answer "y" when prompted to save your changes.
Now *close this terminal window* and open a new one. Try running:
```
arm-none-eabi-gcc --version
```
You should get output similar to (in this example compiler series 7.2.1 is used):
```
arm-none-eabi-gcc (GNU Tools for Arm Embedded Processors 7-2017-q4-major) 7.2.1 20170904 (release) [ARM/embedded-7-branch revision 255204]
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
```
If `arm-none-eabi-gcc` couldn't be found, go back and check that you entered the correct path in your `~/.profile` file.
[GNU Tools for ARM Embedded Processors project]: https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads
## Ruby
@ -90,9 +73,48 @@ This will download the entire INAV repository for you into a new folder called "
## Build the code
Enter the inav directory and run `make TARGET=SPRACINGF3` to build firmware for the SPRacing F3. When the build completes,
the .hex firmware should be available as `obj/inav_x.x.x_SPRACINGF3.hex` for you to flash using the INAV
Configurator.
Assuming you've just cloned the source code, you can switch your current
directory to inav's source try by typing:
```sh
cd inav
```
Inside the inav directory, create a new directory to store the built files. This
helps keeping everything nice and tidy, separating source code from artifacts. By
convention this directory is usually called `build`, but any name would work. Enter
the following command to create it and switch your working directory to it:
```sh
mkdir -p build && cd build
```
Now we need to configure the build by using the following command:
```sh
cmake ..
```
This will automatically download the required compiler for inav, so it
might take a few minutes. Once it's finished without errors, you can
build the target that you want by typing `make target-name`. e.g.:
```sh
make -j8 MATEKF722 # Will build MATEKF722 target
```
A list of all the available targets can be displayed with:
```sh
make targets
```
Once the build completes, the correspondent `.hex` file will be found
in current directory (e.g. `build`) and it will be named as
`inav_x.y.z_TARGET.hex`. `x.y.z` corresponds to the INAV version number
while `TARGET` will be the target name you've just built. e.g.
`inav_2.6.0_MATEKF722.hex`. This is the file that can be flashed using
INAV Configurator.
## Updating to the latest source
@ -100,10 +122,9 @@ If you want to erase your local changes and update to the latest version of the
inav directory and run these commands to first erase your local changes, fetch and merge the latest
changes from the repository, then rebuild the firmware:
```
```sh
git reset --hard
git pull
make clean TARGET=SPRACINGF3
make TARGET=SPRACINGF3
make target-name # e.g. make MATEKF722
```

View file

@ -1,4 +1,4 @@
# Building in Windows 10 with Linux subsystem
# Building in Windows 10 with Linux subsystem [Recommended]
Linux subsystem for Windows 10 is probably the simplest way of building INAV under Windows 10.
@ -25,9 +25,13 @@ Update the repo packages:
Install Git, Make, gcc and Ruby
1. `sudo apt-get install git`
1. `sudo apt-get install make`
1. `sudo apt-get install gcc-arm-none-eabi`
1. `sudo apt-get install cmake`
1. `sudo apt-get install ruby`
### CMAKE and Ubuntu 18_04
To run `cmake` in the latest version you will need to update from Ubuntu `18_04` to `20_04`. The fastest way to do it is to uninstall current version and install `20_04` for Microsoft Store [https://www.microsoft.com/store/productId/9N6SVWS3RX71](https://www.microsoft.com/store/productId/9N6SVWS3RX71)
## Downloading the iNav repository (example):
Mount MS windows C drive and clone iNav
@ -40,15 +44,52 @@ You now have a folder called inav in the root of C drive that you can edit in wi
## Building (example):
For detailed build instrusctions see [Building in Linux](Building%20in%20Linux.md)
Launch Ubuntu:
Click Windows Start button then scroll and lauch "Ubuntu"
Building from Ubunto command line
`cd /mnt/c/inav`
`make clean TARGET=OMNIBUSF4PRO` (as an example)
`make TARGET=MATEKF405` (as an example)
Building from Ubuntu command line
`cd /mnt/c/inav`
Do it onece to prepare build environment
```
mkdir build
cd build
cmake ..
```
Then to build
```
cd build
make MATEKF722
```
## Flashing:
Launch windows configurator GUI and from within the firmware flasher select `Load firmware[Local]`
Hex files can be found in the folder `c:\inav\obj`
Hex files can be found in the folder `c:\inav\build`
## Troubleshooting
### Syntax error: "(" unexpected
```
dzikuvx@BerlinAtHome:/mnt/c/Users/pspyc/Documents/Projects/inav/build$ make MATEKF722SE
Generating MATEKF722SE/settings_generated.h, MATEKF722SE/settings_generated.c
/bin/sh: 1: Syntax error: "(" unexpected
make[3]: *** [src/main/target/MATEKF722SE/CMakeFiles/MATEKF722SE.elf.dir/build.make:63: src/main/target/MATEKF722SE/MATEKF722SE/settings_generated.h] Error 2
make[2]: *** [CMakeFiles/Makefile2:33607: src/main/target/MATEKF722SE/CMakeFiles/MATEKF722SE.elf.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:33290: src/main/target/MATEKF722SE/CMakeFiles/MATEKF722SE.dir/rule] Error 2
make: *** [Makefile:13703: MATEKF722SE] Error 2
```
This error can be triggered by a Windows PATHs included in the Linux Subsystem. The solution is to:
1. Open Windows RegEdit tool
1. Find `HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Lxss\{GUID}\Flags`
1. Change `Flags` from `7` to `5`
1. Restart WSL and Windows preferably
1. `cd build`
1. `cmake ..`
1. `make {TARGET}` should be working again

View file

@ -1,4 +1,4 @@
# Building in windows light
# Building in windows light [Deprecated]
no cygwin and no path changes
## Install Git for windows

View file

@ -0,0 +1,69 @@
# Cmake Usage
## Introduction
This guide documents inav usage of the `cmake` build tool.
## Target Defintion
A target requires `CMakeLists.txt` file. This file contains one of more lines of the form:
```
target_hardware_definition(name optional_parameters)
```
For example:
```
target_stm32f405xg(QUARKVISION HSE_MHZ 16)
```
* The hardware is `stm32f405xg`, a F405 with a 1MiB flash
* The name is `QUARKVISION` (a board that never reached production)
* The optional parameter is `HSE_MHZ 16` defining the non-default high-speed external (HSE) oscillator clock.
## Hardware names
As of inav 2.6, the following target hardware platforms are recognised:
* stm32f303xc
* stm32f405xg
* stm32f411xe
* stm32f427xg
* stm32f722xe
* stm32f745xg
* stm32f765xg
* stm32f765xi
The device characteristics for these names may be found at [stm32-base.org](https://stm32-base.org/cheatsheets/linker-memory-regions/).
## Optional Parameters
The following optional parameters are recognised:
| Paramater | Usage |
| --------- | ----- |
| `SKIP_RELEASES` | The target is disabled for releases and CI. It still may be possible to build the target directly. |
| `COMPILE_DEFINITIONS "VAR[=value]"` | Sets a preprocessor define. |
| `HSE_MZ value` | The target uses a high-speed external crystal (HSE) oscillator clock with a frequency different from the 8MHz default. The `value` is the desired clock, for example `HSE_MHZ 24` |
Multiple optional parameters may be specified, for example `HSE_MHZ 16 SKIP_RELEASES`.
## Target variations
A number of targets support multiple variants, either successive versions of the same hardware, or varations that enable different resources (soft serial, leds etc.) This is defined by adding additional `target_` lines to `CMakeLists.txt`. For example, the OMNIBUSF4 and its multiple clones / variations, `src/main/target/OMNIBUSF4/CMakeLists.txt`:
```
target_stm32f405xg(DYSF4PRO)
target_stm32f405xg(DYSF4PROV2)
target_stm32f405xg(OMNIBUSF4)
# the OMNIBUSF4SD has an SDCARD instead of flash, a BMP280 baro and therefore a slightly different ppm/pwm and SPI mapping
target_stm32f405xg(OMNIBUSF4PRO)
target_stm32f405xg(OMNIBUSF4PRO_LEDSTRIPM5)
target_stm32f405xg(OMNIBUSF4V3_S5_S6_2SS)
target_stm32f405xg(OMNIBUSF4V3_S5S6_SS)
target_stm32f405xg(OMNIBUSF4V3_S6_SS)
# OMNIBUSF4V3 is a (almost identical) variant of OMNIBUSF4PRO target,
# except for an inverter on UART6.
target_stm32f405xg(OMNIBUSF4V3)
```

View file

@ -1,148 +0,0 @@
# Generic Linux development tools
## Overview
This article endeavours to provide a generic guide for compiling iNav on Linux for iNav after iNav 2.2.1.
iNav requires a reasonably modern `gcc-arm-none-eabi` cross-compiler. Different Linux distros will provide different versions of the cross-compiler. This will range from obsolete versions (e.g. Debian, Ubuntu LTS) to the latest stable release (Arch Linux).
In order to provide a uniform and reasonably modern cross compiler, after release iNav 2.2.1, iNav provides for the installation of a "known good / working" cross compiler, as well as a mechanism to override this if your distro provides a more modern option (e.g Arch Linux). In general, from a security perspective, Linux distros discourage the installation of software from sources other than the official distribution repositories and 'approved' sources (Ubuntu PPA, Arch AUR). The iNav approach of providing a recommended compiler is however both sound and justified:
* The cross-compiler is installed from a reputable source (ARM, the company that makes the CPUs used in our UAS)
* Disto cross-compiler are often older than the recommended iNav compiler
* The installed cross-compiler is only used to build iNav and it not obviously / generally available outside of the iNav build environment.
There are a however some specific cases for using the distro cross-compiler in preference to that installed by iNav:
* You are using a distro that installs a more modern compiler (Arch)
* You are using a host platform other than x86_64 (e.g. ia32, AArch64).
However, before we consider the compiler options, it is necessary to install some other dependencies.
## Other Prerequisites
In addition to a cross-compiler, it is necessary to install some other tools:
### Ubuntu / Debian
```
$ # make sure the system is updated first
$ sudo apt update && sudo apt upgrade
$ sudo apt install gcc git make ruby curl
```
### Fedora
```
$ # make sure the system is updated first
$ sudo dnf -y update
$ sudo dnf install gcc git make ruby curl
```
### Arch
```
$ # make sure the system is updated first
$ sudo pacman -Syu
$ sudo pacman -S gcc git make ruby curl
```
Once these prerequisites are installed, we can clone the repository to provide a local instance of the iNav source code.
## Cloning the repository
```
$ git clone https://github.com/iNavFlight/inav.git
```
Note: If you have a Github account with registered ssh key you can replace the `git clone` command with `git clone git@github.com:iNavFlight/inav.git` instead of the https link.
The `git clone` creates an `inav` directory; we can enter this directory and try and build the firmware. Initially, will probably fail as we have not yet defined the cross-compiler. The following example is from Ubuntu 19.04:
```
$ cd inav
$ make TARGET=MATEKF405
make/tools.mk:78: *** **ERROR** your arm-none-eabi-gcc is '7.3.1', but '8.2.1' is expected. Override with 'GCC_REQUIRED_VERSION' in make/local.mk or run 'make arm_sdk_install' to install the right version automatically in the tools folder of this repo. Stop.
```
We must either install the iNav toolchain cross-compiler (preferred option) or define the distro cross-compiler.
## Compiler choices
### Installing the iNav preferred cross compiler.
In the iNav directory, issue the command `make arm_sdk_install`. The output will be something like the following (only hopefully you do not suffer from "rural broadband"):
```
$ make arm_sdk_install
mkdir -p tools
mkdir -p downloads
Warning: Illegal date format for -z, --time-cond (and not a file name).
Warning: Disabling time condition. See curl_getdate(3) for valid date syntax.
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 244 100 244 0 0 645 0 --:--:-- --:--:-- --:--:-- 643
100 102M 100 102M 0 0 1385k 0 0:01:15 0:01:15 --:--:-- 1392k
```
Note that the `curl` warning will only occur the first time (as there is no pre-existing iNav-specific cross-compiler installed).
### Using the Distro compiler.
If your distro provides a more recent cross compiler, or you're using a host platform other than x86_64 you may choose to use your distro compiler (or have no choice in the case of "not x86_64").
You must first install the distro compiler: Arch is the most likely to provide a more modern cross compiler, which would need to be installed as `sudo pacman -S arm-none-eabi-gcc arm-none-eabi-binutils arm-none-eabi-newlib`.
There are two options to define the distro compiler version:
* Invoke `make` with the variable `GCC_REQUIRED_VERSION` set to the distro version. This can be done as:
```
$ make GCC_REQUIRED_VERSION=$(arm-none-eabi-gcc -dumpversion)
```
For convenience, you can create an `alias` or define a shell function. The shell function will be evaluated each time it is invoked, while the alias will be evaluated once (typically at login), for example:
```
# bash function, typically in ~/.bashrc
$ makefc() { make GCC_REQUIRED_VERSION=$(arm-none-eabi-gcc -dumpversion) $@; }
export -f makefc
# or, bash alias, typically in ~/.bash_aliases
$ alias makefc="make GCC_REQUIRED_VERSION=$(arm-none-eabi-gcc -dumpversion) $@"
```
then e.g `$ makefc TARGET=MATEKF405`
* or, create the file `make/local.mk` defining the local distro compiler version.
```
$ echo GCC_REQUIRED_VERSION=$(arm-none-eabi-gcc -dumpversion) > make/local.mk
```
then use `make` normally, `$ make TARGET=MATEKF405`
If you define the distro cross-compiler version in `make/local.mk`, you will need to update `make/local.mk` whenever your disto updates the cross-compiler.
## Building the firmware
By default, `make` builds the REVO target, to build another target, specify the target name to the make command, for example:
```
make TARGET=MATEKF405
```
The resultant hex file are in the `obj/` directory.
You can use the INAV Configurator to flash the local ```obj/inav_TARGET.hex``` file, or use `stm32flash` or `dfu-util` directly from the command line.
[msp-tool](https://github.com/fiam/msp-tool) and [flash.sh](https://github.com/stronnag/mwptools/blob/master/docs/MiscTools.asciidoc#flashsh) provide / describe 3rd party helper tools for command line flashing.
## Updating and rebuilding
In order to update your local firmware build:
* Navigate to the local iNav repository
* Use the following steps to pull the latest changes and rebuild your local version of iNav:
```
$ cd inav
$ git pull
$ make TARGET=<TARGET>
```
## Advanced Usage
For more advanced development information and `git` usage, please refer to the [development guide](https://github.com/iNavFlight/inav/blob/master/docs/development/Development.md).

View file

@ -0,0 +1,119 @@
# IDE - Visual Studio Code with Windows 10
![Visual Studio Code](assets/vscode01.png)
[Visual Studio Code](https://code.visualstudio.com/) is probably the best free option for all Windows 10 users. It provides almost seamless integration with WSL running Ubuntu, syntax highlighting, building, and hardware debugging.
## Setup
1. Setup build environment using [generic WSL guide](Building%20in%20Windows%2010%20with%20Linux%20Subsystem.md)
1. Download and install [Visual Studio Code](https://code.visualstudio.com/)
1. From the VS Code Extensions download [Remote - WSL](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl) plugin
1. Open INAV folder
1. Use `Ctrl + Shift + P` to run option `Remote-WSL: Reopen Folder in WSL`
1. Allow firewall and other permissions if requested
1. Install plugins in WSL workspace:
1. [C/C++ from Microsoft](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools) for C/C++ support
1. [Bookmarks](https://marketplace.visualstudio.com/items?itemName=alefragnani.Bookmarks) for simpler navigation
1. Configure the environment using the following snippets as a base
### C propertiues
Edit file `./.vscode/c_cpp_properties.json` to setup enabled `defines`
```
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceRoot}",
"${workspaceRoot}/src/main/**"
],
"browse": {
"limitSymbolsToIncludedHeaders": false,
"path": [
"${workspaceRoot}/**"
]
},
"intelliSenseMode": "msvc-x64",
"cStandard": "c11",
"cppStandard": "c++17",
"defines": [
"USE_NAV",
"NAV_FIXED_WING_LANDING",
"USE_OSD",
"USE_GYRO_NOTCH_1",
"USE_GYRO_NOTCH_2",
"USE_DTERM_NOTCH",
"USE_ACC_NOTCH",
"USE_GYRO_BIQUAD_RC_FIR2",
"USE_D_BOOST",
"USE_SERIALSHOT",
"USE_ANTIGRAVITY",
"USE_ASYNC_GYRO_PROCESSING",
"USE_RPM_FILTER",
"USE_GLOBAL_FUNCTIONS",
"USE_DYNAMIC_FILTERS",
"USE_IMU_BNO055",
"USE_SECONDARY_IMU",
"USE_DSHOT",
"FLASH_SIZE 480",
"USE_I2C_IO_EXPANDER",
"USE_PCF8574",
"USE_ESC_SENSOR"
]
}
],
"version": 4
}
```
### Tasks
Edit `./.vscode/tasks.json` to enable Building with `Ctrl + Shift + B` keyboard shortcut and from Command Console.
```
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Build Matek F722-SE",
"type": "shell",
"command": "make MATEKF722SE",
"group": "build",
"problemMatcher": [],
"options": {
"cwd": "${workspaceFolder}/build"
}
},
{
"label": "Build Matek F722",
"type": "shell",
"command": "make MATEKF722",
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": [],
"options": {
"cwd": "${workspaceFolder}/build"
}
}
,
{
"label": "CMAKE Update",
"type": "shell",
"command": "cmake ..",
"group": "build",
"problemMatcher": [],
"options": {
"cwd": "${workspaceFolder}/build"
}
}
]
}
```

View file

@ -1,63 +0,0 @@
### IO variables
`gyroADC/8192*2000 = deg/s`
`gyroADC/4 ~ deg/s`
`rcCommand` - `<-500 - 500>` nominal, but is scaled with `rcRate/100`, max +-1250
`inclination` - in 0.1 degree, roll and pitch deviation from horizontal position
`max_angle_inclination` - in 0.1 degree, default 50 degrees (500)
`axisPID` - output to mixer, will be added to throttle(`<1000-2000>`), output range is `<minthrottle, maxthrottle>` (default `<1150 - 1850>`)
### PID controller 0, "MultiWii" (default)
#### Leveling term
```
error = constrain(2*rcCommand[axis], limit +- max_angle_inclination) - inclination[axis]
Pacc = constrain(P8[PIDLEVEL]/100 * error, limit +- 5 * D8[PIDLEVEL])
Iacc = intergrate(error, limit +-10000) * I8[PIDLEVEL] / 4096
```
#### Gyro term
```
Pgyro = rcCommand[axis];
error = rcCommand[axis] * 10 * 8 / pidProfile->P8[axis] - gyroADC[axis] / 4; (conversion so that error is in deg/s ?)
Igyro = integrate(error, limit +-16000) / 10 / 8 * I8[axis] / 100 (conversion back to mixer units ?)
```
reset I term if
- axis rotation rate > +-64deg/s
- axis is YAW and rcCommand>+-100
##### Mode dependent mix(yaw is always from gyro)
- HORIZON - proportionally according to max deflection
```
deflection = MAX(ABS(rcCommand[PITCH]), ABS(rcCommand[ROLL])) / 500 ; limit to 0.0 .. 1.0
P = Pacc * (1-deflection) + Pgyro * deflection
I = Iacc * (1-deflection) + Igyro * deflection
```
- gyro
```
P = Pgyro
I = Igyro
```
- ANGLE
```
P = Pacc
I = Iacc
```
#### Gyro stabilization
```
P -= gyroADC[axis] / 4 * dynP8 / 10 / 8
D = -mean(diff(gyroADC[axis] / 4), over 3 samples) * 3 * dynD8 / 32
[equivalent to :]
D = - (gyroADC[axis]/4 - (<3 loops old>gyroADC[axis]/4)) * dynD8 / 32
```
This can be seen as sum of
- PI controller (handles rcCommand, HORIZON/ANGLE); `Igyro` is only output based on gyroADC
- PD controller(parameters dynP8/dynD8) with zero setpoint acting on gyroADC

Binary file not shown.

After

Width:  |  Height:  |  Size: 564 KiB

File diff suppressed because one or more lines are too long

View file

@ -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

View file

@ -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)*/
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;
} 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,7 +47,7 @@ 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 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)
@ -79,7 +79,7 @@ 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 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)
@ -137,7 +137,7 @@ 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 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.
*/
@ -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)
{

View file

@ -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*/
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; /*< Type from ADSB_ALTITUDE_TYPE enum*/
uint8_t altitude_type; /*< ADSB altitude type.*/
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;
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
@ -78,17 +78,17 @@ typedef struct __mavlink_adsb_vehicle_t {
* @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 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 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 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)
*/
@ -140,17 +140,17 @@ static inline uint16_t mavlink_msg_adsb_vehicle_pack(uint8_t system_id, uint8_t
* @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 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 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 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)
*/
@ -228,17 +228,17 @@ static inline uint16_t mavlink_msg_adsb_vehicle_encode_chan(uint8_t system_id, u
* @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 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 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 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
@ -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)
{
@ -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)
{

View file

@ -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)
{

View file

@ -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)*/
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; /*< X position in meters (NED)*/
float y; /*< Y position in meters (NED)*/
float z; /*< Z position in meters (NED)*/
}) mavlink_att_pos_mocap_t;
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 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 X position in meters (NED)
* @param y Y position in meters (NED)
* @param z Z position in meters (NED)
* @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 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 X position in meters (NED)
* @param y Y position in meters (NED)
* @param z Z position in meters (NED)
* @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 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 X position in meters (NED)
* @param y Y position in meters (NED)
* @param z Z position in meters (NED)
* @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)
{
@ -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)
{

View file

@ -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)
{

View file

@ -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)*/
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; /*< Roll angular speed (rad/s)*/
float pitchspeed; /*< Pitch angular speed (rad/s)*/
float yawspeed; /*< Yaw angular speed (rad/s)*/
}) mavlink_attitude_quaternion_t;
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 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 Roll angular speed (rad/s)
* @param pitchspeed Pitch angular speed (rad/s)
* @param yawspeed Yaw angular speed (rad/s)
* @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 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 Roll angular speed (rad/s)
* @param pitchspeed Pitch angular speed (rad/s)
* @param yawspeed Yaw angular speed (rad/s)
* @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 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 Roll angular speed (rad/s)
* @param pitchspeed Pitch angular speed (rad/s)
* @param yawspeed Yaw angular speed (rad/s)
* @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)
{
@ -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)
{

View file

@ -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)*/
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; /*< 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;
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 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 Roll angular speed (rad/s)
* @param pitchspeed Pitch angular speed (rad/s)
* @param yawspeed Yaw angular speed (rad/s)
* @param covariance Attitude covariance
* @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 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 Roll angular speed (rad/s)
* @param pitchspeed Pitch angular speed (rad/s)
* @param yawspeed Yaw angular speed (rad/s)
* @param covariance Attitude covariance
* @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 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 Roll angular speed (rad/s)
* @param pitchspeed Pitch angular speed (rad/s)
* @param yawspeed Yaw angular speed (rad/s)
* @param covariance Attitude covariance
* @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)
{
@ -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)
{

View file

@ -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*/
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; /*< 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 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;
} 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,12 +59,12 @@ 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 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 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 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)
*/
@ -103,12 +103,12 @@ 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 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 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 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)
*/
@ -173,12 +173,12 @@ 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 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 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 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)
{
@ -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)
{

View file

@ -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;
} mavlink_auth_key_t;
#define MAVLINK_MSG_ID_AUTH_KEY_LEN 32
#define MAVLINK_MSG_ID_AUTH_KEY_MIN_LEN 32

View file

@ -3,10 +3,10 @@
#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*/
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*/
@ -16,7 +16,7 @@ typedef struct __mavlink_autopilot_version_t {
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;
} 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,7 +73,7 @@ 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 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
@ -83,7 +83,7 @@ typedef struct __mavlink_autopilot_version_t {
* @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 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,7 +129,7 @@ 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 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
@ -139,7 +139,7 @@ static inline uint16_t mavlink_msg_autopilot_version_pack(uint8_t system_id, uin
* @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 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,7 +211,7 @@ 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 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
@ -221,7 +221,7 @@ static inline uint16_t mavlink_msg_autopilot_version_encode_chan(uint8_t system_
* @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 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)
{
@ -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)
{

View file

@ -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*/
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: (0%: 0, 100%: 100), -1: autopilot does not estimate the remaining battery*/
}) mavlink_battery_status_t;
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) }, \
} \
}
@ -68,12 +68,12 @@ typedef struct __mavlink_battery_status_t {
* @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 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,
@ -118,12 +118,12 @@ static inline uint16_t mavlink_msg_battery_status_pack(uint8_t system_id, uint8_
* @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 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,
@ -194,12 +194,12 @@ static inline uint16_t mavlink_msg_battery_status_encode_chan(uint8_t system_id,
* @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 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
@ -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)
{

View file

@ -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*/
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;
} mavlink_camera_trigger_t;
#define MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN 12
#define MAVLINK_MSG_ID_CAMERA_TRIGGER_MIN_LEN 12
@ -44,7 +44,7 @@ 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 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)
*/
@ -75,7 +75,7 @@ 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 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)
*/
@ -132,7 +132,7 @@ 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 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)
{

View file

@ -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.*/
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;
} mavlink_change_operator_control_t;
#define MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN 28
#define MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_MIN_LEN 28
@ -52,7 +52,7 @@ typedef struct __mavlink_change_operator_control_t {
*
* @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 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)
*/
@ -87,7 +87,7 @@ static inline uint16_t mavlink_msg_change_operator_control_pack(uint8_t system_i
* @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 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)
*/
@ -148,7 +148,7 @@ static inline uint16_t mavlink_msg_change_operator_control_encode_chan(uint8_t s
*
* @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 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
@ -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)
{

View file

@ -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;
} 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

View file

@ -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*/
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;
} 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
@ -63,9 +63,9 @@ typedef struct __mavlink_collision_t {
* @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 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,
@ -109,9 +109,9 @@ static inline uint16_t mavlink_msg_collision_pack(uint8_t system_id, uint8_t com
* @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 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,
@ -181,9 +181,9 @@ static inline uint16_t mavlink_msg_collision_encode_chan(uint8_t system_id, uint
* @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 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
@ -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)
{

View file

@ -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)
{

View file

@ -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
}

View file

@ -3,7 +3,7 @@
#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*/
@ -11,14 +11,14 @@ typedef struct __mavlink_command_int_t {
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*/
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. see MAV_FRAME in mavlink_types.h*/
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;
} 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
@ -79,8 +79,8 @@ typedef struct __mavlink_command_int_t {
*
* @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 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
@ -89,7 +89,7 @@ typedef struct __mavlink_command_int_t {
* @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 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,
@ -143,8 +143,8 @@ static inline uint16_t mavlink_msg_command_int_pack(uint8_t system_id, uint8_t c
* @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 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
@ -153,7 +153,7 @@ static inline uint16_t mavlink_msg_command_int_pack(uint8_t system_id, uint8_t c
* @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 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,
@ -233,8 +233,8 @@ static inline uint16_t mavlink_msg_command_int_encode_chan(uint8_t system_id, ui
*
* @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 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
@ -243,7 +243,7 @@ static inline uint16_t mavlink_msg_command_int_encode_chan(uint8_t system_id, ui
* @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 z PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame).
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
@ -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)
{
@ -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)
{

View file

@ -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.*/
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;
} 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
@ -73,15 +73,15 @@ typedef struct __mavlink_command_long_t {
*
* @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 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, 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 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,
@ -131,15 +131,15 @@ static inline uint16_t mavlink_msg_command_long_pack(uint8_t system_id, uint8_t
* @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 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, 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 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,
@ -215,15 +215,15 @@ static inline uint16_t mavlink_msg_command_long_encode_chan(uint8_t system_id, u
*
* @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 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, 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 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
@ -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)
{
@ -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)
{

View file

@ -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*/
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; /*< 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;
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 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 Angular rate in roll axis
* @param pitch_rate Angular rate in pitch axis
* @param yaw_rate Angular rate in yaw axis
* @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 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 Angular rate in roll axis
* @param pitch_rate Angular rate in pitch axis
* @param yaw_rate Angular rate in yaw axis
* @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 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 Angular rate in roll axis
* @param pitch_rate Angular rate in pitch axis
* @param yaw_rate Angular rate in yaw axis
* @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)
{
@ -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)
{

View file

@ -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*/
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;
} 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) }, \
} \
}
@ -48,7 +48,7 @@ typedef struct __mavlink_data_stream_t {
* @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 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)
*/
@ -82,7 +82,7 @@ static inline uint16_t mavlink_msg_data_stream_pack(uint8_t system_id, uint8_t c
* @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 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)
*/
@ -142,7 +142,7 @@ static inline uint16_t mavlink_msg_data_stream_encode_chan(uint8_t system_id, ui
* @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 message_rate [Hz] The message rate
* @param on_off 1 stream is enabled, 0 stream is stopped.
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
@ -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)
{

View file

@ -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)
{

View file

@ -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)*/
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;
} 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,7 +47,7 @@ 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 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)
@ -81,7 +81,7 @@ 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 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)
@ -141,7 +141,7 @@ 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 time_boot_ms [ms] Timestamp (time since system boot).
* @param ind index of debug variable
* @param value DEBUG value
*/
@ -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)
{

View file

@ -3,14 +3,14 @@
#define MAVLINK_MSG_ID_DEBUG_VECT 250
MAVPACKED(
typedef struct __mavlink_debug_vect_t {
uint64_t time_usec; /*< Timestamp*/
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;
} 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
@ -54,7 +54,7 @@ typedef struct __mavlink_debug_vect_t {
* @param msg The MAVLink message to compress the data into
*
* @param name Name
* @param time_usec Timestamp
* @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
@ -92,7 +92,7 @@ static inline uint16_t mavlink_msg_debug_vect_pack(uint8_t system_id, uint8_t co
* @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 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
@ -156,7 +156,7 @@ static inline uint16_t mavlink_msg_debug_vect_encode_chan(uint8_t system_id, uin
* @param chan MAVLink channel to send the message
*
* @param name Name
* @param time_usec Timestamp
* @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
@ -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)
{

View file

@ -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.*/
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 from MAV_SENSOR_ORIENTATION enum.*/
uint8_t covariance; /*< Measurement covariance in centimeters, 0 for unknown / invalid readings*/
}) mavlink_distance_sensor_t;
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 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 from MAV_SENSOR_ORIENTATION enum.
* @param covariance Measurement covariance in centimeters, 0 for unknown / invalid readings
* @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 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 from MAV_SENSOR_ORIENTATION enum.
* @param covariance Measurement covariance in centimeters, 0 for unknown / invalid readings
* @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 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 from MAV_SENSOR_ORIENTATION enum.
* @param covariance Measurement covariance in centimeters, 0 for unknown / invalid readings
* @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)
{
@ -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)
{

View file

@ -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;
} mavlink_encapsulated_data_t;
#define MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN 255
#define MAVLINK_MSG_ID_ENCAPSULATED_DATA_MIN_LEN 255

View file

@ -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)*/
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; /*< 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;
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 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 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 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 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 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 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 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 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 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)
{
@ -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)
{

View file

@ -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;
} mavlink_extended_sys_state_t;
#define MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN 2
#define MAVLINK_MSG_ID_EXTENDED_SYS_STATE_MIN_LEN 2

View file

@ -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
}

View file

@ -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;
} mavlink_file_transfer_protocol_t;
#define MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN 254
#define MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_MIN_LEN 254

View file

@ -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 timestamp; /*< [ms] Timestamp (time 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*/
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;
} 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,13 +75,13 @@ 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 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 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 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
@ -131,13 +131,13 @@ 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 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 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 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
@ -213,13 +213,13 @@ 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 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 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 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
@ -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)
{
@ -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)
{

View file

@ -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)
{

View file

@ -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.)*/
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;
} 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 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 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 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 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 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 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 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 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 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)
{
@ -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)
{

View file

@ -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)
{

View file

@ -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.*/
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;
} 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 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 Age of DGPS info
* @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 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 Age of DGPS info
* @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 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 Age of DGPS info
* @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)
{
@ -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)
{

View file

@ -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 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; /*< Rate of baseline messages being received by GPS, in HZ*/
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. 0 == ECEF, 1 == NED*/
}) mavlink_gps2_rtk_t;
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,17 +77,17 @@ 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 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 GPS Time of Week 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 Rate of baseline messages being received by GPS, in HZ
* @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. 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 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)
@ -141,17 +141,17 @@ 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 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 GPS Time of Week 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 Rate of baseline messages being received by GPS, in HZ
* @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. 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 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)
@ -231,17 +231,17 @@ 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 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 GPS Time of Week 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 Rate of baseline messages being received by GPS, in HZ
* @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. 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 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.
*/
@ -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)
{
@ -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)
{
@ -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)
{
@ -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)
{

View file

@ -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)
{

View file

@ -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 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
@ -52,8 +52,8 @@ typedef struct __mavlink_gps_inject_data_t {
*
* @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 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,
@ -87,8 +87,8 @@ static inline uint16_t mavlink_msg_gps_inject_data_pack(uint8_t system_id, uint8
* @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 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,
@ -148,8 +148,8 @@ static inline uint16_t mavlink_msg_gps_inject_data_encode_chan(uint8_t system_id
*
* @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 len [bytes] Data length
* @param data Raw data (110 is enough for 12 satellites of RTCMv2)
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
@ -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)
{

View file

@ -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.*/
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;
} 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,23 +92,23 @@ 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 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 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 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 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 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)
*/
@ -171,23 +171,23 @@ 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 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 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 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 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 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)
*/
@ -276,23 +276,23 @@ 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 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 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 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 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 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)
{
@ -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)
{
@ -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)
{

View file

@ -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.*/
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; /*< 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.*/
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;
} 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,15 +68,15 @@ 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 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 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 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)
*/
@ -123,15 +123,15 @@ 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 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 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 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)
*/
@ -204,15 +204,15 @@ 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 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 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 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)
{
@ -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)
{

View file

@ -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 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;
} 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,8 +47,8 @@ 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 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)
*/
@ -79,8 +79,8 @@ 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 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)
*/
@ -137,8 +137,8 @@ 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 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)
{

View file

@ -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 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; /*< Rate of baseline messages being received by GPS, in HZ*/
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. 0 == ECEF, 1 == NED*/
}) mavlink_gps_rtk_t;
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,17 +77,17 @@ 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 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 GPS Time of Week 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 Rate of baseline messages being received by GPS, in HZ
* @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. 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 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)
@ -141,17 +141,17 @@ 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 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 GPS Time of Week 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 Rate of baseline messages being received by GPS, in HZ
* @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. 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 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)
@ -231,17 +231,17 @@ 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 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 GPS Time of Week 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 Rate of baseline messages being received by GPS, in HZ
* @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. 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 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.
*/
@ -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)
{
@ -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)
{
@ -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)
{
@ -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)
{

Some files were not shown because too many files have changed in this diff Show more