blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 3 281 | content_id stringlengths 40 40 | detected_licenses listlengths 0 57 | license_type stringclasses 2 values | repo_name stringlengths 6 116 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 313 values | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 18.2k 668M ⌀ | star_events_count int64 0 102k | fork_events_count int64 0 38.2k | gha_license_id stringclasses 17 values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 107 values | src_encoding stringclasses 20 values | language stringclasses 1 value | is_vendor bool 2 classes | is_generated bool 2 classes | length_bytes int64 4 6.02M | extension stringclasses 78 values | content stringlengths 2 6.02M | authors listlengths 1 1 | author stringlengths 0 175 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9002cd217cd0450f581da569094cf0043a5f2e4e | 9bd08d744f07d9cea9d5a95ecf3e9aede6c0b7f2 | /Web/manage.py | 9d1c895b0d94e16af1a9dc11a45ff1e2cde752e1 | [
"MIT"
] | permissive | tunglambk/image_style_transfer | f05d28dfd91e83efc3263b84ef0a9395329940c1 | 9b5e01f12d5363cf61a7b7538a5daa54600f8eda | refs/heads/master | 2022-12-26T01:19:59.685210 | 2020-10-04T10:55:33 | 2020-10-04T10:55:33 | 297,641,729 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 802 | py | #!/usr/bin/env python3
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "Web.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that the
# issue is really that Django is missing to avoid masking other
# exceptions on Python 2.
try:
import django
except ImportError:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
)
raise
execute_from_command_line(sys.argv)
| [
"lamphambatung92@gmail.com"
] | lamphambatung92@gmail.com |
bf0f163132ee363249ab666a58a0edde8ea1a057 | a82cacae7081f4a04fabdf87cb2833d4ce8bc6db | /crm/forms.py | bca14f2bd27002ded460bf7ea07585e02a7218ca | [] | no_license | sadhikari89/mfscrm | 55909712f808344611d8ed3b45b3cc17d88125e9 | ea1275f8a97542a07e0ffc08d5b597d7e95d2490 | refs/heads/master | 2020-03-31T06:30:01.629465 | 2018-10-08T05:11:38 | 2018-10-08T05:11:38 | 151,985,043 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 674 | py | from django import forms
from .models import Customer, Service, Product
class CustomerForm(forms.ModelForm):
class Meta:
model = Customer
fields = ('cust_name', 'organization','role', 'bldgroom', 'state',
'account_number', 'address', 'city', 'zipcode', 'email')
class ServiceForm(forms.ModelForm):
class Meta:
model = Service
fields = ('cust_name', 'service_category', 'description', 'location', 'setup_time', 'cleanup_time', 'service_charge' )
class ProductForm(forms.ModelForm):
class Meta:
model = Product
fields = ('cust_name', 'product', 'p_description', 'quantity', 'pickup_time', 'charge' )
| [
"surajadhikari@unomaha.edu"
] | surajadhikari@unomaha.edu |
6ffb9e979f6730bd14fd463eb7ba98fc4547a482 | db739516bba702ebe230016e090d6b6f00caf83a | /lib/annotate.py | af8b132c417571b998feb898cfd6358bf821e123 | [
"MIT"
] | permissive | adamewing/discord-retro | 2cb9a37adfd0604de2cc7a9c353886ea9d8d2137 | 1afc09d60ffc138c0890bd02d707fe5d408a63d8 | refs/heads/master | 2021-01-10T21:08:07.972791 | 2013-03-11T23:16:04 | 2013-03-11T23:16:04 | 4,288,385 | 1 | 2 | null | null | null | null | UTF-8 | Python | false | false | 2,349 | py | #!/bin/env python
"""
Copyright (C) 2012 by Adam Ewing (adam.ewing@gmail.com)
Released under the MIT license, see LICENSE.txt
"""
import pysam, sys, re
def uniqann(annList):
uniq = {}
for ann in annList:
uniq[ann] = 1
return uniq.keys()
def checkfile(fname):
try:
open(fname)
except IOError as e:
print "can't find file: " + fname
sys.exit()
class annotator:
def __init__(self,tabixfile,name,genome):
checkfile(tabixfile)
self.tabixfn = tabixfile # location of tabix file
self.tabix = pysam.Tabixfile(tabixfile, 'r')
self.name = name # name for annotation
self.genome = genome # genome assembly
# returns a list of annotations
def annotate(self,bedline,genome):
c = bedline.rstrip().rsplit("\t")
chr = c[0]
start = c[1]
end = c[2]
if not re.search('chr',chr):
raise LookupError("chromosome names must start with chr: " + chr)
return []
if (self.genome != genome):
raise LookupError("tried to compare a %s bedfile to a %s annotation." % (genome,self.genome))
return []
else:
annotations = []
if (chr and start and end):
try:
tabixTupleParse = self.tabix.fetch(reference=chr,
start=int(start),
end=int(end),
parser=pysam.asTuple())
for tabixTuple in tabixTupleParse:
annotations.append(tabixTuple[3])
return uniqann(annotations)
except(ValueError):
print "warning: " + chr + " is not present in reference."
return []
else:
raise LookupError("can't find chr,start,end. File must be tab-delimited")
return []
if __name__ == '__main__':
if len(sys.argv) < 3:
sys.exit()
a = annotator(sys.argv[1],'default','hg19')
f = open(sys.argv[2], 'r')
for line in f:
if not re.search("^track", line):
for annotation in a.annotate(line,'hg19'):
print annotation
f.close()
| [
"adam.ewing@gmail.com"
] | adam.ewing@gmail.com |
7988673d625c38b116306c3d3c27e2d0d379bbe3 | 8bb0536528c72829fe117dd2f8adf264f4c8b05e | /v2/theme/browser/v2_generic_view.py | 49421e022e714390d10282b20e243a371ad3f29d | [] | no_license | v2lab/v2.theme | b688b14121dfdca6ead8baf2b7f59e247dfa52dc | 1fe5dd22fd9a40804cf2f386c70afed7a6d3dff4 | refs/heads/master | 2021-08-20T05:04:03.694831 | 2021-07-14T12:09:45 | 2021-07-14T12:09:45 | 16,309,357 | 0 | 0 | null | 2014-07-15T04:59:52 | 2014-01-28T10:59:17 | Python | UTF-8 | Python | false | false | 5,639 | py | import time
from Acquisition import aq_inner
from zope.component import getUtility
from Products.Five import BrowserView
from Products.CMFPlone.interfaces import IPloneSiteRoot
from collective.contentleadimage.config import IMAGE_FIELD_NAME
from collective.contentleadimage.leadimageprefs import ILeadImagePrefsForm
from v2.theme.browser.v2_buyable_content import IBuyableContent
from Products.CMFCore.utils import getToolByName
from collective.flowplayer.interfaces import IAudio
from collective.flowplayer.interfaces import IFlowPlayable
import feedparser
import HTMLParser
v2_vimeo_rss_url = "http://vimeo.com/channels/349409/videos/rss"
class V2GenericView(BrowserView):
"""Simple Folder view.
"""
@property
def prefs(self):
portal = getUtility(IPloneSiteRoot)
return ILeadImagePrefsForm(portal)
def tag(self, obj, css_class='tileImage'):
context = aq_inner(obj)
field = context.getField(IMAGE_FIELD_NAME)
if field is not None:
if field.get_size(context) != 0:
scale = self.prefs.desc_scale_name
return field.tag(context, scale=scale, css_class=css_class)
return ''
def currenttime(self):
return time.time()
def trimDescription(self, desc, num=100):
if len(desc) > num:
res = desc[0:num]
lastspace = res.rfind(" ")
return res[0:lastspace] + " ..."
return desc
def getShoppingInformation(self, content):
information = IBuyableContent(content, None)
if information is not None:
if information.price or information.webshop_url:
# Informations are set
detail = {}
if information.price:
detail['price'] = information.price
if information.webshop_url:
detail['webshop_url'] = information.webshop_url
return detail
return None
def getCategoryByURL(self, url):
"""Find the parent name in the url path.
This displays in which category an item is placed."""
url_low = url.lower()
menu_items = ['event','events', 'publishing', 'lab','about','organization','webshop','shop','archive']
for item in menu_items:
if item in url_low:
return item
return "v2"
def toLocalizedTime(self, time, long_format=None, time_only = None):
"""Convert time to localized time
"""
util = getToolByName(self.context, 'translation_service')
try:
return util.ulocalized_time(time, long_format, time_only, self.context,
domain='plonelocales')
except TypeError: # Plone 3.1 has no time_only argument
return util.ulocalized_time(time, long_format, self.context,
domain='plonelocales')
def getSubFolderContents(self, folder):
catalog = getToolByName(self, 'portal_catalog')
if folder.portal_type == "Folder":
path = folder.getPath()
return catalog.searchResults(
path={'query': path, 'depth': 1},
sort_on='getObjPositionInParent', sort_limit=3)[:3]
if folder.portal_type == "Topic":
query = folder.getObject().buildQuery()
if query is not None:
return catalog.searchResults(query)[:3]
return []
def isVideo(self, content):
if IFlowPlayable.providedBy(content):
return True
extension = content.id[-3:]
return (extension == "mov" or
extension == "avi" or
extension == "mp4" or
extension == "m4v")
def isAudio(self, content):
return IAudio.providedBy(content)
def getCategory(self, content):
"""Find the parent name in the url path.
This displays in which category an item is placed."""
url = content.virtual_url_path().upper()
menu_items = ['EVENT', 'PUBLISHING', 'LAB']
for item in menu_items:
if item in url:
return item
def getVideos(self):
# h = HTMLParser.HTMLParser()
# videos = []
# for entry in feed.entries:
# videos.append( h.unescape(entry.summary) )
feed = feedparser.parse( v2_vimeo_rss_url )
videos = []
for entry in feed.entries:
video =[]
# video.append( entry.links[0]["href"].split('/349409/')[1] )
video.append( entry.link )
video.append( entry.summary.split('img src="')[1].split('_200x150.jpg')[0] )
video.append( entry.title )
videos.append( video )
return videos
def getVideo(self, content):
# entries = []
# entries.extend( feed[ "items" ] )
# sorted_entries = sorted(entries, key=lambda entry: entry["date_parsed"])
# sorted_entries.reverse() # for most recent entries first
# return sorted_entries[0].links[0]["href"].split('/349409/')[1]
feed = feedparser.parse( v2_vimeo_rss_url )
return feed.entries[0].links[0]["href"].split('/349409/')[1]
def getVideoTitle(self):
# entries = []
# entries.extend( feed[ "items" ] )
# sorted_entries = sorted(entries, key=lambda entry: entry["date_parsed"])
# sorted_entries.reverse() # for most recent entries first
# return sorted_entries[0].links[0]["href"].split('/349409/')[1]
feed = feedparser.parse( v2_vimeo_rss_url )
return feed.entries[0].title | [
"sachoco@gmail.com"
] | sachoco@gmail.com |
9b6fafae6e237ae5ae6bc66af26f63455b3fe79b | 080b9a32a5665e5fdf2be3ff45aee2c2c0bdcaf6 | /topicApp/migrations/0006_auto_20191007_2031.py | e4e1f0a73f64a090857a6539af325ad70495c85f | [] | no_license | brittmagee/EidsonBikeCo-SEI23-Project4 | 10d4e7135ed323be3fe3ab7c6b23c7b0d1d728ba | 193ff51daa3d73fe0612519aaea5fbb4f9240e45 | refs/heads/master | 2021-06-20T23:49:28.602813 | 2020-01-04T03:57:39 | 2020-01-04T03:57:39 | 212,595,585 | 0 | 1 | null | 2021-06-10T22:02:34 | 2019-10-03T14:04:40 | JavaScript | UTF-8 | Python | false | false | 465 | py | # Generated by Django 2.1.11 on 2019-10-07 20:31
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('topicApp', '0005_auto_20191007_2026'),
]
operations = [
migrations.AlterField(
model_name='bike',
name='color',
field=models.CharField(choices=[('Black + White', 'The Pair'), ('Black', 'Black'), ('White', 'White')], max_length=2),
),
]
| [
"brittgmagee@gmail.com"
] | brittgmagee@gmail.com |
e1801dc6a75d9de1f8b1bfd8f299d1984ab4f812 | 92cdb723909e6c096780ea7251349512393632f0 | /deeppavlov/agents/ner/dictionary.py | 71c1f954f24596fc6932e5f67515c9e2ec65fcb3 | [
"Apache-2.0"
] | permissive | World-Speak/deeppavlov | f89a6fb59eb7e0285059a428a0cdbc0063793746 | 3bc3c01e96368adf4dda7e7198d03a84ef8c0812 | refs/heads/master | 2021-07-20T15:07:29.857887 | 2017-10-30T16:24:52 | 2017-10-30T16:24:52 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,180 | py | import copy
import os
import pickle
from collections import defaultdict
from parlai.core.dict import DictionaryAgent
from parlai.core.params import class2str
def get_char_dict():
base_characters = u'\"#$%&\'()+,-./0123456789:;<>?ABCDEFGHI' \
u'JKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstu' \
u'vwxyz«\xad»×АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪ' \
u'ЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюяё‑–' \
u'—“”€№…’'
characters = ['<UNK>'] + ['<PAD>'] + list(base_characters)
char_dict = defaultdict(int)
for i, ch in enumerate(characters):
char_dict[ch] = i
return char_dict
class NERDictionaryAgent(DictionaryAgent):
@staticmethod
def add_cmdline_args(argparser):
group = DictionaryAgent.add_cmdline_args(argparser)
group.add_argument(
'--dict_class', default=class2str(NERDictionaryAgent),
help='Sets the dictionary\'s class'
)
def __init__(self, opt, shared=None):
child_opt = copy.deepcopy(opt)
# child_opt['model_file'] += '.labels'
child_opt['dict_file'] = child_opt['dict_file'] + '.labels.dict'
self.labels_dict = DictionaryAgent(child_opt, shared)
self.char_dict = get_char_dict()
super().__init__(opt, shared)
def observe(self, observation):
observation = copy.deepcopy(observation)
labels_observation = copy.deepcopy(observation)
labels_observation['text'] = None
observation['labels'] = None
self.labels_dict.observe(labels_observation)
return super().observe(observation)
def act(self):
self.labels_dict.act()
super().act()
return {'id': 'NERDictionary'}
def save(self, filename=None, append=False, sort=True):
filename = self.opt['model_file'] if filename is None else filename
self.labels_dict.save(filename + '.labels.dict')
return super().save(filename, append, sort)
def tokenize(self, text, building=False):
return text.split(' ') if text else []
| [
"arkhipov@yahoo.com"
] | arkhipov@yahoo.com |
38659ed0474ddb03208bf582aa89246ec5811daa | 7f7c8b33462c07d73c9426bc54640f6657a06693 | /scripts/common.py | a77bddfddfd29c0be5726f1fa26381c8f27bde0b | [
"MIT"
] | permissive | zenithght/gengine | 6ae148dd67718b92f54d3821c681dd171f6710bf | d4ce904883c61023dade814cec1182a9d61fc8dd | refs/heads/master | 2020-06-30T23:31:58.729647 | 2016-11-18T12:37:29 | 2016-11-18T12:37:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 5,489 | py | #!/usr/bin/python3
import platform
import os
import sys
import argparse
import multiprocessing
import os.path
debugMode = False
targetDir = None
rootPath = None
buildPath = None
binaryPath = None
itMustRun = False
html5Mode = False
buildUrho3D = False
targetPlatform = "undefined"
targetMode = "undefined"
def printn(*args):
sys.stdout.write(*args)
def log(*args):
sys.stdout.write("[gengine] ")
print(*args)
def exitWithError(err):
sys.exit("[gengine] " + '\033[91m' + "Error: " + err + '\033[0m')
def isPlatform64():
if getPlatformName() == "Windows":
return False
return "_64" in platform.machine()
def isLinux():
return platform.system() == "Linux"
def getPlatformName():
system = platform.system()
if "CYGWIN" in system:
return "Windows"
return system
def sanityCheck():
printn("Sanity check... ")
if not "GENGINE" in os.environ:
print("GENGINE environment variable is not set.")
exit(1)
print("Ok!")
def init():
log("Initialization...")
global binaryPath
global debugMode
global targetDir
global rootPath
global buildPath
global itMustRun
global html5Mode
global buildUrho3D
global targetPlatform
global targetMode
parser = argparse.ArgumentParser()
parser.add_argument('-d', help='Debug mode', default=False, action='store_true')
parser.add_argument('-r', help='Run', default=False, action='store_true')
parser.add_argument('--html5', help='HTML5 mode (emscripten)', default=False, action='store_true')
parser.add_argument('--urho3d', help='Build Urho3D lib', default=False, action='store_true')
parser.add_argument('dir', help='Target directory', default='.', nargs='?')
args = parser.parse_args()
debugMode = args.d
itMustRun = args.r
html5Mode = args.html5
buildUrho3D = args.urho3d
targetDir = os.getcwd() + "/" + args.dir + "/"
rootPath = os.environ['GENGINE']
buildPath = rootPath + "/build/"
binaryPath = rootPath + "/build/gengine" + ('d' if debugMode else '') + ('.bc' if html5Mode else '')
if not os.path.isdir(targetDir):
exitWithError("Target directroy does not exist.")
if html5Mode:
targetPlatform = "emscripten"
elif isLinux():
targetPlatform = "linux"
else:
targetPlatform = "windows"
if debugMode:
targetMode = "debug"
else:
targetMode = "release"
def getDeps():
log("Downloading dependencies...")
directory = rootPath+"/deps/"+getPlatformName().lower()+"/lib"+('64' if isPlatform64() else ('32' if isLinux() else ''))
os.chdir(directory)
if getPlatformName() == "Linux":
if not os.path.isfile(directory+"/libcef.so"):
os.system("./get-libs")
if getPlatformName() == "Windows":
if not os.path.isfile(directory+"/windows-32.tar.gz"):
os.system("./get-libs")
os.system("cp *.dll " + rootPath + "/build/")
def build():
if buildUrho3D:
log("Building Urho3D lib...")
urhoDir = os.environ['GENGINE']+"/deps/common/Urho3D/"
os.chdir(urhoDir)
buildDir = 'build/' + targetPlatform + '/' + targetMode
os.system("rm -rf " + buildDir + "/lib/libUrho3D.a")
options = ('-DCMAKE_BUILD_TYPE=Debug' if debugMode else '')
command = ('./cmake_generic.sh' if not html5Mode else './cmake_emscripten.sh')
os.system(command + ' ' + buildDir + " " + options + " -DURHO3D_LUA=0")
os.chdir(buildDir)
os.system("make Urho3D -j" + str(multiprocessing.cpu_count()))
if not os.path.exists(urhoDir + buildDir + "/lib/libUrho3D.a"):
exitWithError("Urho3D build failed.")
os.system("rm -rf " + binaryPath)
current_dir = os.getcwd()
if not html5Mode:
getDeps()
log("Building gengine...")
os.chdir(os.environ['GENGINE']+"/build")
if isLinux():
config = ('debug' if debugMode else 'release') + ('emscripten' if html5Mode else '') + ('64' if isPlatform64() else '32')
os.system("premake4 gmake")
os.system(('emmake ' if html5Mode else '') + "make config=" + config + " -j" + str(multiprocessing.cpu_count()))
else:
msbuild = "/cygdrive/c/Program Files (x86)/MSBuild/12.0/Bin/MSBuild.exe"
if not os.path.exists(msbuild):
msbuild = "/cygdrive/c/Program Files/MSBuild/12.0/Bin/MSBuild.exe"
msbuild = msbuild.replace(" ", "\\ ")
msbuild = msbuild.replace("(", "\\(")
msbuild = msbuild.replace(")", "\\)")
os.system("./premake4.exe vs2012")
os.system("sed -i 's/v110/v120/g' *.vcxproj")
os.system(msbuild + " /p:Configuration=Release")
if not os.path.exists(binaryPath):
exitWithError("gengine compilation failed.")
compile()
os.chdir(current_dir)
def compile():
os.system("rm -rf " + targetDir + "generated/main.js")
if not os.path.exists(targetDir + "/build.hxml"):
log("Compiling : Running haxe default command line...")
os.system("haxe -cp $GENGINE/deps/common/Ash-Haxe/src/ -cp $GENGINE/src/haxe/ -cp " + targetDir + " -cp " + targetDir + "/src -main gengine.Main -js " + targetDir + "generated/main.js")
else:
log("Compiling : Running haxe with build.hxml...")
os.system("cd " + targetDir + "; haxe build.hxml")
if not os.path.exists(targetDir + "generated/main.js"):
exitWithError("Haxe compilation failed.")
| [
"gauthier.billot@fishingcactus.com"
] | gauthier.billot@fishingcactus.com |
f30c88dfd616203247b156a17bed169e52e39d60 | 36bc6ceb273d4703a5cc92a59d8b82fbccdb5deb | /bhabana/tools/generate_vocabulary.py | 35d245996af8815d7b4d61f02fe1d91f833ddff3 | [
"Apache-2.0"
] | permissive | dashayushman/bhabana | a18345dcedde8712777b10a5edb42883490fb4d5 | 7438505e20be53a4c524324abf9cf8985d0fc684 | refs/heads/develop | 2022-10-30T22:28:56.103462 | 2018-02-09T10:40:33 | 2018-02-09T10:40:33 | 106,683,432 | 0 | 1 | Apache-2.0 | 2022-10-06T22:44:07 | 2017-10-12T11:23:08 | Python | UTF-8 | Python | false | false | 4,977 | py | # Copied from
# https://github.com/google/seq2seq/blob/master/bin/tools/generate_vocab.py
#
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os
import codecs
import argparse
import collections
import logging
import progressbar
from bhabana.processing import *
parser = argparse.ArgumentParser(
description="Generate vocabulary for a tokenized text file.")
parser.add_argument(
"--min_frequency",
dest="min_frequency",
type=int,
default=0,
help="Minimum frequency of a word to be included in the vocabulary.")
parser.add_argument(
"--max_vocab_size",
dest="max_vocab_size",
type=int,
help="Maximum number of tokens in the vocabulary")
parser.add_argument(
"--indir",
dest="indir",
type=str,
help="directory containing the text files that you want to process")
parser.add_argument(
"--mode",
dest="mode",
type=str,
default="word",
help="word, semhash, char"
)
parser.add_argument(
"--line_processor",
dest="line_processor",
type=str,
default="json",
help="json, tsv, text"
)
parser.add_argument(
"--separator",
dest="separator",
type=str,
default="\t",
help="\\t, $%%^% or anything else"
)
parser.add_argument(
"--keys",
dest="keys",
type=str,
default="text",
help="comma separated for more than one, and column indeces if line "
"processor is of type tsv or separator"
)
parser.add_argument(
"--lang",
dest="lang",
type=str,
default="en",
help="language"
)
args = parser.parse_args()
# Counter for all tokens in the vocabulary
cnt = collections.Counter()
keys = args.keys.split(",")
fields = []
def get_line_processor(lp_name):
if lp_name.lower() == "json":
return JSONLineProcessor
elif lp_name.lower() == "tsv":
return TSVLineProcessor
elif lp_name.lower() == "text":
return TextLineProcessor
LP = get_line_processor(args.line_processor)
tokenizer = Tokenizer(args.lang, mode=args.mode, process_batch=True)
if args.line_processor.lower() == "json":
for key in keys:
fields.append({
"key": key,
"dtype": str
})
elif args.line_processor.lower() == "tsv":
keys = [int(key) for key in keys]
max_index = 0
for key in keys:
if key > max_index:
max_index = key
for key in range(max_index):
fields.append({
"key": key,
"dtype": str
})
if args.line_processor.lower() == "text":
line_processor = LP(fields, args.separator)
else:
line_processor = LP(fields)
file_list = os.listdir(args.indir)
bar = progressbar.ProgressBar(max_value=len(file_list),
redirect_stdout=True)
n_line = 0
for file_name in file_list:
file_path = os.path.join(args.indir, file_name)
with codecs.open(file_path, "r", "utf-8") as fp:
line = fp.read()
valid_line = line_processor.is_valid_data(line)
if valid_line["is_valid"]:
values = line_processor.process(line)
if args.line_processor == "tsv":
values = [values[i] for i in keys]
tokens = tokenizer.process(values)
tokens = [y for x in tokens for y in x]
if args.mode == "semhash":
tokens = [y for x in tokens for y in x]
cnt.update(tokens)
n_line += 1
else:
print("Skipping line '{}' because of the following "
"error:".format(line))
print(valid_line["error"])
bar.update(n_line)
bar.finish()
logging.info("Found %d unique tokens in the vocabulary.", len(cnt))
# Filter tokens below the frequency threshold
if args.min_frequency > 0:
filtered_tokens = [(w, c) for w, c in cnt.most_common()
if c > args.min_frequency]
cnt = collections.Counter(dict(filtered_tokens))
logging.info("Found %d unique tokens with frequency > %d.",
len(cnt), args.min_frequency)
# Sort tokens by 1. frequency 2. lexically to break ties
word_with_counts = cnt.most_common()
word_with_counts = sorted(
word_with_counts, key=lambda x: (x[1], x[0]), reverse=True)
# Take only max-vocab
if args.max_vocab_size is not None:
word_with_counts = word_with_counts[:args.max_vocab_size]
with open('{}_{}_vocab.txt'.format(args.mode, args.lang), 'w') as vf:
for word, count in word_with_counts:
vf.write("{}\t{}\n".format(word, count))
| [
"dash.ayushman.99@gmail.com"
] | dash.ayushman.99@gmail.com |
7e087ad12814d8c1853c447a882c149bcee80703 | 34fae60a658df5877e5fe0574a93fec2ebffb27f | /trolls/urls.py | 0ae5254ac392d43d3a67ebcaa95aec3d3bcddb6b | [] | no_license | MoniCore/react_frontend_django_backend | 0cc0432c6a7aaa854d6ed837d323dc4908706481 | ad69245db33e6f0727507667fe171bc10a7a8852 | refs/heads/master | 2023-06-24T12:39:50.839767 | 2021-07-24T17:13:59 | 2021-07-24T17:13:59 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 269 | py | from django.urls import path
from django.urls import re_path
from django.contrib.auth import views as auth_views
from . import views
app_name = 'trolls'
urlpatterns = [
path('dashboard',view=views.trollsdashboard, name='trollsdashboard'),
] | [
"pheonix20210101@gmail.com"
] | pheonix20210101@gmail.com |
ab93a5d3ea18d2855c94ec70eb505259cf21f234 | f703a31c8d215d3d40b4e7520b02cc96a1190076 | /prob_calculator.py | 266b7d3d90c01d62e58e16963b95d5e4369f5498 | [] | no_license | alfredojry/probability-calculator | 4be73105cf0acb34ebadc4391a7e15d0b885e86f | 93c440cb5fb776e894c9429d819de41a2029fdc5 | refs/heads/master | 2023-07-19T02:15:02.931123 | 2021-09-13T01:05:07 | 2021-09-13T01:05:07 | 405,791,540 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,046 | py | import copy
import random
# Consider using the modules imported above.
class Hat(object):
def __init__(self, **kwargs):
self.contents = []
for k, v in kwargs.items():
self.contents += [k] * v
def draw(self, n):
if n > len(self.contents):
return self.contents
else:
index_list = []
balls = []
for i in range(n):
x = random.randrange(len(self.contents))
balls.append(self.contents[x])
self.contents = self.contents[:x] + self.contents[x + 1:]
return balls
def experiment(hat, expected_balls, num_balls_drawn, num_experiments):
M = 0
for i in range(num_experiments):
copied_hat = copy.deepcopy(hat)
drawn_balls = copied_hat.draw(num_balls_drawn)
flag_fav = True
for k, v in expected_balls.items():
if drawn_balls.count(k) < v:
flag_fav = False
if flag_fav:
M += 1
return M / num_experiments
| [
"43357527+alfredojry@users.noreply.github.com"
] | 43357527+alfredojry@users.noreply.github.com |
9219214be204f69c7705e81f0d1058af1e0041f4 | 1171af9cc0c1b524959bf6a3018eddee48034318 | /config.py | 7ffb7a2c45bb2b381f2b4a6211dcca004100c8b5 | [] | no_license | fengo4142/robotframework-email | 44e2c467b7f6f524a71e23d2c46def465be34437 | ce587a54dea0684494638225cb803a85041c25a7 | refs/heads/master | 2020-10-02T01:53:23.741721 | 2019-05-23T11:10:11 | 2019-05-23T11:10:11 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 379 | py |
# condition to send email if 'True' email will be sent
SEND_EMAIL = True
# email smtp (smpt of yahoo, gmail, msn, outlook etc.,)
SMPT = "smtp.gmail.com:587"
# email subject
SUBJECT = "MyProject Automation Execution Status"
# credentials
FROM = "XXXXX@gmail.com"
PASSWORD = "XXXXX"
# receivers
TO = "XXXXX@gmail.com"
CC = "XXXXXX@gmail.com"
COMPANY_NAME = "My Company Title" | [
"shiva.adirala@zenq.com"
] | shiva.adirala@zenq.com |
67d83f8708af74d0a824b6d18678142207d2bfcf | f08073f559ba9f415e6f2bf029fcb44194043d51 | /verifiable_mpc/trinocchio/wip_keygen_geppetri.py | 811ba5ac8f9c70c691996666a5c912f29fd6b644 | [
"MIT"
] | permissive | marcusmjh/verifiable_mpc | ac4c90456a886883cfe61130ef0b3a4d24aa0065 | 8f9b734c28e98057cb3928870cb504ab045c3a83 | refs/heads/main | 2023-06-20T08:58:08.667413 | 2021-07-14T08:23:41 | 2021-07-14T08:23:41 | 385,866,654 | 0 | 0 | MIT | 2021-07-14T08:23:14 | 2021-07-14T08:23:13 | null | UTF-8 | Python | false | false | 2,729 | py | # WORK-IN-PROGRESS
""" Implementation of Geppetri key gen steps with BN256 curves
Using pairings.py from https://github.com/randombit/pairings.py
Alternative for bn128 by Ethereum: https://github.com/ethereum/py_ecc/blob/master/py_ecc/bn128/bn128_curve.py
"""
import os, sys
project_root = sys.path.append(os.path.abspath(".."))
if project_root not in sys.path:
sys.path.insert(0, project_root)
from random import SystemRandom
import zk_helpers.pairings.bn256 as bn256
# k,g = bn256.g1_random()
# k,g = bn256.g2_random()
# in qap2key:
# void generate_master_skey(mastersk& sk) {
# sk.s = modp::rand();
# sk.rc = modp::rand();
# sk.al = modp::rand();
# }
DEFAULT_QAP_DEGREE = 20
def list_add(grp_elements):
n = len(grp_elements)
if n == 1:
return grp_elements[0]
m0 = list_add(grp_elements[:n//2])
m1 = list_add(grp_elements[n//2:])
return m0.add(m1)
def generate_s():
""" Generate secret s """
s = prng.randrange(bn256.order)
return s
def generate_crs(s, qap_degree = DEFAULT_QAP_DEGREE):
""" Generate common reference string per function G01, p. 7 """
crs_g1 = {"x^"+str(i)+"_g1" : g1.scalar_mul(s**i) for i in range(qap_degree + 1)}
crs_g2 = {"x^"+str(i)+"_g2" : g2.scalar_mul(s**i) for i in range(qap_degree + 1)}
return {**crs_g1, **crs_g2}
def generate_commitment_key(qap_degree = DEFAULT_QAP_DEGREE):
""" Generate commitment key per function Gc1, p. 7 """
alpha = prng.randrange(bn256.order)
ck_g1 = {"x^"+str(i)+"_g1": g1.scalar_mul(s**i) for i in range(qap_degree + 1)}
ck_g2 = {"ax^"+str(i)+"_g2": g2.scalar_mul(alpha * (s**i)) for i in range(qap_degree + 1)}
return {**ck_g1, **ck_g2}
def commit(v, r, ck):
""" Commit to input v per function C1, p. 7 """
c_g1 = ck["x^"+str(0)+"_g1"].scalar_mul(r)
x_terms = list_add([ck["x^"+str(i+1)+"_g1"].scalar_mul(v[i]) for i in range(len(v))])
c_g1 = c_g1.add(x_terms)
c_g2 = ck["ax^"+str(0)+"_g2"].scalar_mul(r)
x_terms = list_add([ck["ax^"+str(i+1)+"_g2"].scalar_mul(v[i]) for i in range(len(v))])
c_g2 = c_g2.add(x_terms)
return (c_g1, c_g2)
def code_to_qap(code, ffield):
r1cs = code_to_r1cs(code, ffield)
qap = r1cs_to_qap(r1cs, ffield)
return qap # v, w, y, t
if __name__ == '__main__':
prng = SystemRandom()
g1 = bn256.curve_G
g2 = bn256.twist_G
d = 5 # degree of the QAP
n = 5 # input length
s = generate_s()
crs = generate_crs(s, d)
ck = generate_commitment_key(d)
v = [1, 2, 3, 4, 5]
r = prng.randrange(bn256.order)
c = commit(v, r, ck)
print(c)
| [
"a.j.m.segers@tue.nl"
] | a.j.m.segers@tue.nl |
b7330826eae31b9d839278ea4340891bf58b4dd4 | 7abd326c73cbbf5bacb5c343177be1f35689f175 | /venv/bin/python-config | 19afd2d11d9faa9cdab0634bbbb72134a5d3561c | [] | no_license | vipul-rao/company-to-domain | 763c476639f1fb39e8dff4bc3111ee7a96ac22ae | 7f9b8a3ad6d213abd60d69f7900e2f03952e3872 | refs/heads/master | 2020-03-09T10:14:18.358904 | 2018-04-10T03:52:03 | 2018-04-10T03:52:03 | 128,730,417 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,357 | #!/home/vipul/PycharmProjects/domain/venv/bin/python
import sys
import getopt
import sysconfig
valid_opts = ['prefix', 'exec-prefix', 'includes', 'libs', 'cflags',
'ldflags', 'help']
if sys.version_info >= (3, 2):
valid_opts.insert(-1, 'extension-suffix')
valid_opts.append('abiflags')
if sys.version_info >= (3, 3):
valid_opts.append('configdir')
def exit_with_usage(code=1):
sys.stderr.write("Usage: {0} [{1}]\n".format(
sys.argv[0], '|'.join('--'+opt for opt in valid_opts)))
sys.exit(code)
try:
opts, args = getopt.getopt(sys.argv[1:], '', valid_opts)
except getopt.error:
exit_with_usage()
if not opts:
exit_with_usage()
pyver = sysconfig.get_config_var('VERSION')
getvar = sysconfig.get_config_var
opt_flags = [flag for (flag, val) in opts]
if '--help' in opt_flags:
exit_with_usage(code=0)
for opt in opt_flags:
if opt == '--prefix':
print(sysconfig.get_config_var('prefix'))
elif opt == '--exec-prefix':
print(sysconfig.get_config_var('exec_prefix'))
elif opt in ('--includes', '--cflags'):
flags = ['-I' + sysconfig.get_path('include'),
'-I' + sysconfig.get_path('platinclude')]
if opt == '--cflags':
flags.extend(getvar('CFLAGS').split())
print(' '.join(flags))
elif opt in ('--libs', '--ldflags'):
abiflags = getattr(sys, 'abiflags', '')
libs = ['-lpython' + pyver + abiflags]
libs += getvar('LIBS').split()
libs += getvar('SYSLIBS').split()
# add the prefix/lib/pythonX.Y/config dir, but only if there is no
# shared library in prefix/lib/.
if opt == '--ldflags':
if not getvar('Py_ENABLE_SHARED'):
libs.insert(0, '-L' + getvar('LIBPL'))
if not getvar('PYTHONFRAMEWORK'):
libs.extend(getvar('LINKFORSHARED').split())
print(' '.join(libs))
elif opt == '--extension-suffix':
ext_suffix = sysconfig.get_config_var('EXT_SUFFIX')
if ext_suffix is None:
ext_suffix = sysconfig.get_config_var('SO')
print(ext_suffix)
elif opt == '--abiflags':
if not getattr(sys, 'abiflags', None):
exit_with_usage()
print(sys.abiflags)
elif opt == '--configdir':
print(sysconfig.get_config_var('LIBPL'))
| [
"vipulrao355@gmail.com"
] | vipulrao355@gmail.com | |
66e2e93e2395070c67f8869a11803e3cfb16d2bc | a67980fc4b398bb8a9cc3250ba4efaf461cf4f87 | /tiandiPythonClient/__init__.py | afa480458a033c8a9af3ff3dd7178b2b6f268329 | [] | no_license | RobbieXie/NetflixConductorPythonClient | b4651e50916ecee898a97f4a2bc83d97cf66874c | 7347a6a7b4f87ff0812f48ac8e1441b72db52882 | refs/heads/master | 2021-03-24T10:32:37.679252 | 2018-01-20T12:44:02 | 2018-01-20T12:44:02 | 116,361,837 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 95 | py | __version__ = '1.0.0'
VERSION = tuple(map(int, __version__.split('.')))
__all__ = ['workflow'] | [
"619835217@qq.com"
] | 619835217@qq.com |
df24f45384238ba36f523f3f1d406f6de20dd805 | cf999cbba3a57065fcb138f0a03b3492c596e993 | /correlation.py | 6feecfe40984b9d5d8c5e1de719c107a2614e137 | [] | no_license | Michal-Stempkowski/NotSoAwesomeSRNotAtAll | 79c368fef9250429b248982718318bad45d878a5 | 16930077c5012f1bc83ea2709a54b0e2420a4b07 | refs/heads/master | 2021-01-01T16:59:49.641981 | 2015-01-28T15:56:12 | 2015-01-28T15:56:12 | 28,886,642 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 7,306 | py | from functools import reduce
import os
from audiolazy.lazy_filters import z
from audiolazy.lazy_lpc import lpc
from audiolazy.lazy_math import dB20
from audiolazy.lazy_synth import line
from numpy.fft import rfft
import matplotlib.pyplot as plot
import math
from numpy.ma import abs
class Point(object):
def __init__(self, x=0, y=0, z=0):
self.x = x
self.y = y
self.z = z
def distance(self, other):
return math.sqrt((self.x - other.x)**2 + (self.y - other.y)**2 + (self.z - other.z)**2)
@staticmethod
def from_list(ls):
# ls = list(reversed(ls))
index = 0
return Point(ls[0 + index], ls[1+ index], ls[2+ index]) if len(ls) > 2+ index else Point(ls[0+ index], ls[1+ index], ls[1+ index])
def __str__(self):
return '{0:.2f}x{1:.2f}x{2:.2f}'.format(self.x, self.y, self.z)
__repr__ = __str__
class Signal(object):
@staticmethod
def pad_with_zeroes(signal, padding):
return signal + [0 for _ in range(padding - len(signal))]
@staticmethod
def convolution(signal):
return [math.fabs(x) for x in rfft(Signal.pad_with_zeroes(signal, len(signal) * 2))]
@staticmethod
def normalize(signal):
max_value = max(signal)
return [x / max_value for x in signal]
@staticmethod
def find_formant(signal, denied):
return reduce(
lambda cur_max, i:
cur_max if denied[i] or cur_max[0] > signal[i]
else (signal[i], i), range(len(signal)), (-1, None)
)[1]
@staticmethod
def find_k_formants(signal, k, delta):
denied = [False for _ in range(len(signal))]
for _ in range(k):
new_formant = Signal.find_formant(signal, denied)
for i in range(new_formant - delta, new_formant + delta):
denied[i] = True
yield new_formant
@staticmethod
def generate_characteristics_of_sample(sample, number_of_formants):
conv = Signal.convolution(sample)
delta = calculate_delta(len(conv))
return sorted(Signal.find_k_formants(conv, number_of_formants, delta))
@staticmethod
def find_peaks_on_curve(curve, number_of_peaks):
peaks = list()
greater = lambda x, y: x >= y
equal = lambda x, y: x == y
lower = lambda x, y: x <= y
update_state = lambda x, y, previous_state: \
previous_state if previous_state and previous_state(x, y) \
else (greater if greater(x, y) else lower)
update_peaks = lambda old_state, new_state: \
old_state != new_state and old_state != equal and new_state != equal
previous_state = None
size = 1000
# curve.plot().show()
# input()
probes = extract_lpc_numerals(curve, size)
# plot_shit(probes)
# input()
# probes = list(curve(range(size)))
# tab = range (1000)
# filtr =curve
# result = curve(tab)
# plot.plot(list(result))
# plot.show()
for i in range(size - 1):
x = probes[i]
y = probes[i + 1]
next_state = update_state(x, y, previous_state)
if update_peaks(previous_state, next_state):
peaks.append(x)
previous_state = next_state
return peaks[:]
@staticmethod
def generate_characteristics_of_sample_with_lpc(sample, number_of_formants):
lpc_curve = lpc(
Signal.convolution(sample),
number_of_formants)
return Signal.find_peaks_on_curve(lpc_curve, number_of_formants)
def calculate_delta(rate):
return rate // 52
def calculate_error(signal_characteristics, sample_characteristics):
return reduce(lambda x, y: x + y, (math.fabs(signal - sample) for
(signal, sample) in zip(signal_characteristics, sample_characteristics))) \
/ len(signal_characteristics)
count = 0
def load_characteristics(fonem_provider, number_of_formants):
return [(fonem_name, Signal.generate_characteristics_of_sample_with_lpc(fonem_sample, number_of_formants))
for (fonem_name, fonem_sample) in fonem_provider]
def recognize_character(signal, fonem_schemas):
number_of_formants = len(fonem_schemas[0][1])
signal_schema = Signal.generate_characteristics_of_sample_with_lpc(signal, number_of_formants)
error_measure = [(name, calculate_error(signal_schema, schema)) for (name, schema) in fonem_schemas]
print(error_measure)
return reduce(lambda best, curr: best if best[1] < curr[1] else curr, error_measure)[0]
def read_fonem_file(filename, fonem_dir):
with open(fonem_dir + os.sep + filename) as file:
return filename.split('.')[0], eval(file.readlines()[0])
def get_fonem_provider(fonem_dir):
return (read_fonem_file(filename, fonem_dir)
for filename in os.listdir(fonem_dir) if filename.find('.fonem') >= 0)
def recognize_character_lpc(take, schemas, num_of_formants):
characteristics = Signal.generate_characteristics_of_sample_with_lpc(take, num_of_formants)
point = Point.from_list(characteristics)
best = None
for (name, other) in schemas:
if not best:
best = (other, Point.from_list(other).distance(point), name)
else:
curr = (other, Point.from_list(other).distance(point), name)
best = best if best[1] <= curr[1] else curr
return best
def plot_shit(sh):
plot.plot(sh)
plot.ylabel('Literka')
plot.show()
def extract_lpc_numerals(lpc_result, samples):
min_freq=0.
max_freq=3.141592653589793;
freq_scale="linear"
mag_scale="dB"
fscale = freq_scale.lower()
mscale = mag_scale.lower()
mscale = "dB"
Hz = 3.141592653589793 / 12.
freqs = list(line(samples, min_freq, max_freq, finish=True))
freqs_label = list(line(samples, min_freq / Hz, max_freq / Hz, finish=True))
data = lpc_result.freq_response(freqs)
mag = { "dB": dB20 }[mscale]
# print("extract numerals")
return (mag(data))
if __name__ == '__main__':
fonem_dir = 'fonems'
num_of_formants = 4
fonem_provider = get_fonem_provider(fonem_dir)
schemas = load_characteristics(fonem_provider, num_of_formants)
takes = get_fonem_provider('fonems2')
tested = 0
well_classified = 0
t1 = list(get_fonem_provider('fonems'))#[:2]
t2 = list(get_fonem_provider('fonems2'))#[:2]
test_schemas = [(fonem_name, Signal.generate_characteristics_of_sample_with_lpc(fonem_sample, num_of_formants))
for (fonem_name, fonem_sample) in t1][:1]
test_schemas2 = [(fonem_name, Signal.generate_characteristics_of_sample_with_lpc(fonem_sample, num_of_formants))
for (fonem_name, fonem_sample) in t2]
i = 0
for (name, take) in takes:
recognized = recognize_character_lpc(take, schemas, num_of_formants)
result = recognized[2] == name
tested += 1
well_classified += 1 if result else 0
print(name,
# Point.from_list(schemas[i][1]),
'-->',
recognized[2],
'SUCCESS!!' if result else '')
i += 1
print('Recognition: ', well_classified, '/', tested)
print('Hello World!') | [
"michulix@gmail.com"
] | michulix@gmail.com |
dfff7c198e095b1ee257e50bf1e6ce303894264d | 4ba5d35bb6513dd0f45ce515cd5d5c8bdf1a9627 | /pic.py | 6b42fe492eb5f8ae04d1019a7b8c6e70def95e27 | [] | no_license | alanwong2357/CS147-Mask-Detection-System | 02cfd7bafd12afa2d732be3d3364c636d5016f65 | 98a0c958f06ea134ab0bdbc78075ef48635e722c | refs/heads/master | 2023-05-15T06:37:35.841235 | 2021-06-04T09:18:19 | 2021-06-04T09:18:19 | 373,779,252 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 371 | py | import cv2
videoCaptureObject = cv2.VideoCapture(0)
while(True):
ret,frame = videoCaptureObject.read()
cv2.imshow('Capturing Video',frame)
if(cv2.waitKey(1) & 0xFF == ord('y')):
cv2.imwrite('pic.png', frame)
cv2.destroyAllWindows()
break
elif(cv2.waitKey(1) & 0xFF == ord('q')):
videoCaptureObject.release()
cv2.destroyAllWindows()
cap.release()
| [
"alanwong2357@gmail.com"
] | alanwong2357@gmail.com |
68f4bea959f9353ceedb880f2548198b8b3a7073 | 60e821452f5c7e517be23dc4a513881d2d3d953d | /tempCodeRunnerFile.py | d5f7b8b3189aed3f7457b23b64cebec8304aa18b | [] | no_license | Akj1710/Desktop-Assistant | 451672625f43c8a2f35373675b8cf3aa4630f530 | bf6bd4068d81559258b7087f4c63d6f4b914e598 | refs/heads/master | 2022-12-30T17:30:40.929377 | 2020-10-22T13:56:39 | 2020-10-22T13:56:39 | 306,356,708 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 147 | py |
def takeCommand():
#it takes microphone input from the user and converts into string
r=sr.Recognizer()
with sr.Microphone() as source: | [
"camtam1710@gmail.com"
] | camtam1710@gmail.com |
4d95c1bb8a988d7e5e3af479f81f0a22535e8b70 | 8bfbc75043aa155939d3fa6b0029c21720d2db22 | /test.py | 7ede08cae896b2b4051bd6faf896be0d5f1660a2 | [] | no_license | miguel-mzbi/computer-vision | a18f1122284ff1b4dacef0b3dca2c30267fada24 | 15659208d3cc63f6d1ba4c1e8f8eb04162124d1a | refs/heads/master | 2020-09-03T18:06:56.979020 | 2019-11-27T03:16:04 | 2019-11-27T03:16:04 | 219,528,966 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,195 | py | import numpy as np
import cv2
from matplotlib import pyplot as plt
def getMask(hsvImage):
lower = (0,10,50)
upper = (180,40,100)
mask = cv2.inRange(hsvImage, lower, upper)
return mask
def applyMask(mask, hsvImage):
return cv2.bitwise_and(hsvImage, hsvImage, mask=mask)
def processFrame(cap):
_, frame = cap.read()
frame = cv2.convertScaleAbs(frame, alpha=1, beta=50)
hsvImage = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV)
grayImage = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
rgbImage = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
kernel = np.ones((5,5),np.uint8)
rgbImage = cv2.morphologyEx(rgbImage, cv2.MORPH_OPEN, kernel, iterations=3)
mask = getMask(hsvImage)
segmentedImageHSV = applyMask(mask, hsvImage)
segmentedImage = cv2.cvtColor(segmentedImageHSV, cv2.COLOR_HSV2RGB)
# opening = cv2.morphologyEx(segmentedImage, cv2.MORPH_OPEN, kernel, iterations=2)
# closing = cv2.morphologyEx(segmentedImage, cv2.MORPH_CLOSE, kernel, iterations=2)
# gradient = cv2.morphologyEx(segmentedImage, cv2.MORPH_GRADIENT, kernel, iterations=1)
plt.subplot(2,2,1)
plt.title('Original')
plt.imshow(rgbImage)
plt.xticks([]),plt.yticks([])
plt.subplot(2,2,2)
plt.title('Mask')
plt.imshow(mask)
plt.xticks([]),plt.yticks([])
plt.subplot(2,2,3)
plt.title('Segmented')
plt.imshow(segmentedImage)
plt.xticks([]),plt.yticks([])
# plt.subplot(2,2,1)
# plt.title('Opening (Erosion->Dilation)')
# plt.imshow(opening)
# plt.xticks([]),plt.yticks([])
# plt.subplot(2,2,2)
# plt.title('Closing (Dilation->Erosion)')
# plt.imshow(closing)
# plt.xticks([]),plt.yticks([])
# plt.subplot(2,2,4)
# plt.title('Gradient (Dilation-Erosion)')
# plt.imshow(cv2.cvtColor(frame, cv2.COLOR_BGR2RGB))
# plt.xticks([]),plt.yticks([])
if __name__ == "__main__":
cap = cv2.VideoCapture(0)
plt.ion()
while(cap.isOpened()):
processFrame(cap)
press = plt.waitforbuttonpress(0.01)
if press is None or press == False:
pass
else:
break
cap.release()
plt.ioff()
plt.show() | [
"miguel.mzbi@gmail.com"
] | miguel.mzbi@gmail.com |
fb627818bd609c0bff8ac51d2e910b7ebb29b86f | e463fa2008ebceb3aae88eed000303abc060d471 | /student_admit/studentnet.py | 5e3b7023353588621adb8cd5646c57db9ef9e39e | [] | no_license | satyam15mishra/Pytorch_NNs | 437c8d069a45b0cac14249a6bc31778c8cd8f18f | 636500476706e7a4b0047a79800a1e6a792402fb | refs/heads/master | 2020-08-12T10:54:15.507633 | 2019-11-12T05:14:04 | 2019-11-12T05:14:04 | 214,754,173 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,542 | py | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import torch
from torch import nn
data = pd.read_csv('studentdata.csv')
X = data.iloc[:,[1,2,3]]
y = data.iloc[:, 0]
def plot_data(data):
X_plot = np.array(data[['gre', 'gpa']])
y_plot = np.array(data['admit'])
admitted = X_plot[np.argwhere(y == 1)]
rejected = X_plot[np.argwhere(y == 0)]
plt.scatter([s[0][0] for s in rejected], [s[0][1] for s in rejected], s = 25, color = 'red', edgecolor = 'k')
plt.scatter([s[0][0] for s in admitted], [s[0][1] for s in admitted], s = 25, color = 'cyan', edgecolor = 'k')
plt.xlabel("GRE")
plt.ylabel("CGPA")
plt.show()
#one hot encoding the data
from sklearn.compose import ColumnTransformer
from sklearn.preprocessing import OneHotEncoder
ct = ColumnTransformer(
[('one_hot_encoder', OneHotEncoder(categories = 'auto'), [-1])], # The column numbers to be transformed (here is [0] but can be [0, 1, 3])
remainder='passthrough' # Leave the rest of the columns untouched
)
X = np.array(ct.fit_transform(X), dtype=np.float)
from sklearn.model_selection import train_test_split
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size = 0.15, random_state = 42)
#scaling the data
from sklearn.preprocessing import StandardScaler
sc_X = StandardScaler()
X_train = sc_X.fit_transform(X_train)
X_test = sc_X.transform(X_test)
#converting into numpy array and then into pytorch tensors
X_train = torch.from_numpy(np.asarray(X_train))
X_test = torch.from_numpy(np.asarray(X_test))
y_train = torch.from_numpy(np.asarray(y_train))
y_test = torch.from_numpy(np.asarray(y_test))
X_train = X_train.float()
X_test = X_test.float()
y_train = y_train.float()
y_test = y_test.float()
# network architecture
class MyNet(nn.Module):
def __init__(self):
super(MyNet, self).__init__()
self.fc1 = torch.nn.Linear(6, 32)
self.fc2 = torch.nn.Linear(32, 16)
self.fc3 = torch.nn.Linear(16, 8)
self.fc4 = torch.nn.Linear(8, 1)
def forward(self, x):
x = torch.relu(self.fc1(x))
x = torch.tanh(self.fc2(x))
x = torch.sigmoid(self.fc3(x))
x = torch.sigmoid(self.fc4(x)) #sigmoid because of binary classification
return x
network = MyNet()
out = network(X_train)
import torch.optim as optim
optimizer = optim.SGD(MyNet().parameters(), lr=0.01)
criterion = torch.nn.MSELoss()
optimizer.zero_grad() # zero the gradient buffers
loss = criterion(out, y_train)
#backpropogation to minimize loss
loss.backward()
optimizer.step()
print 'Mean squared error or loss = ', loss
| [
"noreply@github.com"
] | noreply@github.com |
e14a0b8c28734a04f58c05b7c832436033fda1be | cb86daa80f9de85f632fd91de04006d32c0102a0 | /process_tweets/cross_verify_tweets.py | 441f5c5ff9eef1dd16804b7f7daec357cfa86b88 | [] | no_license | ericshape/CREDBANK-data | a537fd4c2b2046daa5dca2e826af6e7cc1ab09f4 | 2d37e9fca16f3c0fae338135e6048da46dd0cc13 | refs/heads/master | 2021-01-17T11:04:56.271620 | 2016-04-09T23:36:45 | 2016-04-09T23:36:45 | 55,520,040 | 0 | 0 | null | 2016-04-05T15:34:01 | 2016-04-05T15:34:01 | null | UTF-8 | Python | false | false | 2,998 | py | # created by Ji Wang ericshape @ 4/5/16 11:47 AM
import numpy as np
import json
import sys
import re
idRegEx = re.compile(r".*ID=")
endElRegEx = re.compile(r"'.*")
ratingsFile = "cred_event_TurkRatings.data"
tweetsFile = "cred_event_SearchTweets.data"
merge_outputFile = "merge_timeline.output"
inputFile = "cred_event_SearchTweets.data"
topic_outputFile = "topic_timeline.output"
class Cross_Verify_Tweets():
def __init__(self):
pass
def topic_timeline(self):
output = open(outputFile, "w")
with open(inputFile, "r") as f:
header = f.next()
for line in f:
topicData = line.split("\t")
topicKey = topicData[0]
topicTerms = topicData[1]
topicTweetCount = topicData[2]
tweetIdList = topicData[3]
print topicKey
realTweetIds = []
# Need to read: [('ID=522759240817971202', 'AUTHOR=i_Celeb_Gossips', 'CreatedAt=2014-10-16 14:41:30'),...]
idElements = tweetIdList.split("),")
for element in idElements:
elArr = element.split(",")
idEl = filter(lambda x: "ID" in x, elArr)[0]
idEl = idRegEx.sub("", idEl)
idEl = endElRegEx.sub("", idEl)
realTweetIds.append(long(idEl))
realTweetIds = list(set(realTweetIds))
topicMap = {
"key": topicKey,
"terms": topicTerms.split(","),
"count": topicTweetCount,
"tweets": realTweetIds
}
json.dump(topicMap, output, sort_keys=True)
output.write("\n")
output.close()
def merge_timeline(self):
tweetsMap = {}
with open(tweetsFile, "r") as f:
for line in f:
tweetData = json.loads(line)
tweetsMap[tweetData["key"]] = tweetData
output = open(outputFile, "w")
with open(ratingsFile, "r") as f:
header = f.next()
for line in f:
topicData = line.split("\t")
topicKey = topicData[0]
topicTerms = topicData[1]
ratings = topicData[2]
reasons = topicData[3]
ratings = map(lambda x: int(x.strip().replace("'", "")),
ratings.replace("[", "").replace("]", "").split(","))
ratings = np.array(ratings)
tweetsMap[topicKey]["ratings"] = ratings.tolist()
tweetsMap[topicKey]["mean"] = ratings.mean()
topicMap = tweetsMap[topicKey]
print topicMap["key"], topicMap["mean"]
json.dump(topicMap, output, sort_keys=True)
output.write("\n")
output.close()
if __name__ == '__main__':
cross_verify_tweets = Cross_Verify_Tweets()
| [
"wangjiprc@gmail.com"
] | wangjiprc@gmail.com |
da992c15b4e0a9fd1234d5e3a0f1a2116b27e0a9 | cfef60d72091264f6bccaf218d4ec8f301a7b7ad | /fabric_helpers/machines/ubuntu.py | 96a52ee465b554be0c0b3af1a234fede00f59cbc | [] | no_license | punteney/fabric_helpers | 9a6fbeceaa7c24257dcb1c13cc0244194a07085e | 291af17b3cbc25b71d7887a6f09ba8caba8d63de | refs/heads/master | 2021-01-19T22:29:32.823515 | 2010-11-15T18:03:40 | 2010-11-15T18:03:40 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,868 | py | from fabric import state
from fabric.api import run, sudo, cd, local
from fabric.contrib.files import append
from fabric_helpers.machines import Machine
class UbuntuServer(Machine):
def __init__(self,
public_address,
env_name,
open_ports=[],
private_address=None,
private_ports=[],
servers=[],
python_version='2.6',
ssh_port=22,
locale='en_US.UTF-8',
packages=[
'bash-completion'
'ufw',
'build-essential',
'python-setuptools',
'git-core',
'subversion',
'mercurial',
'postgresql-client',
'python-imaging',
'python-psycopg2',
'python-dev',
'wv',
'ghostscript',
'libpng3',
'libjpeg62',
'texlive',
'faad',
'ffmpeg',
'imagemagick',
],
):
self.public_address = public_address
self.env_name = env_name
self.open_ports = open_ports
self.private_address = private_address
self.private_ports = private_ports
self.servers = servers
self.ssh_port = ssh_port
self.locale = locale
self.packages = packages
self.python_version='2.6'
self.ssh_port = ssh_port
def install(self):
self.set_locale()
self.setup_firewall()
self.update_packages()
self.install_packages()
self.install_servers()
append('. /etc/bash_completion', '/home/%s/.bashrc' % state.env.user)
def set_locale(self):
sudo('locale-gen %s' % self.locale)
sudo('/usr/sbin/update-locale LANG=%s' % self.locale)
def setup_firewall(self):
sudo('aptitude -y install ufw')
sudo('ufw default deny')
sudo('ufw allow %s' % self.ssh_port)
for port in self.open_ports:
sudo('ufw allow %s' % port)
if self.private_address and self.private_ports:
for port in self.private_ports:
sudo('ufw allow to %s port %s' % (self.private_address, port))
sudo("echo 'y' | ufw enable")
# Update all installed packages to current version
def update_packages(self):
sudo('aptitude -y update')
sudo('aptitude -y safe-upgrade')
sudo('aptitude -y full-upgrade')
def install_packages(self, packages=None):
if not packages:
packages = self.packages
sudo('aptitude -y install %s' % " ".join(self.packages))
for s in self.servers:
if hasattr(s, 'packages'):
sudo('aptitude -y install %s' % " ".join(s.packages))
| [
"punteney@gmail.com"
] | punteney@gmail.com |
81f0eb4b24ff712328b49bbcd84509d2ab1cc296 | a3a89b54af31deb583ea039657cc6a8c79a91bff | /PG/pytorch_util.py | a4a6b2ac237a5d31813f1e76c1e461b4281c8392 | [] | no_license | bunengzhucefeng/rl_algorithm_reimplementation | 1c4348a4914f090943e04aa8b5b8a2b6a105f35a | 5ef53154ea68de9f3cb84e829944646476148f9b | refs/heads/main | 2023-06-08T18:20:19.827511 | 2021-07-02T12:28:24 | 2021-07-02T12:28:24 | 382,340,078 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,220 | py | from typing import Union
import torch
from torch import nn
Activation = Union[str, nn.Module]
_str_to_activation = {
'relu': nn.ReLU(),
'tanh': nn.Tanh(),
'leaky_relu': nn.LeakyReLU(),
'sigmoid': nn.Sigmoid(),
'selu': nn.SELU(),
'softplus': nn.Softplus(),
'identity': nn.Identity(),
}
def build_mlp(
input_size: int,
output_size: int,
n_layers: int,
size: int,
activation: Activation = 'tanh',
output_activation: Activation = 'identity',
):
"""
Builds a feedforward neural network
arguments:
input_placeholder: placeholder variable for the state (batch_size, input_size)
scope: variable scope of the network
n_layers: number of hidden layers
size: dimension of each hidden layer
activation: activation of each hidden layer
input_size: size of the input layer
output_size: size of the output layer
output_activation: activation of the output layer
returns:
output_placeholder: the result of a forward pass through the hidden layers + the output layer
"""
if isinstance(activation, str):
activation = _str_to_activation[activation]
if isinstance(output_activation, str):
output_activation = _str_to_activation[output_activation]
layers = []
in_size = input_size
for _ in range(n_layers):
layers.append(nn.Linear(in_size, size))
layers.append(activation)
in_size = size
layers.append(nn.Linear(in_size, output_size))
layers.append(output_activation)
return nn.Sequential(*layers)
device = None
def init_gpu(use_gpu=True, gpu_id=0):
global device
if torch.cuda.is_available() and use_gpu:
device = torch.device("cuda:" + str(gpu_id))
print("Using GPU id {}".format(gpu_id))
else:
device = torch.device("cpu")
print("GPU not detected. Defaulting to CPU.")
def set_device(gpu_id):
torch.cuda.set_device(gpu_id)
def from_numpy(*args, **kwargs):
return torch.from_numpy(*args, **kwargs).float().to(device)
def to_numpy(tensor):
return tensor.to('cpu').detach().numpy() | [
"1801213983@pku.edu.cn"
] | 1801213983@pku.edu.cn |
8619b701ca3e625d7e82d606e87038282feb7484 | 9987ac2bcb8e2734a34a8ebe8b81de6ff66050ee | /covidsample/covidsample/urls.py | cca3b3faa5dc5df92cc3d02a8fd41158784f402f | [] | no_license | ShivamDhoundiyal/covid_project_sample | a3037b075c9e794e50068ffbf6724057c1bb359b | d78fc4c06487b8ed7c064bcad1aded66e058eeda | refs/heads/master | 2023-05-06T22:11:01.112088 | 2021-05-29T17:37:08 | 2021-05-29T17:37:08 | 372,034,361 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 819 | py | """covidsample URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path,include
urlpatterns = [
path('admin/', admin.site.urls),
path('',include('sample.urls'))
]
| [
"noreply@github.com"
] | noreply@github.com |
ebf76df12eb5235a73cdd6f5d758ef04022f8eeb | f889a1de574dc55425677bcbea6410bf360cddd6 | /labels/serializers.py | 74182afaf2891bdffd2e90bdb064a3c2a8072f99 | [] | no_license | Hagbuck/MyBlackSmith | 816b3b711db021ee702a19b3240bb30c48271bc6 | 671088bee46d2fa705bfd9b37f059610bcdd2252 | refs/heads/main | 2023-01-24T12:23:18.255371 | 2020-12-02T16:46:19 | 2020-12-02T16:46:19 | 313,397,620 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 407 | py | from rest_framework import serializers
from .models import Label
from accounts.serializers import UserSerializer
from projects.serializers import ProjectSerializer
class LabelSerializer(serializers.HyperlinkedModelSerializer):
user = UserSerializer()
project = ProjectSerializer()
class Meta:
model = Label
fields = ['id', 'name', 'color', 'user', 'project', 'creation_date'] | [
"anthony.vuillemin@outlook.fr"
] | anthony.vuillemin@outlook.fr |
eb621fa706f1fb5e6a98134f911aa9907b0257da | e6c65e2e354336a4bea5b6a4ccbccd3682915fe2 | /out-bin/py/google/fhir/models/run_locally.runfiles/com_google_fhir/external/pypi__numpy_1_15_4/numpy/matrixlib/tests/__init__.py | aeeeb27fd221b666a211ced69a956b7500092e85 | [
"Apache-2.0"
] | permissive | rasalt/fhir-datalab | c30ab773d84983dd04a37e9d0ddec8bf2824b8a4 | 3e329fc8b4226d3e3a4a7c23c306a86e7a9ea0de | refs/heads/master | 2021-10-09T05:51:04.593416 | 2018-12-21T18:11:03 | 2018-12-22T05:38:32 | 162,744,237 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 138 | py | /home/rkharwar/.cache/bazel/_bazel_rkharwar/0ddaa3627472ad9d1367a008236ce2f5/external/pypi__numpy_1_15_4/numpy/matrixlib/tests/__init__.py | [
"ruchika.kharwar@gmail.com"
] | ruchika.kharwar@gmail.com |
f0e30cd721e3980995d0f449df77418b9cfddd8a | 30e1dc84fe8c54d26ef4a1aff000a83af6f612be | /deps/src/libxml2-2.9.1/python/tests/reader5.py | 220a3e5bbafc048a0ea35a0277fe47bbaca38f99 | [
"MIT",
"BSD-3-Clause"
] | permissive | Sitispeaks/turicreate | 0bda7c21ee97f5ae7dc09502f6a72abcb729536d | d42280b16cb466a608e7e723d8edfbe5977253b6 | refs/heads/main | 2023-05-19T17:55:21.938724 | 2021-06-14T17:53:17 | 2021-06-14T17:53:17 | 385,034,849 | 1 | 0 | BSD-3-Clause | 2021-07-11T19:23:21 | 2021-07-11T19:23:20 | null | UTF-8 | Python | false | false | 1,246 | py | #!/usr/bin/python -u
#
# this tests the Expand() API of the xmlTextReader interface
# this extract the Dragon bibliography entries from the XML specification
#
import libxml2
import sys
# Memory debug specific
libxml2.debugMemory(1)
expect="""<bibl id="Aho" key="Aho/Ullman">Aho, Alfred V.,
Ravi Sethi, and Jeffrey D. Ullman.
<emph>Compilers: Principles, Techniques, and Tools</emph>.
Reading: Addison-Wesley, 1986, rpt. corr. 1988.</bibl>"""
f = open('../../test/valid/REC-xml-19980210.xml', 'rb')
input = libxml2.inputBuffer(f)
reader = input.newTextReader("REC")
res=""
while reader.Read() > 0:
while reader.Name() == 'bibl':
node = reader.Expand() # expand the subtree
if node.xpathEval("@id = 'Aho'"): # use XPath on it
res = res + node.serialize()
if reader.Next() != 1: # skip the subtree
break;
if res != expect:
print("Error: didn't get the expected output")
print("got '%s'" % (res))
print("expected '%s'" % (expect))
#
# cleanup
#
del input
del reader
# Memory debug specific
libxml2.cleanupParser()
if libxml2.debugMemory(1) == 0:
print("OK")
else:
print("Memory leak %d bytes" % (libxml2.debugMemory(1)))
libxml2.dumpMemory()
| [
"znation@apple.com"
] | znation@apple.com |
d163b55d4ea29236a3c4039c83ab916de00909ce | 2f37b47c9676d316d639b210a11f22a15ef62929 | /IOT/urls.py | a35d862be019b26c7350382ce430b03b96199e41 | [] | no_license | SumanthKumarAlimi/IOTCLUB | 241cca39d2ddb0dcf5e97e70c8196805be371548 | 7af83b00597fd85535fba9527dc7e4f60ebda240 | refs/heads/master | 2020-06-11T02:44:10.034539 | 2019-06-26T04:26:35 | 2019-06-26T04:26:35 | 186,881,549 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 643 | py | from django.conf.urls import url
from . import views
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
urlpatterns = [
url(r'^$', views.homepage, name='index'),
url(r'^workshops/$', views.workshops, name='workshops'),
url(r'^course/$', views.course, name='course'),
url(r'^achievements/$', views.achievements, name='achievements'),
url(r'^corebody/$', views.corebody, name='corebody'),
url(r'^projects/$', views.projects, name='Projects'),
url(r'^actionplan/$', views.action, name='ActionPlan'),
url(r'^Reports/$', views.Reports, name='Reports'),
]
urlpatterns += staticfiles_urlpatterns()
| [
"director@digi-labs.co.in"
] | director@digi-labs.co.in |
3063a211d9d9d17cd1f5aede9bd9170c6237a64a | b36e5a6d1a450cbbd9545b2aa85eee5245515d6b | /myslq.py | 8386670d125a055b4d84894ece014bc5d1e0680d | [] | no_license | ikerseco/mysqlpy | 54d333fe41f41cbc3057cac2a8e788cda2224967 | 4482fdb780e6e40f8c2ece7bbb07152aeeb0c850 | refs/heads/master | 2021-03-30T21:58:07.358819 | 2018-08-17T15:05:24 | 2018-08-17T15:05:24 | 124,822,219 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 14,957 | py | import pymysql.cursors
import json
from m_arr.array_explo import explot
from m_arr.array_explo import implot
from inser_t.insert import read
#from inser_t.insert
"""
print("Zure datubasera konektatzen:\n")
dbi = input("\t*jarri zure databasearen izena:")
useri = input("\t*user:")
passwordi = input("\t*password:")
hosti = input("\t*host:")
# Connect to the database
connection = pymysql.connect(host=hosti,
user=useri,
password=passwordi,
db=dbi,
charset='utf8mb4',
cursorclass=pymysql.cursors.DictCursor)
try:
# select bitarteko erantzunak
with connection.cursor() as cursor:
# Read a single record
sql = "SELECT * FROM `employees`"
cursor.execute(sql)
result = cursor.fetchall()
print(len(result))
for x in range(len(result)):
print (result[x])
print(result[x]['firstname'])
#tablak ikustatu
with connection.cursor() as cursor:
sql = "describe employees"
cursor.execute(sql)
result = cursor.fetchall()
print(len(result))
for x in range(len(result)):
print(result[x])
finally:
connection.close()
"""
class data_base(object):
def __init__(self, user, password, db, host):
self.user = user
self.password = password
self.db = db
self.host = host
self.conec = None
def conexioa(self):
connection = pymysql.connect(host = self.host,
user = self.user,
password = self.password,
db = self.db,
charset = 'utf8mb4',
cursorclass=pymysql.cursors.DictCursor,
autocommit=True)
self.conec = connection
def show_t(self):
with self.conec.cursor() as cursor:
sql_show = "show tables"
cursor.execute(sql_show)
result = cursor.fetchall()
return result
cursor.close()
def describe_t(self,izena):
with self.conec.cursor() as cursor:
sql_co = "describe " + izena
cursor.execute(sql_co)
result = cursor.fetchall()
return result
def select_t(self,data):
with self.conec.cursor() as cursor:
sql_co = "select * from "+ data
cursor.execute(sql_co)
result = cursor.fetchall()
return result
def create_t(self,datuak,t_izena):
with self.conec.cursor() as cursor:
try:
data = "CREATE TABLE "+t_izena+" (" + datuak + ") ENGINE = InnoDB;"
print(data)
cursor.execute(data)
return("zure tabla sortu egin da zorionak!!!")
except ValueError:
return("arazo bat egon da zure tabla sortzean!!!")
def insert_t(self,t_izena,datuak):
#¿Realmente desea ejecutar "DELETE FROM `proba` WHERE `proba`.`id` = 1"?
with self.conec.cursor() as cursor:
try:
datd = "INSERT INTO " + t_izena + " " + datuak + ";"
print(datd)
cursor.execute(datd)
#cursor.execute("INSERT INTO animal values ('1','ga','23') ON DUPLICATE KEY UPDATE id='1',name='ga',tamano='23';")
self.conec.commit()
except ValueError:
print("datuak ezdira sartu")
def dlet(self,tizena):
with self.conec.cursor() as cursor:
deli = "DELETE FROM "+tizena+";"
cursor.execute(deli)
cursor.close()
def delete_t(self,data):
with self.conec.cursor() as cursor:
try:
data = "DROP TABLE IF EXISTS " + data
print(data)
cursor.execute(data)
self.conec.commit()
except ValueError:
print("datu basearekin arazo bat dago.")
def relaion(self,tabla1,tabla2,forey,pryma,rel):
print(pryma)
print(forey)
print(tabla1)
with self.conec.cursor() as cursor:
try:
if rel == "o:m":
data = "ALTER TABLE `"+tabla2+"` ADD INDEX(`"+forey+"`);"
cursor.execute(data)
data = "ALTER TABLE "+tabla2+" ADD FOREIGN KEY ("+forey+") REFERENCES "+tabla1+" ("+pryma+");"
cursor.execute(data)
cursor.close()
self.conec.commit()
if rel == "m:m":
implotf = implot(forey,",")
fimpo = implotf.mount(" : ")
tabla = len(tabla1)
data = "ALTER TABLE `"+tabla1[tabla -1]+"` ADD INDEX("+fimpo+");"
cursor.execute(data)
#data = "ALTER TABLE "+tabla2+" ADD FOREIGN KEY ("+forey+") REFERENCES "+tabla1+" ("+pryma+");"
#cursor.execute(data)
for x in range(len(tabla1) - 1):
data = "ALTER TABLE "+tabla1[tabla -1]+" ADD FOREIGN KEY ("+forey[x]+") REFERENCES "+tabla1[x]+" ("+pryma[x]+");"
cursor.execute(data)
cursor.close()
self.conec.commit()
except ValueError:
print("datu basearekin arazo bat dago.")
#json
data = [{'izena':'name','Funtzioa':''},{'izena':'atributoa','Funtzioa':''},{'izena':'NUll','Funtzioa':''},{'izena':'DEFAULT','Funtzioa':''}]
#funtzioak
def atributo(izen):
atri = [{'1':'INT','2':'VARCHAR','3':'TEXT','4':'DATE'}]
return atri[0][izen]
def Null(izen):
atri = [{'1':'NULL','2':'NOT NULL'}]
return atri[0][izen]
def defektuzko(izen):
if izen == "1":
di = input("PERTSONALA:")
return di
if izen == "2":
return "CURRENT_TIMESTAMP"
if izen == "3":
return ""
def tables(describe):
data = ""
key = ""
print(describe)
for x in range(len(describe)):
if describe[x]["Key"] == "PRI":
key += "PRIMARY KEY ("+describe[x]["Field"]+")"
if describe[x]["Extra"] == "auto_increment":
data += describe[x]["Field"] + " " +describe[x]["Type"] + " "+describe[x]["Extra"] + " ,"
else:
data += describe[x]["Field"] + " " +describe[x]["Type"] + ","
tosoa = data + key
print(tosoa)
return tosoa
#programa
print(str(2))
print("Zure datubasera konektatzen:\n")
db = input("\t*jarri zure databasearen izena:")
user = input("\t*user:")
password = input("\t*password:")
host = input("\t*host:")
mysql = data_base( "root","",db, "127.0.0.1")
mysql.conexioa()
while True:
dbs = "Tables_in_" + db
tabla_s = mysql.show_t()
print("\n")
print("Tablak")
for x in range(len(tabla_s)):
print("\t",x,".",tabla_s[x][dbs])
print("\t",len(tabla_s),".tabla bat sortu")
print("\t",len(tabla_s) + 1,".tabla bat ezabatu")
zent = input("haukeratu tabla bat:")
#tabla bat sortzeko gauzak
print("\n")
if int(zent) == len(tabla_s):
izen_tabla = input("jarri tablaren izena:")
kanti = input("zenbat zutabe:")
zutabeak = ""
pry = ""
for x in range(int(kanti)):
print("\n")
print(x + 1 ,"-zutabea")
izen_zutabea = input("-jarri zutabearen izena:")
data[0]['Funtzioa'] = izen_zutabea
print("\n")
print("-Aukeratu atributo bat:")
print("\t1.INT")
print("\t2.VARCHAR")
print("\t3.TEXT")
print("\t4.DATE")
aukerTR = input("aukera:")
a = atributo(aukerTR)
if aukerTR != "3" and aukerTR != "4":
luzeheraTR = input("Atributoaren luzehera:")
a = atributo(aukerTR) + "("+luzeheraTR+")"
data[1]['Funtzioa'] = a
print("\n")
print("-Null:")
print("\t1.BAI")
print("\t2.EZ")
aukerNL = input("aukera:")
n = Null(aukerNL)
data[2]['Funtzioa'] = n
print("\n")
print("-Defektuzko Datua:")
print("\t1.PERTSONALA:")
print("\t2.CURRENT_TIMESTAMP")
print("\t3.ez")
aukerDF = input("aukera:")
if aukerDF == "1":
d = defektuzko(aukerDF)
print(d)
data[3]['Funtzioa'] = "DEFAULT" + " '" + d + "'"
if aukerDF == "2":
d = defektuzko(aukerDF)
data[3]['Funtzioa'] = d
if aukerDF == "3":
d = defektuzko(aukerDF)
data[3]['Funtzioa'] = d
print("\n")
zutabeak += " " + data[0]['Funtzioa'] +" "+ data[1]['Funtzioa'] +" "+ data[2]['Funtzioa'] +" "+ data[3]['Funtzioa'] +","
pry += "\t*"+data[0]['Funtzioa']+"\n"
print("-Prymari key:")
print("\t1.BAI")
print("\t2.EZ")
a = input("aukera:")
if a == "1":
print("\n")
print("zutabeak:")
print(pry)
zu_name = input("zutabearen izena:")
zutabeak += "PRIMARY KEY("+zu_name+")"
print("\n")
print("\t1.bai")
print("\t2.ez")
auto = input("auto increment:")
if int(auto) == 1:
explots = explot(zutabeak,",")
array = explots.arry()
string = ""
search_arr = explots.search(array,zu_name)
for j in range(len(array)):
print(search_arr[0])
if j == search_arr[0]:
array[j] += "AUTO_INCREMENT"
if j != len(array) - 1:
string += array[j] + ","
if j == len(array) - 1:
string += array[j]
print(string)
mysql.create_t(string,izen_tabla)
if int(auto) == 2:
print("ez auto")
mysql.create_t(zutabeak,izen_tabla)
if a == "2":
zu_name = "none"
print("\n")
#print(zutabeak)
#print(izen_tabla)
if int(zent) == len(tabla_s) + 1:
for x in range(len(tabla_s)):
print("\t",x,".",tabla_s[x][dbs])
eza = input("aukeratu zutabea:")
mysql.delete_t(tabla_s[int(eza)][dbs])
print(tabla_s[int(eza)][dbs])
if int(zent) == len(tabla_s) + 2:
print("\n")
print("aukeratu erlazio modu bat:")
print("\t1* o:m:")
print("\t2* m:m")
print("\t3* o:o")
au = input("aukeratu bat:")
if int(au) == 1:
tabla_s = mysql.show_t()
print("\n")
print("tablak1:")
for x in range(len(tabla_s)):
print("\t*",x,tabla_s[x][dbs])
au = input("prymarikey tabla aukeratu:")
tabla1 = tabla_s[int(au)][dbs]
print("\n")
tablades1 = mysql.describe_t(tabla1)
if tablades1 == " ":
print("ezdaude datuak")
print(tabla1,":")
for p in range(len(tablades1)):
print("\t*",p,tablades1[p]["Field"])
au = input("prymarykey:")
pry = tablades1[int(au)]["Field"]
print("\n")
print("tablak2:")
for t in range(len(tabla_s)):
print("\t*",t,tabla_s[t][dbs])
au = input("forenkey tabla aukeratu:")
tabla2 = tabla_s[int(au)][dbs]
print("\n")
print(tabla2,":")
tablades2 = mysql.describe_t(tabla2)
for p in range(len(tablades2)):
print("\t*",p,tablades2[p]["Field"])
ak = input("forenkay:")
fore = tablades2[int(ak)]["Field"]
re = mysql.relaion(tabla1,tabla2,pry,fore,"o:m")
if int(au) == 2:
prymari = []
tablak = []
forenkay = []
print("m:m")
tz = input("primaykey erlazio kantitatea:")
tabla_s = mysql.show_t()
for x in range(int(tz)):
print("\n")
print(x,"* tablakpry:")
for x in range(len(tabla_s)):
print("\t*",x,tabla_s[x][dbs])
au = input("prymarikey tabla aukeratu:")
tablapry = tabla_s[int(au)][dbs]
tablak.append(tablapry)
print("\n")
tablades1 = mysql.describe_t(tablapry)
print(tablapry,":")
for p in range(len(tablades1)):
print("\t*",p,tablades1[p]["Field"])
au = input("prymarykey:")
pry = tablades1[int(au)]["Field"]
prymari.append(pry)
print("\n")
#////////////
print("tablak2:")
for t in range(len(tabla_s)):
print("\t*",t,tabla_s[t][dbs])
au = input("forenkey tabla aukeratu:")
tabla2 = tabla_s[int(au)][dbs]
tablak.append(tabla2)
tablades2 = mysql.describe_t(tabla2)
for e in range(len(prymari)):
print("\n")
print(e,"forenkey ",tabla2,":")
for x in range(len(tablades2)):
print("\t*",x,tablades2[x]["Field"])
au = input("aukeratu forenkay:")
frore = tablades2[int(au)]["Field"]
forenkay.append(frore)
#def relaion(self,tabla1,tabla2,forey,pryma,rel):
re = mysql.relaion(tablak,"",forenkay,prymari,"m:m")
if int(au) == 3:
print("o:o")
input("")
else:
print("ze nahi duzu?")
print("\t1.visual")
print("\t2.config")
cv = input("aukera:")
if int(cv) == 1:
print("\n")
print("aukeratu modu bat:")
tabla_des = mysql.describe_t(tabla_s[int(zent)][dbs])
lotura_iz = ""
lotura_da = ""
for x in range(len(tabla_des)):
print("\t.",tabla_des[x]["Field"])
tabla_sel = mysql.select_t(tabla_s[int(zent)][dbs])
for p in range(len(tabla_sel)):
print("\t ",p,"* ",tabla_sel[p][tabla_des[x]["Field"]])
print("\t. (insert) datuak sartu")
aukeratu = input("aukera:")
if aukeratu == "insert":
fyle = ""
for j in range(len(tabla_des)):
fyle += tabla_des[j]["Field"] + ","
cont = []
col = ""
for p in range(len(tabla_sel)):
for x in range(len(tabla_des)):
col += str(tabla_sel[p][tabla_des[x]["Field"]]) + ","
cont.append(col[:-1])
col = ""
fitxero = tabla_s[int(zent)][dbs] +".od.csv"
reads = read(fitxero,"C:\\Users\\web\\Desktop\\carpeta\\mysqlpy-master\\oard",fyle[:-1],cont)
r = reads.idatzi()
ja = input("(sartu) idatzi:")
while (ja != "sartu"):
ja = input("(sartu) idatzi:")
val = reads.val()
print(val)
delins = mysql.dlet(tabla_s[int(zent)][dbs])
insert = mysql.insert_t(tabla_s[int(zent)][dbs] ,val)
if int(cv) == 2:
tabla_des = mysql.describe_t(tabla_s[int(zent)][dbs])
print("\n")
print("Zutabeak:")
#print(tabla_des)
for x in range(len(tabla_des)):
print("\t",[x],".Izena:",tabla_des[x]["Field"],"; Karaktere_Mota:",tabla_des[x]["Type"],"; NULL:",tabla_des[x]["Null"],"; Giltza:",tabla_des[x]["Key"],"; Defektuzko_izena:",tabla_des[x]["Default"],"; Gehigarria:",tabla_des[x]["Extra"])
print("\t",[len(tabla_des)],".sortu zutabe berri bat:")
print("\n")
input("") | [
"33206796+ikerseco@users.noreply.github.com"
] | 33206796+ikerseco@users.noreply.github.com |
16c2b16ecf6b6fd0fb698e196b6d01c2bda07d10 | d78411d389ce2a02b72b3ae8793d8b04a0eb76c0 | /src/utils/badges.py | 6d7a404db49f79c2a93e72c12f9d43bc286b78e3 | [] | no_license | codeday/discord-challenge | 338d483cf94cb7ae08606e07e9b58b41b3e28c81 | a17f2e895b4c7c0c33b4a8090a57b2ef502c4892 | refs/heads/master | 2023-02-25T19:38:04.918062 | 2021-02-03T00:24:44 | 2021-02-03T00:24:44 | 328,318,328 | 1 | 1 | null | null | null | null | UTF-8 | Python | false | false | 1,681 | py | import json
from jwt import encode
import time
import requests
import logging
from os import getenv
def gql_token():
secret = getenv("GQL_ACCOUNT_SECRET")
message = {
"scopes": "write:users",
"exp": int(time.time()) + (60*60*24)
}
return encode(message, secret, algorithm='HS256').decode("utf-8")
def gql(query):
result = requests.post("https://graph.codeday.org/",
json={"query": query},
headers={"Authorization": f"Bearer {gql_token()}"})
data = json.loads(result.text)
if "errors" in data:
logging.error(result.text)
return data["data"]
def get_username(member):
query = f"""{{
account {{
getUser(where: {{ discordId: "{member.id}" }}) {{
username
}}
}}
}}"""
result = gql(query)
try:
user = result["account"]["getUser"]
if user:
return user["username"]
except:
logging.error(
f"could not look up ${member.id}")
pass
return None
async def grant(bot, member, id):
logging.info(f"granting badge {id}...")
username = get_username(member)
if not member.id and not username:
return False
logging.info(f"...to {username}")
query = f"""mutation {{
account {{
grantBadge(where: {{discordId: "{member.id}"}}, badge: {{ id: "{id}" }})
}}
}}"""
gql(query)
try:
channel = await bot.fetch_channel(int(getenv("CHANNEL_A_UPDATE")))
await channel.send(f"a~update <@{member.id}>")
except Exception as err:
logging.error(err)
return True
| [
"nikhil@gargmail.com"
] | nikhil@gargmail.com |
be4ff8e37c554502f027d56bef88710044acdfea | 6aa85c51e1a0bfaa2733f5ec8babc7297e209707 | /rs2_ros_aligned_depth.py | 85ad472d0571b530af29191b406e10abf122f1fd | [] | no_license | KingBigHandsome/IntelRealSenseD435 | 02b1470c83606dd00210aadbd99b4e3e7852e3ca | 666d12c960b90cc973d76fbf6e784d525f8bb075 | refs/heads/master | 2020-04-08T18:02:05.093933 | 2018-12-07T05:46:38 | 2018-12-07T05:46:38 | 159,591,274 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,951 | py | #!/usr/bin/env python
from __future__ import print_function
import roslib
roslib.load_manifest('realsense2_camera')
import sys
import rospy
import cv2
import numpy as np
from std_msgs.msg import String
from sensor_msgs.msg import Image
from cv_bridge import CvBridge, CvBridgeError
class Image_converter:
def __init__(self):
# self.image_pub = rospy.Publisher("image_topic_2", Image)
self.bridge = CvBridge()
self.depth_image_sub = rospy.Subscriber("/camera/aligned_depth_to_color/image_raw", Image, self.depth_callback)
def depth_callback(self, data):
print(
"Info of Depth Image:\nimage.header is %s\nimage.height is %s\nimage.width is %s\nimage.encoding is %s\nimage.step is %s\n"
% (data.header, data.height, data.width, data.encoding, data.step))
try:
cv_image = self.bridge.imgmsg_to_cv2(data, "16UC1")
depth_image = np.asanyarray(cv_image)
depth_colormap = cv2.applyColorMap(cv2.convertScaleAbs(depth_image, alpha=0.03), cv2.COLORMAP_JET)
except CvBridgeError as e:
print(e)
(rows, cols, channels) = depth_colormap.shape
# print (rows, cols, channels)
if cols > 60 and rows > 60:
cv2.circle(depth_colormap, (200, 200), 100, (255, 0, 255), 2)
distance = depth_image[200, 200] * 0.001
print('The distance date of the circle center is %6.3f' % distance)
cv2.putText(depth_colormap,
'The distance date of the circle center is' + str(distance),
(50, 400),
cv2.FONT_HERSHEY_COMPLEX,
0.7,
(0, 0, 255),
1)
cv2.imshow("Depth Image window", depth_colormap)
cv2.waitKey(3)
try:
pass
# self.image_pub.publish(self.bridge.cv2_to_imgmsg(cv_image, "bgr8"))
except CvBridgeError as e:
print(e)
def main(args):
ic = Image_converter()
rospy.init_node('image_converter', anonymous=True)
try:
rospy.spin()
except KeyboardInterrupt:
print("Shutting down")
cv2.destroyAllWindows()
if __name__ == '__main__':
main(sys.argv)
| [
"noreply@github.com"
] | noreply@github.com |
4869a312afecf5587acf929abf9f9adcd24f3ff4 | 3a50c0712e0a31b88d0a5e80a0c01dbefc6a6e75 | /thrift/lib/python/any/test/serializer.py | e10f1866cd979f95c40dfcde5b071bca2dbe8ba4 | [
"Apache-2.0"
] | permissive | facebook/fbthrift | 3b7b94a533666c965ce69cfd6054041218b1ea6f | 53cf6f138a7648efe5aef9a263aabed3d282df91 | refs/heads/main | 2023-08-24T12:51:32.367985 | 2023-08-24T08:28:35 | 2023-08-24T08:28:35 | 11,131,631 | 2,347 | 666 | Apache-2.0 | 2023-09-01T01:44:39 | 2013-07-02T18:15:51 | C++ | UTF-8 | Python | false | false | 7,122 | py | #!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import annotations
import typing
import unittest
from apache.thrift.type.standard.thrift_types import TypeName, Void
from apache.thrift.type.type.thrift_types import Type
from folly.iobuf import IOBuf
from testing.thrift_types import Color
from thrift.python.any.serializer import (
deserialize_list,
deserialize_map,
deserialize_primitive,
deserialize_set,
serialize_list,
serialize_map,
serialize_primitive,
serialize_set,
)
from thrift.python.any.typestub import PrimitiveType, SerializableType, TKey, TValue
# @manual=//thrift/test/testset:testset-python-types
from thrift.test.testset import thrift_types
class SerializerTests(unittest.TestCase):
def _test_round_trip(
self, value: PrimitiveType, thrift_type: typing.Optional[Type] = None
) -> None:
iobuf = serialize_primitive(value, thrift_type=thrift_type)
decoded = deserialize_primitive(type(value), iobuf, thrift_type=thrift_type)
self.assertIs(type(value), type(decoded))
if isinstance(value, float):
assert isinstance(decoded, float)
self.assertAlmostEqual(float(value), float(decoded), places=3)
else:
self.assertEqual(value, decoded)
def test_bool_round_trip(self) -> None:
self._test_round_trip(True)
def test_int_round_trip(self) -> None:
self._test_round_trip(42)
def test_float_round_trip(self) -> None:
self._test_round_trip(123456.789)
def test_str_round_trip(self) -> None:
self._test_round_trip("thrift-python")
def test_bytes_round_trip(self) -> None:
self._test_round_trip(b"raw bytes")
def test_iobuf_round_trip(self) -> None:
self._test_round_trip(IOBuf(b"iobuf"))
def test_enum_round_trip(self) -> None:
self._test_round_trip(Color.green)
def _test_round_trip_with_type_names(
self, value: PrimitiveType, type_names: typing.Sequence[TypeName]
) -> None:
for type_name in type_names:
with self.subTest(type_name=type_name):
self._test_round_trip(value, thrift_type=Type(name=type_name))
def test_int_round_trip_with_type_name(self) -> None:
self._test_round_trip_with_type_names(
42,
[
TypeName(byteType=Void.Unused),
TypeName(i16Type=Void.Unused),
TypeName(i32Type=Void.Unused),
TypeName(i64Type=Void.Unused),
],
)
def test_float_round_trip_with_type_name(self) -> None:
self._test_round_trip_with_type_names(
123456.789,
[
TypeName(floatType=Void.Unused),
TypeName(doubleType=Void.Unused),
],
)
def _test_list_round_trip(
self,
value: typing.Sequence[SerializableType],
) -> None:
iobuf = serialize_list(value)
decoded = deserialize_list(
type(value[0]) if value else str,
iobuf,
)
self.assertEqual(value, decoded)
def test_empty_list_round_trip(self) -> None:
self._test_list_round_trip([])
def test_list_of_ints_round_trip(self) -> None:
self._test_list_round_trip([1, 1, 2, 3, 5, 8])
def test_list_of_structs_round_trip(self) -> None:
self._test_list_round_trip(
[
thrift_types.struct_map_string_i32(field_1={"one": 1}),
thrift_types.struct_map_string_i32(field_1={"two": 2}),
]
)
def test_list_of_unions_round_trip(self) -> None:
self._test_list_round_trip(
[
thrift_types.union_map_string_string(field_2={"foo": "bar"}),
thrift_types.union_map_string_string(field_2={"hello": "world"}),
]
)
def test_list_of_exceptions_round_trip(self) -> None:
self._test_list_round_trip(
[
thrift_types.exception_map_string_i64(field_1={"code": 400}),
thrift_types.exception_map_string_i64(field_1={"code": 404}),
]
)
def test_thrift_list_round_trip(self) -> None:
self._test_list_round_trip(
thrift_types.struct_list_i32(field_1=[1, 2, 3, 4]).field_1
)
def _test_set_round_trip(
self,
value: typing.AbstractSet[SerializableType],
) -> None:
iobuf = serialize_set(value)
decoded = deserialize_set(
type(next(iter(value))) if value else bytes, # doesn't matter for empty set
iobuf,
)
self.assertEqual(value, decoded)
def test_empty_set_round_trip(self) -> None:
self._test_set_round_trip(set())
def test_set_of_ints_round_trip(self) -> None:
self._test_set_round_trip({1, 1, 2, 3, 5, 8})
def test_set_of_structs_round_trip(self) -> None:
self._test_set_round_trip(
{
thrift_types.struct_map_string_i32(field_1={"one": 1}),
thrift_types.struct_map_string_i32(field_1={"two": 2}),
}
)
def test_thrift_set_round_trip(self) -> None:
self._test_set_round_trip(
thrift_types.struct_set_i64(field_1={1, 2, 3, 4}).field_1
)
def _test_map_round_trip(
self,
original: typing.Mapping[TKey, TValue],
) -> None:
iobuf = serialize_map(original)
if original:
k, v = next(iter(original.items()))
key_cls = type(k)
value_cls = type(v)
else:
key_cls = bool # doesn't matter for empty dict
value_cls = bool # doesn't matter for empty dict
decoded = deserialize_map(
key_cls,
value_cls,
iobuf,
)
self.assertEqual(original, decoded)
def test_empty_map_round_trip(self) -> None:
self._test_map_round_trip({})
def test_int_to_str_map_round_trip(self) -> None:
self._test_map_round_trip({1: "one", 2: "two"})
def test_str_to_struct_map_round_trip(self) -> None:
self._test_map_round_trip(
{
"one": thrift_types.struct_map_string_i32(field_1={"one": 1}),
"two": thrift_types.struct_map_string_i32(field_1={"two": 2}),
}
)
def test_thrift_map_round_trip(self) -> None:
self._test_map_round_trip(
thrift_types.struct_map_string_i32(field_1={"one": 1}).field_1
)
| [
"facebook-github-bot@users.noreply.github.com"
] | facebook-github-bot@users.noreply.github.com |
3355b64a3de450994ba4ceeab1aa8a93558c962b | ada2c8c05027f523d29fa0f60c642fa537fc074d | /src/app/settings.py | 02eb23aa1a4dd64717e3643dda0e9a61aaf1eb77 | [] | no_license | Tehtehteh/sendify | fc9290a90ead2d4107ec09b956dbfe927a6b63cc | c4f236fb7877b7d99eafce75f38d05a1d1ef01a7 | refs/heads/master | 2020-03-21T03:55:22.478681 | 2018-06-24T19:11:22 | 2018-06-24T19:11:22 | 138,081,213 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,296 | py | import os
import logging
from copy import deepcopy
logger = logging.getLogger('application')
async def create_settings():
return Settings.from_defaults()
class Settings(object):
_defaults = {
'app': {
'port': 8080,
},
'db': {
'host': 'localhost',
'user': 'sendify',
'password': '',
'database': 'sendify'
}
}
def __init__(self, settings_dict):
self.settings_dict = deepcopy(self._defaults)
self.settings_dict.update(settings_dict)
@classmethod
def from_defaults(cls):
return cls(cls._defaults)
@classmethod
def from_file(cls, path):
if not os.path.exists(path):
logging.warning('Configuration file %s not found. Using system defaults.')
return cls.from_defaults()
_, ext = os.path.splitext(path)
if ext in ('.yml', '.yaml'):
import yaml
with open(path) as file_handler:
settings_dict = yaml.load(file_handler)
return cls(settings_dict)
if ext in ('.cfg', '.ini'):
import configparser
cfg = configparser.ConfigParser(allow_no_value=True)
cfg.read(path)
return cls(cfg._sections)
| [
"tehfvpr@gmail.com"
] | tehfvpr@gmail.com |
21bc273b168a4292b9ba2c6ea2d0ece7a0b03517 | 018e9acbf1a7e8dca939095082cd2cb490a08029 | /recommender_system_matrix_factorization/pyspark_MF.py | 0f20746e86d63838f31ff247e74a3cd0d0b0ea05 | [] | no_license | C-Dongbo/machine_learning | 9843e47a6164daa9032b9b89af318b26ffe7d286 | a0a82e0b645a449935575c7c6bf462913ae279fb | refs/heads/master | 2021-03-01T14:29:22.946163 | 2020-09-27T23:23:51 | 2020-09-27T23:23:51 | 245,792,535 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 847 | py | import numpy as np
import pandas as pd
import pyspark
from pyspark import SparkContext
from pyspark.sql import SQLContext
from pyspark.mllib.recommendation import ALS, MatrixFactorizationModel, Rating
sc = SparkContext(master="local", appName="first app")
df_rdd = sc.textFile('./data/ml-1m/ratings.dat').map(lambda x: x.split("::"))
ratings= df_rdd.map(lambda l : Rating(int(l[0]),int(l[1]),float(l[2])))
X_train, X_test= ratings.randomSplit([0.8, 0.2])
rank = 10
numIterations = 10
model = ALS.train(X_train, rank, numIterations)
testdata = X_test.map(lambda p: (p[0], p[1]))
predictions = model.predictAll(testdata).map(lambda r: ((r[0], r[1]), r[2]))
ratesAndPreds = X_test.map(lambda r: ((r[0], r[1]), r[2])).join(predictions)
MSE = ratesAndPreds.map(lambda r: (r[1][0] - r[1][1])**2).mean()
print("Mean Squared Error = " + str(MSE)) | [
"chlehdrms3@gmail.com"
] | chlehdrms3@gmail.com |
19118ac2682ba0a41cc6ecf02fba8d63dfcff830 | f575ab0c484632ca7b8fe21760500fdc514ee355 | /code_chef_programs/Beginner/Days_in_month.py | f576c38f6c406f5d51f90239df6314d2bb8874eb | [] | no_license | sonalisaraswat/My-Programs | dae042327c7f1076d51e98ef28166c0784b50570 | 2b3ef3804b12db34dc1efe26ab9a383fd65a29f5 | refs/heads/master | 2018-09-06T07:08:32.939030 | 2018-06-25T14:48:33 | 2018-06-25T14:48:33 | 117,707,210 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 577 | py | for t in range(int(input())):
w,s=[ch for ch in input().split()]
L1=[4,4,4,4,4,4,4]
L2=['mon','tues','wed','thurs','fri','sat','sun']
if(int(w)==28):
print(*L1,sep=' ')
elif(int(w)==29):
ind = L2.index(s)
L1[ind] += 1
print(*L1, sep=' ')
elif (int(w)==30):
ind = L2.index(s)
L1[ind] += 1
L1[(ind+1)%7] += 1
print(*L1, sep=' ')
else:
ind = L2.index(s)
L1[ind] += 1
L1[(ind + 1)%7] += 1
L1[(ind + 2)%7] += 1
print(*L1, sep=' ') | [
"noreply@github.com"
] | noreply@github.com |
613a05d5b9323597ee0f9e94723dca996486037c | 527a8996239ce00c469642ba6e15406afe15c70c | /cybersecmodule/cybersecmodule/urls.py | c56e5fabed14c8617c13e62d8c023f101817d0db | [] | no_license | gabrielgamero/pythonapp2 | 596302ee525dc75d6b34d8c8e8805f503e6b1f94 | b2a1594641e35e8ebbcb5639344b81f8b625cd64 | refs/heads/master | 2023-03-13T15:15:17.653599 | 2021-03-12T03:56:45 | 2021-03-12T03:56:45 | 346,925,959 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 817 | py | """cybersecmodule URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import include, path
urlpatterns = [
path('admin/', admin.site.urls),
path('cybersecurity/', include('webapi.urls')),
]
| [
"gabriel.gamero@pucp.pe"
] | gabriel.gamero@pucp.pe |
5a9714251bbb986adb690630e02932243d1f0693 | ed4230d4dc48477a25528c76c159ae934ef2b5a6 | /2019_2-Proyecto_Taller_Django/diazstone/inicio/migrations/0010_fotito.py | c921235c3d0992798afc01a45a50889e8e690e38 | [] | no_license | Yhatoh/USM-Tareas | 2092bf87a5bd48e7414c5e048bd7b5b2fbebff7c | 939be727b0ba82426c7c8ce4661e1c1c626a6987 | refs/heads/master | 2023-02-21T13:27:33.185330 | 2021-01-25T03:12:46 | 2021-01-25T03:12:46 | 324,416,603 | 3 | 0 | null | null | null | null | UTF-8 | Python | false | false | 535 | py | # Generated by Django 2.2.6 on 2019-10-10 05:41
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('inicio', '0009_auto_20191009_2057'),
]
operations = [
migrations.CreateModel(
name='Fotito',
fields=[
('foto', models.TextField(null=True, verbose_name='Foto')),
('jugador', models.CharField(max_length=20, primary_key=True, serialize=False, verbose_name='Jugador')),
],
),
]
| [
"gacarmonat@gmail.com"
] | gacarmonat@gmail.com |
84aadccad73e8e097a909f5cd923cc4bfa9a9772 | 9e54fca9aaa7f96d4084606465ebe20f4789d229 | /export.py | f8d94e123cc8c04026be91dbe45a5d97e35b3adc | [
"Apache-2.0"
] | permissive | AliceWn/git-rv | c05dbaba52097c5c30d9f55ee79ea17162e66de7 | 918a4adae67f43fe4cafeafbc086f089f60e31a6 | refs/heads/master | 2020-05-15T19:42:50.603260 | 2015-09-23T20:48:13 | 2015-09-23T20:48:13 | 182,462,578 | 0 | 0 | Apache-2.0 | 2019-04-20T23:06:45 | 2019-04-20T23:06:45 | null | UTF-8 | Python | false | false | 16,180 | py | # Copyright 2013 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Export command for git-rv command line tool.
Allows exporting a new issue for review and interacting with that issue
by changing reviewers, submitting new patches and doing various other
things.
"""
from upload import RealMain
import utils
from utils import GitRvException
class ExportAction(object):
"""A state machine which exports a commit to a review.
Attributes:
state: The current state of the ExportAction state machine.
__branch: The current branch when the action begins.
__current_head: The HEAD commit in the current branch.
__rietveld_info: RietveldInfo object associated with the current branch.
__commit_message_overridden: Boolean indicating whether the git commit
message for the change being exported was overridden by command
line arguments.
__commit_subject: The commit subject passed in from the command line or
inferred from the actual commit being exported.
__commit_description: The commit description passed in from the command
line or inferred from the actual commit being exported.
__argv: A list of strings containing the actual command line arguments.
__no_send_mail: Boolean representing whether or not --send_mail should
be added to the upload.py call.
"""
STARTING = 0
UPLOADING_ISSUE = 1
UPDATING_ISSUE = 2
UPDATING_METADATA = 3
FINISHED = 4
@property
def rietveld_info(self):
"""Simple accessor for stored RietveldInfo on Export.
This is intended to be used by other actions (such as sync) that might
need to access the RietveldInfo after an ExportAction completes.
"""
return self.__rietveld_info
# TODO(dhermes): Make sure things can be re-wound?
# Final vs. in-progress in metadata.
def __init__(self, current_branch, args, commit_subject=None,
commit_description=None, no_send_mail=False, argv=None):
"""Constructor for ExportAction.
Saves some environment data on the object such as the current branch and
the metadata for the current branch.
Args:
current_branch: String; containing the name of a branch.
args: An argparse.Namespace object to extract parameters from.
commit_subject: The title for a commit message for the given review
export. Defaults to None, in which case the git commit message
of the most recent commit is used (or the user is allowed to
pick one among the commits since last export).
commit_description: The description for a commit message for the
given review export. Defaults to None, in which case the git
commit message of the most recent commit is used (or the user
is allowed to pick one among the commits since last export).
no_send_mail: Boolean representing whether or not --send_mail should
be added to the upload.py call.
argv: The original command line arguments that were parsed to create
args. These may be used in a call to upload.py.
"""
self.__branch = current_branch
self.__current_head = utils.get_head_commit(
current_branch=self.__branch)
self.__rietveld_info = utils.RietveldInfo.from_branch(
branch_name=self.__branch) or utils.RietveldInfo(self.__branch)
self.__update_rietveld_info_from_args(args)
# Add remote info if it isn't already there.
if self.__rietveld_info.remote_info is None:
remote_info = utils.get_remote_info(current_branch=self.__branch)
self.__rietveld_info.remote_info = remote_info
self.__rietveld_info.save()
# TODO(dhermes): Should we check if the subject is Truth-y?
if (commit_subject is None) ^ (commit_description is None):
raise GitRvException('Subject and description must either both be '
'specified or both be left out.')
# Only need to check commit_subject since above also guarantees that
# commit_description will also be non-null.
self.__commit_message_overridden = commit_subject is not None
commit_subject, commit_description = self.__get_commit_message_parts(
commit_subject, commit_description)
self.__commit_subject = commit_subject
self.__commit_description = commit_description
self.__argv = argv
self.__no_send_mail = no_send_mail
self.state = self.STARTING
self.advance()
def __update_rietveld_info_from_args(self, args):
"""Updates the current rietveld_info with args from the command line.
Args:
args: An argparse.Namespace object to extract parameters from.
"""
self.__rietveld_info.server = args.server
self.__rietveld_info.private = args.private
if args.cc is not None:
self.__rietveld_info.cc = args.cc
if args.host is not None:
self.__rietveld_info.host = args.host
if args.reviewers is not None:
self.__rietveld_info.reviewers = args.reviewers
def __get_commit_message_parts(self, commit_subject, commit_description):
"""Gets commit subject and description for the current patch set.
If the current message passed in is not None, uses that. Otherwise asks
the prompts the user to choose from the local commits.
NOTE: This assumes commit_subject and commit_description are either both
null or both strings and leaves it up to the caller to check.
Args:
commit_subject: String containing the commit subject. This will be
from the constructor, where it defaults to None.
commit_description: String containing the commit description. This
will be from the constructor, where it defaults to None.
Returns:
Tuple of string containing the commit subject and remaining
description as strings. This pair will have been chosen by
the user.
"""
if commit_subject is not None:
return commit_subject, commit_description
if self.__rietveld_info.review_info is None:
# RemoteInfo always populated in callback()
remote_branch = self.__rietveld_info.remote_info.remote_branch_ref
last_commit = self.__rietveld_info.remote_info.commit_hash
else:
remote_branch = None
last_commit = self.__rietveld_info.review_info.last_commit
return utils.get_user_commit_message_parts(
last_commit, self.__current_head, remote_branch=remote_branch)
@classmethod
def callback(cls, args, argv):
"""A callback to begin an ExportAction after arguments are parsed.
If the branch is not in a clean state, won't create an ExportAction,
will just print 'git diff' and proceed.
Args:
args: An argparse.Namespace object to extract parameters from.
argv: The original command line arguments that were parsed to create
args. These may be used in a call to upload.py.
Returns:
An instance of ExportAction. Just by instantiating the instance, the
state machine will begin working.
"""
current_branch = utils.get_current_branch()
if not utils.in_clean_state():
print 'Branch %r not in clean state:' % (current_branch,)
print utils.capture_command('git', 'diff', single_line=False)
return
if args.no_mail and args.send_patch:
raise GitRvException('The flags --no_mail and --send_patch are '
'mutually exclusive.')
# This is to determine whether or not --send_mail should be added to
# the upload.py call. If --send_patch is set, we don't need to
# send mail. Similarly if --no_mail is set, we should not send mail.
no_send_mail = args.no_mail or args.send_patch
# Rietveld treats an empty string the same as if the value
# was never set.
if args.message and not args.title:
raise GitRvException('A patch description can only be set if it '
'also has a title.')
commit_subject = commit_description = None
if args.title:
if len(args.title) > 100:
raise GitRvException(utils.SUBJECT_TOO_LONG_TEMPLATE %
(args.title,))
# If args.message is '', then both the Title and Description
# will take the value of the title.
commit_subject = args.title
commit_description = args.message or ''
return cls(current_branch, args, commit_subject=commit_subject,
commit_description=commit_description,
no_send_mail=no_send_mail, argv=argv)
def assess_review(self):
"""Checks if the branch is in a review or starting a new one.
If not in a review, sets state to UPLOADING_ISSUE, else to
UPDATING_ISSUE.
Updates the state based on whether a review is in progress or just
beginning and advances the state machine.
"""
if utils.in_review(rietveld_info=self.__rietveld_info):
self.state = self.UPDATING_ISSUE
else:
self.state = self.UPLOADING_ISSUE
self.advance()
def __upload_dot_py(self, issue=None):
"""Calls upload.py with current command line args and branch metadata.
Args:
issue: Integer; containing an ID of a code review issue. Defaults to
None and is ignored in that case.
Returns:
The string output of the call to upload.py.
Raises:
GitRvException: If the first command line argument isn't
utils.EXPORT.
"""
if self.__argv[0] != utils.EXPORT:
raise GitRvException('upload.py called by method other than '
'git-rv export.')
# Create copy of argv to update, drop the command being executed
command_args = self.__argv[1:]
# TODO(dhermes): Catch failure if this lookup breaks.
remote_commit_hash = self.__rietveld_info.remote_info.last_synced
command_args.append(utils.REVISION_TEMPLATE % (remote_commit_hash,))
# VCS is always git
command_args.append(utils.VCS_ARG)
# Auth method is always OAuth 2.0 and never use cookies
command_args.extend(utils.OAUTH2_ARGS)
# Send mail unless explicitly told not to
if not self.__no_send_mail:
command_args.append(utils.SEND_MAIL_ARG)
# Add any issue
if issue is not None:
command_args.append(utils.ISSUE_ARG_TEMPLATE % (issue,))
# Add the message if it wasn't overridden
if not self.__commit_message_overridden:
command_args.extend(['-t', self.__commit_subject,
'-m', self.__commit_description])
# Make sure to execute upload.py
command_args.insert(0, 'upload.py')
# RealMain returns (issue, patchset)
return long(RealMain(command_args)[0])
def upload_issue(self):
"""Uploads a new issue.
If successful, sets state to UPDATING_METADATA.
"""
issue = self.__upload_dot_py()
self.state = self.UPDATING_METADATA
self.advance(issue=issue,
initial_subject=self.__commit_subject,
initial_description=self.__commit_description)
def update_issue(self):
"""Updates an existing issue.
If successful, sets state to UPDATING_METADATA.
"""
do_upload = True
if self.__rietveld_info.review_info.last_commit == self.__current_head:
print 'You have made no commits since your last export.'
print 'Exporting now will upload an empty patch, but may'
print 'update your metadata.'
answer = raw_input('Would like to upload to Rietveld?(y/N) ')
do_upload = (answer.strip() == 'y')
# TODO(dhermes): Use different mechanism than upload if there are
# no changes.
if do_upload:
self.__upload_dot_py(issue=self.__rietveld_info.review_info.issue)
self.state = self.UPDATING_METADATA
self.advance()
def update_metadata(self, issue=None, initial_subject=None,
initial_description=None):
"""Updates the Rietveld metadata associated with the current branch.
If successful, sets state to FINISHED and advances the state machine.
NOTE: This assumes initial_subject and initial_description are either
both null or both strings and leaves it up to the caller to check.
Args:
issue: Integer; containing an ID of a code review issue.
initial_subject: String containing the commit subject. Used when
creating a new issue via upload.py. Defaults to None.
initial_description: String containing the commit description. Used
when creating a new issue via upload.py. Defaults to None.
"""
review_info = utils.ReviewInfo(last_commit=self.__current_head)
# TODO(dhermes): Throw exception if one of these is None while the
# the other isn't?
if issue is not None and initial_subject is not None:
review_info.issue = issue
review_info.subject = initial_subject
if initial_description != initial_subject:
review_info.description = initial_description
else:
review_info.description = ''
self.__rietveld_info.review_info = review_info
self.__rietveld_info.save()
success, _ = utils.update_rietveld_metadata_from_issue(
rietveld_info=self.__rietveld_info)
if success:
print 'Metadata update from code server succeeded.'
else:
print 'Metadata update from code server failed.'
print 'To try again run:'
print '\tgit rv getinfo --pull-metadata'
self.state = self.FINISHED
self.advance()
def advance(self, *args, **kwargs):
"""Advances by calling the method corresponding to the current state.
Args:
*args: Arguments to be passed to the specified method based on
the current state.
**kwargs: Keyword arguments to be passed to the specified method
based on the current state.
Raises:
GitRvException: If this method is called and the state is not one
of the valid states.
"""
if self.state == self.STARTING:
self.assess_review(*args, **kwargs)
elif self.state == self.UPLOADING_ISSUE:
self.upload_issue(*args, **kwargs)
elif self.state == self.UPDATING_ISSUE:
self.update_issue(*args, **kwargs)
elif self.state == self.UPDATING_METADATA:
self.update_metadata(*args, **kwargs)
elif self.state == self.FINISHED:
return
else:
raise GitRvException('Unexpected state %r in ExportAction.' %
(self.state,))
| [
"dhermes@google.com"
] | dhermes@google.com |
a574f989e0cfb49efad5504ef1959e4592372c4b | 0a5b1693b93dcd23b7b56ed888dd0a3fda78e90f | /usersapp/urls.py | 411dc70ddb3f3d7a9878c59656f0389abf89ce5f | [] | no_license | welz-atm/NoteAppDjangoandRN | 831859b5202ef34b536f747dead7290911e6f2ec | 6d575810208f2215b8d9fdd1917fdfef7b931b64 | refs/heads/master | 2023-01-07T17:08:29.770201 | 2020-11-06T16:03:26 | 2020-11-06T16:03:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 529 | py | from django.urls import path
from usersapp.api.views import register_user, change_password, ObtainAuthTokenView, AllUsers
from rest_framework.urlpatterns import format_suffix_patterns
app_name = 'notesapp'
urlpatterns = [
path('register/', register_user, name='register_user'),
path('list/', AllUsers.as_view(), name='list'),
path('change_password/', change_password, name='change_password'),
path('login/', ObtainAuthTokenView.as_view(), name='token_view'),
]
urlpatterns = format_suffix_patterns(urlpatterns) | [
"59687594+welz-atm@users.noreply.github.com"
] | 59687594+welz-atm@users.noreply.github.com |
0f0f679d63b3379178b8318f35c97e7382f885c9 | 9f5648f4b50d7657f3692b20e4a8d6761af7f9bf | /manage.py | 18a6d194bf48e15ecad6ff89ce45df50ac58280d | [] | no_license | DevelopWithAP/quality_control | 2fe2617bbffdb814e2d68b60a17fcd09408c5afd | 41b7eaadcd6e65029f8fb359923dd48ba9f033c7 | refs/heads/master | 2023-08-27T06:09:18.013082 | 2021-11-08T15:57:02 | 2021-11-08T15:57:02 | 398,589,894 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 671 | py | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'quality_control.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
) from exc
execute_from_command_line(sys.argv)
if __name__ == '__main__':
main()
| [
"apostolisparga@gmail.com"
] | apostolisparga@gmail.com |
d4d14e7908dbf00e1dc37aa7dda53942b6749f3f | 7020c615dbc3391c43869e6b8f58a30860f1206b | /app/views.py | 86821cddd3e2ccaf5238ab27d20e143402eccaec | [] | no_license | jerrylizilong/autotest_platform | ae6358c95b14dd09757ee9c7fd5d3aa5c677689b | 6c43ee096396a6568d3e1dd2844a26f74e73611e | refs/heads/master | 2023-08-17T23:20:33.895934 | 2023-08-05T14:04:18 | 2023-08-05T14:04:18 | 142,558,059 | 649 | 268 | null | 2023-08-05T14:04:20 | 2018-07-27T09:36:53 | JavaScript | UTF-8 | Python | false | false | 883 | py | from flask import render_template, session
from app.view import user
from app import app
@app.route('/')
@app.route('/index')
@user.authorize
def index():
list = session.get('user', None)
username = list[0]["username"]
return render_template("util/index.html", message='Hello, %s' % username)
@app.route('/test')
def index1():
user = { 'nickname': 'Miguel' } # fake user
return render_template("util/500.html")
@app.errorhandler(404)
def page_not_found(e):
return render_template('util/404.html',message = 'Sorry , page not found!'), 404
@app.errorhandler(500)
def internal_server_error(e):
return render_template('util/500.html', message = 'Something is wrong ,please retry !'), 500
def getInfoAttribute(info,field):
try:
value = info.get(field)
except:
value = ''
if value == None:
value = ''
return value
| [
"lizion138@163.com"
] | lizion138@163.com |
8528817f2e818ab95c640dec2fbc42d988e68de4 | 8bd63bc56b39d26458ad54b7f18c4b149c1e3ce2 | /sphinx-files/rst-files/Data/code/2011/11/000032/binary_liquid_mixture_immiscibility_and_stability.py | d86c0be99462bbdd27b0749ff15621910c02ba82 | [
"CC0-1.0",
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-public-domain-disclaimer"
] | permissive | isabella232/scipy-central-rescue | 43270c0e1850b989fbe9a5b1a06c3be11d16464a | 2b331610d52c189ae96bea4f4ce2ec343146b608 | refs/heads/master | 2021-09-06T09:17:30.627497 | 2018-02-04T19:41:11 | 2018-02-04T19:41:11 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 4,469 | py | # License: Creative Commons Zero (almost public domain) http://scpyce.org/cc0
#Determines regions of immiscibility and any limits of essential instability
#for a binary liquid mixture of components B and C. the excess Gibbs energy of
#mixing is given explicitly by an empirical equation:
#deltaGex/RT = xBxC[k1+k2(xB-xC)+k3(xB-xC)^2] where xB+xC=1
import numpy as np
from matplotlib.pylab import *
# These are the functions called by the bisection method
def f(x, id):
if id == 1:
return (-2 * (k1 + k2 * (6 * x - 3) + k3 * (24 * x**2 - 24 * x + 5))
+ 1 / (x - x**2))
elif id == 2:
return (-2 * k1 * x + k1 + k2 * (-6 * x**2 + 6 * x - 1) + k3 *
( -16 * x**3 + 24 * x**2 - 10 * x + 1) + log(x) - log(1 - x))
elif id == 3:
return (dummys - (-2 * k1 * x + k1 + k2 * (-6 * x**2 + 6 * x - 1) +
k3 * (-16 * x**3 + 24 * x**2 - 10 * x + 1) +
log(x) - log(1 - x)))
#This function is to calculate values for the y-axis on the figure
def g(x):
return (x * (1 - x) * (k1 + k2 * (x - (1 - x)) + k3 * (x - (1 - x))**2) +
x * log(x) + (1 - x) * log(1 - x))
#The incremental search method is used to start off the bisection method
def incremental(x0,xf,id):
dx = (xf - x0) / 998
for i in range(998):
y1 = f(x0,id)
y2 = f(x0 + (i + 1) * dx,id)
if y1 * y2 < 0:
for j in range(10):
y1 = f(x0 + i * dx,id)
y2 = f(x0 + i * dx + (j + 1) * dx/10,id)
if y1 * y2 < 0:
x1 = x0 + i * dx + j * dx / 10
x2 = x0 + i * dx + (j + 1) * dx / 10
y1 = f(x1,id)
y2 = f(x2,id)
return x1, x2, y1, y2
# Bisection method used to solve for non-linear equation
def bisec(x0,xf,id):
x1, x2, y1, y2 = incremental(x0,xf,id)
e = 1
while e > 1e-6:
x3 = (x1 + x2) / 2
y3 = f(x3,id)
if y1 * y3 < 0:
x2 = x3
y2 = y3
else:
x1 = x3
y1 = y3
e = abs(1 - (x1 / x2))
return x2
# Constants
k1 = 2.0
k2 = 0.2
k3 = -0.8
#Set up vectors of composition values
xB = np.linspace(0.001,0.999,101)
xC = 1 - xB
#This is deltaG/RT calculated from the excess Gibbs given at top
deltaGoverRT = (xB * xC * (k1 + k2 * (xB - xC) + k3 * (xB - xC)**2) +
xB * log(xB) + xC * log(xC))
#First and second derivative of deltaG/RT
derivative = (-2 * k1 * xB + k1 + k2 * (-6 * xB**2 + 6 * xB - 1) + k3 *
(-16 * xB**3 + 24 * xB**2 - 10 * xB + 1) + log(xB) - log(1 - xB))
derivative2 = (-2 * (k1 + k2 * (6 * xB - 3) + k3 * (24 * xB**2 - 24 * xB + 5))
+ 1 / (xB - xB**2))
#find spinodal points for instability region using bisection method
xspin1 = bisec(0.001, 0.999, 1)
xspin2 = bisec(xspin1, 0.999, 1)
#initial guess at binodal points at minima of function
xB1 = bisec(0.001, 0.999, 2)
xB2 = bisec(xB1, 0.999, 2)
xB3 = bisec(xB2, 0.999, 2)
xBa = xB1
xBb = xB3
#Solve for binodal points using bisection method
converged = False
while not converged:
dummys = (g(xBb) - g(xBa)) / (xBb - xBa) #dummy slope
e = abs(1 - (dummys / f(xBb, 2)))
if e < 1e-4:
converged = True
else:
xBa = bisec(0.001, 0.999, 3)
xBu = bisec(xBa, 0.999, 3)
xBb = bisec(xBu, 0.999, 3)
yint = g(xBa) - dummys * xBa
y = yint + dummys * xB
figure()
plot(xB, deltaGoverRT, '-')
plot(xB, y, '-')
plot(xB1, g(xB1), '.', color='blue', markersize=12)
plot(xB3, g(xB3), '.', color='blue', markersize=12)
plot(xBa, g(xBa), '.', color='red', markersize=12)
plot(xBb, g(xBb), '.', color='red', markersize=12)
plot(xspin1, g(xspin1), '.', color='orange', markersize=12)
plot(xspin2, g(xspin2), '.', color='orange', markersize=12)
grid('on')
xlabel(' xB ')
ylabel(' deltaG/RT ')
title('DeltaG/RT vs xB')
show()
print 'There is one-phase instability between xB = ', "%.2f" % xspin1,
'and xB = ', "%.2f" % xspin2
print '(Orange points on figure, "spinodal points")'
print 'The region of immiscibility is between xB = ', "%.2f" % xBa,
'and xB = ', "%.2f" % xBb
print '(Red points on figure, "binodal points")'
print 'Blue points on fig show minima, which do not equal to the binodal points' | [
"jiayue.li@berkeley.edu"
] | jiayue.li@berkeley.edu |
6bef0061951f422698c3e7c02ff2d483b56ab394 | 599caedb27dbd4573a8f717f23cd652b30aa6574 | /main.py | d6abf6b38e71c9357c910ead0a50d31de0f6a736 | [] | no_license | Kaedenn/Kaye | d3b752409fccad96fd8c45ed105a4692d2d81a66 | d57a195088b2108be24c7a97cab9dc9b7c5d87b9 | refs/heads/master | 2020-05-18T05:12:31.502003 | 2016-02-14T01:04:38 | 2016-02-14T01:04:38 | 31,037,482 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 182 | py | #!/usr/bin/env python
"""
Kaye--a remake of Neru Kye, which is a remake of Kye.
"""
import sys
import source
if __name__ == "__main__":
game = source.kaye.Kaye()
game.main()
| [
"kaedenn@gmail.com"
] | kaedenn@gmail.com |
5a347c87bc2dbee5984e90800c414e99838da150 | 40a9818f59f430992be53b428851ddf476e866f4 | /SparkCourse/total-spent.py | b3cb6b27cd2ad63c9f01bc3e70f2a86660a4c5f0 | [] | no_license | fejxc/python | baed124af1e796aebf202a4c0c99e93b3688ccce | b3566d9ffffad78158ac67cb4c02badaac544bea | refs/heads/master | 2023-05-04T11:17:35.003910 | 2021-05-25T15:51:50 | 2021-05-25T15:51:50 | 287,763,446 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 565 | py | from pyspark import SparkConf, SparkContext
conf = SparkConf().setMaster("local").setAppName("FriendsByAge")
sc = SparkContext(conf = conf)
def parseLine(line):
fields = line.split(',')
customer_ID = int(fields[0])
amount_spent = float(fields[2])
return ( customer_ID, amount_spent)
lines = sc.textFile("file:///Users/sunyun/Downloads/SparkCourse/customer-orders.csv")
rdd = lines.map(parseLine)
totalsByCustomer = rdd.reduceByKey(lambda x, y: x + y)
results = totalsByCustomer.collect()
for result in results:
print(result)
| [
"1031364436@qq.com"
] | 1031364436@qq.com |
1d50097e0a83ffa78fdcb9bc614bf2bf6cbe3300 | a4d5fc4fc6f528bae0b1c352010aa816e3e7dcb6 | /analysis/sorting_busan.py | e664bc467531e5c5f297161c6c7b46803b46d2a5 | [] | no_license | sseung30/project | b3bb5cdb7770ecd95c70f8669190ffc62bda50fc | 5bc72410c1eb7375e72203e61c3bd18d56f81811 | refs/heads/master | 2022-12-03T23:08:51.679822 | 2020-08-23T18:30:26 | 2020-08-23T18:30:26 | 289,080,846 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,083 | py | #!/usr/bin/env python
# coding: utf-8
# In[1]:
get_ipython().run_line_magic('matplotlib', 'inline')
import numpy as np
import pandas as pd
from datetime import datetime
import warnings
warnings.filterwarnings('ignore')
# In[2]:
# 한국어 표시를 위해 나눔스퀘어 사용
# matplotlib 폰트설정
plt.rc('font', family='NanumSquareOTF') # For MacOS
# In[3]:
station = pd.read_csv('busan_tube_station.csv', encoding = 'CP949')
station.head()
# In[4]:
station2 = station[['역코드','역명','역주소']]
station2 = station2.rename(columns = {'역코드':'역번호'})
adress_split = station2['역주소'].str.split(" ")
station2["구"] = adress_split.str.get(1)
station2['구']
# In[5]:
station2 = station2[['역번호', '역명','구']]
station2
# In[6]:
#역이름 통일 : 뒷글자'역'제거
station2['역명'] = station2['역명'].str.replace('역','')
# In[7]:
#역명 추가 수정 딕셔너리
di = {'부산':'부산역', '서면(1)':'1서면','연산(1)':'1연산','동래(1)':'1동래',
'시립미술관':'벡스코','수영':'수영','경성대·부경대':'경성대부경대',
'국제금융센터·부산은행':'국제금융센터','서면(2)':'2서면','덕천(2)':'2덕천',
'부산대 양산캠퍼스':'부산대양산', '연산(3)':'3연산', '미남(3)':'미남', '미남(4)':'미남',
'덕천(3)':'3덕천', '동래(4)':'4동래', '반여농산물시장':'반여농산물','동부산대학':'동부산대',
'수영':'수영', '수영(2)':'수영', '사상(2)':'사상'}
#역명수정
station2["역명"].replace(di, inplace=True)
station2
# In[8]:
busan_pre = pd.read_csv('busan_pre.csv', encoding = 'CP949', lineterminator='\n', thousands = ',')
busan_pre['합계'] = busan_pre.sum(axis=1)
#월만 남기기
date_split = busan_pre['년월일'].str.split("-")
busan_pre["년월"] = date_split.str.get(0) + "-" + date_split.str.get(1)
busan_pre
# In[9]:
#승하차 정보에 구 정보 추가
merge_df = pd.merge(station2, busan_pre, how='right')
merge_df
# In[10]:
#구NaN인 데이터 확인
merge_df_nan = merge_df[merge_df['구'].isnull()]
merge_df_nan['역명'].unique()
# In[11]:
#구 NaN데이터 역명 보기 (dic 만들기 위해 station2 역명 찾기용)
station2.loc[station2['역명'].str.contains('사상')]
# In[12]:
#필요데이터만 남기기
merge_df = merge_df.filter(['역명', '구', '년월', '합계' ])
merge_df
# In[13]:
#구별, 년월 합계
gu_sum = merge_df.groupby(['년월','구']).sum()
gu_sum = pd.DataFrame(gu_sum).reset_index()
gu_sum = gu_sum.rename({'합계':'구별-월-승하차인원'}, axis=1)
gu_sum
# In[16]:
#구별, 년월, 최대승하차역
gu_max = merge_df.groupby(['년월','구']).max()
gu_max = pd.DataFrame(gu_max).reset_index()
gu_max = gu_max.rename({'합계':'최대역-승하차인원','역명':'최대승하차역'}, axis=1)
gu_max
# In[17]:
#표 하나로 합치기
result = pd.merge(gu_sum, gu_max)
result
# In[18]:
#저장
result.to_csv("busan_result", encoding = 'utf-8-sig')
# In[ ]:
| [
"noreply@github.com"
] | noreply@github.com |
6c25422c8ff41dbdd27f33cd691c33afb6f7064f | 17e9b949c0ee60a24673583ad1f7296e00512ab1 | /backend/isic/isic_crawler.py | f3570005f65cfcf529446b2e3e6ab0869fe854b3 | [
"MIT"
] | permissive | Huy-Ngo/skin-crawler | 5a47aa1fdfffae71ee0bcfb158a709e5ae6aab00 | fada2c8608dd01c06d7987a409854ca86dee2ea1 | refs/heads/main | 2023-01-30T03:47:08.428625 | 2020-12-02T07:00:47 | 2020-12-02T07:00:47 | 311,970,798 | 4 | 3 | MIT | 2020-12-02T07:00:49 | 2020-11-11T12:55:37 | Python | UTF-8 | Python | false | false | 4,051 | py | import requests
import os
from io import BytesIO
from PIL import Image, ImageFile
ImageFile.LOAD_TRUNCATED_IMAGES = True
"""A module to fetch data from International Skin Imaging Collaboration API
For further information about the API: https://isic-archive.com/api/v1/
"""
def ISIC_request(response, num=100):
"""Fetching the metadata from images in ISIC archive by sending a HTTP
request to the ISIC's REST API.
Parameters:
num(int): Number of the images you get from the archive,default is 100
Returns:
Json: Response metadata in JSON format
"""
start_url = f'https://isic-archive.com/api/v1/image?limit={num} \
&sort=name&sortdir=1&detail=true'
headers = {'Accept': 'application/json'}
r = requests.get(start_url, headers=headers)
data = r.json()
return data
def check_dermoscopic(meta):
"""Checking if a image is acquired through dermoscopy by ISIC's API.
Parameter:
meta: The metadata of the image getting through the API
Return:
True if the image is acquired through dermoscopy, False if it isn't
"""
if "image_type" not in meta["meta"]["acquisition"]:
return False
elif not str(meta["meta"]["acquisition"]["image_type"]) == "dermoscopic":
return False
return True
def check_melanoma(metadata):
"""Checking if a image is confirmed melanocytic by ISIC's API.
Parameter:
metadata: The metadata of the image getting through the API
Return:
True if the image is confirmed melanocytic, False if it isn't
"""
if "melanocytic" not in metadata["meta"]["clinical"]:
return False
elif not metadata["meta"]["clinical"]["melanocytic"]:
return False
return True
def ISIC_getdata(numjson=20, numimage=20,
dermo_filter=False,
melano_filter=False,
path=os.getcwd()):
"""Download images of dermoscopic images and return their metadata.
Parameters:
numjson(int): Number of datasets of images from ISIC_request().
numimage(int): Number of images you want from the dataset.
Should be more than numjson.
dermo_filter(bool): Get only want images acquired by dermoscopy
melano_filter(bool): Get you only want images confirmed melanocytic
Return: List of the metadata of the images downloaded
"""
if (numjson < numimage):
print("Invalid parameters")
else:
dataset = ISIC_request(numjson)
image_data = {}
datalist = []
i = 0
dir = path+"/static/isic/"
if not os.path.exists(dir):
os.makedirs(dir)
for set in dataset:
if(dermo_filter is False or check_dermoscopic(set) and
melano_filter is False or check_melanoma(set)):
image_data['Name'] = str(set['name'])
image_data['Caption'] = str(set['_id'])
download_path = f'{dir}{image_data["Name"]}.jpg'
is_downloaded = os.path.exists(download_path)
if not is_downloaded:
headers = {
'Accept': 'application/json'
}
r = requests.get("https://isic-archive.com/api/v1/image/" +
str(set['_id'])+"/download",
headers=headers)
img = Image.open(BytesIO(r.content))
img.save(download_path)
datalist.append(image_data.copy())
i += 1
if(i == numimage):
break
formatted_datalist = []
for data in datalist:
formatted_data = {
'image': f'static/isic/{data["Name"]}.jpg',
'host': 'ISIC API',
'original': 'https://isic-archive.com/api/v1/',
'title': f'ISIC {data["Caption"]}'
}
formatted_datalist.append(formatted_data)
return formatted_datalist
| [
"noreply@github.com"
] | noreply@github.com |
24cbc9c4271d2f7d14986f9fe038a23070e18c79 | 2fd6fdb39f3c62d1d9dac0fdbb20ba077f204a9d | /Acquire_Valued_Shopper_Challenge/gen_vw_features.py | 57652060d9936d4e28ff0e6b4596590f85c7aabb | [
"MIT"
] | permissive | snafis/Kaggle | 60443822c516c52a7a88ca46b44ed194bfd31d62 | c617c7fa47aa9cbf7a236559b53ba190622a4e5f | refs/heads/master | 2022-09-06T09:57:25.760379 | 2020-05-25T04:34:10 | 2020-05-25T04:34:10 | 195,595,726 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 8,480 | py | # -*- coding: UTF-8 -*-
"""
Kaggle Challenge:
"http://www.kaggle.com/c/acquire-valued-shoppers-challenge/"
'Reduce the data and generate features' by Triskelion
After a forum post by BreakfastPirate
Very mediocre and hacky code, single-purpose, but pretty fast
Some refactoring by Zygmunt Zając <zygmunt@fastml.com>
"""
from datetime import datetime, date
from collections import defaultdict
loc_offers = "data/offers.csv"
loc_transactions = "data/transactions.csv"
loc_train = "data/trainHistory.csv"
loc_test = "data/testHistory.csv"
# will be created
loc_reduced = "data/reduced.csv"
loc_out_train = "data/train.vw"
loc_out_test = "data/test.vw"
###
def reduce_data(loc_offers, loc_transactions, loc_reduced):
start = datetime.now()
#get all categories and comps on offer in a dict
offers_cat = {}
offers_co = {}
for e, line in enumerate( open(loc_offers) ):
offers_cat[ line.split(",")[1] ] = 1
offers_co[ line.split(",")[3] ] = 1
#open output file
with open(loc_reduced, "wb") as outfile:
#go through transactions file and reduce
reduced = 0
for e, line in enumerate( open(loc_transactions) ):
if e == 0:
outfile.write( line ) #print header
else:
#only write when if category in offers dict
if line.split(",")[3] in offers_cat or line.split(",")[4] in offers_co:
outfile.write( line )
reduced += 1
#progress
if e % 5000000 == 0:
print e, reduced, datetime.now() - start
print e, reduced, datetime.now() - start
#reduce_data(loc_offers, loc_transactions, loc_reduced)
def diff_days(s1,s2):
date_format = "%Y-%m-%d"
a = datetime.strptime(s1, date_format)
b = datetime.strptime(s2, date_format)
delta = b - a
return delta.days
def generate_features(loc_train, loc_test, loc_transactions, loc_out_train, loc_out_test):
#keep a dictionary with the offerdata
offers = {}
for e, line in enumerate( open(loc_offers) ):
row = line.strip().split(",")
offers[ row[0] ] = row
#keep two dictionaries with the shopper id's from test and train
train_ids = {}
test_ids = {}
for e, line in enumerate( open(loc_train) ):
if e > 0:
row = line.strip().split(",")
train_ids[row[0]] = row
for e, line in enumerate( open(loc_test) ):
if e > 0:
row = line.strip().split(",")
test_ids[row[0]] = row
#open two output files
with open(loc_out_train, "wb") as out_train, open(loc_out_test, "wb") as out_test:
#iterate through reduced dataset
last_id = 0
features = defaultdict(float)
for e, line in enumerate( open(loc_transactions) ):
if e > 0: #skip header
#poor man's csv reader
row = line.strip().split(",")
#write away the features when we get to a new shopper id
if last_id != row[0] and e != 1:
#generate negative features
if "has_bought_company" not in features:
features['never_bought_company'] = 1
if "has_bought_category" not in features:
features['never_bought_category'] = 1
if "has_bought_brand" not in features:
features['never_bought_brand'] = 1
if "has_bought_brand" in features and "has_bought_category" in features and "has_bought_company" in features:
features['has_bought_brand_company_category'] = 1
if "has_bought_brand" in features and "has_bought_category" in features:
features['has_bought_brand_category'] = 1
if "has_bought_brand" in features and "has_bought_company" in features:
features['has_bought_brand_company'] = 1
outline = ""
test = False
for k, v in features.items():
if k == "label" and v == 0.5:
#test
outline = "1 '" + last_id + " |f" + outline
test = True
elif k == "label":
outline = str(v) + " '" + last_id + " |f" + outline
else:
outline += " " + k+":"+str(v)
outline += "\n"
if test:
out_test.write( outline )
else:
out_train.write( outline )
#print "Writing features or storing them in an array"
#reset features
features = defaultdict(float)
#generate features from transaction record
#check if we have a test sample or train sample
if row[0] in train_ids or row[0] in test_ids:
#generate label and history
if row[0] in train_ids:
history = train_ids[row[0]]
if train_ids[row[0]][5] == "t":
features['label'] = 1
else:
features['label'] = 0
else:
history = test_ids[row[0]]
features['label'] = 0.5
#print "label", label
#print "trainhistory", train_ids[row[0]]
#print "transaction", row
#print "offers", offers[ train_ids[row[0]][2] ]
#print
features['offer_value'] = offers[ history[2] ][4]
features['offer_quantity'] = offers[ history[2] ][2]
offervalue = offers[ history[2] ][4]
features['total_spend'] += float( row[10] )
if offers[ history[2] ][3] == row[4]:
features['has_bought_company'] += 1.0
features['has_bought_company_q'] += float( row[9] )
features['has_bought_company_a'] += float( row[10] )
date_diff_days = diff_days(row[6],history[-1])
if date_diff_days < 30:
features['has_bought_company_30'] += 1.0
features['has_bought_company_q_30'] += float( row[9] )
features['has_bought_company_a_30'] += float( row[10] )
if date_diff_days < 60:
features['has_bought_company_60'] += 1.0
features['has_bought_company_q_60'] += float( row[9] )
features['has_bought_company_a_60'] += float( row[10] )
if date_diff_days < 90:
features['has_bought_company_90'] += 1.0
features['has_bought_company_q_90'] += float( row[9] )
features['has_bought_company_a_90'] += float( row[10] )
if date_diff_days < 180:
features['has_bought_company_180'] += 1.0
features['has_bought_company_q_180'] += float( row[9] )
features['has_bought_company_a_180'] += float( row[10] )
if offers[ history[2] ][1] == row[3]:
features['has_bought_category'] += 1.0
features['has_bought_category_q'] += float( row[9] )
features['has_bought_category_a'] += float( row[10] )
date_diff_days = diff_days(row[6],history[-1])
if date_diff_days < 30:
features['has_bought_category_30'] += 1.0
features['has_bought_category_q_30'] += float( row[9] )
features['has_bought_category_a_30'] += float( row[10] )
if date_diff_days < 60:
features['has_bought_category_60'] += 1.0
features['has_bought_category_q_60'] += float( row[9] )
features['has_bought_category_a_60'] += float( row[10] )
if date_diff_days < 90:
features['has_bought_category_90'] += 1.0
features['has_bought_category_q_90'] += float( row[9] )
features['has_bought_category_a_90'] += float( row[10] )
if date_diff_days < 180:
features['has_bought_category_180'] += 1.0
features['has_bought_category_q_180'] += float( row[9] )
features['has_bought_category_a_180'] += float( row[10] )
if offers[ history[2] ][5] == row[5]:
features['has_bought_brand'] += 1.0
features['has_bought_brand_q'] += float( row[9] )
features['has_bought_brand_a'] += float( row[10] )
date_diff_days = diff_days(row[6],history[-1])
if date_diff_days < 30:
features['has_bought_brand_30'] += 1.0
features['has_bought_brand_q_30'] += float( row[9] )
features['has_bought_brand_a_30'] += float( row[10] )
if date_diff_days < 60:
features['has_bought_brand_60'] += 1.0
features['has_bought_brand_q_60'] += float( row[9] )
features['has_bought_brand_a_60'] += float( row[10] )
if date_diff_days < 90:
features['has_bought_brand_90'] += 1.0
features['has_bought_brand_q_90'] += float( row[9] )
features['has_bought_brand_a_90'] += float( row[10] )
if date_diff_days < 180:
features['has_bought_brand_180'] += 1.0
features['has_bought_brand_q_180'] += float( row[9] )
features['has_bought_brand_a_180'] += float( row[10] )
last_id = row[0]
if e % 100000 == 0:
print e
#generate_features(loc_train, loc_test, loc_transactions, loc_out_train, loc_out_test)
if __name__ == '__main__':
reduce_data(loc_offers, loc_transactions, loc_reduced)
generate_features(loc_train, loc_test, loc_reduced, loc_out_train, loc_out_test)
| [
"shifath.nafis@gmail.com"
] | shifath.nafis@gmail.com |
220fab6089513f0840fae4e66571819307003fef | 6b8703c5e7a8a2b0a0308bc2399695695bf89a0a | /mysite/urls.py | 8a2b3675dab4177ab42c102be20eb01efba834a0 | [] | no_license | IreneGaoc/CMPUT404LAB6 | 2078fb1d2e5623ec0584deaf41aa6117dd8c43d0 | a48a975059e716c4f7d1cc409f4990f33eacd4bb | refs/heads/master | 2020-04-23T00:26:23.045490 | 2019-02-15T01:10:01 | 2019-02-15T01:10:01 | 170,779,751 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 170 | py | from django.contrib import admin
from django.urls import include path
urlpatterns = [
path('polls/', include('polls.urls')),
path('admin/', admin.site.urls),
]
| [
"zgao1@ualberta.ca"
] | zgao1@ualberta.ca |
4db586bf6bffedab7a1c883b8f6c0e720434fe87 | 10d87423fe57af7258d7c327db06034a80700571 | /gym_minigrid/envs/fourroom.py | ed6047002a07f36ceead3de4c7fbb76645a275c5 | [
"BSD-3-Clause"
] | permissive | johannah/gym-minigrid | dee47bc1cd5587d069f2094173053ee3f1e42f5e | 127eef302c4e52f0b976c10304a2b33390fbca78 | refs/heads/master | 2021-08-30T10:27:25.191472 | 2017-12-17T14:08:59 | 2017-12-17T14:08:59 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 79 | py | from gym_minigrid.minigrid import *
from gym_minigrid.register import register
| [
"maximechevalierb@gmail.com"
] | maximechevalierb@gmail.com |
789fc68e0ed940ae1793520de0f87348d70c0aad | a4b15a63e222581d024a84f02588ffa498b34f60 | /pandoratradingsolution/predictions/admin.py | de425e540888a506997cc524fae7bcb531a4a526 | [] | no_license | inikishin/PandoraTradingSolutions | 286e95d4b84c2de80195e6fe4b98fddb94429a53 | 9551014188a40876dee8ca176b8ec0430958e5af | refs/heads/master | 2023-05-04T23:48:55.510647 | 2021-05-24T12:08:54 | 2021-05-24T12:08:54 | 265,003,111 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 378 | py | from django.contrib import admin
from .models import PredictionHorizon, Prediction
admin.site.register(PredictionHorizon)
class PredictionAdmin(admin.ModelAdmin):
list_display = ['ticker', 'horizon', 'created', 'currentprice', 'predictprice', 'prctChange', 'probability']
list_filter = ['created', 'ticker', 'horizon']
admin.site.register(Prediction, PredictionAdmin) | [
"inikishin@gmail.com"
] | inikishin@gmail.com |
5dfe888d6a2fc84bcc3698d8c94a53e631c5dbc6 | 564b3ec642ac471ed02bfee3816892342176cfb4 | /tagger/modules/recurrent.py | a35d7a16805fd97c4f5019a9ad49883f3ee09147 | [] | no_license | maning-xbmu/chinese-self-attention-srl | 7c2edffcb2b24adc806ed91408cce249a16bf078 | 0f58ec4566e3eaab62a779dda3e95a26c813ec3d | refs/heads/master | 2022-07-12T14:27:41.466568 | 2020-05-14T15:01:08 | 2020-05-14T15:01:08 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 10,799 | py | # coding=utf-8
# Copyright 2017-2020 The THUMT Authors
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import torch
import torch.nn as nn
import tagger.utils as utils
from tagger.modules.affine import Affine
from tagger.modules.layer_norm import LayerNorm
from tagger.modules.module import Module
class GRUCell(Module):
def __init__(self, input_size, output_size, normalization=False,
name="gru"):
super(GRUCell, self).__init__(name=name)
self.input_size = input_size
self.output_size = output_size
with utils.scope(name):
self.reset_gate = Affine(input_size + output_size, output_size,
bias=False, name="reset_gate")
self.update_gate = Affine(input_size + output_size, output_size,
bias=False, name="update_gate")
self.transform = Affine(input_size + output_size, output_size,
name="transform")
def forward(self, x, h):
r = torch.sigmoid(self.reset_gate(torch.cat([x, h], -1)))
u = torch.sigmoid(self.update_gate(torch.cat([x, h], -1)))
c = self.transform(torch.cat([x, r * h], -1))
new_h = (1.0 - u) * h + u * torch.tanh(h)
return new_h, new_h
def init_state(self, batch_size, dtype, device):
h = torch.zeros([batch_size, self.output_size], dtype=dtype,
device=device)
return h
def mask_state(self, h, prev_h, mask):
mask = mask[:, None]
new_h = mask * h + (1.0 - mask) * prev_h
return new_h
def reset_parameters(self, initializer="uniform"):
if initializer == "uniform_scaling":
nn.init.xavier_uniform_(self.gates.weight)
nn.init.constant_(self.gates.bias, 0.0)
elif initializer == "uniform":
nn.init.uniform_(self.gates.weight, -0.08, 0.08)
nn.init.uniform_(self.gates.bias, -0.08, 0.08)
else:
raise ValueError("Unknown initializer %d" % initializer)
class LSTMCell(Module):
def __init__(self, input_size, output_size, normalization=False,
activation=torch.tanh, name="lstm"):
super(LSTMCell, self).__init__(name=name)
self.input_size = input_size
self.output_size = output_size
self.activation = activation
with utils.scope(name):
self.gates = Affine(input_size + output_size, 4 * output_size,
name="gates")
if normalization:
self.layer_norm = LayerNorm([4, output_size])
else:
self.layer_norm = None
self.reset_parameters()
def forward(self, x, state, mask):
"""
:param x: batch * seq * hidden
:param state:
:param mask: batch * seq
:return: batch * hidden
"""
c, h = state
gates = self.gates(torch.cat([x, h], 1))
if self.layer_norm is not None:
combined = self.layer_norm(
torch.reshape(gates, [-1, 4, self.output_size]))
else:
combined = torch.reshape(gates, [-1, 4, self.output_size])
i, j, f, o = torch.unbind(combined, 1)
i, f, o = torch.sigmoid(i), torch.sigmoid(f), torch.sigmoid(o)
new_c = f * c + i * torch.tanh(j)
if self.activation is None:
# Do not use tanh activation
new_h = o * new_c
else:
new_h = o * self.activation(new_c)
new_c, new_h = self.mask_state((new_c, new_h), (c, h), mask)
return new_h, (new_c, new_h)
def init_state(self, batch_size, dtype, device):
c = torch.zeros([batch_size, self.output_size], dtype=dtype,
device=device)
h = torch.zeros([batch_size, self.output_size], dtype=dtype,
device=device)
return c, h
def mask_state(self, state, prev_state, mask):
"""
:param state:
:param prev_state:
:param mask: [batch]
:return:
"""
c, h = state
prev_c, prev_h = prev_state
# [batch, 1]
mask = mask[:, None]
# batch * hidden_size
new_c = mask * c + (1.0 - mask) * prev_c
new_h = mask * h + (1.0 - mask) * prev_h
return new_c, new_h
def reset_parameters(self, initializer="orthogonal"):
if initializer == "uniform_scaling":
nn.init.xavier_uniform_(self.gates.weight)
nn.init.constant_(self.gates.bias, 0.0)
elif initializer == "uniform":
nn.init.uniform_(self.gates.weight, -0.04, 0.04)
nn.init.uniform_(self.gates.bias, -0.04, 0.04)
elif initializer == "orthogonal":
self.gates.orthogonal_initialize()
else:
raise ValueError("Unknown initializer %d" % initializer)
class HighwayLSTMCell(Module):
def __init__(self, input_size, output_size, name="lstm"):
super(HighwayLSTMCell, self).__init__(name=name)
self.input_size = input_size
self.output_size = output_size
with utils.scope(name):
self.gates = Affine(input_size + output_size, 5 * output_size,
name="gates")
self.trans = Affine(input_size, output_size, name="trans")
self.reset_parameters()
def forward(self, x, state):
c, h = state
gates = self.gates(torch.cat([x, h], 1))
combined = torch.reshape(gates, [-1, 5, self.output_size])
i, j, f, o, t = torch.unbind(combined, 1)
i, f, o = torch.sigmoid(i), torch.sigmoid(f), torch.sigmoid(o)
t = torch.sigmoid(t)
new_c = f * c + i * torch.tanh(j)
tmp_h = o * torch.tanh(new_c)
new_h = t * tmp_h + (1.0 - t) * self.trans(x)
return new_h, (new_c, new_h)
def init_state(self, batch_size, dtype, device):
c = torch.zeros([batch_size, self.output_size], dtype=dtype,
device=device)
h = torch.zeros([batch_size, self.output_size], dtype=dtype,
device=device)
return c, h
def mask_state(self, state, prev_state, mask):
c, h = state
prev_c, prev_h = prev_state
mask = mask[:, None]
new_c = mask * c + (1.0 - mask) * prev_c
new_h = mask * h + (1.0 - mask) * prev_h
return new_c, new_h
def reset_parameters(self, initializer="orthogonal"):
if initializer == "uniform_scaling":
nn.init.xavier_uniform_(self.gates.weight)
nn.init.constant_(self.gates.bias, 0.0)
elif initializer == "uniform":
nn.init.uniform_(self.gates.weight, -0.04, 0.04)
nn.init.uniform_(self.gates.bias, -0.04, 0.04)
elif initializer == "orthogonal":
self.gates.orthogonal_initialize()
self.trans.orthogonal_initialize()
else:
raise ValueError("Unknown initializer %d" % initializer)
class DynamicLSTMCell(Module):
def __init__(self, input_size, output_size, k=2, num_cells=4, name="lstm"):
super(DynamicLSTMCell, self).__init__(name=name)
self.input_size = input_size
self.output_size = output_size
self.num_cells = num_cells
self.k = k
with utils.scope(name):
self.gates = Affine(input_size + output_size,
4 * output_size * num_cells,
name="gates")
self.topk_gate = Affine(input_size + output_size,
num_cells, name="controller")
self.reset_parameters()
@staticmethod
def top_k_softmax(logits, k, n):
top_logits, top_indices = torch.topk(logits, k=min(k + 1, n))
top_k_logits = top_logits[:, :k]
top_k_indices = top_indices[:, :k]
probs = torch.softmax(top_k_logits, dim=-1)
batch = top_k_logits.shape[0]
k = top_k_logits.shape[1]
# Flat to 1D
indices_flat = torch.reshape(top_k_indices, [-1])
indices_flat = indices_flat + torch.div(
torch.arange(batch * k, device=logits.device), k) * n
tensor = torch.zeros([batch * n], dtype=logits.dtype,
device=logits.device)
tensor = tensor.scatter_add(0, indices_flat.long(),
torch.reshape(probs, [-1]))
return torch.reshape(tensor, [batch, n])
def forward(self, x, state):
c, h = state
feats = torch.cat([x, h], dim=-1)
logits = self.topk_gate(feats)
# [batch, num_cells]
gate = self.top_k_softmax(logits, self.k, self.num_cells)
# [batch, 4 * num_cells * dim]
combined = self.gates(feats)
combined = torch.reshape(combined,
[-1, self.num_cells, 4, self.output_size])
i, j, f, o = torch.unbind(combined, 2)
i, f, o = torch.sigmoid(i), torch.sigmoid(f), torch.sigmoid(o)
# [batch, num_cells, dim]
new_c = f * c[:, None, :] + i * torch.tanh(j)
new_h = o * torch.tanh(new_c)
gate = gate[:, None, :]
new_c = torch.matmul(gate, new_c)
new_h = torch.matmul(gate, new_h)
new_c = torch.squeeze(new_c, 1)
new_h = torch.squeeze(new_h, 1)
return new_h, (new_c, new_h)
def init_state(self, batch_size, dtype, device):
c = torch.zeros([batch_size, self.output_size], dtype=dtype,
device=device)
h = torch.zeros([batch_size, self.output_size], dtype=dtype,
device=device)
return c, h
def mask_state(self, state, prev_state, mask):
c, h = state
prev_c, prev_h = prev_state
mask = mask[:, None]
new_c = mask * c + (1.0 - mask) * prev_c
new_h = mask * h + (1.0 - mask) * prev_h
return new_c, new_h
def reset_parameters(self, initializer="orthogonal"):
if initializer == "uniform_scaling":
nn.init.xavier_uniform_(self.gates.weight)
nn.init.constant_(self.gates.bias, 0.0)
elif initializer == "uniform":
nn.init.uniform_(self.gates.weight, -0.04, 0.04)
nn.init.uniform_(self.gates.bias, -0.04, 0.04)
elif initializer == "orthogonal":
weight = self.gates.weight.view(
[self.input_size + self.output_size, self.num_cells,
4 * self.output_size])
nn.init.orthogonal_(weight, 1.0)
nn.init.constant_(self.gates.bias, 0.0)
else:
raise ValueError("Unknown initializer %d" % initializer)
| [
"976611019@qq.com"
] | 976611019@qq.com |
b0d9fef2ad69d5bfe724b957d8aff99d7220846f | 80abb2b35886bcc4ea305ef7a91b7a8a4541b81c | /q2_phylofactor/_phylofactor.py | 487b75951b2d8e3983e221a8201ff8a0d278eba8 | [] | no_license | johnchase/q2-phylofactor | fcbdedc224356eede5b06378fd894f4a10f766b5 | af9acec44fc56618e985ff679ff006314a6c316d | refs/heads/master | 2020-03-16T23:41:21.564707 | 2018-07-09T23:27:26 | 2018-07-09T23:27:26 | 133,087,391 | 1 | 3 | null | 2018-06-14T21:42:58 | 2018-05-11T20:50:08 | Python | UTF-8 | Python | false | false | 4,954 | py | import os
import subprocess
import tempfile
import biom
import skbio
import pandas as pd
import qiime2
from q2_types.tree import NewickFormat
from qiime2 import Metadata
def run_commands(cmds, verbose=True):
if verbose:
print("Running external command line application(s). This may print "
"messages to stdout and/or stderr.")
print("The command(s) being run are below. These commands cannot "
"be manually re-run as they will depend on temporary files that "
"no longer exist.")
for cmd in cmds:
if verbose:
print("\nCommand:", end=' ')
print(" ".join(cmd), end='\n\n')
subprocess.run(cmd, check=True)
def _phylofactor(table,
phylogeny,
metadata,
family,
formula,
choice,
nfactors,
ncores):
with tempfile.TemporaryDirectory() as temp_dir_name:
input_table = os.path.join(temp_dir_name, 'table.tsv')
input_metadata = os.path.join(temp_dir_name, 'metadata.tsv')
with open(input_table, 'w') as fh:
fh.write(table.to_tsv())
metadata.save(input_metadata)
data_output = os.path.join(temp_dir_name, 'data.tsv')
basis_output = os.path.join(temp_dir_name, 'basis.tsv')
tree_output = os.path.join(temp_dir_name, 'tree.nwk')
group_output = os.path.join(temp_dir_name, 'group.tsv')
factor_output = os.path.join(temp_dir_name, 'factors.tsv')
cmd = ['run_phylofactor.R',
input_table,
str(phylogeny),
input_metadata,
str(family),
str(formula),
str(choice),
str(nfactors),
str(ncores),
str(data_output),
str(basis_output),
str(tree_output),
str(group_output),
str(factor_output)]
try:
print('Running Commands')
run_commands([cmd])
except subprocess.CalledProcessError as e:
raise Exception("An error was encountered with PhyloFactor"
" in R (return code %d), please inspect stdout"
" and stderr to learn more." % e.returncode)
data = pd.read_csv(data_output, sep='\t')
basis = pd.read_csv(basis_output, sep='\t')
tree = skbio.tree.TreeNode.read(tree_output)
groups = pd.read_csv(group_output, sep='\t')
factors = pd.read_csv(factor_output, sep='\t')
return data, basis, tree, groups, factors
# Does this really need to be it's own function?
def phylofactor(table: biom.Table,
phylogeny: NewickFormat,
metadata: Metadata,
family: str,
formula: str = 'Data ~ X',
choice: str = 'F',
nfactors: int = 10,
ncores: int = 1
) -> (pd.DataFrame,
pd.DataFrame,
skbio.tree.TreeNode,
pd.DataFrame,
pd.DataFrame):
return _phylofactor(table,
phylogeny,
metadata,
family,
formula,
choice,
nfactors,
ncores,
)
def cross_validate_map(table: biom.Table,
groups: pd.DataFrame,
phylogeny: NewickFormat,
full_phylogeny: NewickFormat,
) -> (biom.Table, pd.DataFrame):
with tempfile.TemporaryDirectory() as temp_dir_name:
input_table = os.path.join(temp_dir_name, 'table.tsv')
with open(input_table, 'w') as fh:
fh.write(table.to_tsv())
input_groups = os.path.join(temp_dir_name, 'groups.tsv')
groups.to_csv(input_groups, sep='\t')
biom_output = os.path.join(temp_dir_name, 'out_table.tsv')
group_output = os.path.join(temp_dir_name, 'groups_out.tsv')
cmd = ['run_crossVmap.R',
input_table,
input_groups,
str(phylogeny),
str(full_phylogeny),
str(biom_output),
str(group_output)]
try:
print('Running Commands')
run_commands([cmd])
except subprocess.CalledProcessError as e:
raise Exception("An error was encountered with PhyloFactor"
" in R (return code %d), please inspect stdout"
" and stderr to learn more." % e.returncode)
with open(biom_output) as fh:
biom_table = biom.Table.from_tsv(fh, None, None, None)
group_output_df = pd.read_csv(group_output, sep='\t')
return biom_table, group_output_df
| [
"chasejohnh@gmail.com"
] | chasejohnh@gmail.com |
02c053a332e8c66afa1b50f843361da692cf6096 | 4b05c7f8c5b7505e96842f12e34150829374f0b3 | /mysql_connect.py | 6e383072c37ae2e8af7f43c5aa4be62e236fbd76 | [] | no_license | jcodewriter/craigslist-scraping | 11d01ea889bcf1a42fd4cf00c66ed156a0b48630 | 92ff84e777b55fd09fc0a4b00179cd21ba6f1cbb | refs/heads/main | 2023-05-24T00:01:58.878050 | 2021-06-18T22:31:26 | 2021-06-18T22:31:26 | 378,133,370 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 424 | py | from mysql.connector import MySQLConnection, Error
from mysql_dbconfig import read_db_config
""" Connect to MySQL database """
db_config = read_db_config()
connect = None
try:
print('Connecting to MySQL database...')
connect = MySQLConnection(**db_config)
if connect.is_connected():
print('Connection established.')
else:
print('Connection failed.')
except Error as error:
print(error)
| [
"jcodewriter@gmail.com"
] | jcodewriter@gmail.com |
a195765ba259353475c5b8845033de67c2618de3 | 61f39d1febf9077e77250f4f1576b04d903ab2f0 | /argument by value.py | 0b8463ca16ff935d6a9ecdcd0e21603d69872767 | [] | no_license | malli1996/interview | f387c14449e03ae5af8628288add47849ec4e762 | ee2be057c778817a42d5d5d8167e676705448142 | refs/heads/master | 2020-07-03T01:49:29.088570 | 2019-08-16T01:10:50 | 2019-08-16T01:10:50 | 201,747,127 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 134 | py | '''def foo(l):
l = [4,5,6]
return l
mylist = [1,200,3]
foo(mylist)'''
def foo(ii):
ii = 5
i = 6
foo(i)
| [
"noreply@github.com"
] | noreply@github.com |
bdfd83783996168ac1c732dceec9cb1333f00075 | 9e8ebc9d4b27d550a23a8c94d80bfdfcd429548f | /withPool.py | 637d7398c64a8d7ba800b33bcf4974defeefb350 | [] | no_license | MDProject/ConvNN | d51196807069273a530633516c555fec5b657df7 | a108f0b5c649f2c1d597e1cea91600f75a4b27ba | refs/heads/master | 2020-05-24T11:29:18.976381 | 2019-05-31T08:03:07 | 2019-05-31T08:03:07 | 187,249,560 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 4,024 | py | import torch
import torch.nn as nn
from torch.autograd import Variable
import torchvision.datasets as dset
import torchvision.transforms as transforms
import torch.nn.functional as F
import torch.optim as optim
import os.path as IO
import numpy as np
conv1 = []
conv2 = []
conv3 = []
FC = []
class Net(nn.Module):
def __init__(self):
super(Net, self).__init__()
# 1 input image channel, 6 output channels, 5x5 square convolution
# kernel
self.conv1 = nn.Conv2d(1, 5, 5) # 28*28 -- 24*24 + pooling 24*24 -- 12*12
self.conv2 = nn.Conv2d(5, 10, 5) # 12*12 -- 8*8
self.conv3 = nn.Conv2d(10, 20, 5) # 8*8 -- 4*4
# an affine operation: y = Wx + b
self.fc1 = nn.Linear(20 * 4 * 4, 64)
self.fc2 = nn.Linear(64, 10)
def forward(self, x):
tmp = F.relu(self.conv1(x))
x = F.avg_pool2d(tmp,(2,2))
#conv1.append(tmp)
x = F.relu(self.conv2(x))
#conv2.append(x)
x = F.relu(self.conv3(x))
#conv3.append(x)
x = x.view(-1, self.num_flat_features(x))
x = F.relu(self.fc1(x))
x = self.fc2(x)
return x
def num_flat_features(self, x):
size = x.size()[1:] # all dimensions except the batch dimension
num_features = 1
for s in size:
num_features *= s
return num_features
net = Net()
for layer in list(net._modules.items()):
print(layer[1])
"""
def for_hook(module, input, output):
print(module)
for val in input:
print("input val:",val.size())
for out_val in output:
print("output val:", out_val.size())
"""
# net.conv2.register_forward_hook(for_hook)
# net.conv3.register_forward_hook(for_hook)
batchSize = 50
trans = transforms.Compose([transforms.ToTensor(), transforms.Normalize((0.5,), (1.0,))])
# print(IO.exists('../MNIST_DATA/train-labels-idx1-ubyte'))
train_set = dset.MNIST('../MNIST_DATA/', train=True, transform=trans, download=True)
test_set = dset.MNIST('../MNIST_DATA/', train=False, transform=trans, download=True)
# img, label = train_set[0]
train_loader = torch.utils.data.DataLoader(dataset=train_set,
batch_size=batchSize,
shuffle=True)
test_loader = torch.utils.data.DataLoader(dataset=test_set,
batch_size=batchSize,
shuffle=False)
criterion = nn.CrossEntropyLoss()
optimizer = optim.Adam(net.parameters(),lr=1e-3)
savePath = './Project/Pool/param'
appendix = '.t7'
# print(IO.exists(savePath))
loss_bound = 0.01
def train(epoch): # epoch -- ensemble number
for i in range(epoch):
for batch_idx, (data, target) in enumerate(train_loader):
# target = target.float()
data, target = Variable(data), Variable(target)
optimizer.zero_grad()
output = net(data)
loss = criterion(output, target)
loss.backward()
optimizer.step()
if loss.item() < loss_bound:
print("Epoch {0}: Batch idx: {1} Loss: {2} -- IO".format(i,batch_idx,loss.item()))
break
if batch_idx % 500 == 0:
print("Epoch {0}: Batch idx: {1} Loss: {2}".format(i,batch_idx,loss.item()))
path = savePath + str(i) + appendix
torch.save(net.state_dict(),path)
Ensemble_num = 10
train(1)
net.eval() # eval mode (batchnorm uses moving mean/variance instead of mini-batch mean/variance)
with torch.no_grad():
correct = 0
total = 0
for images, labels in test_loader:
outputs = net(images)
_, predicted = torch.max(outputs.data, 1)
total += labels.size(0)
correct += (predicted == labels).sum().item()
print('Test Accuracy of the model on the 10000 test images: {} %'.format(100 * correct / total))
| [
"noreply@github.com"
] | noreply@github.com |
d9ffcbceac38827fdbfd583282e8743c87b35428 | fe7e57c1001f8c95c141fd959fe942b320468a63 | /py_lby/rename/rename-prefixAdd.py | 91f578894fc8ac86f9c29966c497ffafd9e01eda | [] | no_license | libaiyu/PE_mark | 66178449a0fb66459b8f85e0c83e8687c24e4993 | 13fa601116b3b10ca2a55586c1b8d6b3d4c6c0c1 | refs/heads/master | 2020-06-26T13:26:19.543740 | 2017-07-13T07:49:18 | 2017-07-13T07:49:18 | 97,019,337 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 953 | py | #! python3
# _*_ coding: utf_8 _*_
import os
import re
dirName = input('please input the directory: ')
fileType = input('input the file type: ')
fReg = re.compile('.' + fileType + '$')
prefix = input('please input the prefix: ')
pre = re.compile('^' + prefix)
files = os.listdir(dirName)
count = 0
finishCount = 0
for file in files:
# print(file)
if fReg.search(file):
if not pre.search(file):
newName = prefix + file # add prefix
print(file,"\n",newName)
count += 1
if count < 3:
input('Please input "c" for continue: %c')
try:
os.rename(dirName + '\\' + file,dirName + '\\' + newName)
finishCount += 1
except FileExistsError:
print('file already exist. this file has not renamed.')
print('finish adding prefix %d files in %d files .'% (finishCount,count))
| [
"709097185@qq.com"
] | 709097185@qq.com |
b40cd4001119de85952c78f3996d2b98f1343b32 | 9c225ac6c033deecb01c95e47fcd5ee3737a0e44 | /rango/models.py | a7e0fbf7f643f7fdfd7cbb039d23c9a99a2a0090 | [] | no_license | shanQshuiY/rango | a70784cf959482e2e72ccdf56895128cf1633b41 | a0681e75bcbfc77e5b10434c1acc58dd8cb428fc | refs/heads/master | 2021-07-01T16:56:41.747044 | 2017-09-22T10:48:21 | 2017-09-22T10:48:21 | 103,117,909 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,102 | py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.db import models
from django.template.defaultfilters import slugify
# Create your models here.
class Category(models.Model):
name = models.CharField(max_length=128, unique=True)
views = models.IntegerField(default=0)
likes = models.IntegerField(default=0)
slug = models.SlugField(unique=True)
def save(self, *args, **kwargs):
self.slug = slugify(self.name)
super(Category, self).save(*args, **kwargs)
def __unicode__(self):
return self.name
class Page(models.Model):
category = models.ForeignKey(Category)
title = models.CharField(max_length=128)
url = models.URLField();
views = models.IntegerField(default=0)
def __unicode__(self):
return self.title
class UserProfile(models.Model):
user = models.OneToOneField(User)
website = models.URLField(blank=True)
picture = models.ImageField(upload_to='profile_images', blank=True)
def __unicode__(self):
return self.user.username | [
"yangzhihuilzy@sina.com"
] | yangzhihuilzy@sina.com |
d6b1c2132c968c9c9d620843cf716f7edc2ef978 | 2f26cb652666310b94b3c0d0bd2e66200ce24db1 | /cinemaredux.py | 6d2e1124614596a8d49c9a652b2ed17e3aa4c873 | [] | no_license | digitaldickinson/PythonVideoprocessing | 1a0e29f90477d5bdf7dee6ffc5396c624550be96 | 630c8bf29ac69f9f413f76f97056f92b3331e81f | refs/heads/master | 2022-05-27T21:24:16.087312 | 2018-04-16T11:35:23 | 2018-04-16T11:35:23 | 129,378,937 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 6,895 | py | """
A SCRIPT TO CREATE CINEMA REDUX STYLE IMAGE FROM A VIDEO FILE
Inspired by Brendan Dawes cinenmaredux work - http://www.brendandawes.com/projects/cinemaredux
"""
#import some libs to work with
import cv2 #The openCV lib to do video processing
import numpy as np #use this for arrays
import os, os.path #using this to count images
import math #Use this to round up numbers
from glob import iglob #Grab files to do stuff with
from PIL import Image #Handle the image stuff
import re # Regex - This for the sorting of filenames
import warnings #this for the DecompressionBombWarning that sometimes appears
#Define some functions to do stuff
def extract_image_one_fps(video_source_path):
#This function takes the video specified in video_source_path and grabs one frame every second. This came from https://stackoverflow.com/questions/33311153/python-extracting-and-saving-video-frames
vidcap = cv2.VideoCapture(video_source_path)
count = 0
success = True
while success:
vidcap.set(cv2.CAP_PROP_POS_MSEC,(count*1000))
success,image = vidcap.read()
# There is a funny error that the last frame returns an empty image. I think this a problem with the camera
# The if statement below checks to see if the image has been read.
if success:
## Stop when last frame is identified
image_last = cv2.imread("frames/frame{}.png".format(count-1))
if np.array_equal(image,image_last):
break
cv2.imwrite("frames/frame%d.png" % count, image) # save frame as PNG file
print("done frame"+format(count))
count += 1
def remove_files(folder):
for the_file in os.listdir(path):
file_path = os.path.join(folder, the_file)
try:
if os.path.isfile(file_path):
os.unlink(file_path)
#elif os.path.isdir(file_path): shutil.rmtree(file_path)
except Exception as e:
print(e)
def count_images():
#Short function to count the number of frame images in the frames folder. We use this to work out how many rows the image will have
img_num = len([name for name in os.listdir('./frames') if os.path.isfile(name)])
print (image_num)
def numericalSort(value):
#This is function that helps sort the images into the right order
parts = numbers.split(value)
parts[1::2] = map(int, parts[1::2])
return parts
def thumbnailer(thumbpath, op_path, grid, thumb_size, background_color):
#Coroutine to receive image file names and produce thumbnail pages of them laid-out in a grid.
#This came from https://stackoverflow.com/questions/38421160/combine-multiple-different-images-from-a-directory-into-a-canvas-sized-3x6
page_num = 0
page_extent = grid[1]*thumb_size[0], grid[0]*thumb_size[1]
print(page_extent[0], page_extent[1])
print(thumb_size[0], thumb_size[1])
try:
while True:
paste_cnt = 0
new_img = Image.new('RGB', page_extent, background_color)
#Start at zero and go up in 384's till you get to width of the page
for y in range(0, page_extent[1], thumb_size[1]):
#Start at zero and go up in 216's till you get to height of the page
for x in range(0, page_extent[0], thumb_size[0]):
try:
filepath = (yield)
except GeneratorExit:
print('GeneratorExit received')
return
filename = os.path.basename(filepath)
print('{} thumbnail -> ({}, {})'.format(filename, x, y))
thumbnail_img = Image.open(filepath)
thumbnail_img.thumbnail(thumb_size)
new_img.paste(thumbnail_img, (x,y))
paste_cnt += 1
else:
continue # no break, continue outer loop
break # break occurred, terminate outer loop
print('Thumbnail page completed...')
if paste_cnt:
page_num += 1
print('Saving thumbpage{}.jpg'.format(page_num))
new_img.save(os.path.join(op_path, 'thumbpage{}.jpg'.format(page_num)))
finally:
print('Last part...')
if paste_cnt:
page_num += 1
print('Saving thumbpage{}.jpg'.format(page_num))
new_img.save(os.path.join(op_path, 'thumbpage{}.jpg'.format(page_num)))
#Turn off a warning that appears when the image is looking too big. Called a DecompressionBombWarning
warnings.simplefilter('ignore', Image.DecompressionBombWarning)
# Tell it where the video is. Assumes it's in the same directory as the script
video = 'test.mov'
#Tell it where to put the frames and the final image
path = 'frames/'
#Then the path the save the finsihed thumbnail
op_path = 'output/'
# The following functions deletes any files in the frames folder before we start
# Comment this out if you don't want to risk it.
remove_files(path)
#Run the function that samples the video file. This will drop a png file into the frames folder for every second of video.
extract_image_one_fps(video)
#Now we have the frames we can begin to create the composite image.
# First problem to get over is how to read the image files from the frames folder in the right order as the standard sorting function (look for sorted() below) in Python deosn't do it!
# Found a solution to this at #https://stackoverflow.com/questions/12093940/reading-files-in-a-particular-order-in-python
#First thing is to create a variable that splits out the numbers
numbers = re.compile(r'(\d+)')
#Then we hoover up all the images in the frames flder into a list using a custom function called numericalSort to make sure they are in the right order.
npath = [infile for infile in sorted(iglob(os.path.join(path, '*.png')), key=numericalSort)]
#Get some quick stats on what we are wokring withself.
#First, how many images?
num_images = len(npath)
#We can then use that to work out how many rows we'll need. Dawes uses one row for each minute of footage, thats sixty images per row. So we can do a basic divide which we then round up using math.ceil function so that we have full rows.
minutes = math.ceil(len(npath)/60)
#Now we can build the actual image.
#The function I found uses coroutines, I'm not familiar with them but it worked so that's for another day. I did need to tweak it a little for Python3. For example .next and xrange are not supported but it only took a quick google of the error message to sort that.
#Set some paremeters. In this case the number of rows is set with the minutes variable we created above.
coroutine = thumbnailer(path, op_path, (minutes,60), (384,216), 'black')
coroutine.__next__() # start it
for filepath in npath:
coroutine.send(filepath)
print('Done making the thumbnails')
coroutine.close()
| [
"judgemonkey@mac.com"
] | judgemonkey@mac.com |
46d902ffa02a481fd53104565242dfa4f6b75921 | 255604fa876c9a54dfaef9057b9373c70e0a4cbb | /NewsPaper/NewsPaper/settings.py | 8a37750dc8511cff1c61ac8662faaa935c1be059 | [] | no_license | Ritter00/NP_D4.4 | 39fba8c2ebd6cfd8d6ca1fda61be8836bfef5ff4 | 5c8118dc4c3ffc25095a45d3d3990ba7397f4184 | refs/heads/main | 2023-08-16T01:50:12.642934 | 2021-09-23T09:10:56 | 2021-09-23T09:10:56 | 405,026,167 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 4,263 | py | """
Django settings for NewsPaper project.
Generated by 'django-admin startproject' using Django 3.2.6.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
from pathlib import Path
import os
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'django-insecure-rcc!j@!=wi(-nv(wx2r1&qhcp)7ae)ehpm5%fxh32t(ls59$ys'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.sites',
'django.contrib.flatpages',
'django_filters',
'myapp',
'allauth',
'allauth.account',
'allauth.socialaccount',
'allauth.socialaccount.providers.google',
]
SITE_ID = 1
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
]
ROOT_URLCONF = 'NewsPaper.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'templates')],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
'django.template.context_processors.request',
],
},
},
]
WSGI_APPLICATION = 'NewsPaper.wsgi.application'
# Database
# https://docs.djangoproject.com/en/3.2/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
}
}
# Password validation
# https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]
# Internationalization
# https://docs.djangoproject.com/en/3.2/topics/i18n/
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/3.2/howto/static-files/
STATIC_URL = '/static/'
STATICFILES_DIRS = [
BASE_DIR / "static"]
# Default primary key field type
# https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
LOGIN_URL = '/accounts/login/'
LOGIN_REDIRECT_URL = '/'
AUTHENTICATION_BACKENDS = [
# Needed to login by username in Django admin, regardless of `allauth`
'django.contrib.auth.backends.ModelBackend',
# `allauth` specific authentication methods, such as login by e-mail
'allauth.account.auth_backends.AuthenticationBackend',
]
ACCOUNT_EMAIL_REQUIRED = True
ACCOUNT_UNIQUE_EMAIL = True
ACCOUNT_USERNAME_REQUIRED = False
ACCOUNT_AUTHENTICATION_METHOD = 'email'
ACCOUNT_EMAIL_VERIFICATION = 'none'
ACCOUNT_FORMS = {'signup': 'myapp.models.BasicSignupForm'} | [
"olzim@tut.by"
] | olzim@tut.by |
2bd62843ae04e565226e5515c198315358a1d2ac | c5073f127ba5f5e6d6ea90b288b1d4902b00db77 | /experiment-files/cgi/submit.cgi | 15b45c6623734c5e771c854c14c878d30a2c9b2c | [] | no_license | halpinsa/2018MScDiss | 2e65d545a28a65095f80b834cc8d991b3de8758c | 9ce9839d57023d39bb01c93da24e181cf5717a5b | refs/heads/master | 2020-03-26T18:49:16.866918 | 2018-08-18T17:48:16 | 2018-08-18T17:48:16 | 145,232,728 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,659 | cgi | #!/usr/bin/python
import cgi
import cgitb
import sys
cgitb.enable()
import os
import psycopg2
import json
print "Content-Type: application/json"
print
f = open('req.txt' , 'r')
for line in f:
p = line.strip()
f.close();
#Define our connection string
conn_string = "host='pgteach' dbname='online_questions' user='s1617355' password= %s sslmode='disable'" % p
# print the connection string we will use to connect
# print "Connecting to database\n ->%s" % (conn_string)
# get a connection, if a connect cannot be made an exception will be raised here
conn = psycopg2.connect(conn_string)
# conn.cursor will return a cursor object, you can use this cursor to perform queries
cursor = conn.cursor()
dataArray = []
# Data array stores JSON, randomCode
for line in sys.stdin:
dataArray.append(line.strip())
data = dataArray[0]
randomCode = dataArray[1]
# f = open('data.json' , 'w')
# f.write(data);
# f.close();
# print "Connected!\n"
# Drop table
# cursor.execute("DROP TABLE test;")
# Create a table
# cursor.execute("CREATE TABLE test (id serial PRIMARY KEY, randomCode varchar, data JSON);")
# Load some JSON
# Add some JSON
# cursor.execute("INSERT INTO test (data) VALUES '({})'".format(someData))
# insertString = "INSERT INTO test (randomCode, data) VALUES (%s, %s::json[])" % (randomCode, data)
# cursor.execute(insertString)
SQL = "INSERT INTO userData (randomCode, data) VALUES (%s, %s)"
insertValues = (randomCode, data)
cursor.execute(SQL, insertValues)
# Commit table
conn.commit()
# Close cursor
cursor.close()
# Close connection
conn.close()
print '''{
"data": {
"response": 200,
"name": "Success"
}
}'''
print
| [
"halpinsa@tcd.ie"
] | halpinsa@tcd.ie |
7e7d1b9026dfc15931ee9281fa1c3cbbd6ee0303 | c818eafff8fb9cfb052e9c016aa7de67de246f21 | /sales/migrations/0027_remove_return_receipt.py | b27fbc4fb3e044ba81c8479d9cf55a5e81ca6c45 | [] | no_license | mugagambi/mgh-server | a4275b07243f476db9d63e568c8b9331190b75f0 | da966882bd695df606622ab816cd93fab1d53773 | refs/heads/master | 2021-10-22T05:52:15.354561 | 2019-03-08T11:50:19 | 2019-03-08T11:50:19 | 120,087,420 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 327 | py | # Generated by Django 2.0.3 on 2018-04-17 15:46
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('sales', '0026_return_approved_by'),
]
operations = [
migrations.RemoveField(
model_name='return',
name='receipt',
),
]
| [
"mugagambi@gmail.com"
] | mugagambi@gmail.com |
7a4ea8fb4fbee69b0722d5a4867d805e6c6c95da | 3d65a2d72e65083c752281368cf040ae977e4757 | /plot_scripts/plot_spagetti.py | b30fed38d6694fb61a31c8c4cb7aff780abb1d61 | [] | no_license | florisvb/OdorAnalysis | 6b4b2c32979b9139856aee20cc63c34cfe63819e | 18beae8d3c6be271f171b1c36c9fd932a8a404ba | refs/heads/master | 2020-06-03T14:48:34.962795 | 2012-10-23T22:28:21 | 2012-10-23T22:28:21 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 8,207 | py | #!/usr/bin/env python
import sys, os
from optparse import OptionParser
sys.path.append('../')
sys.path.append('../analysis_modules')
import flydra_analysis_tools as fat
import fly_plot_lib
fly_plot_lib.set_params.pdf()
import fly_plot_lib.plot as fpl
fad = fat.flydra_analysis_dataset
dac = fat.dataset_analysis_core
fap = fat.flydra_analysis_plot
tac = fat.trajectory_analysis_core
import odor_packet_analysis as opa
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as patches
################# get trajectory keys #################
def get_keys(dataset):
keys = dataset.trajecs.keys()
return keys
################# plotting functions #######################
def plot_colored_cartesian_spagetti(config, dataset, axis='xy', xlim=(-0.2, .2), ylim=(-0.75, .25), zlim=(0, 0.3), keys=None, keys_to_highlight=[], show_saccades=False, colormap='jet', color_attribute='speed', norm=(0,0.5), artists=None, save_figure_path='', figname=None, show_start=False):
if keys is None:
keys = get_keys(dataset)
print 'plotting spagetti, axis: ', axis
print 'number of keys: ', len(keys)
if len(keys) < 1:
print 'No data'
return
fig = plt.figure()
ax = fig.add_subplot(111)
height = config.post_center[2]-config.ticks['z'][0]
print 'ARTISTS STARTING'
print artists
if axis=='xy': # xy plane
ax.set_ylim(ylim[0], ylim[1])
ax.set_xlim(xlim[0], xlim[1])
ax.set_autoscale_on(True)
ax.set_aspect('equal')
axes=[0,1]
fap.cartesian_spagetti(ax, dataset, keys=keys, nkeys=10, start_key=0, axes=axes, show_saccades=show_saccades, keys_to_highlight=[], colormap=colormap, color_attribute=color_attribute, norm=norm, show_start=show_start)
post = patches.Circle(config.post_center[0:2], config.post_radius, color='black')
if axis=='yz': # yz plane
ax.set_ylim(zlim[0], zlim[1])
ax.set_xlim(ylim[0], ylim[1])
ax.set_autoscale_on(True)
ax.set_aspect('equal')
axes=[1,2]
fap.cartesian_spagetti(ax, dataset, keys=keys, nkeys=10, start_key=0, axes=axes, show_saccades=show_saccades, keys_to_highlight=[], colormap=colormap, color_attribute=color_attribute, norm=norm, show_start=show_start)
post = patches.Rectangle([-1*config.post_radius, config.ticks['z'][0]], config.post_radius*2, height, color='black')
if axis=='xz': # xz plane
ax.set_ylim(zlim[0], zlim[1])
ax.set_xlim(xlim[0], xlim[1])
ax.set_autoscale_on(True)
ax.set_aspect('equal')
axes=[0,2]
fap.cartesian_spagetti(ax, dataset, keys=keys, nkeys=10, start_key=0, axes=axes, show_saccades=show_saccades, keys_to_highlight=[], colormap=colormap, color_attribute=color_attribute, norm=norm, show_start=show_start)
post = patches.Rectangle([-1*config.post_radius, config.ticks['z'][0]], config.post_radius*2, height, color='black')
if artists is None:
artists = []
artists.append(post)
if artists is not None:
for artist in artists:
ax.add_artist(artist)
#prep_cartesian_spagetti_for_saving(ax)
xticks = config.ticks['x']
yticks = config.ticks['y']
zticks = config.ticks['z']
if axis=='xy':
fpl.adjust_spines(ax, ['left', 'bottom'], xticks=xticks, yticks=yticks)
ax.set_xlabel('x axis, m')
ax.set_ylabel('y axis, m')
ax.set_title('xy plot, color=speed from 0-0.5 m/s')
if axis=='yz':
fpl.adjust_spines(ax, ['left', 'bottom'], xticks=yticks, yticks=zticks)
ax.set_xlabel('y axis, m')
ax.set_ylabel('z axis, m')
ax.set_title('yz plot, color=speed from 0-0.5 m/s')
if axis=='xz':
fpl.adjust_spines(ax, ['left', 'bottom'], xticks=xticks, yticks=zticks)
ax.set_xlabel('x axis, m')
ax.set_ylabel('z axis, m')
ax.set_title('xz plot, color=speed from 0-0.5 m/s')
fig.set_size_inches(8,8)
if figname is None:
figname = save_figure_path + 'spagetti_' + axis + '.pdf'
else:
figname = os.path.join(save_figure_path, figname)
fig.savefig(figname, format='pdf')
return ax
def main(config, culled_dataset, save_figure_path=''):
print
print 'Plotting spagetti'
if 1:
# in odor
print
print 'Odor: '
dataset_in_odor = fad.make_dataset_with_attribute_filter(culled_dataset, 'odor_stimulus', 'on')
if len(dataset_in_odor.trajecs.keys()) > 0:
plot_colored_cartesian_spagetti(config, dataset_in_odor, axis='xy', save_figure_path=save_figure_path, figname='spagetti_odor_xy.pdf')
plot_colored_cartesian_spagetti(config, dataset_in_odor, axis='yz', save_figure_path=save_figure_path, figname='spagetti_odor_yz.pdf')
plot_colored_cartesian_spagetti(config, dataset_in_odor, axis='xz', save_figure_path=save_figure_path, figname='spagetti_odor_xz.pdf')
# not in odor
print
print 'No odor: '
dataset_no_odor = fad.make_dataset_with_attribute_filter(culled_dataset, 'odor_stimulus', 'none')
if len(dataset_no_odor.trajecs.keys()) > 0:
plot_colored_cartesian_spagetti(config, dataset_no_odor, axis='xy', save_figure_path=save_figure_path, figname='spagetti_no_odor_xy.pdf')
plot_colored_cartesian_spagetti(config, dataset_no_odor, axis='yz', save_figure_path=save_figure_path, figname='spagetti_no_odor_yz.pdf')
plot_colored_cartesian_spagetti(config, dataset_no_odor, axis='xz', save_figure_path=save_figure_path, figname='spagetti_no_odor_xz.pdf')
# pulse odor
print
print 'Pulsing odor: '
dataset_pulsing_odor = fad.make_dataset_with_attribute_filter(culled_dataset, 'odor_stimulus', 'pulsing')
if len(dataset_pulsing_odor.trajecs.keys()) > 0:
plot_colored_cartesian_spagetti(config, dataset_pulsing_odor, axis='xy', save_figure_path=save_figure_path, figname='spagetti_pulsing_odor_xy.pdf')
plot_colored_cartesian_spagetti(config, dataset_pulsing_odor, axis='yz', save_figure_path=save_figure_path, figname='spagetti_pulsing_odor_yz.pdf')
plot_colored_cartesian_spagetti(config, dataset_pulsing_odor, axis='xz', save_figure_path=save_figure_path, figname='spagetti_pulsing_xz.pdf')
# odor plot
print
print 'Best odor trajectory: '
if 1:
keys = opa.get_trajectories_with_odor(culled_dataset, 50)
keys = keys[0]
plot_colored_cartesian_spagetti(config, culled_dataset, axis='xy', keys=keys, color_attribute='odor', norm=(0,200), save_figure_path=save_figure_path, figname='odor_trajectory_xy.pdf', show_start=True)
plot_colored_cartesian_spagetti(config, culled_dataset, axis='xz', keys=keys, color_attribute='odor', norm=(0,200), save_figure_path=save_figure_path, figname='odor_trajectory_xz.pdf', show_start=True)
if 0:
keys = opa.get_trajectories_with_odor(culled_dataset, 175)
plot_colored_cartesian_spagetti(config, culled_dataset, axis='xy', keys=keys, color_attribute='odor', norm=(0,100), save_figure_path=save_figure_path, figname='odor_trajectory_xy.pdf')
plot_colored_cartesian_spagetti(config, culled_dataset, axis='xz', keys=keys, color_attribute='odor', norm=(0,100), save_figure_path=save_figure_path, figname='odor_trajectory_xz.pdf')
if __name__ == '__main__':
parser = OptionParser()
parser.add_option("--path", type="str", dest="path", default='',
help="path to empty data folder, where you have a configuration file")
(options, args) = parser.parse_args()
path = options.path
sys.path.append(path)
import analysis_configuration
config = analysis_configuration.Config()
culled_dataset_name = os.path.join(path, config.culled_datasets_path, config.culled_dataset_name)
culled_dataset = fad.load(culled_dataset_name)
figure_path = os.path.join(path, config.figure_path)
main(config, culled_dataset, save_figure_path=os.path.join(figure_path, 'spagetti/') )
| [
"florisvb@gmail.com"
] | florisvb@gmail.com |
47e8742a744f9ec9021e601b6a15d12833728306 | 9b0b204c3093a0d545fed6e0119f550a2f39f862 | /src/grammar_tester/lgmisc.py | ef5eee449822455d58ad8cc76b81467b2fa7ca17 | [
"MIT"
] | permissive | akolonin/language-learning | 581909ff84014949d33225e40bbb90e40a7dccc7 | 022c34a3066aa97ea0d007419e026247a4f78dd5 | refs/heads/master | 2020-03-22T09:55:51.442357 | 2018-12-24T14:50:13 | 2018-12-24T14:50:13 | 139,869,814 | 0 | 0 | MIT | 2018-12-24T14:43:24 | 2018-07-05T15:39:42 | Jupyter Notebook | UTF-8 | Python | false | false | 7,675 | py | import re
import os
import shutil
import logging
from .optconst import *
__all__ = ['get_output_suffix', 'print_output', 'LGParseError', 'LG_DICT_PATH', 'create_grammar_dir', 'get_dir_name',
'ParserError']
LG_DICT_PATH = "/usr/local/share/link-grammar"
LINK_1ST_TOKEN_INDEX = 0
LINK_2ND_TOKEN_INDEX = 1
logger = logging.getLogger(__name__)
class ParserError(Exception):
pass
class LGParseError(ParserError):
pass
def get_dir_name(file_name: str) -> (str, str):
"""
Extract template grammar directory name and a name for new grammar directory
:param file_name: Grammar file name. It should have the following notation:
'<grammar-name>_<N>C_<yyyy-MM-dd>_<hhhh>.4.0.dict' (e.g. poc-turtle_8C_2018-03-03_0A10.4.0.dict)
grammar-name Name of the language the grammar file was created for
N Number of clusters used while creating the grammar followed by literal 'C'.
yyyy-MM-dd Dash delimited date, where yyyy - year (e.g. 2018), MM - month,
dd - day of month.
hhhh Hexadecimal sequential number.
4.0.dict suffix is mandatory for any grammar definition file and should not be ommited.
:return: tuple (template_grammar_directory_name, grammar_directory_name)
"""
p = re.compile(
'(/?([+._:\w\d=~-]*/)*)(([a-zA-Z-]+)_[0-9]{1,6}C_[0-9]{4}-[0-9]{2}-[0-9]{2}_[0-9A-F]{4})\.(4\.0\.dict)')
m = p.match(file_name)
return (None, None) if m is None else (m.group(4), m.group(3))
def create_grammar_dir(dict_file_path: str, grammar_path: str, template_path: str, options: int) -> str:
"""
Create grammar directory using specified .dict file and other files from template directory.
:param dict_file_path: Path to .dict file.
:param grammar_path: Path to a directory where newly created grammar should be stored.
:param template_path: Path to template directory or language name installed with LG.
:param options: Bit field that specifies multiple parsing options.
:return: Path to newly created grammar directory.
:raises: FileNotFoundError
"""
if len(dict_file_path) == 0:
raise FileNotFoundError("Dictionary file name should not be empty.")
if not os.path.isfile(dict_file_path):
# The path is not specified correctly.
if dict_file_path.find("/") >= 0:
raise FileNotFoundError("Dictionary path '" + dict_file_path + "' does not exist.")
# If 'dict_file_path' is LG language short name such as 'en' then there must be a dictionary folder with the
# same name. If that's the case there is no need to create grammar folder, simply return the same name.
# Let LG handle it.
elif options & BIT_LG_GR_NAME: # os.path.isdir(LG_DICT_PATH + "/" + dict_file_path):
return dict_file_path
else:
raise FileNotFoundError("Dictionary path does not exist.")
# Extract grammar name and a name of the new grammar directory from the file name
(template_dict_name, dict_path) = get_dir_name(dict_file_path)
if dict_path is None:
raise FileNotFoundError("Dictionary file name is expected to have proper notation." + dict_file_path)
if not os.path.isdir(grammar_path):
raise FileNotFoundError("Grammar root path '{}' does not exist.".format(grammar_path))
dict_path = grammar_path + "/" + dict_path if dict_path is not None else dict_file_path
# If template_dir is not specified
if template_path is None:
template_path = LG_DICT_PATH + "/" + template_dict_name
# If template_dir is simply a language name such as 'en'
elif template_path.find("/") == -1:
template_path = LG_DICT_PATH + "/" + template_path
# Raise exception if template_path does not exist
if not os.path.isdir(template_path):
raise FileNotFoundError("Directory '{0}' does not exist.".format(template_path))
# Raise exctption if any of required LG dictionary files does not exist.
if not (os.path.isfile(template_path + "/4.0.affix") and os.path.isfile(template_path + "/4.0.knowledge")
and os.path.isfile(template_path + "/4.0.regex") ):
raise FileNotFoundError("Template directory '{0}' does not appear to be a proper Link Grammar dictionary."
.format(template_path))
if os.path.isdir(dict_path):
logger.info("Directory '" + dict_path + "' already exists.")
if options & BIT_RM_DIR > 0:
shutil.rmtree(dict_path, True)
logger.info("Directory '" + dict_path + "' has been removed. Option '-r' was specified.")
if not os.path.isdir(dict_path):
# Create dictionary directory using existing one as a template
shutil.copytree(template_path, dict_path)
logger.info("Directory '" + dict_path + "' with template files has been created.")
# Replace dictionary file '4.0.dict' with a new one
shutil.copy(dict_file_path, dict_path + "/4.0.dict")
logger.info("Dictionary file has been replaced with '" + dict_file_path + "'.")
return dict_path
def get_output_suffix(options: int) -> str:
""" Return output file name suffix depending on set options """
out_format = options & BIT_OUTPUT
suff = "" # "2" if (options & BIT_LG_EXE) else ""
if (out_format & BIT_OUTPUT_CONST_TREE) == BIT_OUTPUT_CONST_TREE:
return ".tree" + suff
elif (out_format & BIT_OUTPUT_DIAGRAM) == BIT_OUTPUT_DIAGRAM:
return ".diag" + suff
elif (out_format & BIT_OUTPUT_POSTSCRIPT) == BIT_OUTPUT_POSTSCRIPT:
return ".post" + suff
else:
return ".ull" + suff
def print_output(tokens: list, raw_links: list, options: int, ofl) -> None:
"""
Print links in ULL format to the output specified by 'ofl' variable.
:param tokens: List of tokens.
:param raw_links: List of links (unfiltered).
:param options: Bitmask with parsing options.
:param ofl: Output file handle.
:return: None
"""
rwall_index = -1
i = 0
for token in tokens:
if not token.startswith("###"):
ofl.write(token + ' ')
else:
if token.find("RIGHT-WALL") >= 0:
rwall_index = i
i += 1
ofl.write('\n')
links = sorted(raw_links, key=lambda x: (x[0], x[1]))
for link in links:
# Filter out all links with LEFT-WALL if 'BIT_NO_LWALL' is set
# if (options & BIT_NO_LWALL) and (link[LINK_1ST_TOKEN_INDEX] == 0 or link[LINK_2ND_TOKEN_INDEX] == 0):
if (options & BIT_ULL_NO_LWALL) and (link[LINK_1ST_TOKEN_INDEX] == 0 or link[LINK_2ND_TOKEN_INDEX] == 0):
continue
# Filter out all links with RIGHT-WALL if 'BIT_RWALL' is not set
if (options & BIT_RWALL) != BIT_RWALL and rwall_index >= 0 \
and (link[LINK_1ST_TOKEN_INDEX] == rwall_index or link[LINK_2ND_TOKEN_INDEX] == rwall_index):
continue
token_count = len(tokens)
index1, index2 = link[LINK_1ST_TOKEN_INDEX], link[LINK_2ND_TOKEN_INDEX]
if index1 < token_count and index2 < token_count:
print(index1, tokens[index1], index2, tokens[index2], file=ofl)
else:
logging.error("print_output(): something went wrong...")
logger.debug(tokens)
logger.debug(str(token_count) + ", (" + str(index1) + ", " + str(index2) + ")")
print('', file=ofl)
| [
"alex-gl@mail.ru"
] | alex-gl@mail.ru |
ece9158673edc340e1fa78bffe1386a47cf2f0d2 | 4e9577550faf6e2c43fc3b04913e2dc66bbc1659 | /RegExPuller/regex/string_process.py | dad516ba5e20199a5a86fed05569d2626801f268 | [] | no_license | wfearn/reg-con-proc | 300c9b3e383442d59fddcd025ee41c516ec20c98 | 4b657bd599d114063ca6552deb78f833c950fcc3 | refs/heads/master | 2020-04-12T08:03:46.601542 | 2016-10-05T23:07:08 | 2016-10-05T23:07:08 | 61,832,245 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,441 | py | #!/usr/bin/env python
import re
class StringProcess:
def __init__(self):
#Finds all strings that begin with a section number, beginning with
#Section, or simply a number.
self.section_match = re.compile(r'((?:\A\Section\s\d+\.[\d]+)|(?:\A[\d]+\.[\d]+\s))',
flags=re.IGNORECASE)
#Finds all strings that start with IN WITNESS WHEREOF, signifying end
#of an acquisition agreement.
self.end_match = re.compile(r'(\W*?IN\W*?WITNESS\W*?WHEREOF)', flags=re.M)
#Finds all strings that begin with "Agreement and Plan of Merger" which
#signifies the beginning of an acquisition agreement contract
self.beginning_match = re.compile(r"""((?:\A\W*?Agreement\W*?and\W*?Plan\W*?of\W*?Merger)|
(?:\A\W*?Acquisition\W*?Agreement)|
(?:\A\W*?Plan\W*?of\W*?Reorganization)|
(?:\A\W*?Stock\W*?Purchase\W*?Agreement)|
(?:\A\W*?Transaction\W*?Agreement))""", flags=re.I)
def matches_section(self, string):
match = self.section_match.match(string)
if match != None:
return True
else:
return False
def get_section_match(self, string):
if self.matches_section(string):
match = self.section_match.match(string)
return match.group(0)
else:
raise Exception("InvalidInput: %s" % string)
def matches_end(self, string):
#match = self.end_match.match(string)
match = self.end_match.search(string)
if match != None:
return True
else:
return False
def get_end_match(self, string):
if self.matches_end(string):
match = self.end_match.match(string)
return match.group(0)
else:
raise Exception("InvalidInput: %s" % string)
def matches_beginning(self, string):
match = self.beginning_match.match(string)
if match != None:
return True
else:
return False
def get_beginning_match(self, string):
if self.matches_beginning(string):
match = self.beginning_match.match(string)
return match.group(0)
else:
raise Exception("InvalidInput: %s" % string)
| [
"wilson.fearn@gmail.com"
] | wilson.fearn@gmail.com |
7c30ca77ff7ab8d16b8eccdf763b818abbd72e45 | ac810c7e637afd67cf19704a1a724eaac56fed93 | /Hackerrank_python/4.sets/30.Symmetric Difference.py | 880ecccb9397cfde54a05b96340d08a4c960acc0 | [
"MIT"
] | permissive | Kushal997-das/Hackerrank | 57e8e422d2b47d1f2f144f303a04f32ca9f6f01c | 1256268bdc818d91931605f12ea2d81a07ac263a | refs/heads/master | 2021-10-28T06:27:58.153073 | 2021-10-18T04:11:18 | 2021-10-18T04:11:18 | 298,875,299 | 41 | 8 | MIT | 2021-03-01T04:40:57 | 2020-09-26T18:26:19 | Python | UTF-8 | Python | false | false | 194 | py | # Enter your code here. Read input from STDIN. Print output to STDOUT
M=input()
x=set(map(int,input().split()))
N=input()
y=set(map(int,input().split()))
f=x^y
for i in sorted(f):
print (i)
| [
"noreply@github.com"
] | noreply@github.com |
60479426cc9150e33b3165fffc354d6ed03f1068 | 3493b395b7d8aba7a42401eb5a997967ab07352f | /models/image.py | aef03ebb693bc35a19f12da78775ee9e43d2a2b1 | [] | no_license | hachibeeDI/Giza | 334af48372defd66b6ab872bb2b753f32d69c8f4 | 12552ce5863f66d418c8c57d4c387e9ea6494999 | refs/heads/master | 2021-01-10T20:21:22.825538 | 2014-02-21T01:17:31 | 2014-02-21T01:17:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,578 | py | # -*- coding: utf-8 -*-
from __future__ import (print_function, division, absolute_import, unicode_literals, )
from os import (path, )
from base64 import b64decode
from flask import (jsonify, )
from .project import Projects
_ALLOWED_EXTENSIONS = {'PNG', 'png', 'JPG', 'jpg', 'jpeg', 'gif'}
def make_image(entry_id):
'''
:rtype Image:
'''
return Image(Projects().get(entry_id)[0])
def _allowed_file_extention(filename):
ext = filename.rsplit('.', 1)[1]
return '.' in filename and ext in _ALLOWED_EXTENSIONS
def _write_content(full_path, image64_as_url):
with open(full_path, 'wb+') as f:
_, data = image64_as_url.split(',')
f.write(b64decode(data))
class Image(object):
def __init__(self, project):
""""""
self.id = project.id
self.project = project
self._full_path = None
def create(self, content, name):
'''
:param {save: () -> T} content: posted file object by flask
'''
full_path = path.join(self.project.root, name)
if path.exists(full_path):
response = jsonify({'id': self.id, 'reason': 'file alredy exists.', })
return response, 409
if not (content or _allowed_file_extention(full_path)):
print(content)
print(full_path)
response = jsonify({'id': self.id, 'reason': 'invalid file pattern.', })
return response, 409
_write_content(full_path, content)
response = jsonify({'id': self.id, 'status': 'success'})
return response, 201
| [
"daiki.ogura@soliton.co.jp"
] | daiki.ogura@soliton.co.jp |
0d5db6af7c7852a4890054a62024e6713e579c74 | b22588340d7925b614a735bbbde1b351ad657ffc | /athena/Trigger/TriggerCommon/TriggerMenu/python/l1menu/Menu_Physics_HI_v5.py | 15f0ee3b1a83a6c0196d246fe4a72355984a0428 | [] | no_license | rushioda/PIXELVALID_athena | 90befe12042c1249cbb3655dde1428bb9b9a42ce | 22df23187ef85e9c3120122c8375ea0e7d8ea440 | refs/heads/master | 2020-12-14T22:01:15.365949 | 2020-01-19T03:59:35 | 2020-01-19T03:59:35 | 234,836,993 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 36,900 | py | # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
def print_available():
from TriggerMenu.l1.Lvl1Flags import Lvl1Flags
defineMenu()
available = []
for i in range(512):
if i==463: continue #reserved for L1_RD2_BGRP14, L1_RD3_BGRP15 now assigned to 510 for partition 3 ATR-17737
if i>=509 and i<=511: continue #reserved for CALREQ
if not i in Lvl1Flags.CtpIdMap().values(): available.append(str(i))
available.sort()
print "There are %d available CTP IDs:"%len(available),",".join(available)
print "IDs >= 472 go in partition 2, IDs >= 492 go in partition 3"
def defineMenu():
"""
Defines the following LvlFlags:
thresholds .... list of all threshold names in the menu (includes forced thresholds)
items .... list of all L1 item names in the menu
CtpIdMap .... map of item names to CTP IDs
"""
from TriggerMenu.l1.Lvl1Flags import Lvl1Flags
Lvl1Flags.CTPVersion = 4 # new CTP
#TODO should be different?
Lvl1Flags.BunchGroupPartitioning = [1, 13, 14] # partition 1: 1-12, partition 2: 13, partition 3: 14-15 (note that BGRP0 is used by all items)
Lvl1Flags.BunchGroupNames = ['BCRVeto', 'Filled', 'Calib', 'Empty', 'UnpairedBeam1', 'UnpairedBeam2', 'FirstEmpty', 'InTrain']
Lvl1Flags.BunchGroupNames += ['NotUsed'] * len(Lvl1Flags.BunchGroupNames())
Lvl1Flags.MenuPartitioning = [0, 472, 492] # partition 1: ctpid 0-471, partition 2: ctpid 472-491, partition 3: ctpid 492-511
Lvl1Flags.RemapThresholdsAsListed = True
Lvl1Flags.thresholds = [
# Note that the forced thresholds (FTHR) are not used in the menu but are needed for input monitoring
# They can always be replaced with something that is needed for the menu
#-------------------------
# SLOT 7 / CON 0,1 (EM1,2)
#-------------------------
# 16 x EM
'EM7', 'EM8', 'EM8I', 'EM10', 'EM10VH', 'EM12', 'EM13VH', 'EM14', 'EM15', 'EM15HI', 'EM16', 'EM18', 'EM20', 'EM20VH', 'EM20VHI', 'EM22',
# 1 x ZB
'ZB_J75', # TODO double check if 'ZB_EM15' should be used for Run-2 (need to be changed also in ItemDef).
#--------------------------
# SLOT 7 / CON 2,3 (TAU1,2)
#--------------------------
#TODO TAU trigger behaving like EM items, lowere thresholds
# 16 x TAU
'HA8', 'HA12', 'HA12IL', 'HA12IM', 'HA12IT', 'HA15', 'HA20', 'HA20IL', 'HA20IM', 'HA20IT', 'HA25', 'HA25IT', 'HA30', 'HA40', 'HA60', 'HA100',
#----------------------
# SLOT 8 / CON 0 (JET1)
#----------------------
# 10 x 3-bit JET (can have multiplicity 4 or more)
#TODO shall we start at higher pT to reduce overflows?
# 8 x JETs and central jets
'J12', 'J12.0ETA23', 'J15', 'J15.0ETA25','J20', 'J25','J25.0ETA23','J30',
# 2 x VBF
'J20.0ETA49', 'J30.0ETA49',
#----------------------
# SLOT 8 / CON 1 (JET2)
#----------------------
# 15 x 2-bit JET (can have maximum multiplicity of 3) (SLOT 8, CON 1)
# 3 x Central Jet
'JJ15.23ETA49','J20.28ETA31','J40.0ETA25',
# 6 Jets
'J40', 'J50', 'J75', 'J85', 'J100', 'J175',
# 6 x FJ
'J10.31ETA49', 'J15.31ETA49', 'J20.31ETA49', 'J30.31ETA49', 'J75.31ETA49', 'J100.31ETA49',
#---------------------
# SLOT 8 / CON 2 (EN1)
#---------------------
# 24 x 1-bit thresholds
# 8 x TE
'TE5', 'TE20', 'TE50', 'TE100', 'TE200', 'TE10000', 'TE12000', 'TE14000',
# 8 x XE
'XE35', 'XE40', 'XE45', 'XE50', 'XE55', 'XE60', 'XE70', 'XE80',
'XE35.0ETA24', 'XE40.0ETA24', 'XE45.0ETA24', 'XE50.0ETA24', 'XE55.0ETA24', 'XE60.0ETA24', 'XE70.0ETA24', 'XE80.0ETA24',
# 8 x XS
'XS20', 'XS30', 'XS40', 'XS45', 'XS50', 'XS55', 'XS60', 'XS65',
#---------------------
# SLOT 8 / CON 3 (EN2)
#---------------------
# 16 x 1-bit thresholds
# 8 x weighted sum ET
#'RXE35', 'RXE40', 'RXE45', 'RXE50', 'RXE55', 'RXE60', 'RXE70', 'RXE80', # FTHR
# 8 x restricted eta range in |eta|<4.9
'TE500.0ETA49', 'TE1500.0ETA49', 'TE3000.0ETA49', 'TE3500.0ETA49',
'TE5000.0ETA49', 'TE6500.0ETA49', 'TE8000.0ETA49', 'TE9000.0ETA49',
#------------------------
# SLOT 9 / CON 0 (MUCTPi)
#------------------------
# 6 x MU (TODO can we still use MU0?)
'MU4', 'MU6', 'MU10', 'MU11', 'MU15', 'MU20',
# MU10 is needed for monitoring
#------------------------
# SLOT 9 / CON 1 (CTPCal)
#------------------------
# 3 x 1-bit BCM
'BCM_AtoC', 'BCM_CtoA', 'BCM_Wide',
# 1 x 3-bit BCM
'BCM_Comb',
# 8 x DBM
#'DBM0', 'DBM1', 'DBM2', 'DBM3', 'DBM4', 'DBM5', 'DBM6', 'DBM7', # FTHR
# 2 x BPTX
'BPTX0','BPTX1',
# 6 x LUCID
'LUCID_A', 'LUCID_C',
#'LUCID_Coinc_AC', # FTHR
#'LUCID_COMM',
#'LUCID_05', 'LUCID_06', # FHTR
# 3 x ZDC
'ZDC_A', 'ZDC_C',
'ZDC_AND', # FTHR
# 3 x CALREQ
'CAL0','CAL1','CAL2',
#-----------------------------
# SLOT 9 / CON 2,3 (NIM1,NIM2)
#-----------------------------
# 2 x MBTS
'MBTS_A', 'MBTS_C',
#TODO/NOTE: redefined according to pp_v7 menu
# 32 x MBTSSI (all FTHR)
# NOTE: THESE ARE OUT OF ORDER FOR A REASON! Do not change!
# The order defines the mapping - see ATR-17870.
'MBTS_A0', 'MBTS_A1', 'MBTS_A2', 'MBTS_A3', 'MBTS_A4', 'MBTS_A5', 'MBTS_A6', 'MBTS_A7',
'MBTS_A8', 'MBTS_A10', 'MBTS_A12', 'MBTS_A14', 'MBTS_A9', 'MBTS_A11','MBTS_A13', 'MBTS_A15',
'MBTS_C0', 'MBTS_C1', 'MBTS_C2', 'MBTS_C3', 'MBTS_C4', 'MBTS_C5', 'MBTS_C6', 'MBTS_C7',
'MBTS_C8', 'MBTS_C10', 'MBTS_C12', 'MBTS_C14', 'MBTS_C11', 'MBTS_C13','MBTS_C9','MBTS_C15',
# L1A for CTP monitoring itself
'NIML1A',
# LHCF
'NIMLHCF',
# TGC
'NIMTGC',
# RPC
'NIMRPC',
# TRT
'NIMTRT',
# AFP
'AFP_NSC', 'AFP_NSA',
'AFP_FSA_SIT', 'AFP_FSA_TOF', 'AFP_FSA_LOG',
'AFP_FSC_SIT', 'AFP_FSC_LOG', 'AFP_FSC_TOF',
#-------------------------------------------------------------------
#L1 TOPO inputs TODO - need to modify?
#-------------------------------------------------------------------
#HT
'HT190-AJ15all.ETA21',
'HT190-J15s5.ETA21',
'HT150-AJ20all.ETA31',
'HT150-J20s5.ETA31',
#ZH
'10MINDPHI-AJ20s2-XE50', '10MINDPHI-J20s2-XE50', '10MINDPHI-J20s2-XE30', '10MINDPHI-J20ab-XE50', '10MINDPHI-CJ20ab-XE50',
#Jpsi T&P
'1INVM5-EMs1-EMs6', '1INVM5-EM7s1-EMs6', '1INVM5-EM12s1-EMs6',
#W T&P
'05MINDPHI-AJj10s6-XE0',
'10MINDPHI-AJj10s6-XE0',
'15MINDPHI-AJj10s6-XE0',
'05MINDPHI-EM12s6-XE0',
'15MINDPHI-EM12s6-XE0',
'05MINDPHI-EM15s6-XE0',
'15MINDPHI-EM15s6-XE0',
'05RATIO-XE0-HT0-AJj15all.ETA49',
'90RATIO2-XE0-HT0-AJj15all.ETA49',
'250RATIO2-XE0-HT0-AJj15all.ETA49',
'HT20-AJj15all.ETA49',
'NOT-02MATCH-EM10s1-AJj15all.ETA49',
'25MT-EM12s6-XE0',
'35MT-EM12s6-XE0',
'35MT-EM15s6-XE0',
#'10MINDPHI-AJj15s2-XE0',
#'20MINDPHI-AJjs6-XE0',
#'20MINDPHI-AJj15s2-XE0',
#'10MINDPHI-EM6s1-XE0',
#'20MINDPHI-EM9s6-XE0',
#'20MINDPHI-EM6s1-XE0',
#'05RATIO-XE0-HT0-AJj15all.ETA49',
#'08RATIO-XE0-HT0-AJj0all.ETA49',
#'40RATIO2-XE0-HT0-AJj15all.ETA49',
#'90RATIO2-XE0-HT0-AJj0all.ETA49',
#'HT20-AJj0all.ETA49',
#'NOT-02MATCH-EM9s1-AJj15all.ETA49',
#'05RATIO-XE0-SUM0-EM9s1-HT0-AJj15all.ETA49',
#'20MT-EM6s6-XE0',
#'30MT-EM6s6-XE0',
#'40MT-EM6s6-XE0',
# central muon
'MULT-CMU4ab',
'MULT-CMU6ab',
#B-jet
'0DR04-MU4ab-CJ15ab', '0DR04-MU4ab-CJ20ab', '0DR04-MU4ab-CJ30ab', '0DR04-MU6ab-CJ20ab', '0DR04-MU6ab-CJ25ab',
#B-physics
'0DR03-EM7ab-CJ15ab',
'2DR15-2MU6ab',
# L1 thresholds for L1Topo streamers
#SX '2INVM999-CMU4ab-MU4ab',
#SX '2INVM999-2CMU4ab',
#SX '2INVM999-MU6ab-MU4ab',
#SX '2INVM999-ONEBARREL-MU6ab-MU4ab',
#SX '2INVM999-CMU6ab-CMU4ab',
#SX '4INVM8-CMU4ab-MU4ab',
#SX '4INVM8-2CMU4ab',
#SX '4INVM8-MU6ab-MU4ab',
#SX '4INVM8-ONEBARREL-MU6ab-MU4ab',
#SX '4INVM8-CMU6ab-CMU4ab',
'2DR99-2MU4ab',
'5DETA99-5DPHI99-MU6ab-MU4ab',
'5DETA99-5DPHI99-2MU6ab',
'0DR10-MU10ab-MU6ab',
'0DR15-2MU6ab',
# '0DETA04-0DPHI03-EM8abi-MU10ab',
'0DETA04-EM8abi-MU10ab',
'0DPHI03-EM8abi-MU10ab',
# '0DETA04-0DPHI03-EM15abi-MUab',
'0DETA04-EM15abi-MUab',
'0DPHI03-EM15abi-MUab',
'10MINDPHI-AJ20s2-XE50',
'10MINDPHI-J20s2-XE50',
'10MINDPHI-J20ab-XE50',
'10MINDPHI-CJ20ab-XE50',
'900INVM9999-AJ30s6-AJ20s6',
'800INVM9999-AJ30s6-AJ20s6',
'700INVM9999-AJ30s6-AJ20s6',
'500INVM9999-AJ30s6-AJ20s6',
'400INVM9999-AJ30s6-AJ20s6',
#'350INVM9999-AJ30s6-AJ20s6',
'300INVM9999-AJ30s6-AJ20s6',
'200INVM9999-AJ30s6-AJ20s6',
'100INVM9999-AJ30s6-AJ20s6',
'600INVM9999-J30s6-AJ20s6',
'500INVM9999-J30s6-AJ20s6',
'400INVM9999-J30s6-AJ20s6',
'200INVM9999-J30s6-AJ20s6',
'63DETA127-FJ20s1-FJ20s2',
'0DETA20-J50s1-Js2',
'27DPHI32-EMs1-EMs6',
#'350INVM9999-J30s6-J20s6',
#'300INVM9999-J30s6-J20s6',
#'250INVM9999-J30s6-J20s6',
#'200INVM9999-J30s6-J20s6',
'HT150-AJj15all.ETA49',
'0MATCH-4AJ20.ETA31-4AJj15.ETA31',
'100RATIO-0MATCH-TAU30si2-EMall',
'NOT-0MATCH-TAU30si1-EMall',
'0DR28-MU10ab-TAU12abi',
'1DISAMB-TAU12abi-J25ab',
'1DISAMB-EM15his2-TAU12abi-J25ab',
'DISAMB-0DR28-EM15his2-TAU12abi',
'1DISAMB-J25ab-0DR28-EM15his2-TAU12abi',
'1DISAMB-TAU20abi-TAU12abi-J25ab',
'0DR25-TAU20abi-TAU12abi',
'0DR28-TAU20abi-TAU12abi',
'0DETA20-0DPHI20-TAU20abi-TAU12abi',
'1DISAMB-J25ab-0DR25-TAU20abi-TAU12abi',
'1DISAMB-J25ab-0DR28-TAU20abi-TAU12abi',
'DISAMB-30INVM-EM20his2-TAU12ab',
'400INVM9999-AJ30s6.ETA31-AJ20s6.31ETA49',
'LAR-EM20shi1',
'LAR-J100s1',
'ZEE-EM20shi2',
'FTK-EM20s1',
'FTK-J100s1',
'FTK-MU10s1',
'2INVM9-2MU6ab',
'7INVM15-2MU4ab',
'2INVM8-ONEBARREL-MU6ab-MU4ab',
'0DR24-2CMU4ab',
'0DR22-2MU6ab',
'0DR34-2MU4ab',
'0DR24-2MU4ab',
'0DR24-CMU4ab-MU4ab',
'2INVM8-CMU4ab-MU4ab',
'0DR15-2MU4ab',
'0DR15-MU6ab-MU4ab',
'0DR22-MU6ab-MU4ab',
'8INVM15-MU6ab-MU4ab',
'8INVM15-2MU6ab',
'0INVM9-EM7ab-EMab',
'2INVM8-2MU4ab', # ATR-15197 '2INVM9-2MU4ab',
'2INVM8-MU6ab-MU4ab', # ATR-15197 '2INVM9-MU6ab-MU4ab',
'2INVM9-2MU4ab',
'2INVM9-MU6ab-MU4ab',
'KF-XE40-AJall',
'KF-XE50-AJall',
'KF-XE55-AJall',
'KF-XE60-AJall',
'KF-XE65-AJall',
'KF-XE75-AJall',
'LATE-MU10s1',
'SC111-CJ15ab.ETA26',
'SC85-CJ15ab.ETA26',
# ALFA (the replication is needed to build all the combinations in the CTPCore)
'ALFA_B7R1L', 'ALFA_B7R1U', 'ALFA_A7R1L', 'ALFA_A7R1U', 'ALFA_A7L1L', 'ALFA_A7L1U', 'ALFA_B7L1L', 'ALFA_B7L1U',
'ALFA2_B7R1L', 'ALFA2_B7R1U', 'ALFA2_A7R1L', 'ALFA2_A7R1U', 'ALFA2_A7L1L', 'ALFA2_A7L1U', 'ALFA2_B7L1L', 'ALFA2_B7L1U',
'ALFA3_B7R1L', 'ALFA3_B7R1U', 'ALFA3_A7R1L', 'ALFA3_A7R1U', 'ALFA3_A7L1L', 'ALFA3_A7L1U', 'ALFA3_B7L1L', 'ALFA3_B7L1U',
'ALFA4_B7R1L', 'ALFA4_B7R1U', 'ALFA4_A7R1L', 'ALFA4_A7R1U', 'ALFA4_A7L1L', 'ALFA4_A7L1U', 'ALFA4_B7L1L', 'ALFA4_B7L1U',
#ATR-13743
'ALFA_B7R1L_OD', 'ALFA_B7R1U_OD', 'ALFA_A7R1L_OD', 'ALFA_A7R1U_OD', 'ALFA_A7L1L_OD', 'ALFA_A7L1U_OD', 'ALFA_B7L1L_OD', 'ALFA_B7L1U_OD',
]
Lvl1Flags.items = [
'L1_EM7',
'L1_EM8',
'L1_EM10',
'L1_EM12',
'L1_EM14',
'L1_EM16',
'L1_EM18',
'L1_EM20',
'L1_EM22',
'L1_2EM10',
#'L1_2EM5',
'L1_2EM7',
# tau beam items
#'L1_TAU8',
#muons
#'L1_MU0',
'L1_MU11',
'L1_MU15',
'L1_MU20',
'L1_MU4',
'L1_MU6',
#'L1_2MU0',
'L1_2MU4',
#'L1_2MU0_MU6',
'L1_2MU11',
'L1_2MU20',
'L1_2MU6',
'L1_3MU6',
#jets
'L1_J12',
'L1_J15',
'L1_J20',
'L1_J30',
#'L1_J35',
'L1_J50',
'L1_J75',
'L1_J175',
#jet energy
'L1_2J15',
#'L1_JE200',
#'L1_JE300',
#'L1_JE500',
# forward jets
'L1_J10.31ETA49',
#'L1_FJ30',
#'L1_FJ55' ,
#'L1_FJ95',
#MinBias
'L1_LUCID_A',
'L1_LUCID_C',
'L1_LUCID_A_C',
'L1_LUCID',
#'L1_LUCID_COMM',
'L1_MBTS_2',
'L1_MBTS_2_BGRP9',
'L1_MBTS_2_BGRP11',
'L1_MBTS_2_EMPTY',
'L1_MBTS_2_UNPAIRED_ISO',
'L1_MBTS_2_UNPAIRED_NONISO',
'L1_MBTS_1',
'L1_MBTS_1_EMPTY',
'L1_MBTS_1_UNPAIRED_ISO',
'L1_MBTS_1_UNPAIRED_NONISO',
'L1_MBTS_1_1',
'L1_MBTS_2_2',
'L1_MBTS_3_3',
'L1_MBTS_4_4',
'L1_MBTS_1_1_BGRP11',
'L1_MBTS_1_1_VTE50',
'L1_MBTS_2_2_VTE50',
#TRT
'L1_TRT_FILLED',
'L1_TRT_EMPTY',
#randoms
'L1_RD0_BGRP9',
'L1_RD0_FILLED',
'L1_RD0_FIRSTEMPTY',
'L1_RD0_UNPAIRED_ISO',
'L1_RD0_EMPTY',
'L1_RD1_FILLED',
'L1_RD1_EMPTY',
#MET
#total energy
'L1_TE5',
'L1_TE20',
'L1_TE50',
'L1_TE100',
'L1_TE200',
'L1_TE10000',
'L1_TE12000',
'L1_TE14000',
'L1_TE5_NZ',
'L1_TE5_VTE200',
# restricted TE
'L1_TE500.0ETA49',
'L1_TE1500.0ETA49',
'L1_TE3000.0ETA49',
'L1_TE3500.0ETA49',
'L1_TE5000.0ETA49',
'L1_TE6500.0ETA49',
'L1_TE8000.0ETA49',
'L1_TE9000.0ETA49',
# restricted TE for overlay
'L1_TE500.0ETA49_OVERLAY',
'L1_TE1500.0ETA49_OVERLAY',
'L1_TE3000.0ETA49_OVERLAY',
'L1_TE3500.0ETA49_OVERLAY',
'L1_TE5000.0ETA49_OVERLAY',
'L1_TE6500.0ETA49_OVERLAY',
'L1_TE8000.0ETA49_OVERLAY',
'L1_TE9000.0ETA49_OVERLAY',
#Min Bias
'L1_ZDC',
'L1_ZDC_A',
'L1_ZDC_C',
'L1_ZDC_AND',
'L1_ZDC_AND_VTE50',
'L1_ZDC_A_C',
'L1_ZDC_A_C_BGRP11',
'L1_ZDC_A_C_OVERLAY',
'L1_ZDC_A_C_VTE50_OVERLAY',
'L1_TE50_OVERLAY',
'L1_ZDC_A_C_VTE50',
'L1_ZDC_A_C_TE50',
'L1_BCM_Wide',
'L1_BCM_HT_BGRP0','L1_BCM_Wide_BGRP0','L1_BCM_AC_CA_BGRP0',
'L1_ZDC_MBTS_1',
'L1_ZDC_MBTS_2',
'L1_ZDC_MBTS_1_1',
'L1_ZDC_MBTS_2_2',
'L1_ZDC_VTE200',
#ZDC one side
'L1_ZDC_A_VZDC_C_VTE200',
'L1_ZDC_C_VZDC_A_VTE200',
'L1_ZDC_XOR',
'L1_ZDC_XOR_VTE200',
'L1_ZDC_XOR_TE5_VTE200',
'L1_ZDC_XOR_TRT_VTE200',
#coincidence
'L1_ZDC_A_C_VTE200',
'L1_ZDC_A_C_TE5_VTE200',
#NIMDIR stuff
# temporary commented out in HI_v3: 'L1_NIM_S8C2B21', 'L1_NIM_S8C2B22', 'L1_NIM_S8C2B23',
# votoed by TE
#UPC triggers
#'L1_MU0_NZ',
'L1_J15_NZ',
#'L1_2MU0_NZ',
#'L1_2EM3_NZ',
'L1_2J15_NZ',
#'L1_MU0_NL',
#'L1_EM3_NL',
'L1_J15_NL',
#'L1_2MU0_NL',
#'L1_2EM3_NL',
'L1_2J15_NL',
#'L1_MU0_MV',
#'L1_2MU0_MV',
#'L1_MU0_MV_VTE50',
#'L1_MU0_VTE50',
#'L1_MU0_TE50',
'L1_MU4_MV_VTE50',
'L1_MU4_VTE50',
'L1_MU4_TE50',
#'L1_EM3_MV_VTE50',
#'L1_EM3_VTE50',
'L1_J12_VTE100',
'L1_J12_VTE200',
## VDM
'L1_ZDC_A_C_BGRP7','L1_LUCID_BGRP7','L1_BGRP7',
#MBTS 32 inputs
'L1_MBTSA0', 'L1_MBTSA1', 'L1_MBTSA2', 'L1_MBTSA3', 'L1_MBTSA4',
'L1_MBTSA5', 'L1_MBTSA6', 'L1_MBTSA7', 'L1_MBTSA8', ##'L1_MBTSA9', 11, 13, 15 not in run2 anymore
'L1_MBTSA10', ##'L1_MBTSA11',
'L1_MBTSA12', ##'L1_MBTSA13',
'L1_MBTSA14',##'L1_MBTSA15',
'L1_MBTSC0', 'L1_MBTSC1', 'L1_MBTSC2', 'L1_MBTSC3', 'L1_MBTSC4',
'L1_MBTSC5', 'L1_MBTSC6', 'L1_MBTSC7', 'L1_MBTSC8', ##'L1_MBTSC9',
'L1_MBTSC10', ##'L1_MBTSC11',
'L1_MBTSC12', ##'L1_MBTSC13',
'L1_MBTSC14',
##'L1_MBTSC15',
#background
'L1_EM7_UNPAIRED_ISO','L1_EM7_UNPAIRED_NONISO','L1_EM7_EMPTY','L1_EM7_FIRSTEMPTY',
#MU UNPAIRED-EMPTY-ETC
#'L1_MU0_UNPAIRED_ISO','L1_MU0_UNPAIRED_NONISO','L1_MU0_EMPTY','L1_MU0_FIRSTEMPTY',
'L1_MU4_UNPAIRED_ISO', 'L1_MU4_UNPAIRED_NONISO', 'L1_MU4_EMPTY',
'L1_MU4_FIRSTEMPTY',
'L1_MU6_FIRSTEMPTY','L1_MU11_EMPTY',
#'L1_2MU0_EMPTY',
'L1_2MU4_EMPTY',
'L1_2MU6_UNPAIRED_ISO','L1_2MU6_UNPAIRED_NONISO','L1_2MU6_EMPTY','L1_2MU6_FIRSTEMPTY',
#TAU UNPAIRED-EMPTY-ETC
'L1_TAU12_UNPAIRED_ISO','L1_TAU12_UNPAIRED_NONISO','L1_TAU12_EMPTY','L1_TAU12_FIRSTEMPTY',
#J UNPAIRED-EMPTY-ETC
'L1_J12_UNPAIRED_ISO','L1_J12_UNPAIRED_NONISO','L1_J12_EMPTY','L1_J12_FIRSTEMPTY',
'L1_J30_EMPTY', 'L1_J30_UNPAIRED', 'L1_J30_FIRSTEMPTY',
#FJ UNPAIRED-EMPTY-ETC
#'L1_FJ10_UNPAIRED_ISO', 'L1_FJ10_FIRSTEMPTY',
'L1_J10.31ETA49_EMPTY',
#ZDC
'L1_ZDC_EMPTY',
'L1_ZDC_UNPAIRED_ISO',
'L1_ZDC_UNPAIRED_NONISO',
#L1_ZDC_AND
'L1_ZDC_AND_EMPTY',
'L1_ZDC_AND_UNPAIRED_ISO',
'L1_ZDC_AND_UNPAIRED_NONISO',
#
'L1_ZDC_A_C_BGRP9',
'L1_ZDC_A_C_EMPTY',
'L1_ZDC_A_C_UNPAIRED_ISO',
'L1_ZDC_A_C_UNPAIRED_NONISO',
#MBTS
'L1_MBTS_1_1_BGRP9',
'L1_MBTS_1_1_EMPTY',
'L1_MBTS_2_2_EMPTY',
'L1_MBTS_3_3_EMPTY',
'L1_MBTS_1_1_UNPAIRED_ISO',
'L1_MBTS_2_2_UNPAIRED_ISO',
'L1_MBTS_3_3_UNPAIRED_ISO',
'L1_MBTS_4_4_UNPAIRED_ISO',
#LUCID
'L1_LUCID_EMPTY',
'L1_LUCID_UNPAIRED_ISO',#'L1_LUCID_COMM_UNPAIRED_ISO',
'L1_LUCID_A_C_EMPTY',
'L1_LUCID_A_C_UNPAIRED_ISO',
'L1_LUCID_A_C_UNPAIRED_NONISO',
#ZB
'L1_ZB',
# lumi measurements
'L1_MLZ_A', 'L1_MLZ_C', 'L1_MBLZ',
# BGRP and BPTX
'L1_BPTX0_BGRP0', 'L1_BPTX1_BGRP0',
'L1_BGRP0',
'L1_BGRP1',
#BCM
'L1_BCM_Wide_EMPTY','L1_BCM_Wide_UNPAIRED_ISO','L1_BCM_Wide_UNPAIRED_NONISO',
'L1_BCM_AC_CA_UNPAIRED_ISO',
######### Run-2 monitoring items taken from monitoring rules
'L1_BCM_AC_ABORTGAPNOTCALIB',
'L1_BCM_AC_CALIB',
'L1_BCM_AC_UNPAIRED_ISO',
'L1_BCM_AC_UNPAIRED_NONISO',
'L1_BCM_CA_ABORTGAPNOTCALIB',
'L1_BCM_CA_CALIB',
'L1_BCM_CA_UNPAIRED_ISO',
'L1_BCM_CA_UNPAIRED_NONISO',
'L1_BCM_Wide_ABORTGAPNOTCALIB',
'L1_BCM_Wide_CALIB',
'L1_J12_ABORTGAPNOTCALIB',
'L1_J12_BGRP12',
'L1_J30.31ETA49_UNPAIRED_ISO',
'L1_J30.31ETA49_UNPAIRED_NONISO',
'L1_J30.31ETA49_BGRP12',
'L1_J50_ABORTGAPNOTCALIB',
'L1_J50_UNPAIRED_ISO',
'L1_J50_UNPAIRED_NONISO',
'L1_CALREQ2',
'L1_EM10VH',
'L1_EM15',
'L1_EM15HI_2TAU12IM',
'L1_EM15HI_2TAU12IM_J25_3J12',
'L1_EM15HI_2TAU12IM_XE35',
'L1_EM15HI_TAU40_2TAU15',
#### NO-MU10 'L1_MU10_TAU12IM',
#### NO-MU10 'L1_MU10_TAU12IM_J25_2J12',
#### NO-MU10 'L1_MU10_TAU12IM_XE35',
#### NO-MU10 'L1_MU10_TAU12IM_XE40',
#### NO-MU10 'L1_MU10_TAU12_J25_2J12',
#### NO-MU10 'L1_MU10_TAU20',
#### NO-MU10 'L1_MU10_TAU20IM',
'L1_TAU12',
'L1_TAU12IL',
'L1_TAU12IM',
'L1_TAU12IT',
'L1_TAU20',
'L1_TAU20IL',
'L1_TAU20IL_2TAU12IL_J25_2J20_3J12',
'L1_TAU20IM',
'L1_TAU20IM_2J20_XE45',
'L1_TAU20IM_2J20_XE50',
'L1_TAU20IM_2TAU12IM',
'L1_TAU20IM_2TAU12IM_J25_2J20_3J12',
'L1_TAU20IM_2TAU12IM_XE35',
'L1_TAU20IM_2TAU12IM_XE40',
'L1_TAU20IT',
'L1_TAU20_2J20_XE45',
'L1_TAU20_2TAU12',
'L1_TAU20_2TAU12_XE35',
'L1_TAU25IT_2TAU12IT_2J25_3J12',
'L1_TAU30',
'L1_TAU40',
'L1_TAU60',
#'L1_TAU8',
'L1_EM20VH_FIRSTEMPTY',
'L1_EM20VHI',
'L1_EM7_EMPTY',
'L1_EM7_FIRSTEMPTY',
'L1_J100',
#'L1_J100.31ETA49',
#'L1_J100.31ETA49_FIRSTEMPTY',
'L1_J100_FIRSTEMPTY',
'L1_J30.31ETA49',
'L1_J30.31ETA49_EMPTY',
'L1_J40_XE50',
'L1_J75.31ETA49',
'L1_J75_XE40',
'L1_RD0_ABORTGAPNOTCALIB',
'L1_TGC_BURST',
'L1_XE35',
'L1_XE50',
#TOPO
'L1_LAR-EM',
'L1_LAR-J',
]
Lvl1Flags.CtpIdMap = {
'L1_EM18' : 0,
'L1_EM22' : 1,
'L1_EM7' : 2,
'L1_EM10' : 3,
'L1_EM12' : 4,
'L1_EM14' : 5,
'L1_2MU4_EMPTY' : 6,
'L1_RD0_UNPAIRED_NONISO' : 7,
'L1_BCM_AC_CA_UNPAIRED_NONISO': 8,
'L1_FJ10_UNPAIRED_NONISO' : 9,
'L1_2EM10' : 10,
#'L1_2EM5' : 11,
#'L1_MU0_VTE20' : 12,
'L1_LAR-EM' : 11,
'L1_LAR-J' : 12,
'L1_NIM_S8C2B21' : 13,#DIRNIM
'L1_NIM_S8C2B22' : 14,#DIRNIM
'L1_MBTS_4_4' : 15,
'L1_RD1_EMPTY': 16,
'L1_RD0_FILLED' : 17,
'L1_RD0_FIRSTEMPTY' : 18,
'L1_RD0_UNPAIRED_ISO' : 19,
'L1_MBTS_4_4_UNPAIRED_ISO': 20,
'L1_ZDC_AND_VTE50' : 27,
#'L1_EM3_VTE20': 28,
#'L1_MU0_MV_VTE50' : 34,
#'L1_MU0_VTE50' : 35,
'L1_ZDC_A_C_VTE50' : 36,
'L1_ZDC_A_C_UNPAIRED_NONISO' : 37,
'L1_MU4_VTE50' : 38,
'L1_MU4_MV_VTE50' : 39,
'L1_ZDC_A_C_OVERLAY' : 40,
#'L1_MU0_TE50' : 41,
'L1_ZDC_A_C_TE50' : 42,
'L1_MU4_TE50' : 43,
#'L1_EM3_VTE50' : 44,
#'L1_EM3_MV_VTE50' : 45,
'L1_J12_VTE100' : 46,
'L1_BGRP7' : 47,
'L1_LUCID_BGRP7' : 48,
'L1_MBTS_2_BGRP7' : 49,
'L1_MBTSC4' : 50,
'L1_MBTSC5' : 51,
'L1_MBTSC6' : 52,
'L1_MBTSC7' : 53,
'L1_MBTSC8' : 54,
'L1_MBTSC9' : 55,
'L1_MBTSC10' : 56,
'L1_MBTSC11' : 57,
'L1_MBTSC12' : 58,
'L1_MBTSC13' : 59,
'L1_MBTSC14' : 60,
'L1_MBTSC15' : 61,
'L1_RD0_EMPTY' : 62,
'L1_RD1_FILLED' : 63,
#'L1_TAU3' : 64,
'L1_MBTSC3' : 65,
'L1_MU4_FIRSTEMPTY' : 67,
'L1_MU6_FIRSTEMPTY' : 68,
#'L1_2MU0_EMPTY' : 69,
#'L1_MU0_FIRSTEMPTY' : 70,
'L1_2MU6' : 71,
'L1_2MU11' : 72,
'L1_2MU20' : 73,
'L1_MU11_EMPTY' : 75,
'L1_MBTSC2' : 76,
'L1_LUCID_UNPAIRED_NONISO' : 77,
'L1_BCM_Wide_BGRP0' : 80,
'L1_BCM_AC_CA_BGRP0' : 81,
'L1_MBTSC1' : 82,
'L1_J12_UNPAIRED' : 83,
'L1_EM20' : 84,
'L1_EM16' : 85,
'L1_MBTSC0' : 86,
'L1_J30_UNPAIRED' : 87,
'L1_MU15' : 88,
#'L1_MU0' : 89,
'L1_MU6' : 90,
'L1_MU11' : 91,
'L1_MU20' : 92,
'L1_MU4' : 93,
#'L1_2MU0' : 94,
'L1_2MU4' : 95,
'L1_J20' : 96,
#'L1_J12' : 97,
'L1_J15' : 98,
'L1_J30' : 99,
#'L1_J35' : 100,
'L1_J50' : 102,
'L1_J18' : 104,
#'L1_J5' : 105,
'L1_BCM_AC_CA_UNPAIRED_ISO' : 106,
'L1_BCM_Wide_EMPTY' : 107,
'L1_BCM_Wide_UNPAIRED_ISO' : 108,
'L1_L1_BCM_Wide_UNPAIRED_NONISO' : 109,
'L1_LUCID_UNPAIRED_ISO' : 113,
#'L1_TAU8_FIRSTEMPTY' : 114,
'L1_TAU8_UNPAIRED_ISO' : 115,
'L1_TAU8_UNPAIRED_NONISO' : 116,
'L1_ZDC_A_C_UNPAIRED_ISO' : 117,
'L1_MBTSA0' : 120,
'L1_MBTSA1' : 122,
'L1_FJ0' : 123,
'L1_2MU6_UNPAIRED_ISO' : 124,
'L1_2MU6_UNPAIRED_NONISO' : 125,
'L1_BCM_Wide_UNPAIRED_NONISO' : 126,
'L1_EM7_UNPAIRED_ISO' : 127,
'L1_EM7_UNPAIRED_NONISO' : 128,
'L1_J30_FIRSTEMPTY' : 130,
'L1_MBTSA2' : 131,
'L1_TE5' : 132,
'L1_TE14000' : 133,
'L1_TE20' : 134,
'L1_TE50' : 138,
'L1_TE100' : 136,
'L1_TE200' : 135,
'L1_MBTSA3' : 137,
'L1_2J5' : 139,
'L1_2J12' : 140,
'L1_TE12000' : 141,
'L1_TE10000' : 142,
'L1_2MU6_EMPTY' : 143,
'L1_2MU6_FIRSTEMPTY' : 144,
'L1_ZDC_MBTS_1' : 145,
'L1_ZDC_MBTS_2' : 146,
'L1_ZDC_MBTS_1_1' : 147,
'L1_ZDC_MBTS_2_2' : 148,
'L1_MBTS_1_EMPTY' : 149,
'L1_MBTS_1_1_EMPTY' : 150,
'L1_MBTS_2_EMPTY' : 151,
#'L1_TAU8_EMPTY' : 152,
'L1_MBTSA4' : 153,
'L1_MBTSA5' : 154,
'L1_MBTSA6' : 155,
'L1_MBTSA7' : 156,
'L1_NIM_S8C2B23' : 157,#DIRNIM
#'L1_MU0_UNPAIRED_NONISO' : 159,
#'L1_MU0_UNPAIRED_ISO' : 160,
'L1_MBTSA8' : 161,
#'L1_MU0_EMPTY' : 162,
'L1_MBTSA9' : 163,
'L1_MBTSA10' : 164,
'L1_MU4_UNPAIRED_NONISO': 165,
'L1_MU4_EMPTY' : 166,
'L1_MU4_UNPAIRED_ISO': 167,
'L1_MBTSA11' : 168,
#'L1_J10_EMPTY' : 171,
'L1_J30_EMPTY' : 172,
'L1_MBTSA12' : 173,
'L1_MBTSA13' : 174,
'L1_FJ0_EMPTY' : 175,
'L1_MBTSA14' : 176,
#'L1_EM3_EMPTY' : 177,
'L1_MBTSA15' : 178,
'L1_FJ0_UNPAIRED_ISO' : 180,
'L1_FJ5_UNPAIRED_ISO' : 181,
'L1_ZDC_UNPAIRED_ISO' : 182,
'L1_ZDC_UNPAIRED_NONISO' : 183,
#'L1_J12_EMPTY' : 184,
#'L1_J12_FIRSTEMPTY' : 185,
#'L1_J12_UNPAIRED_ISO' : 186,
#'L1_J12_UNPAIRED_NONISO' : 187,
'L1_ZDC_A_BGRP7' : 188,
'L1_ZDC_AND' : 189,
'L1_ZDC_A' : 190,
'L1_ZDC_C' : 191,
'L1_ZDC_A_C' : 192,
'L1_ZDC' : 193,
'L1_ZDC_C_BGRP7' : 194,
'L1_ZDC_A_C_EMPTY' : 196,
'L1_ZDC_EMPTY' : 197,
'L1_FJ5' : 198,
'L1_FJ10' : 199,
'L1_MBTS_1_UNPAIRED_ISO': 200,
'L1_MBTS_1_UNPAIRED_NONISO': 201,
'L1_MBTS_1_1_UNPAIRED_ISO': 202,
'L1_FJ15': 203,
'L1_MBTS_2_UNPAIRED_ISO': 204,
'L1_MBTS_2_UNPAIRED_NONISO': 205,
'L1_LUCID_A_C_UNPAIRED_NONISO': 206,
'L1_LUCID_A_C_UNPAIRED_ISO': 208,
'L1_LUCID_A_UNPAIRED': 209,
'L1_LUCID_C_UNPAIRED': 210,
'L1_LUCID_A_C_UNPAIRED': 211,
'L1_LUCID_A' : 212,
'L1_LUCID_C' : 213,
'L1_LUCID_A_C' : 214,
'L1_LUCID' : 215,
'L1_FJ5_EMPTY' : 218,
'L1_FJ0_C' : 219,
'L1_MBTS_2' : 222,
'L1_MBTS_2_2' : 223,
'L1_MBTS_3_3' : 224,
'L1_BCM_HT_BGRP0' : 225,
'L1_MBTS_1' : 226,
'L1_MBTS_1_1' : 228,
'L1_MBTS_2_2_EMPTY' : 229,
'L1_MBTS_3_3_EMPTY' : 230,
'L1_MBTS_2_2_UNPAIRED_ISO' : 231,
'L1_MBTS_3_3_UNPAIRED_ISO' : 232,
#'L1_J5_TE90' : 233,
'L1_2J5_TE90' : 234,
'L1_ZDC_A_C_BGRP11' : 235,
'L1_LUCID_A_EMPTY' : 236,
'L1_LUCID_C_EMPTY' : 237,
'L1_LUCID_A_C_EMPTY' : 238,
'L1_FJ0_A' : 239,
'L1_MBTS_1_1_BGRP11' : 240,
'L1_BPTX0_BGRP0' : 241,
'L1_BPTX1_BGRP0' : 242,
'L1_MBTS_2_BGRP9' : 243,
'L1_MBTS_1_1_BGRP9' : 244,
'L1_LUCID_EMPTY' : 245,
'L1_RD0_BGRP9' : 246,
'L1_LHCF' : 247,
'L1_ZDC_A_C_BGRP9' : 248,
'L1_MBTS_2_BGRP11' : 249,
'L1_ZB' : 250,
'L1_BGRP1' : 252,
#new in Run 2
'L1_ZDC_A_C_VTE50_OVERLAY' : 256,
'L1_TE50_OVERLAY' : 257,
'L1_J12_VTE200' : 258,
'L1_BCM_AC_ABORTGAPNOTCALIB': 259,
'L1_BCM_AC_CALIB': 260,
'L1_BCM_AC_UNPAIRED_ISO': 261,
'L1_BCM_AC_UNPAIRED_NONISO': 262,
'L1_BCM_CA_ABORTGAPNOTCALIB': 263,
'L1_BCM_CA_CALIB': 264,
'L1_BCM_CA_UNPAIRED_ISO': 265,
'L1_BCM_CA_UNPAIRED_NONISO': 266,
'L1_BCM_Wide_ABORTGAPNOTCALIB': 267,
'L1_BCM_Wide_CALIB': 268,
'L1_J12_ABORTGAPNOTCALIB': 269,
'L1_J12_UNPAIRED_ISO': 270,
'L1_J12_UNPAIRED_NONISO': 271,
'L1_J12_BGRP12': 493,
'L1_J30.31ETA49_UNPAIRED_ISO': 272,
'L1_J30.31ETA49_UNPAIRED_NONISO': 273,
'L1_J30.31ETA49_BGRP12': 494,
'L1_J50_ABORTGAPNOTCALIB': 274,
'L1_J50_UNPAIRED_ISO': 275,
'L1_J50_UNPAIRED_NONISO': 276,
#'L1_TAU8': 277,
'L1_TAU12': 278,
'L1_TAU12IL': 279,
'L1_TAU12IM': 280,
'L1_TAU12IT': 281,
'L1_TAU20': 282,
'L1_TAU20IL': 283,
'L1_TAU20IL_2TAU12IL_J25_2J20_3J12': 284,
'L1_TAU20IM': 285,
'L1_TAU20IM_2J20_XE45': 286,
'L1_TAU20IM_2J20_XE50': 287,
'L1_TAU20IM_2TAU12IM': 288,
'L1_TAU20IM_2TAU12IM_J25_2J20_3J12': 289,
'L1_TAU20IM_2TAU12IM_XE35': 290,
'L1_TAU20IM_2TAU12IM_XE40': 291,
'L1_TAU20IT': 292,
'L1_TAU20_2J20_XE45': 293,
'L1_TAU20_2TAU12': 294,
'L1_TAU20_2TAU12_XE35': 295,
'L1_TAU25IT_2TAU12IT_2J25_3J12': 296,
'L1_TAU30': 297,
'L1_TAU40': 298,
'L1_TAU60': 299,
'L1_EM20VH_FIRSTEMPTY': 300,
'L1_EM20VHI': 301,
'L1_EM7_EMPTY': 302,
'L1_EM7_FIRSTEMPTY': 303,
'L1_J100': 304,
#'L1_J100.31ETA49': 305,
#'L1_J100.31ETA49_FIRSTEMPTY': 306,
'L1_J100_FIRSTEMPTY': 307,
'L1_J12': 308,
'L1_J12_EMPTY': 309,
'L1_J12_FIRSTEMPTY': 310,
'L1_J30.31ETA49': 311,
'L1_J30.31ETA49_EMPTY': 312,
'L1_J40_XE50': 313,
'L1_J75.31ETA49': 314,
'L1_J75_XE40': 315,
'L1_RD0_ABORTGAPNOTCALIB': 316,
'L1_TGC_BURST': 317,
'L1_XE35': 318,
'L1_XE50': 319,
'L1_EM10VH': 320,
'L1_EM15': 321,
'L1_EM15HI_2TAU12IM': 322,
'L1_EM15HI_2TAU12IM_J25_3J12': 323,
'L1_EM15HI_2TAU12IM_XE35': 324,
'L1_EM15HI_TAU40_2TAU15': 325,
# restricted TE
'L1_TE500.0ETA49': 326,
'L1_TE1500.0ETA49': 327,
'L1_TE3000.0ETA49': 328,
'L1_TE3500.0ETA49': 329,
'L1_TE4500.0ETA49': 330,
'L1_TE6500.0ETA49': 331,
'L1_TE8000.0ETA49': 332,
'L1_TE9000.0ETA49': 333,
#'L1_J5': 334,
'L1_TE5_VTE200': 335,
# restricted TE for overlay
'L1_TE500.0ETA49_OVERLAY': 336,
'L1_TE1500.0ETA49_OVERLAY': 337,
'L1_TE3000.0ETA49_OVERLAY': 338,
'L1_TE3500.0ETA49_OVERLAY': 339,
'L1_TE4500.0ETA49_OVERLAY': 340,
'L1_TE6500.0ETA4_OVERLAY9': 341,
'L1_TE8000.0ETA49_OVERLAY': 342,
'L1_TE9000.0ETA49_OVERLAY': 343,
'L1_EM8': 344,
'L1_2EM7': 345,
'L1_CALREQ2' : 511,
'L1_TRT_FILLED' : 482,
'L1_TRT_EMPTY' : 483,
'L1_ZDC_A_VZDC_C_VTE200' : 484,
'L1_ZDC_C_VZDC_A_VTE200' : 485,
'L1_ZDC_XOR' : 486,
'L1_ZDC_XOR_VTE200' : 487,
'L1_ZDC_XOR_TE5_VTE200' : 488,
'L1_ZDC_XOR_TRT_VTE200' : 489,
'L1_ZDC_VTE200' : 490,
'L1_ZDC_A_C_VTE200' : 491,
'L1_ZDC_A_C_TE5_VTE200' : 492,
}
Lvl1Flags.prescales = {}
| [
"rushioda@lxplus754.cern.ch"
] | rushioda@lxplus754.cern.ch |
20eabdb496e5e0bb99f97dfe377c3c4da5527f60 | fb1d80581c4ef8c981c5abd20eda3ea989e48472 | /medicine/migrations/0013_auto_20191210_0138.py | f6262a49494adc44a4d02697d40b85e9c2e1d58b | [] | no_license | harrycode007/Online-Pharma | 49988336f8c82c9d6f913e21f5570f8f7b7c6f6d | 5f10489d08c55e9a0c3b7389ee7ad5cde7b66ea8 | refs/heads/master | 2022-07-10T12:05:46.777883 | 2020-05-20T07:09:14 | 2020-05-20T07:09:14 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,840 | py | # Generated by Django 2.2.1 on 2019-12-09 20:08
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('medicine', '0012_auto_20191210_0134'),
]
operations = [
migrations.AlterField(
model_name='medicineordered',
name='Ashwagandha',
field=models.IntegerField(default=0),
),
migrations.AlterField(
model_name='medicineordered',
name='Chyawanprash',
field=models.IntegerField(default=0),
),
migrations.AlterField(
model_name='medicineordered',
name='Cofsils',
field=models.IntegerField(default=0),
),
migrations.AlterField(
model_name='medicineordered',
name='Crocin',
field=models.IntegerField(default=0),
),
migrations.AlterField(
model_name='medicineordered',
name='Dettol',
field=models.IntegerField(default=0),
),
migrations.AlterField(
model_name='medicineordered',
name='DigeneGel',
field=models.IntegerField(default=0),
),
migrations.AlterField(
model_name='medicineordered',
name='DigeneTablet',
field=models.IntegerField(default=0),
),
migrations.AlterField(
model_name='medicineordered',
name='Hajmola',
field=models.IntegerField(default=0),
),
migrations.AlterField(
model_name='medicineordered',
name='Lubrifresh',
field=models.IntegerField(default=0),
),
migrations.AlterField(
model_name='medicineordered',
name='Moov',
field=models.IntegerField(default=0),
),
migrations.AlterField(
model_name='medicineordered',
name='Paracetamol',
field=models.IntegerField(default=0),
),
migrations.AlterField(
model_name='medicineordered',
name='Seacod',
field=models.IntegerField(default=0),
),
migrations.AlterField(
model_name='medicineordered',
name='Shelcal',
field=models.IntegerField(default=0),
),
migrations.AlterField(
model_name='medicineordered',
name='Vicks',
field=models.IntegerField(default=0),
),
migrations.AlterField(
model_name='medicineordered',
name='Zandu',
field=models.IntegerField(default=0),
),
migrations.AlterField(
model_name='medicineordered',
name='totalSum',
field=models.IntegerField(default=0),
),
]
| [
"1999hari@gmail.com"
] | 1999hari@gmail.com |
e5f7db27e87fcf2cc39af20e1eb5c98990f5410f | dbd64d5167ac127c3d1c142e49b4b2a4043ecd7b | /confirmation.py | ad7f26bdb603d9d9b098e1ce714562b52c9abb4c | [
"MIT"
] | permissive | minMaximilian/webdev2 | 25e5f0e44ed816bfa2e0dbd9355514f7f811d287 | d8334979398ff8ec47300da9e45b2c0f62f23d55 | refs/heads/master | 2022-10-25T15:24:47.897110 | 2020-06-08T09:10:20 | 2020-06-08T09:10:20 | 270,599,745 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,660 | py | #!/usr/bin/python3
import os
import sys
restricted = "restricted"
sys.path.append(os.path.abspath(restricted))
from cgi import FieldStorage
import pymysql as db
import passwords
from html import escape
form_data = FieldStorage()
confirm = form_data.getfirst("confirmUrl")
if not confirm:
confirm = ""
confirm = escape(confirm, quote=False)
def check_confirmation(confirm):
connection = db.connect(passwords.serverip, passwords.servername, passwords.serverpass, passwords.db_name)
cursor = connection.cursor(db.cursors.DictCursor)
cursor.execute("""SELECT confirmUrl
FROM users
WHERE confirmUrl = %s""", (confirm))
for row in cursor.fetchall():
if confirm == row["confirmUrl"]:
connection.commit()
cursor.close()
connection.close()
return True
connection.commit()
cursor.close()
connection.close()
return False
if check_confirmation(confirm):
connection = db.connect(passwords.serverip, passwords.servername, passwords.serverpass, passwords.db_name)
cursor = connection.cursor(db.cursors.DictCursor)
cursor.execute("""UPDATE users
SET confirm = 1, confirmUrl = NULL
WHERE confirmUrl = %s""", (confirm))
connection.commit()
cursor.close()
connection.close()
print("Content-Type: text/html")
print()
print("""<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Confirmed</title>
<link rel="stylesheet" href="index.css" />
<script src="js/redirect.js" type="module"></script>
</head>
<body>
<section class="confirmation">
<p>Your account has been validated you can login now, redirecting in 5 seconds.</p>
</section>
</body>
</html>""")
else:
print("Content-Type: text/html")
print()
print("""<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Confirmed</title>
<link rel="stylesheet" href="css/index.css" />
<script src="js/redirect.js" type="module"></script>
</head>
<body>
<section class="confirmation">
<p>Woah you aren't supposed to be here, getting rid of you from this premise in 5 seconds</p>
</section>
</body>
</html>""") | [
"sebastian.8295.8295@gmail.com"
] | sebastian.8295.8295@gmail.com |
6fe28c1650cd7e713a29cacf981272ea53492be1 | 98c76cb102adbbd3d91ba456e0e29424a143a96b | /Pi/teststuff/twitterNameGetter.py | 2171eeac9535742ff69720d6222013849bfcf12e | [
"MIT"
] | permissive | juggler2000/Mimic | b7ca7ba8d40133cdae7cb2ecda1c56031bf7ccf3 | 190e35380ec5dd0bd823a6fe4500f4d97c343675 | refs/heads/master | 2021-05-14T03:47:26.950159 | 2017-11-29T22:22:34 | 2017-11-29T22:22:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,637 | py | #!/usr/bin/env python
# encoding: utf-8
import json
import re
import tweepy #https://github.com/tweepy/tweepy
#Twitter API credentials
consumer_key = "qsaZuBudT7HRaXf4JU0x0KtML"
consumer_secret = "C6hpOGEtzTc9xoCeABgEnWxwWXjp3qOIpxrNiYerCoSGXZRqEd"
access_key = "896619221475614720-MBUhORGyemI4ueSPdW8cAHJIaNzgdr9"
access_secret = "Lu47Nu4eQrtQI1vmKUIMWTQ419CmEXSZPVAyHb8vFJbTu"
#Twitter only allows access to a users most recent 3240 tweets with this method
#authorize twitter, initialize tweepy
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_key, access_secret)
api = tweepy.API(auth)
stuff = api.user_timeline(screen_name = 'SupaTreadz', count = 1, include_rts = False, tweet_mode = 'extended')
#stuff = api.get_status(909345339391561729)
for status in stuff:
parsingtext = status.full_text
print parsingtext.find('@')
storage = []
index = 0
if parsingtext.find('@')>0:
while index < len(parsingtext):
index = parsingtext.find('@',index)
if index == -1:
break
storage.append(str(parsingtext[index:]))
index += 1
count = 0
while count < len(storage):
storage[count] = (storage[count].split('@')[1]).split(' ')[0]
count += 1
count = 0
while count < len(storage):
print storage[count]
storage[count] = str(api.get_user(storage[count]).name)
storage[count] = storage[count].split()[-1]
count += 1
print storage
#for friend in tweepy.Cursor(api.friends, screen_name="NASA_Astronauts").items():
# print friend.screen_name
# print friend.name
# print friend.user.name
| [
"samrtreadgold@gmail.com"
] | samrtreadgold@gmail.com |
78598224140536167f75d8b24ba0b0e9f07edb6f | bcf07603c2e75a47b20d5e40972bb8f37ffb74bd | /facebook-echobot/lib/python3.6/_bootlocale.py | b5a60607fb67adeeab4707fa21ef4ba575afead0 | [] | no_license | abhishekSinghG/Messenger-Bot | f41340028d57487ef376042c93d52b52e7fd0362 | 5a5212c218d155f02edd06fd5dae1eda3aabfcac | refs/heads/master | 2022-05-01T17:31:01.452311 | 2019-10-25T05:07:07 | 2019-10-25T05:07:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 59 | py | /Users/abhisheksingh/anaconda3/lib/python3.6/_bootlocale.py | [
"abhisheksingh@Abhisheks-MacBook-Pro-2.local"
] | abhisheksingh@Abhisheks-MacBook-Pro-2.local |
230b09e8b8a16de4af9b5873a5e364a68838722f | f0ee834c8f60e5c2513ded18a48260299a80ba5d | /datatypes/q12_datatypes.py | 2aebb2d350e1d0502bc7e189f1ad041e4e2b09e4 | [] | no_license | shres-ruby/pythonassignment | 7d62bf425e463b5cc464c346b824565de25d3b07 | 189eadb5e5ae991cb3be3fab921c2f189177f059 | refs/heads/master | 2022-11-12T18:06:58.881945 | 2020-06-28T12:36:08 | 2020-06-28T12:36:08 | 275,580,823 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 225 | py | # 12. Write a Python script that takes input from the user and displays that input back in upper and lower cases.
c = input("Enter a string : ")
up = c.upper()
low = c.lower()
print(f"Upper case : {up}\nLower case : {low}") | [
"shres.ruby@gmail.com"
] | shres.ruby@gmail.com |
e4b9f8ab5bb19544e331e60d7ba9441168e86c0f | 3c9727c4b5a89684b861fa90424e43c5a914ea45 | /Production/test/get_py.py | 5234fbfb2b6066772be282bce7ee1e8393f89862 | [] | no_license | vhegde91/TreeMaker | f51b453243081ccef0cfa721468ed7f7f9ca51f2 | e9dc3e3de793250980b29bebfef9b07c78bc97f7 | refs/heads/Run2 | 2021-08-11T03:45:45.430562 | 2018-04-11T14:30:28 | 2018-04-11T14:30:28 | 78,883,127 | 0 | 0 | null | 2017-01-13T20:14:01 | 2017-01-13T20:14:01 | null | UTF-8 | Python | false | false | 6,669 | py | import re,sys,getopt,urllib2,json
from dbs.apis.dbsClient import DbsApi
from optparse import OptionParser
# Read parameters
parser = OptionParser()
parser.add_option("-d", "--dict", dest="dict", default="", help="check for samples listed in this dict (default = %default)")
parser.add_option("-p", "--py", dest="py", default=False, action="store_true", help="generate python w/ list of files (default = %default)")
parser.add_option("-w", "--wp", dest="wp", default=False, action="store_true", help="generate WeightProducer lines (default = %default)")
parser.add_option("-s", "--se", dest="se", default=False, action="store_true", help="make list of sites with 100% hosting (default = %default)")
(options, args) = parser.parse_args()
dictname = options.dict.replace(".py","");
flist = __import__(dictname).flist
makepy = options.py
makewp = options.wp
makese = options.se
if not makepy and not makewp and not makese:
parser.error("No operations selected!")
#interface with DBS
dbs3api = DbsApi("https://cmsweb.cern.ch/dbs/prod/global/DBSReader")
#format for dict entries:
# data: [['sample'] , []]
# MC: [['sample'] , [xsec]]
# MC w/ extended sample: [['sample','sample_ext'] , [xsec]]
# MC w/ negative weights (amcatnlo): [['sample'] , [xsec, neff]]
#MC w/ negative weights (amcatnlo) + extended sample: [['sample','sample_ext'] , [xsec, neff, neff_ext]]
if makewp:
wname = "weights_"+dictname+".txt"
wfile = open(wname,'w')
if makese:
sname = "sites_"+dictname+".txt"
sfile = open(sname,'w')
for fitem in flist:
ff = fitem[0]
x = fitem[1]
nevents_all = []
for f in ff: # in case of extended samples
if makepy:
#get sample name
oname = f.split('/')[1]
#check for extended sample
extcheck = re.search("ext[0-9]",f.split('/')[2])
if not extcheck==None and len(extcheck.group(0))>0: oname = oname+"_"+extcheck.group(0)
#make python file with preamble
pfile = open(oname+"_cff.py",'w')
pfile.write("import FWCore.ParameterSet.Config as cms\n\n")
pfile.write("maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) )\n")
pfile.write("readFiles = cms.untracked.vstring()\n")
pfile.write("secFiles = cms.untracked.vstring()\n")
pfile.write("source = cms.Source (\"PoolSource\",fileNames = readFiles, secondaryFileNames = secFiles)\n")
#get dataset info - detail only needed in makewp case
filelist = []
nevents = 0
print f
fileArrays = dbs3api.listFileArray(dataset=f,detail=makewp)
for fileArray in fileArrays:
if makepy:
filelist.append(fileArray["logical_file_name"])
if makewp:
nevents += fileArray["event_count"]
nevents_all.append(nevents)
# check for sites with 100% dataset presence (using PhEDEx API)
# refs:
# https://github.com/dmwm/DAS/blob/master/src/python/DAS/services/combined/combined_service.py
# https://github.com/gutsche/scripts/blob/master/PhEDEx/checkLocation.py
if makese:
url='https://cmsweb.cern.ch/phedex/datasvc/json/prod/blockreplicas?dataset=' + f
jstr = urllib2.urlopen(url).read()
jstr = jstr.replace("\n", " ")
result = json.loads(jstr)
site_list = {}
for block in result['phedex']['block']:
for replica in block['replica']:
site = replica['node']
addr = replica['se']
#safety checks
if site is None: continue
if addr is None: addr = ""
if (site,addr) not in site_list.keys(): site_list[(site,addr)] = 0
site_list[(site,addr)] += replica['files']
# get total number of expected files from DBS
nfiles_tot = len(fileArrays)
# calculate dataset fraction (presence) in % and check for completion
highest_percent = 0
for site,addr in site_list:
this_percent = float(site_list[(site,addr)])/float(nfiles_tot)*100
site_list[(site,addr)] = this_percent
if this_percent > highest_percent: highest_percent = this_percent
sfile.write(f+"\n")
if highest_percent < 100:
sfile.write(" !!! No site has complete dataset !!! ( Highest: "+str(highest_percent)+"% )\n")
for site,addr in site_list:
this_percent = site_list[(site,addr)]
if this_percent==highest_percent:
sfile.write(" "+site+" ("+addr+")\n")
if makepy:
#sort list of files for consistency
filelist.sort()
counter = 0
#split into chunks of 255
for lfn in filelist:
if counter==0: pfile.write("readFiles.extend( [\n")
pfile.write(" '"+lfn+"',\n")
if counter==254 or lfn==filelist[-1]:
pfile.write("] )\n")
counter = 0
else:
counter += 1
#only do weightproducer stuff for MC (w/ xsec provided)
if makewp and len(x)>0:
xsec = x[0]
nevents = nevents_all[0]
neff = 0
if len(x)>1: neff = x[1]
#handle combining extended samples
if len(ff)>1:
neff = sum(x[1:])
nevents = sum(nevents_all)
for i,f in enumerate(ff):
#make line for weightproducer
line = " MCSample(\""+f.split('/')[1]+"\", \""+"-".join(f.split('/')[2].split('-')[1:3])+"\", \""+f.split('/')[2].split('-')[0]+"\", \"Constant\", "+str(x[0])+", ";
if neff>0:
line = line+str(neff)+"),"
if len(ff)>1: line = line+" # subtotal = "+str(x[i+1])+", straight subtotal = "+str(nevents_all[i])+"\n"
else: line = line+" # straight total = "+str(nevents)+"\n"
else:
line = line+str(nevents)+"),"
if len(ff)>1: line = line+" # subtotal = "+str(nevents_all[i])+"\n"
else: line = line+"\n"
wfile.write(line)
| [
"kpedro88@gmail.com"
] | kpedro88@gmail.com |
f38046e829ead21f90db3089dc7385dc29dd748d | 3c51c6ff82ec3581bf74d6a93e72231e9ef6bef5 | /user/serializers.py | 461247a5fe7db3d2c6764000386cdcfd26178e32 | [] | no_license | gmlwndla97/Asset-Kiwoom | fede62d1c3713d4781e8d65cb267f979c4faee6c | a956fc05ce3374d7c05aab1ec7b0f8e041c90f0e | refs/heads/master | 2023-04-25T23:00:08.724943 | 2021-06-09T09:27:20 | 2021-06-09T09:27:20 | 335,189,904 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 178 | py | from rest_framework import serializers
from .models import *
class StockSerializer(serializers.ModelSerializer):
class Meta:
model = User
fields = '__all__' | [
"37864097+gmlwndla97@users.noreply.github.com"
] | 37864097+gmlwndla97@users.noreply.github.com |
9dd3c227c916b4fae2af88a5f15365217a4ad4d1 | 373cb4ff0f0af7fdb5be1aae67fdea8cedc86579 | /positional-args/calc.py | 40d7a5f9095453e1e143a0c864b3b5ec70977b58 | [] | no_license | jasonwcc/learntopython | c4205081400670e598f51f812e1834be071125cb | 7749637be9706b223320e7a807b7ff98c3199eb0 | refs/heads/main | 2023-08-16T21:23:11.222929 | 2021-09-01T09:56:53 | 2021-09-01T09:56:53 | 372,115,653 | 5 | 1 | null | null | null | null | UTF-8 | Python | false | false | 296 | py | import argparse
parser = argparse.ArgumentParser(description='Calculation')
parser.add_argument('num1', type=int, help='First number to my calculation')
parser.add_argument('num2', type=int, help='Second number to my calculation')
args = parser.parse_args()
num1 = args.num1
num2 = args.num2
| [
"jasonwcc@yahoo.com"
] | jasonwcc@yahoo.com |
d6de6dc5bc55bc7f91d52729d40f91cb11fc47c6 | 184b81559cb5ae10eeebe17c5260ff15cfce08e2 | /projeto_revendas/models.py | 32390579a0e1819ef31df57ea4003f5f9362eb85 | [] | no_license | Brcolt/revenda_carros | ba3f8cb4bd3ece480df2725a550ae2460b7d40c7 | 3e529e1e331eda16cd548b3935e199209b6fa55f | refs/heads/master | 2023-02-09T02:48:34.146971 | 2021-01-03T18:54:39 | 2021-01-03T18:54:39 | 326,478,892 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 508 | py | from django.db import models
from django.core.validators import MinValueValidator
from django.utils.datetime_safe import datetime
# Create your models here.
class Carro(models.Model):
modelo = models.CharField(max_length=50, null=False)
marca = models.CharField(max_length=50, null=False)
ano = models.PositiveIntegerField(validators=[MinValueValidator(2000)], null=False)
valor = models.FloatField(null=False)
data_cadastro = models.DateTimeField(default=datetime.now(), null=False)
| [
"brunocolt.ufrn@gmail.com"
] | brunocolt.ufrn@gmail.com |
9ba94fdaa0336d97658bb817cac17daeacb40efa | 11841e8fb1e44c69ae7e50c0b85b324c4d90abda | /zipfile1.py | 57928210c0c0f271bff15ecb5d69c931b5a2dca3 | [] | no_license | chenlong2019/python | 1d7bf6fb60229221c79538234ad2f1a91bb03c50 | fc9e239754c5715a67cb6d743109800b64d74dc8 | refs/heads/master | 2020-12-08T11:11:49.951752 | 2020-01-10T04:58:29 | 2020-01-10T04:59:50 | 232,968,232 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 484 | py | import os, zipfile
#打包目录为zip文件(未压缩)
def make_zip(source_dir, output_filename):
zipf = zipfile.ZipFile(output_filename, 'w')
for parent, dirnames, filenames in os.walk(source_dir):
for filename in filenames:
pathfile = os.path.join(parent, filename)
zipf.write(pathfile, filename)
zipf.close()
if __name__ == '__main__':
make_zip("F:\\changshu\\state\\pm25\\PM252019_08_16_16", 'F:\\zip\\PM252019_08_190977_.zip') | [
"1174650816@qq.com"
] | 1174650816@qq.com |
546f4b0a7b9e573b93414313b979be1eeb48b1b5 | b43c6c03eea348d68d6582c3594760bbe0ecaa08 | /gitlab/tests/conftest.py | 929f128062588569e26097e5ee90aebcc993b89f | [
"MIT"
] | permissive | imsardine/learning | 1b41a13a4c71c8d9cdd8bd4ba264a3407f8e05f5 | 925841ddd93d60c740a62e12d9f57ef15b6e0a20 | refs/heads/master | 2022-12-22T18:23:24.764273 | 2020-02-21T01:35:40 | 2020-02-21T01:35:40 | 24,145,674 | 0 | 0 | MIT | 2022-12-14T20:43:28 | 2014-09-17T13:24:37 | Python | UTF-8 | Python | false | false | 2,278 | py | import os
from os import path
from subprocess import Popen, PIPE
import pytest
class DataFileHelper(object):
def __init__(self, base_dir):
self._base_dir = base_dir
def abspath(self, fn):
return path.join(self._base_dir, fn)
def relpath(self, fn):
return path.relpath(self.abspath(fn)) # relative to CWD
def read(self, fn, encoding=None):
with open(self.abspath(fn), 'rb') as f:
data = f.read()
return data.decode(encoding) if encoding else data
def json(self, fn, encoding='utf-8'):
import json
return json.loads(self.read(fn, encoding))
class CommandLine(object):
def __init__(self, base_dir):
self._base_dir = base_dir
def run(self, cmdline, cwd=None):
_cwd = os.getcwd()
assert path.isabs(_cwd), _cwd
os.chdir(self._base_dir)
if cwd:
os.chdir(cwd) # absolute or relative to base dir
try:
p = Popen(cmdline, stdout=PIPE, stderr=PIPE, shell=True)
out, err = p.communicate()
return CommandLineResult(
out.decode('utf-8'), err.decode('utf-8'), p.returncode)
finally:
os.chdir(_cwd)
class CommandLineResult(object):
def __init__(self, out, err, rc):
self.out = out
self.err = err
self.rc = rc
@pytest.fixture
def testdata(request):
base_dir = path.dirname(request.module.__file__)
return DataFileHelper(base_dir)
@pytest.fixture
def cli(request):
base_dir = path.dirname(request.module.__file__)
return CommandLine(base_dir)
import urllib, urllib2
import json
class GitLabAPI():
def __init__(self, url, access_token):
self._url = url
self._access_token = access_token
def _request(self, endpoint):
request = urllib2.Request(self._url + endpoint)
request.add_header('Private-Token', self._access_token)
return request
def get(self, endpoint, params={}):
qs = urllib.urlencode(params)
resp = urllib2.urlopen(self._request(endpoint + '?' + qs))
return json.loads(resp.read())
@pytest.fixture
def gitlab():
return GitLabAPI(
os.environ['GITLAB_URL'],
os.environ['GITLAB_ACCESS_TOKEN'])
| [
"imsardine@gmail.com"
] | imsardine@gmail.com |
82f7ae8a799b1f6418b9cc3009b6543768380a9c | 0e0e984ef9f8c4815e613715fe6657f60bcfd61b | /emp/models.py | af3b9dee4c4d79d436823a099aebe90797d9898a | [] | no_license | peyo-karpuzov/cv-project | 0c8cb982d81f83c75c7f249de1101246832a0876 | 7d082f8acd8035d5389077474406025f003f876a | refs/heads/master | 2020-05-26T13:01:16.395139 | 2019-05-26T09:03:45 | 2019-05-26T09:03:45 | 188,240,504 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 501 | py | from django.db import models
from django.contrib.auth.models import User
class JobOffer(models.Model):
user = models.ForeignKey(User, on_delete=models.CASCADE)
company_name = models.CharField(max_length=30)
position = models.CharField(max_length=50)
starting_salary = models.PositiveIntegerField()
job_description = models.TextField()
address = models.CharField(max_length=50)
def __str__(self):
return f"{self.company_name} company - {self.position} position."
| [
"peyo.karpuzov@gmail.com"
] | peyo.karpuzov@gmail.com |
4db0ac8e630e1411595e405c50925a61a43013a6 | 6d9fd1a912c07125bcc9c0d0b8fda913f142214f | /linear_model_homework_1/program/python/3.19.py | 04e097b88551bbd94014e6ee7e7eeed6d8c16740 | [] | no_license | zakizhou/linear-regression | dad6730cd3f3af7e2329da79740fc26255b70f22 | 70663cbc725d7f8ae83e440b1f4cb80ab3087868 | refs/heads/master | 2020-06-30T20:21:45.519918 | 2016-11-22T15:18:38 | 2016-11-22T15:18:38 | 74,353,171 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,224 | py | # -*- coding: utf-8 -*-
"""
Created on Sun Nov 20 21:07:42 2016
@author: Windows98
"""
import numpy as np
import statsmodels.api as sm
import matplotlib.pyplot as plt
from sklearn import preprocessing
from sklearn import linear_model
dataframe = np.loadtxt("C:/linear_model/data/3.19.txt").T
dataframe[:3]
X = dataframe[:,1:]
y = dataframe[:,0]
scaler = preprocessing.StandardScaler()
X_scaled = scaler.fit_transform(X)
standard = np.dot(X_scaled.T,X_scaled)
V, D = np.linalg.eig(standard)
condition_number = V.max() / V.min()
condition_number
X_center = X - X.mean(axis=0)
alphas = np.linspace(0, 0.1, num=100)
coeficients = []
for alpha in alphas:
regressor = sm.OLS(y, sm.add_constant(X_center)).fit_regularized(L1_wt=0., alpha=alpha)
coeficients.append(regressor.params[1:])
ks = len(X) * np.array(alphas)
fig, ax = plt.subplots(figsize=(10,10))
ax.plot(ks, np.array(zip(*coeficients)).T[:,0], "g*--", linewidth=2, markersize=10)
ax.plot(ks, np.array(zip(*coeficients)).T[:,1], "bh--", linewidth=2, markersize=7)
ax.set_xlabel(u"$k$", fontsize=30)
ax.set_ylabel(r"$\hat{\beta}$", fontsize=30)
ax.set_title(r"$\hat{\beta}-k$",fontsize=40)
print(regressor.summary()) | [
"windows98@ruc.edu.cn"
] | windows98@ruc.edu.cn |
148d3e817efcd11b28dcc6c13e49112239d6e335 | 39f95a7b4abe665f1b0e3a0f4b356db002ddce2e | /tests/test_exceptions.py | 3f14f4213f02a864daf23f5b39c6897b7609a298 | [
"MIT"
] | permissive | gitter-badger/tapioca-wrapper | d96a538071d44c36f93f0bbd7318510dfc9f7633 | 4e6dbd85da1a218d00f08fee84dfea29a83d61c3 | refs/heads/master | 2021-01-16T18:48:50.848519 | 2015-09-09T15:21:41 | 2015-09-09T15:21:41 | 42,362,017 | 0 | 0 | null | 2015-09-12T15:29:44 | 2015-09-12T15:29:44 | Python | UTF-8 | Python | false | false | 1,889 | py | # coding: utf-8
from __future__ import unicode_literals
import unittest
import responses
import requests
from tapioca.exceptions import (
ClientError, ServerError, ResponseProcessException)
from tests.client import TesterClient, TesterClientAdapter
class TestExceptions(unittest.TestCase):
def setUp(self):
self.wrapper = TesterClient()
@responses.activate
def test_adapter_raises_response_process_exception_on_400s(self):
responses.add(responses.GET, self.wrapper.test().data(),
body='{"erros": "Server Error"}',
status=400,
content_type='application/json')
response = requests.get(self.wrapper.test().data())
with self.assertRaises(ResponseProcessException):
TesterClientAdapter().process_response(response)
@responses.activate
def test_adapter_raises_response_process_exception_on_500s(self):
responses.add(responses.GET, self.wrapper.test().data(),
body='{"erros": "Server Error"}',
status=500,
content_type='application/json')
response = requests.get(self.wrapper.test().data())
with self.assertRaises(ResponseProcessException):
TesterClientAdapter().process_response(response)
@responses.activate
def test_raises_request_error(self):
responses.add(responses.GET, self.wrapper.test().data(),
body='{"data": {"key": "value"}}',
status=400,
content_type='application/json')
with self.assertRaises(ClientError):
self.wrapper.test().get()
@responses.activate
def test_raises_server_error(self):
responses.add(responses.GET, self.wrapper.test().data(),
status=500,
content_type='application/json')
with self.assertRaises(ServerError):
self.wrapper.test().get()
| [
"filipeximenes@gmail.com"
] | filipeximenes@gmail.com |
fcb806b070156928c2b03ad6d408e9055efc9a9a | 3cde5a749af89c9dc4d2aca3fb9bf7c56d9a4a7f | /website.py | 43a44ed6750624703414cd6a969170689fe73bba | [] | no_license | akrherz/kimthub | b211974c071f6ed5f2caa7349ba8ff8e2ec2f87b | 028894591841e83ddc35d2157fe4044049d20db8 | refs/heads/master | 2020-12-29T00:25:50.689178 | 2019-04-01T15:46:14 | 2019-04-01T15:46:14 | 16,999,566 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 654 | py | # website tool to configure this application
from twisted.web import resource, server
class HomePage(resource.Resource):
def __init__(self, r):
resource.Resource.__init__(self)
self.r = r
def render(self, request):
s = self.r.dumpObs()
request.setHeader('Content-Length', len(s))
request.setHeader('Content-Type', 'text/plain')
request.setResponseCode(200)
request.write( s )
request.finish()
return server.NOT_DONE_YET
class RootResource(resource.Resource):
def __init__(self, r):
resource.Resource.__init__(self)
self.putChild('', HomePage(r))
| [
"akrherz@iastate.edu"
] | akrherz@iastate.edu |
21ab63765addf9a377cd36f8efccad65c9aa8bba | 5cf1a6c9c5f1cb6235c8e67433d63ec7f62a0292 | /logpuzzle/logpuzzle.py~ | 35e95e9f4c9635c1504e591aa2462790c9426df6 | [
"Apache-2.0"
] | permissive | sparshpriyadarshi/google-python-exercises | 3c5664c99ebb396b391a06e3ded9f9824106205d | c31c3523afcd083ded79dd87d216760c34538a84 | refs/heads/master | 2021-11-11T09:09:32.830455 | 2017-12-05T21:51:03 | 2017-12-05T21:51:03 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,427 | #!/usr/bin/python
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
import os
import re
import sys
import urllib
"""Logpuzzle exercise
Given an apache logfile, find the puzzle urls and download the images.
Here's what a puzzle url looks like:
10.254.254.28 - - [06/Aug/2007:00:13:48 -0700] "GET /~foo/puzzle-bar-aaab.jpg HTTP/1.0" 302 528 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6"
"""
def sort_key(url):
match = re.search(r'-(\w+)-(\w+)\.\w+', url)
if match:
return match.group(2)
else:
return url
def read_urls(filename):
"""Returns a list of the puzzle urls from the given log file,
extracting the hostname from the filename itself.
Screens out duplicate urls and returns the urls sorted into
increasing order."""
urls = {}
host = 'http://' + filename.split('_')[1]
f = open(filename, 'rU')
text = f.read()
requests = []
requests = re.findall(r'GET (\S*/puzzle\S*.jpg) HTTP/1.0',text)
for request in requests :
urls[host+request] = 1
f.close()
return sorted(urls.keys(),key = sort_key)
# +++your code here+++
def download_images(img_urls, dest_dir):
"""Given the urls already in the correct order, downloads
each image into the given directory.
Gives the images local filenames img0, img1, and so on.
Creates an index.html in the directory
with an img tag to show each local image file.
Creates the directory if necessary.
"""
count = 0
imgtags = []
if not os.path.exists(dest_dir) :
os.mkdir(dest_dir)
for img_url in img_urls :
print 'Retrieving...' + img_url + '\n'
imgtags.append('<img src=\'img'+str(count)+'\'>')
urllib.urlretrieve(img_url,os.path.join(dest_dir,'img'+str(count)))
count+=1
htmlcode = ''.join(imgtags)
f = open(dest_dir+'/index.html','w')
f.write(htmlcode)
f.close()
print 'Done. Check directory.'
# +++your code here+++
def main():
args = sys.argv[1:]
if not args:
print 'usage: [--todir dir] logfile '
sys.exit(1)
todir = ''
if args[0] == '--todir':
todir = args[1]
del args[0:2]
img_urls = read_urls(args[0])
if todir:
download_images(img_urls, todir)
else:
print '\n'.join(img_urls)
if __name__ == '__main__':
main()
| [
"sparsh11194@gmail.com"
] | sparsh11194@gmail.com | |
faa04cf9b649637aa3a8ae10ba45572c0cbe8c45 | acd6f7ceb59b66b686e427b6cfb39d6e9d1bee32 | /ratuil/widgets/listing.py | af6dc919a6470151399370b482c0ff68e7d30ca4 | [
"MIT"
] | permissive | jmdejong/ratuil | c564b20a38eb680c7b096075ae00fc1c46b45043 | 41143d0c69c71b52170217e4952c44fac940da98 | refs/heads/master | 2021-06-26T21:46:48.800827 | 2021-01-23T13:01:07 | 2021-01-23T13:01:07 | 206,735,153 | 9 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,348 | py |
from . import Widget
from ..strwidth import strwidth, crop
class Listing(Widget):
def __init__(self, selected=0, selector_char="*", items=None):
if items is not None:
self.items = list(items)#[line.strip() for line in etree.text.splitlines() if line.strip()]
else:
self.items = []
self.selector = selected
self.selector_char = selector_char
def set_items(self, items):
self.items = items
self.change()
def select(self, index):
self.selector = index
self.change()
def draw(self, target):
target.clear()
width = target.width
height = target.height
start = min(self.selector - height//2, len(self.items) - height)
start = max(start, 0)
end = start + height
for i, item in enumerate(self.items[start:end]):
if i + start == self.selector:
target.write(0, i, self.selector_char)
target.write(strwidth(self.selector_char), i, item)
if end < len(self.items):
target.write(width-1, height-1, "+")
if start > 0:
target.write(width-1, 0, "-")
@classmethod
def from_xml(cls, children, attr, text):
kwargs = {}
if text is not None:
kwargs["items"] = [line.strip() for line in text.splitlines() if line.strip()]
if "select" in attr:
kwargs["selected"] = int(attr["select"])
if "selector" in attr:
kwargs["selector_char"] = attr["selector"]
return cls(**kwargs)
| [
"troido@protonmail.com"
] | troido@protonmail.com |
a22e80a8d748d74187b75b7ca9f43ed5399f0094 | 420ed6ae166e89a9915e2632af1ac341366feb00 | /dataLoader/__init__.py | 5d564aa3286b97a13f6a2a3d800db1eb269478d5 | [] | no_license | kejingjing/Detector | 0294aa73cb4ce736ea1f5554de2ae66efdd0ce70 | fb57a44b6e22afb0681c21aa4eafc6f597dc3563 | refs/heads/master | 2020-03-21T04:23:25.359928 | 2018-06-20T17:20:04 | 2018-06-20T17:20:04 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 115 | py | # -*- coding: utf-8 -*-
from .VocBboxDataset import VOC_BBOX_LABEL_NAMES
from .dataLoader import getVocDataLoader
| [
"mandeer163@163.com"
] | mandeer163@163.com |
05048d5f830df5ed0b5e43b5e6473d8c7b7d7246 | 0ff87e0a84dd8b9a198cebb59a5130fa7765b9dd | /tests/test_backtest.py | 606de235aebb5127e7941c9e643a0564ca164f4f | [
"Apache-2.0"
] | permissive | dxcv/moonshot | 470caf28cdb3bc5cd5864596e69875bf1810d05d | ca05aa347b061db05c0da221e80b125a5e9ddea1 | refs/heads/master | 2020-05-31T04:40:43.638058 | 2019-03-28T17:07:04 | 2019-03-28T17:07:04 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 76,137 | py | # Copyright 2018 QuantRocket LLC - All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# To run: python3 -m unittest discover -s tests/ -p test_*.py -t . -v
import os
import unittest
from unittest.mock import patch
import glob
import pandas as pd
from moonshot import Moonshot
from moonshot.cache import TMP_DIR
class BacktestTestCase(unittest.TestCase):
def tearDown(self):
"""
Remove cached files.
"""
for file in glob.glob("{0}/moonshot*.pkl".format(TMP_DIR)):
os.remove(file)
def test_complain_if_prices_to_signals_not_implemented(self):
"""
Tests error handling when prices_to_signals hasn't been implemented.
"""
def mock_get_historical_prices(*args, **kwargs):
dt_idx = pd.DatetimeIndex(["2018-05-01","2018-05-02","2018-05-03"])
fields = ["Close","Volume"]
idx = pd.MultiIndex.from_product([fields, dt_idx], names=["Field", "Date"])
prices = pd.DataFrame(
{
12345: [
# Close
9,
11,
10.50,
# Volume
5000,
16000,
8800
],
23456: [
# Close
12,
11,
8.50,
# Volume
15000,
14000,
28800
],
},
index=idx
)
return prices
def mock_get_db_config(db):
return {
'vendor': 'ib',
'domain': 'main',
'bar_size': '1 day'
}
def mock_download_master_file(f, *args, **kwargs):
master_fields = ["Timezone", "Symbol", "SecType", "Currency", "PriceMagnifier", "Multiplier"]
securities = pd.DataFrame(
{
12345: [
"America/New_York",
"ABC",
"STK",
"USD",
None,
None
],
23456: [
"America/New_York",
"DEF",
"STK",
"USD",
None,
None,
]
},
index=master_fields
)
securities.columns.name = "ConId"
securities.T.to_csv(f, index=True, header=True)
f.seek(0)
with patch("moonshot.strategies.base.get_historical_prices", new=mock_get_historical_prices):
with patch("moonshot.strategies.base.download_master_file", new=mock_download_master_file):
with patch("moonshot.strategies.base.get_db_config", new=mock_get_db_config):
with self.assertRaises(NotImplementedError) as cm:
Moonshot().backtest()
self.assertIn("strategies must implement prices_to_signals", repr(cm.exception))
def test_basic_long_only_strategy(self):
"""
Tests that the resulting DataFrames are correct after running a basic
long-only strategy that largely relies on the default methods.
"""
class BuyBelow10(Moonshot):
"""
A basic test strategy that buys below 10.
"""
def prices_to_signals(self, prices):
signals = prices.loc["Close"] < 10
return signals.astype(int)
def mock_get_historical_prices(*args, **kwargs):
dt_idx = pd.DatetimeIndex(["2018-05-01","2018-05-02","2018-05-03", "2018-05-04"])
fields = ["Close","Volume"]
idx = pd.MultiIndex.from_product([fields, dt_idx], names=["Field", "Date"])
prices = pd.DataFrame(
{
12345: [
# Close
9,
11,
10.50,
9.99,
# Volume
5000,
16000,
8800,
9900
],
23456: [
# Close
9.89,
11,
8.50,
10.50,
# Volume
15000,
14000,
28800,
17000
],
},
index=idx
)
return prices
def mock_get_db_config(db):
return {
'vendor': 'ib',
'domain': 'main',
'bar_size': '1 day'
}
def mock_download_master_file(f, *args, **kwargs):
master_fields = ["Timezone", "Symbol", "SecType", "Currency", "PriceMagnifier", "Multiplier"]
securities = pd.DataFrame(
{
12345: [
"America/New_York",
"ABC",
"STK",
"USD",
None,
None
],
23456: [
"America/New_York",
"DEF",
"STK",
"USD",
None,
None,
]
},
index=master_fields
)
securities.columns.name = "ConId"
securities.T.to_csv(f, index=True, header=True)
f.seek(0)
with patch("moonshot.strategies.base.get_historical_prices", new=mock_get_historical_prices):
with patch("moonshot.strategies.base.download_master_file", new=mock_download_master_file):
with patch("moonshot.strategies.base.get_db_config", new=mock_get_db_config):
results = BuyBelow10().backtest()
self.assertSetEqual(
set(results.index.get_level_values("Field")),
{'Commission',
'AbsExposure',
'Signal',
'Return',
'Slippage',
'NetExposure',
'TotalHoldings',
'Turnover',
'AbsWeight',
'Weight'}
)
# replace nan with "nan" to allow equality comparisons
results = results.round(7)
results = results.where(results.notnull(), "nan")
signals = results.loc["Signal"].reset_index()
signals.loc[:, "Date"] = signals.Date.dt.strftime("%Y-%m-%dT%H:%M:%S%z")
self.assertDictEqual(
signals.to_dict(orient="list"),
{'Date': [
'2018-05-01T00:00:00',
'2018-05-02T00:00:00',
'2018-05-03T00:00:00',
'2018-05-04T00:00:00'],
12345: [1.0,
0.0,
0.0,
1.0],
23456: [1.0,
0.0,
1.0,
0.0]}
)
weights = results.loc["Weight"].reset_index()
weights.loc[:, "Date"] = weights.Date.dt.strftime("%Y-%m-%dT%H:%M:%S%z")
self.assertDictEqual(
weights.to_dict(orient="list"),
{'Date': [
'2018-05-01T00:00:00',
'2018-05-02T00:00:00',
'2018-05-03T00:00:00',
'2018-05-04T00:00:00'],
12345: [0.5,
0.0,
0.0,
1.0],
23456: [0.5,
0.0,
1.0,
0.0]}
)
abs_weights = results.loc["AbsWeight"].reset_index()
abs_weights.loc[:, "Date"] = abs_weights.Date.dt.strftime("%Y-%m-%dT%H:%M:%S%z")
self.assertDictEqual(
abs_weights.to_dict(orient="list"),
{'Date': [
'2018-05-01T00:00:00',
'2018-05-02T00:00:00',
'2018-05-03T00:00:00',
'2018-05-04T00:00:00'],
12345: [0.5,
0.0,
0.0,
1.0],
23456: [0.5,
0.0,
1.0,
0.0]}
)
net_positions = results.loc["NetExposure"].reset_index()
net_positions.loc[:, "Date"] = net_positions.Date.dt.strftime("%Y-%m-%dT%H:%M:%S%z")
self.assertDictEqual(
net_positions.to_dict(orient="list"),
{'Date': [
'2018-05-01T00:00:00',
'2018-05-02T00:00:00',
'2018-05-03T00:00:00',
'2018-05-04T00:00:00'],
12345: ["nan",
0.5,
0.0,
0.0],
23456: ["nan",
0.5,
0.0,
1.0]}
)
abs_positions = results.loc["AbsExposure"].reset_index()
abs_positions.loc[:, "Date"] = abs_positions.Date.dt.strftime("%Y-%m-%dT%H:%M:%S%z")
self.assertDictEqual(
abs_positions.to_dict(orient="list"),
{'Date': [
'2018-05-01T00:00:00',
'2018-05-02T00:00:00',
'2018-05-03T00:00:00',
'2018-05-04T00:00:00'],
12345: ["nan",
0.5,
0.0,
0.0],
23456: ["nan",
0.5,
0.0,
1.0]}
)
total_holdings = results.loc["TotalHoldings"].reset_index()
total_holdings.loc[:, "Date"] = total_holdings.Date.dt.strftime("%Y-%m-%dT%H:%M:%S%z")
self.assertDictEqual(
total_holdings.to_dict(orient="list"),
{'Date': [
'2018-05-01T00:00:00',
'2018-05-02T00:00:00',
'2018-05-03T00:00:00',
'2018-05-04T00:00:00'],
12345: [0,
1.0,
0,
0],
23456: [0,
1.0,
0,
1.0]}
)
turnover = results.loc["Turnover"].reset_index()
turnover.loc[:, "Date"] = turnover.Date.dt.strftime("%Y-%m-%dT%H:%M:%S%z")
self.assertDictEqual(
turnover.to_dict(orient="list"),
{'Date': [
'2018-05-01T00:00:00',
'2018-05-02T00:00:00',
'2018-05-03T00:00:00',
'2018-05-04T00:00:00'],
12345: ["nan",
0.5,
0.5,
0.0],
23456: ["nan",
0.5,
0.5,
1.0]}
)
commissions = results.loc["Commission"].reset_index()
commissions.loc[:, "Date"] = commissions.Date.dt.strftime("%Y-%m-%dT%H:%M:%S%z")
self.assertDictEqual(
commissions.to_dict(orient="list"),
{'Date': [
'2018-05-01T00:00:00',
'2018-05-02T00:00:00',
'2018-05-03T00:00:00',
'2018-05-04T00:00:00'],
12345: [0.0,
0.0,
0.0,
0.0],
23456: [0.0,
0.0,
0.0,
0.0]}
)
slippage = results.loc["Slippage"].reset_index()
slippage.loc[:, "Date"] = slippage.Date.dt.strftime("%Y-%m-%dT%H:%M:%S%z")
self.assertDictEqual(
slippage.to_dict(orient="list"),
{'Date': [
'2018-05-01T00:00:00',
'2018-05-02T00:00:00',
'2018-05-03T00:00:00',
'2018-05-04T00:00:00'],
12345: [0.0,
0.0,
0.0,
0.0],
23456: [0.0,
0.0,
0.0,
0.0]}
)
returns = results.loc["Return"]
returns = returns.reset_index()
returns.loc[:, "Date"] = returns.Date.dt.strftime("%Y-%m-%dT%H:%M:%S%z")
self.assertDictEqual(
returns.to_dict(orient="list"),
{'Date': [
'2018-05-01T00:00:00',
'2018-05-02T00:00:00',
'2018-05-03T00:00:00',
'2018-05-04T00:00:00'],
12345: [0.0,
0.0,
-0.0227273, # (10.50 - 11)/11 * 0.5
-0.0],
23456: [0.0,
0.0,
-0.1136364, # (8.50 - 11)/11 * 0.5
0.0]}
)
def test_basic_long_short_strategy(self):
"""
Tests that the resulting DataFrames are correct after running a basic
long-short strategy that largely relies on the default methods.
"""
class BuyBelow10ShortAbove10(Moonshot):
"""
A basic test strategy that buys below 10 and shorts above 10.
"""
def prices_to_signals(self, prices):
long_signals = prices.loc["Close"] <= 10
short_signals = prices.loc["Close"] > 10
signals = long_signals.astype(int).where(long_signals, -short_signals.astype(int))
return signals
def mock_get_historical_prices(*args, **kwargs):
dt_idx = pd.DatetimeIndex(["2018-05-01","2018-05-02","2018-05-03", "2018-05-04"])
fields = ["Close","Volume"]
idx = pd.MultiIndex.from_product([fields, dt_idx], names=["Field", "Date"])
prices = pd.DataFrame(
{
12345: [
# Close
9,
11,
10.50,
9.99,
# Volume
5000,
16000,
8800,
9900
],
23456: [
# Close
9.89,
11,
8.50,
10.50,
# Volume
15000,
14000,
28800,
17000
],
},
index=idx
)
return prices
def mock_get_db_config(db):
return {
'vendor': 'ib',
'domain': 'main',
'bar_size': '1 day'
}
def mock_download_master_file(f, *args, **kwargs):
master_fields = ["Timezone", "Symbol", "SecType", "Currency", "PriceMagnifier", "Multiplier"]
securities = pd.DataFrame(
{
12345: [
"America/New_York",
"ABC",
"STK",
"USD",
None,
None
],
23456: [
"America/New_York",
"DEF",
"STK",
"USD",
None,
None,
]
},
index=master_fields
)
securities.columns.name = "ConId"
securities.T.to_csv(f, index=True, header=True)
f.seek(0)
with patch("moonshot.strategies.base.get_historical_prices", new=mock_get_historical_prices):
with patch("moonshot.strategies.base.download_master_file", new=mock_download_master_file):
with patch("moonshot.strategies.base.get_db_config", new=mock_get_db_config):
results = BuyBelow10ShortAbove10().backtest()
self.assertSetEqual(
set(results.index.get_level_values("Field")),
{'Commission',
'AbsExposure',
'Signal',
'Return',
'Slippage',
'NetExposure',
'TotalHoldings',
'Turnover',
'AbsWeight',
'Weight'}
)
# replace nan with "nan" to allow equality comparisons
results = results.round(7)
results = results.where(results.notnull(), "nan")
signals = results.loc["Signal"].reset_index()
signals.loc[:, "Date"] = signals.Date.dt.strftime("%Y-%m-%dT%H:%M:%S%z")
self.assertDictEqual(
signals.to_dict(orient="list"),
{'Date': [
'2018-05-01T00:00:00',
'2018-05-02T00:00:00',
'2018-05-03T00:00:00',
'2018-05-04T00:00:00'],
12345: [1.0,
-1.0,
-1.0,
1.0],
23456: [1.0,
-1.0,
1.0,
-1.0]}
)
weights = results.loc["Weight"].reset_index()
weights.loc[:, "Date"] = weights.Date.dt.strftime("%Y-%m-%dT%H:%M:%S%z")
self.assertDictEqual(
weights.to_dict(orient="list"),
{'Date': [
'2018-05-01T00:00:00',
'2018-05-02T00:00:00',
'2018-05-03T00:00:00',
'2018-05-04T00:00:00'],
12345: [0.5,
-0.5,
-0.5,
0.5],
23456: [0.5,
-0.5,
0.5,
-0.5]}
)
abs_weights = results.loc["AbsWeight"].reset_index()
abs_weights.loc[:, "Date"] = abs_weights.Date.dt.strftime("%Y-%m-%dT%H:%M:%S%z")
self.assertDictEqual(
abs_weights.to_dict(orient="list"),
{'Date': [
'2018-05-01T00:00:00',
'2018-05-02T00:00:00',
'2018-05-03T00:00:00',
'2018-05-04T00:00:00'],
12345: [0.5,
0.5,
0.5,
0.5],
23456: [0.5,
0.5,
0.5,
0.5]}
)
net_positions = results.loc["NetExposure"].reset_index()
net_positions.loc[:, "Date"] = net_positions.Date.dt.strftime("%Y-%m-%dT%H:%M:%S%z")
self.assertDictEqual(
net_positions.to_dict(orient="list"),
{'Date': [
'2018-05-01T00:00:00',
'2018-05-02T00:00:00',
'2018-05-03T00:00:00',
'2018-05-04T00:00:00'],
12345: ["nan",
0.5,
-0.5,
-0.5],
23456: ["nan",
0.5,
-0.5,
0.5]}
)
abs_positions = results.loc["AbsExposure"].reset_index()
abs_positions.loc[:, "Date"] = abs_positions.Date.dt.strftime("%Y-%m-%dT%H:%M:%S%z")
self.assertDictEqual(
abs_positions.to_dict(orient="list"),
{'Date': [
'2018-05-01T00:00:00',
'2018-05-02T00:00:00',
'2018-05-03T00:00:00',
'2018-05-04T00:00:00'],
12345: ["nan",
0.5,
0.5,
0.5],
23456: ["nan",
0.5,
0.5,
0.5]}
)
total_holdings = results.loc["TotalHoldings"].reset_index()
total_holdings.loc[:, "Date"] = total_holdings.Date.dt.strftime("%Y-%m-%dT%H:%M:%S%z")
self.assertDictEqual(
total_holdings.to_dict(orient="list"),
{'Date': [
'2018-05-01T00:00:00',
'2018-05-02T00:00:00',
'2018-05-03T00:00:00',
'2018-05-04T00:00:00'],
12345: [0,
1.0,
1.0,
1.0],
23456: [0,
1.0,
1.0,
1.0]}
)
turnover = results.loc["Turnover"].reset_index()
turnover.loc[:, "Date"] = turnover.Date.dt.strftime("%Y-%m-%dT%H:%M:%S%z")
self.assertDictEqual(
turnover.to_dict(orient="list"),
{'Date': [
'2018-05-01T00:00:00',
'2018-05-02T00:00:00',
'2018-05-03T00:00:00',
'2018-05-04T00:00:00'],
12345: ["nan",
0.5,
1.0,
0.0],
23456: ["nan",
0.5,
1.0,
1.0]}
)
commissions = results.loc["Commission"].reset_index()
commissions.loc[:, "Date"] = commissions.Date.dt.strftime("%Y-%m-%dT%H:%M:%S%z")
self.assertDictEqual(
commissions.to_dict(orient="list"),
{'Date': [
'2018-05-01T00:00:00',
'2018-05-02T00:00:00',
'2018-05-03T00:00:00',
'2018-05-04T00:00:00'],
12345: [0.0,
0.0,
0.0,
0.0],
23456: [0.0,
0.0,
0.0,
0.0]}
)
slippage = results.loc["Slippage"].reset_index()
slippage.loc[:, "Date"] = slippage.Date.dt.strftime("%Y-%m-%dT%H:%M:%S%z")
self.assertDictEqual(
slippage.to_dict(orient="list"),
{'Date': [
'2018-05-01T00:00:00',
'2018-05-02T00:00:00',
'2018-05-03T00:00:00',
'2018-05-04T00:00:00'],
12345: [0.0,
0.0,
0.0,
0.0],
23456: [0.0,
0.0,
0.0,
0.0]}
)
returns = results.loc["Return"]
returns = returns.reset_index()
returns.loc[:, "Date"] = returns.Date.dt.strftime("%Y-%m-%dT%H:%M:%S%z")
self.assertDictEqual(
returns.to_dict(orient="list"),
{'Date': [
'2018-05-01T00:00:00',
'2018-05-02T00:00:00',
'2018-05-03T00:00:00',
'2018-05-04T00:00:00'],
12345: [0.0,
0.0,
-0.0227273, # (10.50 - 11)/11 * 0.5
0.0242857], # (9.99 - 10.50)/10.50 * -0.5
23456: [0.0,
0.0,
-0.1136364, # (8.50 - 11)/11 * 0.5
-0.1176471] # (10.50 - 8.50)/8.50 * -0.5
}
)
def test_long_short_strategy_override_methods(self):
"""
Tests that the resulting DataFrames are correct after running a
long-short strategy that overrides the major backtesting methods.
"""
class BuyBelow10ShortAbove10Overnight(Moonshot):
"""
A basic test strategy that buys below 10 and shorts above 10 and holds overnight.
"""
def prices_to_signals(self, prices):
long_signals = prices.loc["Open"] <= 10
short_signals = prices.loc["Open"] > 10
signals = long_signals.astype(int).where(long_signals, -short_signals.astype(int))
return signals
def signals_to_target_weights(self, signals, prices):
weights = self.allocate_fixed_weights(signals, 0.25)
return weights
def target_weights_to_positions(self, weights, prices):
# enter on close same day
positions = weights.copy()
return positions
def positions_to_gross_returns(self, positions, prices):
# hold on close till next day open
closes = prices.loc["Close"]
opens = prices.loc["Open"]
pct_changes = (opens - closes.shift()) / closes.shift()
gross_returns = pct_changes * positions.shift()
return gross_returns
def mock_get_historical_prices(*args, **kwargs):
dt_idx = pd.DatetimeIndex(["2018-05-01","2018-05-02","2018-05-03", "2018-05-04"])
fields = ["Close","Open","Volume"]
idx = pd.MultiIndex.from_product([fields, dt_idx], names=["Field", "Date"])
prices = pd.DataFrame(
{
12345: [
# Close
9.6,
10.45,
10.23,
8.67,
# Open
9,
11,
10.50,
9.99,
# Volume
5000,
16000,
8800,
9900
],
23456: [
# Close
10.56,
12.01,
10.50,
9.80,
# Open
9.89,
11,
8.50,
10.50,
# Volume
15000,
14000,
28800,
17000
],
},
index=idx
)
return prices
def mock_get_db_config(db):
return {
'vendor': 'ib',
'domain': 'main',
'bar_size': '1 day'
}
def mock_download_master_file(f, *args, **kwargs):
master_fields = ["Timezone", "Symbol", "SecType", "Currency", "PriceMagnifier", "Multiplier"]
securities = pd.DataFrame(
{
12345: [
"America/New_York",
"ABC",
"STK",
"USD",
None,
None
],
23456: [
"America/New_York",
"DEF",
"STK",
"USD",
None,
None,
]
},
index=master_fields
)
securities.columns.name = "ConId"
securities.T.to_csv(f, index=True, header=True)
f.seek(0)
with patch("moonshot.strategies.base.get_historical_prices", new=mock_get_historical_prices):
with patch("moonshot.strategies.base.download_master_file", new=mock_download_master_file):
with patch("moonshot.strategies.base.get_db_config", new=mock_get_db_config):
results = BuyBelow10ShortAbove10Overnight().backtest()
self.assertSetEqual(
set(results.index.get_level_values("Field")),
{'Commission',
'AbsExposure',
'Signal',
'Return',
'Slippage',
'NetExposure',
'TotalHoldings',
'Turnover',
'AbsWeight',
'Weight'}
)
# replace nan with "nan" to allow equality comparisons
results = results.round(7)
results = results.where(results.notnull(), "nan")
signals = results.loc["Signal"].reset_index()
signals.loc[:, "Date"] = signals.Date.dt.strftime("%Y-%m-%dT%H:%M:%S%z")
self.assertDictEqual(
signals.to_dict(orient="list"),
{'Date': [
'2018-05-01T00:00:00',
'2018-05-02T00:00:00',
'2018-05-03T00:00:00',
'2018-05-04T00:00:00'],
12345: [1.0,
-1.0,
-1.0,
1.0],
23456: [1.0,
-1.0,
1.0,
-1.0]}
)
weights = results.loc["Weight"].reset_index()
weights.loc[:, "Date"] = weights.Date.dt.strftime("%Y-%m-%dT%H:%M:%S%z")
self.assertDictEqual(
weights.to_dict(orient="list"),
{'Date': [
'2018-05-01T00:00:00',
'2018-05-02T00:00:00',
'2018-05-03T00:00:00',
'2018-05-04T00:00:00'],
12345: [0.25,
-0.25,
-0.25,
0.25],
23456: [0.25,
-0.25,
0.25,
-0.25]}
)
abs_weights = results.loc["AbsWeight"].reset_index()
abs_weights.loc[:, "Date"] = abs_weights.Date.dt.strftime("%Y-%m-%dT%H:%M:%S%z")
self.assertDictEqual(
abs_weights.to_dict(orient="list"),
{'Date': [
'2018-05-01T00:00:00',
'2018-05-02T00:00:00',
'2018-05-03T00:00:00',
'2018-05-04T00:00:00'],
12345: [0.25,
0.25,
0.25,
0.25],
23456: [0.25,
0.25,
0.25,
0.25]}
)
net_positions = results.loc["NetExposure"].reset_index()
net_positions.loc[:, "Date"] = net_positions.Date.dt.strftime("%Y-%m-%dT%H:%M:%S%z")
self.assertDictEqual(
net_positions.to_dict(orient="list"),
{'Date': [
'2018-05-01T00:00:00',
'2018-05-02T00:00:00',
'2018-05-03T00:00:00',
'2018-05-04T00:00:00'],
12345: [0.25,
-0.25,
-0.25,
0.25],
23456: [0.25,
-0.25,
0.25,
-0.25]}
)
abs_positions = results.loc["AbsExposure"].reset_index()
abs_positions.loc[:, "Date"] = abs_positions.Date.dt.strftime("%Y-%m-%dT%H:%M:%S%z")
self.assertDictEqual(
abs_positions.to_dict(orient="list"),
{'Date': [
'2018-05-01T00:00:00',
'2018-05-02T00:00:00',
'2018-05-03T00:00:00',
'2018-05-04T00:00:00'],
12345: [0.25,
0.25,
0.25,
0.25],
23456: [0.25,
0.25,
0.25,
0.25]}
)
total_holdings = results.loc["TotalHoldings"].reset_index()
total_holdings.loc[:, "Date"] = total_holdings.Date.dt.strftime("%Y-%m-%dT%H:%M:%S%z")
self.assertDictEqual(
total_holdings.to_dict(orient="list"),
{'Date': [
'2018-05-01T00:00:00',
'2018-05-02T00:00:00',
'2018-05-03T00:00:00',
'2018-05-04T00:00:00'],
12345: [1.0,
1.0,
1.0,
1.0],
23456: [1.0,
1.0,
1.0,
1.0]}
)
turnover = results.loc["Turnover"].reset_index()
turnover.loc[:, "Date"] = turnover.Date.dt.strftime("%Y-%m-%dT%H:%M:%S%z")
self.assertDictEqual(
turnover.to_dict(orient="list"),
{'Date': [
'2018-05-01T00:00:00',
'2018-05-02T00:00:00',
'2018-05-03T00:00:00',
'2018-05-04T00:00:00'],
12345: ["nan",
0.5,
0.0,
0.5],
23456: ["nan",
0.5,
0.5,
0.5]}
)
commissions = results.loc["Commission"].reset_index()
commissions.loc[:, "Date"] = commissions.Date.dt.strftime("%Y-%m-%dT%H:%M:%S%z")
self.assertDictEqual(
commissions.to_dict(orient="list"),
{'Date': [
'2018-05-01T00:00:00',
'2018-05-02T00:00:00',
'2018-05-03T00:00:00',
'2018-05-04T00:00:00'],
12345: [0.0,
0.0,
0.0,
0.0],
23456: [0.0,
0.0,
0.0,
0.0]}
)
slippage = results.loc["Slippage"].reset_index()
slippage.loc[:, "Date"] = slippage.Date.dt.strftime("%Y-%m-%dT%H:%M:%S%z")
self.assertDictEqual(
slippage.to_dict(orient="list"),
{'Date': [
'2018-05-01T00:00:00',
'2018-05-02T00:00:00',
'2018-05-03T00:00:00',
'2018-05-04T00:00:00'],
12345: [0.0,
0.0,
0.0,
0.0],
23456: [0.0,
0.0,
0.0,
0.0]}
)
returns = results.loc["Return"]
returns = returns.reset_index()
returns.loc[:, "Date"] = returns.Date.dt.strftime("%Y-%m-%dT%H:%M:%S%z")
self.assertDictEqual(
returns.to_dict(orient="list"),
{'Date': [
'2018-05-01T00:00:00',
'2018-05-02T00:00:00',
'2018-05-03T00:00:00',
'2018-05-04T00:00:00'],
12345: [0.0,
0.0364583, # (11 - 9.6)/9.6 * 0.25
-0.0011962, # (10.50 - 10.45)/10.45 * -0.25
0.0058651], # (9.99 - 10.23)/10.23 * 0.25
23456: [0.0,
0.0104167,# (11 - 10.56)/10.56 * 0.25
0.0730641, # (8.50 - 12.01)/12.01 * -0.25
0.0] # (10.50 - 10.50)/10.50 * 0.25
}
)
def test_short_only_once_a_day_intraday_strategy(self):
"""
Tests that the resulting DataFrames are correct after running a
short-only intraday strategy.
"""
class ShortAbove10Intraday(Moonshot):
"""
A basic test strategy that shorts above 10 and holds intraday.
"""
POSITIONS_CLOSED_DAILY = True
def prices_to_signals(self, prices):
morning_prices = prices.loc["Open"].xs("09:30:00", level="Time")
short_signals = morning_prices > 10
return -short_signals.astype(int)
def signals_to_target_weights(self, signals, prices):
weights = self.allocate_fixed_weights(signals, 0.25)
return weights
def target_weights_to_positions(self, weights, prices):
# enter on same day
positions = weights.copy()
return positions
def positions_to_gross_returns(self, positions, prices):
# hold from 10:00-16:00
closes = prices.loc["Close"]
entry_prices = closes.xs("09:30:00", level="Time")
exit_prices = closes.xs("15:30:00", level="Time")
pct_changes = (exit_prices - entry_prices) / entry_prices
gross_returns = pct_changes * positions
return gross_returns
def mock_get_historical_prices(*args, **kwargs):
dt_idx = pd.DatetimeIndex(["2018-05-01","2018-05-02","2018-05-03"])
fields = ["Close","Open"]
times = ["09:30:00", "15:30:00"]
idx = pd.MultiIndex.from_product(
[fields, dt_idx, times], names=["Field", "Date", "Time"])
prices = pd.DataFrame(
{
12345: [
# Close
9.6,
10.45,
10.12,
15.45,
8.67,
12.30,
# Open
9.88,
10.34,
10.23,
16.45,
8.90,
11.30,
],
23456: [
# Close
10.56,
12.01,
10.50,
9.80,
13.40,
14.50,
# Open
9.89,
11,
8.50,
10.50,
14.10,
15.60
],
},
index=idx
)
return prices
def mock_get_db_config(db):
return {
'vendor': 'ib',
'domain': 'main',
'bar_size': '1 day'
}
def mock_download_master_file(f, *args, **kwargs):
master_fields = ["Timezone", "Symbol", "SecType", "Currency", "PriceMagnifier", "Multiplier"]
securities = pd.DataFrame(
{
12345: [
"America/New_York",
"ABC",
"STK",
"USD",
None,
None
],
23456: [
"America/New_York",
"DEF",
"STK",
"USD",
None,
None,
]
},
index=master_fields
)
securities.columns.name = "ConId"
securities.T.to_csv(f, index=True, header=True)
f.seek(0)
with patch("moonshot.strategies.base.get_historical_prices", new=mock_get_historical_prices):
with patch("moonshot.strategies.base.download_master_file", new=mock_download_master_file):
with patch("moonshot.strategies.base.get_db_config", new=mock_get_db_config):
results = ShortAbove10Intraday().backtest()
self.assertSetEqual(
set(results.index.get_level_values("Field")),
{'Commission',
'AbsExposure',
'Signal',
'Return',
'Slippage',
'NetExposure',
'TotalHoldings',
'Turnover',
'AbsWeight',
'Weight'}
)
# replace nan with "nan" to allow equality comparisons
results = results.round(7)
results = results.where(results.notnull(), "nan")
signals = results.loc["Signal"].reset_index()
signals.loc[:, "Date"] = signals.Date.dt.strftime("%Y-%m-%dT%H:%M:%S%z")
self.assertDictEqual(
signals.to_dict(orient="list"),
{'Date': [
'2018-05-01T00:00:00',
'2018-05-02T00:00:00',
'2018-05-03T00:00:00'],
12345: [0.0,
-1.0,
0.0],
23456: [0.0,
0.0,
-1.0]}
)
weights = results.loc["Weight"].reset_index()
weights.loc[:, "Date"] = weights.Date.dt.strftime("%Y-%m-%dT%H:%M:%S%z")
self.assertDictEqual(
weights.to_dict(orient="list"),
{'Date': [
'2018-05-01T00:00:00',
'2018-05-02T00:00:00',
'2018-05-03T00:00:00'],
12345: [0.0,
-0.25,
0.0],
23456: [0.0,
0.0,
-0.25]}
)
abs_weights = results.loc["AbsWeight"].reset_index()
abs_weights.loc[:, "Date"] = abs_weights.Date.dt.strftime("%Y-%m-%dT%H:%M:%S%z")
self.assertDictEqual(
abs_weights.to_dict(orient="list"),
{'Date': [
'2018-05-01T00:00:00',
'2018-05-02T00:00:00',
'2018-05-03T00:00:00'],
12345: [0.0,
0.25,
0.0],
23456: [0.0,
0.0,
0.25]}
)
net_positions = results.loc["NetExposure"].reset_index()
net_positions.loc[:, "Date"] = net_positions.Date.dt.strftime("%Y-%m-%dT%H:%M:%S%z")
self.assertDictEqual(
net_positions.to_dict(orient="list"),
{'Date': [
'2018-05-01T00:00:00',
'2018-05-02T00:00:00',
'2018-05-03T00:00:00'],
12345: [0.0,
-0.25,
0.0],
23456: [0.0,
0.0,
-0.25]}
)
abs_positions = results.loc["AbsExposure"].reset_index()
abs_positions.loc[:, "Date"] = abs_positions.Date.dt.strftime("%Y-%m-%dT%H:%M:%S%z")
self.assertDictEqual(
abs_positions.to_dict(orient="list"),
{'Date': [
'2018-05-01T00:00:00',
'2018-05-02T00:00:00',
'2018-05-03T00:00:00'],
12345: [0.0,
0.25,
0.0],
23456: [0.0,
0.0,
0.25]}
)
total_holdings = results.loc["TotalHoldings"].reset_index()
total_holdings.loc[:, "Date"] = total_holdings.Date.dt.strftime("%Y-%m-%dT%H:%M:%S%z")
self.assertDictEqual(
total_holdings.to_dict(orient="list"),
{'Date': [
'2018-05-01T00:00:00',
'2018-05-02T00:00:00',
'2018-05-03T00:00:00'],
12345: [0.0,
1.0,
0.0],
23456: [0.0,
0.0,
1.0]}
)
turnover = results.loc["Turnover"].reset_index()
turnover.loc[:, "Date"] = turnover.Date.dt.strftime("%Y-%m-%dT%H:%M:%S%z")
self.assertDictEqual(
turnover.to_dict(orient="list"),
{'Date': [
'2018-05-01T00:00:00',
'2018-05-02T00:00:00',
'2018-05-03T00:00:00'],
12345: [0.0,
0.5,
0.0],
23456: [0.0,
0.0,
0.5]}
)
commissions = results.loc["Commission"].reset_index()
commissions.loc[:, "Date"] = commissions.Date.dt.strftime("%Y-%m-%dT%H:%M:%S%z")
self.assertDictEqual(
commissions.to_dict(orient="list"),
{'Date': [
'2018-05-01T00:00:00',
'2018-05-02T00:00:00',
'2018-05-03T00:00:00'],
12345: [0.0,
0.0,
0.0],
23456: [0.0,
0.0,
0.0]}
)
slippage = results.loc["Slippage"].reset_index()
slippage.loc[:, "Date"] = slippage.Date.dt.strftime("%Y-%m-%dT%H:%M:%S%z")
self.assertDictEqual(
slippage.to_dict(orient="list"),
{'Date': [
'2018-05-01T00:00:00',
'2018-05-02T00:00:00',
'2018-05-03T00:00:00'],
12345: [0.0,
0.0,
0.0],
23456: [0.0,
0.0,
0.0]}
)
returns = results.loc["Return"]
returns = returns.reset_index()
returns.loc[:, "Date"] = returns.Date.dt.strftime("%Y-%m-%dT%H:%M:%S%z")
self.assertDictEqual(
returns.to_dict(orient="list"),
{'Date': [
'2018-05-01T00:00:00',
'2018-05-02T00:00:00',
'2018-05-03T00:00:00'],
12345: [0.0,
-0.13167, # (15.45 - 10.12)/10.12 * -0.25
0.0],
23456: [0.0,
0.0,
-0.0205224] # (14.50 - 13.40)/13.40 * 0.25
}
)
def test_continuous_intraday_strategy(self):
"""
Tests that the resulting DataFrames are correct after running a
long-short continuous intraday strategy.
"""
class BuyBelow10ShortAbove10ContIntraday(Moonshot):
"""
A basic test strategy that buys below 10 and shorts above 10.
"""
def prices_to_signals(self, prices):
long_signals = prices.loc["Close"] <= 10
short_signals = prices.loc["Close"] > 10
signals = long_signals.astype(int).where(long_signals, -short_signals.astype(int))
return signals
def mock_get_historical_prices(*args, **kwargs):
dt_idx = pd.DatetimeIndex(["2018-05-01","2018-05-02"])
fields = ["Close"]
times = ["10:00:00", "11:00:00", "12:00:00"]
idx = pd.MultiIndex.from_product([fields, dt_idx, times], names=["Field", "Date", "Time"])
prices = pd.DataFrame(
{
12345: [
# Close
9.6,
10.45,
10.12,
15.45,
8.67,
12.30,
],
23456: [
# Close
10.56,
12.01,
10.50,
9.80,
13.40,
7.50,
],
},
index=idx
)
return prices
def mock_get_db_config(db):
return {
'vendor': 'ib',
'domain': 'main',
'bar_size': '1 hour'
}
def mock_download_master_file(f, *args, **kwargs):
master_fields = ["Timezone", "Symbol", "SecType", "Currency", "PriceMagnifier", "Multiplier"]
securities = pd.DataFrame(
{
12345: [
"America/New_York",
"ABC",
"STK",
"USD",
None,
None
],
23456: [
"America/New_York",
"DEF",
"STK",
"USD",
None,
None,
]
},
index=master_fields
)
securities.columns.name = "ConId"
securities.T.to_csv(f, index=True, header=True)
f.seek(0)
with patch("moonshot.strategies.base.get_historical_prices", new=mock_get_historical_prices):
with patch("moonshot.strategies.base.download_master_file", new=mock_download_master_file):
with patch("moonshot.strategies.base.get_db_config", new=mock_get_db_config):
results = BuyBelow10ShortAbove10ContIntraday().backtest()
self.assertSetEqual(
set(results.index.get_level_values("Field")),
{'Commission',
'AbsExposure',
'Signal',
'Return',
'Slippage',
'NetExposure',
'TotalHoldings',
'Turnover',
'AbsWeight',
'Weight'}
)
# replace nan with "nan" to allow equality comparisons
results = results.round(7)
results = results.where(results.notnull(), "nan")
signals = results.loc["Signal"].reset_index()
signals.loc[:, "Date"] = signals.Date.dt.strftime("%Y-%m-%dT%H:%M:%S%z")
self.assertDictEqual(
signals.to_dict(orient="list"),
{'Date': [
'2018-05-01T00:00:00',
'2018-05-01T00:00:00',
'2018-05-01T00:00:00',
'2018-05-02T00:00:00',
'2018-05-02T00:00:00',
'2018-05-02T00:00:00'],
'Time': ['10:00:00',
'11:00:00',
'12:00:00',
'10:00:00',
'11:00:00',
'12:00:00'],
12345: [1.0,
-1.0,
-1.0,
-1.0,
1.0,
-1.0],
23456: [-1.0,
-1.0,
-1.0,
1.0,
-1.0,
1.0]}
)
weights = results.loc["Weight"].reset_index()
weights.loc[:, "Date"] = weights.Date.dt.strftime("%Y-%m-%dT%H:%M:%S%z")
self.assertDictEqual(
weights.to_dict(orient="list"),
{'Date': [
'2018-05-01T00:00:00',
'2018-05-01T00:00:00',
'2018-05-01T00:00:00',
'2018-05-02T00:00:00',
'2018-05-02T00:00:00',
'2018-05-02T00:00:00'],
'Time': ['10:00:00',
'11:00:00',
'12:00:00',
'10:00:00',
'11:00:00',
'12:00:00'],
12345: [0.5,
-0.5,
-0.5,
-0.5,
0.5,
-0.5],
23456: [-0.5,
-0.5,
-0.5,
0.5,
-0.5,
0.5]}
)
abs_weights = results.loc["AbsWeight"].reset_index()
abs_weights.loc[:, "Date"] = abs_weights.Date.dt.strftime("%Y-%m-%dT%H:%M:%S%z")
self.assertDictEqual(
abs_weights.to_dict(orient="list"),
{'Date': [
'2018-05-01T00:00:00',
'2018-05-01T00:00:00',
'2018-05-01T00:00:00',
'2018-05-02T00:00:00',
'2018-05-02T00:00:00',
'2018-05-02T00:00:00'],
'Time': ['10:00:00',
'11:00:00',
'12:00:00',
'10:00:00',
'11:00:00',
'12:00:00'],
12345: [0.5,
0.5,
0.5,
0.5,
0.5,
0.5],
23456: [0.5,
0.5,
0.5,
0.5,
0.5,
0.5]}
)
net_positions = results.loc["NetExposure"].reset_index()
net_positions.loc[:, "Date"] = net_positions.Date.dt.strftime("%Y-%m-%dT%H:%M:%S%z")
self.assertDictEqual(
net_positions.to_dict(orient="list"),
{'Date': [
'2018-05-01T00:00:00',
'2018-05-01T00:00:00',
'2018-05-01T00:00:00',
'2018-05-02T00:00:00',
'2018-05-02T00:00:00',
'2018-05-02T00:00:00'],
'Time': ['10:00:00',
'11:00:00',
'12:00:00',
'10:00:00',
'11:00:00',
'12:00:00'],
12345: ['nan',
0.5,
-0.5,
-0.5,
-0.5,
0.5],
23456: ['nan',
-0.5,
-0.5,
-0.5,
0.5,
-0.5]}
)
abs_positions = results.loc["AbsExposure"].reset_index()
abs_positions.loc[:, "Date"] = abs_positions.Date.dt.strftime("%Y-%m-%dT%H:%M:%S%z")
self.assertDictEqual(
abs_positions.to_dict(orient="list"),
{'Date': [
'2018-05-01T00:00:00',
'2018-05-01T00:00:00',
'2018-05-01T00:00:00',
'2018-05-02T00:00:00',
'2018-05-02T00:00:00',
'2018-05-02T00:00:00'],
'Time': ['10:00:00',
'11:00:00',
'12:00:00',
'10:00:00',
'11:00:00',
'12:00:00'],
12345: ['nan',
0.5,
0.5,
0.5,
0.5,
0.5],
23456: ['nan',
0.5,
0.5,
0.5,
0.5,
0.5]}
)
total_holdings = results.loc["TotalHoldings"].reset_index()
total_holdings.loc[:, "Date"] = total_holdings.Date.dt.strftime("%Y-%m-%dT%H:%M:%S%z")
self.assertDictEqual(
total_holdings.to_dict(orient="list"),
{'Date': [
'2018-05-01T00:00:00',
'2018-05-01T00:00:00',
'2018-05-01T00:00:00',
'2018-05-02T00:00:00',
'2018-05-02T00:00:00',
'2018-05-02T00:00:00'],
'Time': ['10:00:00',
'11:00:00',
'12:00:00',
'10:00:00',
'11:00:00',
'12:00:00'],
12345: [0,
1.0,
1.0,
1.0,
1.0,
1.0],
23456: [0,
1.0,
1.0,
1.0,
1.0,
1.0]}
)
turnover = results.loc["Turnover"].reset_index()
turnover.loc[:, "Date"] = turnover.Date.dt.strftime("%Y-%m-%dT%H:%M:%S%z")
self.assertDictEqual(
turnover.to_dict(orient="list"),
{'Date': [
'2018-05-01T00:00:00',
'2018-05-01T00:00:00',
'2018-05-01T00:00:00',
'2018-05-02T00:00:00',
'2018-05-02T00:00:00',
'2018-05-02T00:00:00'],
'Time': ['10:00:00',
'11:00:00',
'12:00:00',
'10:00:00',
'11:00:00',
'12:00:00'],
12345: ['nan',
0.5,
1.0,
0.0,
0.0,
1.0],
23456: ['nan',
0.5,
0.0,
0.0,
1.0,
1.0]}
)
commissions = results.loc["Commission"].reset_index()
commissions.loc[:, "Date"] = commissions.Date.dt.strftime("%Y-%m-%dT%H:%M:%S%z")
self.assertDictEqual(
commissions.to_dict(orient="list"),
{'Date': [
'2018-05-01T00:00:00',
'2018-05-01T00:00:00',
'2018-05-01T00:00:00',
'2018-05-02T00:00:00',
'2018-05-02T00:00:00',
'2018-05-02T00:00:00'],
'Time': ['10:00:00',
'11:00:00',
'12:00:00',
'10:00:00',
'11:00:00',
'12:00:00'],
12345: [0.0,
0.0,
0.0,
0.0,
0.0,
0.0],
23456: [0.0,
0.0,
0.0,
0.0,
0.0,
0.0]}
)
slippage = results.loc["Slippage"].reset_index()
slippage.loc[:, "Date"] = slippage.Date.dt.strftime("%Y-%m-%dT%H:%M:%S%z")
self.assertDictEqual(
slippage.to_dict(orient="list"),
{'Date': [
'2018-05-01T00:00:00',
'2018-05-01T00:00:00',
'2018-05-01T00:00:00',
'2018-05-02T00:00:00',
'2018-05-02T00:00:00',
'2018-05-02T00:00:00'],
'Time': ['10:00:00',
'11:00:00',
'12:00:00',
'10:00:00',
'11:00:00',
'12:00:00'],
12345: [0.0,
0.0,
0.0,
0.0,
0.0,
0.0],
23456: [0.0,
0.0,
0.0,
0.0,
0.0,
0.0]}
)
returns = results.loc["Return"].reset_index()
returns.loc[:, "Date"] = returns.Date.dt.strftime("%Y-%m-%dT%H:%M:%S%z")
self.assertDictEqual(
returns.to_dict(orient="list"),
{'Date': [
'2018-05-01T00:00:00',
'2018-05-01T00:00:00',
'2018-05-01T00:00:00',
'2018-05-02T00:00:00',
'2018-05-02T00:00:00',
'2018-05-02T00:00:00'],
'Time': ['10:00:00',
'11:00:00',
'12:00:00',
'10:00:00',
'11:00:00',
'12:00:00'],
12345: [0.0,
0.0,
-0.0157895, # (10.12-10.45)/10.45 * 0.5
-0.2633399, # (15.45-10.12)/10.12 * -0.5
0.2194175, # (8.67-15.45)/15.45 * -0.5
-0.2093426 # (12.30-8.67)/8.67 * -0.5
],
23456: [0.0,
0.0,
0.0628643, # (10.50-12.01)/12.01 * -0.5
0.0333333, # (9.80-10.50)/10.50 * -0.5
-0.1836735, # (13.40-9.80)/9.80 * -0.5
-0.2201493 # (7.50-13.40)/13.40 * 0.5
]}
)
def test_pass_allocation(self):
"""
Tests that the resulting DataFrames are correct after running a basic
long-short strategy and passing an allocation.
"""
class BuyBelow10ShortAbove10(Moonshot):
"""
A basic test strategy that buys below 10 and shorts above 10.
"""
def prices_to_signals(self, prices):
long_signals = prices.loc["Close"] <= 10
short_signals = prices.loc["Close"] > 10
signals = long_signals.astype(int).where(long_signals, -short_signals.astype(int))
return signals
def mock_get_historical_prices(*args, **kwargs):
dt_idx = pd.DatetimeIndex(["2018-05-01","2018-05-02","2018-05-03", "2018-05-04"])
fields = ["Close","Volume"]
idx = pd.MultiIndex.from_product([fields, dt_idx], names=["Field", "Date"])
prices = pd.DataFrame(
{
12345: [
# Close
9,
11,
10.50,
9.99,
# Volume
5000,
16000,
8800,
9900
],
23456: [
# Close
9.89,
11,
8.50,
10.50,
# Volume
15000,
14000,
28800,
17000
],
},
index=idx
)
return prices
def mock_get_db_config(db):
return {
'vendor': 'ib',
'domain': 'main',
'bar_size': '1 day'
}
def mock_download_master_file(f, *args, **kwargs):
master_fields = ["Timezone", "Symbol", "SecType", "Currency", "PriceMagnifier", "Multiplier"]
securities = pd.DataFrame(
{
12345: [
"America/New_York",
"ABC",
"STK",
"USD",
None,
None
],
23456: [
"America/New_York",
"DEF",
"STK",
"USD",
None,
None,
]
},
index=master_fields
)
securities.columns.name = "ConId"
securities.T.to_csv(f, index=True, header=True)
f.seek(0)
with patch("moonshot.strategies.base.get_historical_prices", new=mock_get_historical_prices):
with patch("moonshot.strategies.base.download_master_file", new=mock_download_master_file):
with patch("moonshot.strategies.base.get_db_config", new=mock_get_db_config):
results = BuyBelow10ShortAbove10().backtest(allocation=3.0)
self.assertSetEqual(
set(results.index.get_level_values("Field")),
{'Commission',
'AbsExposure',
'Signal',
'Return',
'Slippage',
'NetExposure',
'TotalHoldings',
'Turnover',
'AbsWeight',
'Weight'}
)
# replace nan with "nan" to allow equality comparisons
results = results.round(7)
results = results.where(results.notnull(), "nan")
signals = results.loc["Signal"].reset_index()
signals.loc[:, "Date"] = signals.Date.dt.strftime("%Y-%m-%dT%H:%M:%S%z")
self.assertDictEqual(
signals.to_dict(orient="list"),
{'Date': [
'2018-05-01T00:00:00',
'2018-05-02T00:00:00',
'2018-05-03T00:00:00',
'2018-05-04T00:00:00'],
12345: [1.0,
-1.0,
-1.0,
1.0],
23456: [1.0,
-1.0,
1.0,
-1.0]}
)
weights = results.loc["Weight"].reset_index()
weights.loc[:, "Date"] = weights.Date.dt.strftime("%Y-%m-%dT%H:%M:%S%z")
self.assertDictEqual(
weights.to_dict(orient="list"),
{'Date': [
'2018-05-01T00:00:00',
'2018-05-02T00:00:00',
'2018-05-03T00:00:00',
'2018-05-04T00:00:00'],
12345: [1.5,
-1.5,
-1.5,
1.5],
23456: [1.5,
-1.5,
1.5,
-1.5]}
)
abs_weights = results.loc["AbsWeight"].reset_index()
abs_weights.loc[:, "Date"] = abs_weights.Date.dt.strftime("%Y-%m-%dT%H:%M:%S%z")
self.assertDictEqual(
abs_weights.to_dict(orient="list"),
{'Date': [
'2018-05-01T00:00:00',
'2018-05-02T00:00:00',
'2018-05-03T00:00:00',
'2018-05-04T00:00:00'],
12345: [1.5,
1.5,
1.5,
1.5],
23456: [1.5,
1.5,
1.5,
1.5]}
)
net_positions = results.loc["NetExposure"].reset_index()
net_positions.loc[:, "Date"] = net_positions.Date.dt.strftime("%Y-%m-%dT%H:%M:%S%z")
self.assertDictEqual(
net_positions.to_dict(orient="list"),
{'Date': [
'2018-05-01T00:00:00',
'2018-05-02T00:00:00',
'2018-05-03T00:00:00',
'2018-05-04T00:00:00'],
12345: ["nan",
1.5,
-1.5,
-1.5],
23456: ["nan",
1.5,
-1.5,
1.5]}
)
abs_positions = results.loc["AbsExposure"].reset_index()
abs_positions.loc[:, "Date"] = abs_positions.Date.dt.strftime("%Y-%m-%dT%H:%M:%S%z")
self.assertDictEqual(
abs_positions.to_dict(orient="list"),
{'Date': [
'2018-05-01T00:00:00',
'2018-05-02T00:00:00',
'2018-05-03T00:00:00',
'2018-05-04T00:00:00'],
12345: ["nan",
1.5,
1.5,
1.5],
23456: ["nan",
1.5,
1.5,
1.5]}
)
total_holdings = results.loc["TotalHoldings"].reset_index()
total_holdings.loc[:, "Date"] = total_holdings.Date.dt.strftime("%Y-%m-%dT%H:%M:%S%z")
self.assertDictEqual(
total_holdings.to_dict(orient="list"),
{'Date': [
'2018-05-01T00:00:00',
'2018-05-02T00:00:00',
'2018-05-03T00:00:00',
'2018-05-04T00:00:00'],
12345: [0,
1.0,
1.0,
1.0],
23456: [0,
1.0,
1.0,
1.0]}
)
turnover = results.loc["Turnover"].reset_index()
turnover.loc[:, "Date"] = turnover.Date.dt.strftime("%Y-%m-%dT%H:%M:%S%z")
self.assertDictEqual(
turnover.to_dict(orient="list"),
{'Date': [
'2018-05-01T00:00:00',
'2018-05-02T00:00:00',
'2018-05-03T00:00:00',
'2018-05-04T00:00:00'],
12345: ["nan",
1.5,
3.0,
0.0],
23456: ["nan",
1.5,
3.0,
3.0]}
)
returns = results.loc["Return"]
returns = returns.reset_index()
returns.loc[:, "Date"] = returns.Date.dt.strftime("%Y-%m-%dT%H:%M:%S%z")
self.assertDictEqual(
returns.to_dict(orient="list"),
{'Date': [
'2018-05-01T00:00:00',
'2018-05-02T00:00:00',
'2018-05-03T00:00:00',
'2018-05-04T00:00:00'],
12345: [0.0,
0.0,
-0.0681818, # (10.50 - 11)/11 * 1.5
0.0728571], # (9.99 - 10.50)/10.50 * -1.5
23456: [0.0,
0.0,
-0.3409091, # (8.50 - 11)/11 * 1.5
-0.3529412] # (10.50 - 8.50)/8.50 * -1.5
}
)
def test_label_conids(self):
"""
Tests that the label_conids param causes symbols to be included in
the resulting columns. For forex, symbol.currency should be used as
the label.
"""
class BuyBelow10(Moonshot):
"""
A basic test strategy that buys below 10.
"""
def prices_to_signals(self, prices):
signals = prices.loc["Close"] < 10
return signals.astype(int)
def mock_get_historical_prices(*args, **kwargs):
dt_idx = pd.DatetimeIndex(["2018-05-01","2018-05-02","2018-05-03", "2018-05-04"])
fields = ["Close","Volume"]
idx = pd.MultiIndex.from_product([fields, dt_idx], names=["Field", "Date"])
prices = pd.DataFrame(
{
12345: [
# Close
9,
11,
10.50,
9.99,
# Volume
5000,
16000,
8800,
9900
],
23456: [
# Close
9.89,
11,
8.50,
10.50,
# Volume
15000,
14000,
28800,
17000
],
},
index=idx
)
return prices
def mock_get_db_config(db):
return {
'vendor': 'ib',
'domain': 'main',
'bar_size': '1 day'
}
def mock_download_master_file(f, *args, **kwargs):
master_fields = ["Timezone", "Symbol", "SecType", "Currency", "PriceMagnifier", "Multiplier"]
securities = pd.DataFrame(
{
12345: [
"America/New_York",
"AAPL",
"STK",
"USD",
None,
None
],
23456: [
"America/New_York",
"EUR",
"CASH",
"JPY",
None,
None,
]
},
index=master_fields
)
securities.columns.name = "ConId"
securities.T.to_csv(f, index=True, header=True)
f.seek(0)
# control: run without label_conids
with patch("moonshot.strategies.base.get_historical_prices", new=mock_get_historical_prices):
with patch("moonshot.strategies.base.download_master_file", new=mock_download_master_file):
with patch("moonshot.strategies.base.get_db_config", new=mock_get_db_config):
results = BuyBelow10().backtest()
self.assertSetEqual(
set(results.columns),
{12345,
23456}
)
# control: run with label_conids
with patch("moonshot.strategies.base.get_historical_prices", new=mock_get_historical_prices):
with patch("moonshot.strategies.base.download_master_file", new=mock_download_master_file):
with patch("moonshot.strategies.base.get_db_config", new=mock_get_db_config):
results = BuyBelow10().backtest(label_conids=True)
self.assertSetEqual(
set(results.columns),
{"AAPL(12345)",
"EUR.JPY(23456)"}
)
def test_truncate_at_start_date(self):
"""
Tests that the resulting DataFrames are truncated at the requested
start date even if the data predates the start date due to lookback
window.
"""
class BuyBelow10(Moonshot):
"""
A basic test strategy that buys below 10.
"""
LOOKBACK_WINDOW = 10 # Due to mock, this isn't actually having any effect
def prices_to_signals(self, prices):
signals = prices.loc["Close"] < 10
return signals.astype(int)
def mock_get_historical_prices(*args, **kwargs):
dt_idx = pd.DatetimeIndex(["2018-05-01","2018-05-02","2018-05-03", "2018-05-04"])
fields = ["Close","Volume"]
idx = pd.MultiIndex.from_product([fields, dt_idx], names=["Field", "Date"])
prices = pd.DataFrame(
{
12345: [
# Close
9,
11,
10.50,
9.99,
# Volume
5000,
16000,
8800,
9900
],
23456: [
# Close
9.89,
11,
8.50,
10.50,
# Volume
15000,
14000,
28800,
17000
],
},
index=idx
)
return prices
def mock_get_db_config(db):
return {
'vendor': 'ib',
'domain': 'main',
'bar_size': '1 day'
}
def mock_download_master_file(f, *args, **kwargs):
master_fields = ["Timezone", "Symbol", "SecType", "Currency", "PriceMagnifier", "Multiplier"]
securities = pd.DataFrame(
{
12345: [
"America/New_York",
"ABC",
"STK",
"USD",
None,
None
],
23456: [
"America/New_York",
"DEF",
"STK",
"USD",
None,
None,
]
},
index=master_fields
)
securities.columns.name = "ConId"
securities.T.to_csv(f, index=True, header=True)
f.seek(0)
with patch("moonshot.strategies.base.get_historical_prices", new=mock_get_historical_prices):
with patch("moonshot.strategies.base.download_master_file", new=mock_download_master_file):
with patch("moonshot.strategies.base.get_db_config", new=mock_get_db_config):
results = BuyBelow10().backtest(start_date="2018-05-03")
self.assertSetEqual(
set(results.index.get_level_values("Field")),
{'Commission',
'AbsExposure',
'Signal',
'Return',
'Slippage',
'NetExposure',
'TotalHoldings',
'Turnover',
'AbsWeight',
'Weight'}
)
self.assertEqual(results.index.get_level_values("Date").min(), pd.Timestamp("2018-05-03"))
| [
"brian@quantrocket.com"
] | brian@quantrocket.com |
397b05b89c59aeb232b4e7f383c73cb06250f850 | 0fcb0644430f1a67d972167c9060042156e3889e | /warcreplay.py | fc342f31a562ae975429b73358cac9d80123a626 | [
"MIT",
"ISC"
] | permissive | odie5533/WarcReplay | dc6344d5e01ab72cb8f20127148bf2dd5ea57883 | 82e46b6b86816f72398d5c2eb69668990e62ded4 | refs/heads/master | 2020-06-02T23:41:36.707950 | 2013-11-11T05:50:02 | 2013-11-11T05:50:02 | 14,255,070 | 2 | 1 | null | null | null | null | UTF-8 | Python | false | false | 4,071 | py | # Copyright (c) 2013 David Bern
import argparse
from twisted.internet import reactor, protocol
from twisted.web.client import _URI
from hanzo.httptools import RequestMessage, ResponseMessage
from TwistedWebProxyServer import WebProxyServerProtocol
from warcmanager import WarcReplayHandler
def _copy_attrs(to, frum, attrs):
map(lambda a: setattr(to, a, getattr(frum, a)), attrs)
class WarcReplayProtocol(WebProxyServerProtocol):
def __init__(self, wrp, *args, **kwargs):
WebProxyServerProtocol.__init__(self, *args, **kwargs)
self._wrp = wrp
@staticmethod
def getRecordUri(request_uri, connect_uri):
"""
:type request_uri: str
:type connect_uri: str
:return: str
"""
req_uri = _URI.fromBytes(request_uri)
con_uri = _URI.fromBytes(connect_uri)
# Remove default port from URL
if con_uri.port == (80 if con_uri.scheme == 'http' else 443):
con_uri.netloc = con_uri.host
# Copy parameters from the relative req_uri to the con_uri
_copy_attrs(con_uri, req_uri, ['path', 'params', 'query', 'fragment'])
return con_uri.toBytes()
@staticmethod
def writeRecordToTransport(r, t):
m = ResponseMessage(RequestMessage())
m.feed(r.content[1])
m.close()
b = m.get_body()
# construct new headers
new_headers = []
old_headers = []
for k, v in m.header.headers:
if not k.lower() in ("connection", "content-length",
"cache-control", "accept-ranges", "etag",
"last-modified", "transfer-encoding"):
new_headers.append((k, v))
old_headers.append(("X-Archive-Orig-%s" % k, v))
new_headers.append(("Content-Length", "%d" % len(b)))
new_headers.append(("Connection", "keep-alive"))
# write the response
t.write("%s %d %s\r\n" % (m.header.version,
m.header.code,
m.header.phrase))
h = new_headers + old_headers
t.write("\r\n".join(["%s: %s" % (k, v) for k, v in h]))
t.write("\r\n\r\n")
t.write(b)
def requestParsed(self, request):
"""
Overrides WebProxyServerProtocol.requestParsed
"""
record_uri = self.getRecordUri(request.uri, self.connect_uri)
#print "requestParsed:", record_uri
r = self._wrp.recordFromUri(record_uri)
if r is not None:
self.writeRecordToTransport(r, self.transport)
else:
print "404: ", record_uri
resp = "URL not found in archives."
self.transport.write("HTTP/1.0 404 Not Found\r\n"
"Connection: keep-alive\r\n"
"Content-Type: text/plain\r\n"
"Content-Length: %d\r\n\r\n"
"%s\r\n" % (len(resp)+2, resp))
class ReplayServerFactory(protocol.ServerFactory):
protocol = WarcReplayProtocol
def __init__(self, warcFiles=None, wrp=None):
self.wrp = wrp or WarcReplayHandler()
map(self.wrp.loadWarcFile, warcFiles or [])
def buildProtocol(self, addr):
p = self.protocol(self.wrp)
p.factory = self
return p
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='WarcReplay')
parser.add_argument('-p', '--port', default='1080',
help='Port to run the proxy server on.')
parser.add_argument('-w', '--warc', default='out.warc.gz',
help='WARC file to load')
args = parser.parse_args()
args.port = int(args.port)
rsf = ReplayServerFactory(warcFiles=[args.warc])
reactor.listenTCP(args.port, rsf)
print "Proxy running on port", args.port
reactor.run()
| [
"odiegit@gmail.com"
] | odiegit@gmail.com |
d950a029ed1fbe2bbb26026def4d45c05ac2ac00 | 8670b4495264bf90742554f73a5d33e7b64138fd | /venv/lib/python3.8/site-packages/pymavlink/dialects/v10/ardupilotmega.py | d43e6f9e45336fce552f725b43abae230783006a | [] | no_license | BIwashi/dronekit-sitl-docker | aaa532245cc0f04bcd7dfbbf967ca754c03ea784 | 209c5a14a50efead4758a6881906862689ea1e57 | refs/heads/master | 2023-01-06T10:19:44.907874 | 2020-10-26T16:31:36 | 2020-10-26T16:31:36 | 298,338,052 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,346,699 | py | '''
MAVLink protocol implementation (auto-generated by mavgen.py)
Generated from: ardupilotmega.xml,common.xml,uAvionix.xml,icarous.xml
Note: this file has been auto-generated. DO NOT EDIT
'''
from __future__ import print_function
from builtins import range
from builtins import object
import struct, array, time, json, os, sys, platform
from pymavlink.generator.mavcrc import x25crc
import hashlib
WIRE_PROTOCOL_VERSION = '1.0'
DIALECT = 'ardupilotmega'
PROTOCOL_MARKER_V1 = 0xFE
PROTOCOL_MARKER_V2 = 0xFD
HEADER_LEN_V1 = 6
HEADER_LEN_V2 = 10
MAVLINK_SIGNATURE_BLOCK_LEN = 13
MAVLINK_IFLAG_SIGNED = 0x01
native_supported = platform.system() != 'Windows' # Not yet supported on other dialects
native_force = 'MAVNATIVE_FORCE' in os.environ # Will force use of native code regardless of what client app wants
native_testing = 'MAVNATIVE_TESTING' in os.environ # Will force both native and legacy code to be used and their results compared
if native_supported and float(WIRE_PROTOCOL_VERSION) <= 1:
try:
import mavnative
except ImportError:
print('ERROR LOADING MAVNATIVE - falling back to python implementation')
native_supported = False
else:
# mavnative isn't supported for MAVLink2 yet
native_supported = False
# some base types from mavlink_types.h
MAVLINK_TYPE_CHAR = 0
MAVLINK_TYPE_UINT8_T = 1
MAVLINK_TYPE_INT8_T = 2
MAVLINK_TYPE_UINT16_T = 3
MAVLINK_TYPE_INT16_T = 4
MAVLINK_TYPE_UINT32_T = 5
MAVLINK_TYPE_INT32_T = 6
MAVLINK_TYPE_UINT64_T = 7
MAVLINK_TYPE_INT64_T = 8
MAVLINK_TYPE_FLOAT = 9
MAVLINK_TYPE_DOUBLE = 10
class MAVLink_header(object):
'''MAVLink message header'''
def __init__(self, msgId, incompat_flags=0, compat_flags=0, mlen=0, seq=0, srcSystem=0, srcComponent=0):
self.mlen = mlen
self.seq = seq
self.srcSystem = srcSystem
self.srcComponent = srcComponent
self.msgId = msgId
self.incompat_flags = incompat_flags
self.compat_flags = compat_flags
def pack(self, force_mavlink1=False):
if WIRE_PROTOCOL_VERSION == '2.0' and not force_mavlink1:
return struct.pack('<BBBBBBBHB', 254, self.mlen,
self.incompat_flags, self.compat_flags,
self.seq, self.srcSystem, self.srcComponent,
self.msgId&0xFFFF, self.msgId>>16)
return struct.pack('<BBBBBB', PROTOCOL_MARKER_V1, self.mlen, self.seq,
self.srcSystem, self.srcComponent, self.msgId)
class MAVLink_message(object):
'''base MAVLink message class'''
def __init__(self, msgId, name):
self._header = MAVLink_header(msgId)
self._payload = None
self._msgbuf = None
self._crc = None
self._fieldnames = []
self._type = name
self._signed = False
self._link_id = None
self._instances = None
self._instance_field = None
# swiped from DFReader.py
def to_string(self, s):
'''desperate attempt to convert a string regardless of what garbage we get'''
try:
return s.decode("utf-8")
except Exception as e:
pass
try:
s2 = s.encode('utf-8', 'ignore')
x = u"%s" % s2
return s2
except Exception:
pass
# so its a nasty one. Let's grab as many characters as we can
r = ''
while s != '':
try:
r2 = r + s[0]
s = s[1:]
r2 = r2.encode('ascii', 'ignore')
x = u"%s" % r2
r = r2
except Exception:
break
return r + '_XXX'
def format_attr(self, field):
'''override field getter'''
raw_attr = getattr(self,field)
if isinstance(raw_attr, bytes):
raw_attr = self.to_string(raw_attr).rstrip("\00")
return raw_attr
def get_msgbuf(self):
if isinstance(self._msgbuf, bytearray):
return self._msgbuf
return bytearray(self._msgbuf)
def get_header(self):
return self._header
def get_payload(self):
return self._payload
def get_crc(self):
return self._crc
def get_fieldnames(self):
return self._fieldnames
def get_type(self):
return self._type
def get_msgId(self):
return self._header.msgId
def get_srcSystem(self):
return self._header.srcSystem
def get_srcComponent(self):
return self._header.srcComponent
def get_seq(self):
return self._header.seq
def get_signed(self):
return self._signed
def get_link_id(self):
return self._link_id
def __str__(self):
ret = '%s {' % self._type
for a in self._fieldnames:
v = self.format_attr(a)
ret += '%s : %s, ' % (a, v)
ret = ret[0:-2] + '}'
return ret
def __ne__(self, other):
return not self.__eq__(other)
def __eq__(self, other):
if other is None:
return False
if self.get_type() != other.get_type():
return False
# We do not compare CRC because native code doesn't provide it
#if self.get_crc() != other.get_crc():
# return False
if self.get_seq() != other.get_seq():
return False
if self.get_srcSystem() != other.get_srcSystem():
return False
if self.get_srcComponent() != other.get_srcComponent():
return False
for a in self._fieldnames:
if self.format_attr(a) != other.format_attr(a):
return False
return True
def to_dict(self):
d = dict({})
d['mavpackettype'] = self._type
for a in self._fieldnames:
d[a] = self.format_attr(a)
return d
def to_json(self):
return json.dumps(self.to_dict())
def sign_packet(self, mav):
h = hashlib.new('sha256')
self._msgbuf += struct.pack('<BQ', mav.signing.link_id, mav.signing.timestamp)[:7]
h.update(mav.signing.secret_key)
h.update(self._msgbuf)
sig = h.digest()[:6]
self._msgbuf += sig
mav.signing.timestamp += 1
def pack(self, mav, crc_extra, payload, force_mavlink1=False):
plen = len(payload)
if WIRE_PROTOCOL_VERSION != '1.0' and not force_mavlink1:
# in MAVLink2 we can strip trailing zeros off payloads. This allows for simple
# variable length arrays and smaller packets
nullbyte = chr(0)
# in Python2, type("fred') is str but also type("fred")==bytes
if str(type(payload)) == "<class 'bytes'>":
nullbyte = 0
while plen > 1 and payload[plen-1] == nullbyte:
plen -= 1
self._payload = payload[:plen]
incompat_flags = 0
if mav.signing.sign_outgoing:
incompat_flags |= MAVLINK_IFLAG_SIGNED
self._header = MAVLink_header(self._header.msgId,
incompat_flags=incompat_flags, compat_flags=0,
mlen=len(self._payload), seq=mav.seq,
srcSystem=mav.srcSystem, srcComponent=mav.srcComponent)
self._msgbuf = self._header.pack(force_mavlink1=force_mavlink1) + self._payload
crc = x25crc(self._msgbuf[1:])
if True: # using CRC extra
crc.accumulate_str(struct.pack('B', crc_extra))
self._crc = crc.crc
self._msgbuf += struct.pack('<H', self._crc)
if mav.signing.sign_outgoing and not force_mavlink1:
self.sign_packet(mav)
return self._msgbuf
def __getitem__(self, key):
'''support indexing, allowing for multi-instance sensors in one message'''
if self._instances is None:
raise IndexError()
if not key in self._instances:
raise IndexError()
return self._instances[key]
# enums
class EnumEntry(object):
def __init__(self, name, description):
self.name = name
self.description = description
self.param = {}
enums = {}
# ACCELCAL_VEHICLE_POS
enums['ACCELCAL_VEHICLE_POS'] = {}
ACCELCAL_VEHICLE_POS_LEVEL = 1 #
enums['ACCELCAL_VEHICLE_POS'][1] = EnumEntry('ACCELCAL_VEHICLE_POS_LEVEL', '''''')
ACCELCAL_VEHICLE_POS_LEFT = 2 #
enums['ACCELCAL_VEHICLE_POS'][2] = EnumEntry('ACCELCAL_VEHICLE_POS_LEFT', '''''')
ACCELCAL_VEHICLE_POS_RIGHT = 3 #
enums['ACCELCAL_VEHICLE_POS'][3] = EnumEntry('ACCELCAL_VEHICLE_POS_RIGHT', '''''')
ACCELCAL_VEHICLE_POS_NOSEDOWN = 4 #
enums['ACCELCAL_VEHICLE_POS'][4] = EnumEntry('ACCELCAL_VEHICLE_POS_NOSEDOWN', '''''')
ACCELCAL_VEHICLE_POS_NOSEUP = 5 #
enums['ACCELCAL_VEHICLE_POS'][5] = EnumEntry('ACCELCAL_VEHICLE_POS_NOSEUP', '''''')
ACCELCAL_VEHICLE_POS_BACK = 6 #
enums['ACCELCAL_VEHICLE_POS'][6] = EnumEntry('ACCELCAL_VEHICLE_POS_BACK', '''''')
ACCELCAL_VEHICLE_POS_SUCCESS = 16777215 #
enums['ACCELCAL_VEHICLE_POS'][16777215] = EnumEntry('ACCELCAL_VEHICLE_POS_SUCCESS', '''''')
ACCELCAL_VEHICLE_POS_FAILED = 16777216 #
enums['ACCELCAL_VEHICLE_POS'][16777216] = EnumEntry('ACCELCAL_VEHICLE_POS_FAILED', '''''')
ACCELCAL_VEHICLE_POS_ENUM_END = 16777217 #
enums['ACCELCAL_VEHICLE_POS'][16777217] = EnumEntry('ACCELCAL_VEHICLE_POS_ENUM_END', '''''')
# HEADING_TYPE
enums['HEADING_TYPE'] = {}
HEADING_TYPE_COURSE_OVER_GROUND = 0 #
enums['HEADING_TYPE'][0] = EnumEntry('HEADING_TYPE_COURSE_OVER_GROUND', '''''')
HEADING_TYPE_HEADING = 1 #
enums['HEADING_TYPE'][1] = EnumEntry('HEADING_TYPE_HEADING', '''''')
HEADING_TYPE_ENUM_END = 2 #
enums['HEADING_TYPE'][2] = EnumEntry('HEADING_TYPE_ENUM_END', '''''')
# SPEED_TYPE
enums['SPEED_TYPE'] = {}
SPEED_TYPE_AIRSPEED = 0 #
enums['SPEED_TYPE'][0] = EnumEntry('SPEED_TYPE_AIRSPEED', '''''')
SPEED_TYPE_GROUNDSPEED = 1 #
enums['SPEED_TYPE'][1] = EnumEntry('SPEED_TYPE_GROUNDSPEED', '''''')
SPEED_TYPE_ENUM_END = 2 #
enums['SPEED_TYPE'][2] = EnumEntry('SPEED_TYPE_ENUM_END', '''''')
# MAV_CMD
enums['MAV_CMD'] = {}
MAV_CMD_NAV_WAYPOINT = 16 # Navigate to waypoint.
enums['MAV_CMD'][16] = EnumEntry('MAV_CMD_NAV_WAYPOINT', '''Navigate to waypoint.''')
enums['MAV_CMD'][16].param[1] = '''Hold time. (ignored by fixed wing, time to stay at waypoint for rotary wing)'''
enums['MAV_CMD'][16].param[2] = '''Acceptance radius (if the sphere with this radius is hit, the waypoint counts as reached)'''
enums['MAV_CMD'][16].param[3] = '''0 to pass through the WP, if > 0 radius to pass by WP. Positive value for clockwise orbit, negative value for counter-clockwise orbit. Allows trajectory control.'''
enums['MAV_CMD'][16].param[4] = '''Desired yaw angle at waypoint (rotary wing). NaN to use the current system yaw heading mode (e.g. yaw towards next waypoint, yaw to home, etc.).'''
enums['MAV_CMD'][16].param[5] = '''Latitude'''
enums['MAV_CMD'][16].param[6] = '''Longitude'''
enums['MAV_CMD'][16].param[7] = '''Altitude'''
MAV_CMD_NAV_LOITER_UNLIM = 17 # Loiter around this waypoint an unlimited amount of time
enums['MAV_CMD'][17] = EnumEntry('MAV_CMD_NAV_LOITER_UNLIM', '''Loiter around this waypoint an unlimited amount of time''')
enums['MAV_CMD'][17].param[1] = '''Empty'''
enums['MAV_CMD'][17].param[2] = '''Empty'''
enums['MAV_CMD'][17].param[3] = '''Radius around waypoint. If positive loiter clockwise, else counter-clockwise'''
enums['MAV_CMD'][17].param[4] = '''Desired yaw angle. NaN to use the current system yaw heading mode (e.g. yaw towards next waypoint, yaw to home, etc.).'''
enums['MAV_CMD'][17].param[5] = '''Latitude'''
enums['MAV_CMD'][17].param[6] = '''Longitude'''
enums['MAV_CMD'][17].param[7] = '''Altitude'''
MAV_CMD_NAV_LOITER_TURNS = 18 # Loiter around this waypoint for X turns
enums['MAV_CMD'][18] = EnumEntry('MAV_CMD_NAV_LOITER_TURNS', '''Loiter around this waypoint for X turns''')
enums['MAV_CMD'][18].param[1] = '''Number of turns.'''
enums['MAV_CMD'][18].param[2] = '''Empty'''
enums['MAV_CMD'][18].param[3] = '''Radius around waypoint. If positive loiter clockwise, else counter-clockwise'''
enums['MAV_CMD'][18].param[4] = '''Forward moving aircraft this sets exit xtrack location: 0 for center of loiter wp, 1 for exit location. Else, this is desired yaw angle. NaN to use the current system yaw heading mode (e.g. yaw towards next waypoint, yaw to home, etc.).'''
enums['MAV_CMD'][18].param[5] = '''Latitude'''
enums['MAV_CMD'][18].param[6] = '''Longitude'''
enums['MAV_CMD'][18].param[7] = '''Altitude'''
MAV_CMD_NAV_LOITER_TIME = 19 # Loiter around this waypoint for X seconds
enums['MAV_CMD'][19] = EnumEntry('MAV_CMD_NAV_LOITER_TIME', '''Loiter around this waypoint for X seconds''')
enums['MAV_CMD'][19].param[1] = '''Loiter time.'''
enums['MAV_CMD'][19].param[2] = '''Empty'''
enums['MAV_CMD'][19].param[3] = '''Radius around waypoint. If positive loiter clockwise, else counter-clockwise.'''
enums['MAV_CMD'][19].param[4] = '''Forward moving aircraft this sets exit xtrack location: 0 for center of loiter wp, 1 for exit location. Else, this is desired yaw angle. NaN to use the current system yaw heading mode (e.g. yaw towards next waypoint, yaw to home, etc.).'''
enums['MAV_CMD'][19].param[5] = '''Latitude'''
enums['MAV_CMD'][19].param[6] = '''Longitude'''
enums['MAV_CMD'][19].param[7] = '''Altitude'''
MAV_CMD_NAV_RETURN_TO_LAUNCH = 20 # Return to launch location
enums['MAV_CMD'][20] = EnumEntry('MAV_CMD_NAV_RETURN_TO_LAUNCH', '''Return to launch location''')
enums['MAV_CMD'][20].param[1] = '''Empty'''
enums['MAV_CMD'][20].param[2] = '''Empty'''
enums['MAV_CMD'][20].param[3] = '''Empty'''
enums['MAV_CMD'][20].param[4] = '''Empty'''
enums['MAV_CMD'][20].param[5] = '''Empty'''
enums['MAV_CMD'][20].param[6] = '''Empty'''
enums['MAV_CMD'][20].param[7] = '''Empty'''
MAV_CMD_NAV_LAND = 21 # Land at location.
enums['MAV_CMD'][21] = EnumEntry('MAV_CMD_NAV_LAND', '''Land at location.''')
enums['MAV_CMD'][21].param[1] = '''Minimum target altitude if landing is aborted (0 = undefined/use system default).'''
enums['MAV_CMD'][21].param[2] = '''Precision land mode.'''
enums['MAV_CMD'][21].param[3] = '''Empty.'''
enums['MAV_CMD'][21].param[4] = '''Desired yaw angle. NaN to use the current system yaw heading mode (e.g. yaw towards next waypoint, yaw to home, etc.).'''
enums['MAV_CMD'][21].param[5] = '''Latitude.'''
enums['MAV_CMD'][21].param[6] = '''Longitude.'''
enums['MAV_CMD'][21].param[7] = '''Landing altitude (ground level in current frame).'''
MAV_CMD_NAV_TAKEOFF = 22 # Takeoff from ground / hand
enums['MAV_CMD'][22] = EnumEntry('MAV_CMD_NAV_TAKEOFF', '''Takeoff from ground / hand''')
enums['MAV_CMD'][22].param[1] = '''Minimum pitch (if airspeed sensor present), desired pitch without sensor'''
enums['MAV_CMD'][22].param[2] = '''Empty'''
enums['MAV_CMD'][22].param[3] = '''Empty'''
enums['MAV_CMD'][22].param[4] = '''Yaw angle (if magnetometer present), ignored without magnetometer. NaN to use the current system yaw heading mode (e.g. yaw towards next waypoint, yaw to home, etc.).'''
enums['MAV_CMD'][22].param[5] = '''Latitude'''
enums['MAV_CMD'][22].param[6] = '''Longitude'''
enums['MAV_CMD'][22].param[7] = '''Altitude'''
MAV_CMD_NAV_LAND_LOCAL = 23 # Land at local position (local frame only)
enums['MAV_CMD'][23] = EnumEntry('MAV_CMD_NAV_LAND_LOCAL', '''Land at local position (local frame only)''')
enums['MAV_CMD'][23].param[1] = '''Landing target number (if available)'''
enums['MAV_CMD'][23].param[2] = '''Maximum accepted offset from desired landing position - computed magnitude from spherical coordinates: d = sqrt(x^2 + y^2 + z^2), which gives the maximum accepted distance between the desired landing position and the position where the vehicle is about to land'''
enums['MAV_CMD'][23].param[3] = '''Landing descend rate'''
enums['MAV_CMD'][23].param[4] = '''Desired yaw angle'''
enums['MAV_CMD'][23].param[5] = '''Y-axis position'''
enums['MAV_CMD'][23].param[6] = '''X-axis position'''
enums['MAV_CMD'][23].param[7] = '''Z-axis / ground level position'''
MAV_CMD_NAV_TAKEOFF_LOCAL = 24 # Takeoff from local position (local frame only)
enums['MAV_CMD'][24] = EnumEntry('MAV_CMD_NAV_TAKEOFF_LOCAL', '''Takeoff from local position (local frame only)''')
enums['MAV_CMD'][24].param[1] = '''Minimum pitch (if airspeed sensor present), desired pitch without sensor'''
enums['MAV_CMD'][24].param[2] = '''Empty'''
enums['MAV_CMD'][24].param[3] = '''Takeoff ascend rate'''
enums['MAV_CMD'][24].param[4] = '''Yaw angle (if magnetometer or another yaw estimation source present), ignored without one of these'''
enums['MAV_CMD'][24].param[5] = '''Y-axis position'''
enums['MAV_CMD'][24].param[6] = '''X-axis position'''
enums['MAV_CMD'][24].param[7] = '''Z-axis position'''
MAV_CMD_NAV_FOLLOW = 25 # Vehicle following, i.e. this waypoint represents the position of a
# moving vehicle
enums['MAV_CMD'][25] = EnumEntry('MAV_CMD_NAV_FOLLOW', '''Vehicle following, i.e. this waypoint represents the position of a moving vehicle''')
enums['MAV_CMD'][25].param[1] = '''Following logic to use (e.g. loitering or sinusoidal following) - depends on specific autopilot implementation'''
enums['MAV_CMD'][25].param[2] = '''Ground speed of vehicle to be followed'''
enums['MAV_CMD'][25].param[3] = '''Radius around waypoint. If positive loiter clockwise, else counter-clockwise'''
enums['MAV_CMD'][25].param[4] = '''Desired yaw angle.'''
enums['MAV_CMD'][25].param[5] = '''Latitude'''
enums['MAV_CMD'][25].param[6] = '''Longitude'''
enums['MAV_CMD'][25].param[7] = '''Altitude'''
MAV_CMD_NAV_CONTINUE_AND_CHANGE_ALT = 30 # Continue on the current course and climb/descend to specified
# altitude. When the altitude is reached
# continue to the next command (i.e., don't
# proceed to the next command until the
# desired altitude is reached.
enums['MAV_CMD'][30] = EnumEntry('MAV_CMD_NAV_CONTINUE_AND_CHANGE_ALT', '''Continue on the current course and climb/descend to specified altitude. When the altitude is reached continue to the next command (i.e., don't proceed to the next command until the desired altitude is reached.''')
enums['MAV_CMD'][30].param[1] = '''Climb or Descend (0 = Neutral, command completes when within 5m of this command's altitude, 1 = Climbing, command completes when at or above this command's altitude, 2 = Descending, command completes when at or below this command's altitude.'''
enums['MAV_CMD'][30].param[2] = '''Empty'''
enums['MAV_CMD'][30].param[3] = '''Empty'''
enums['MAV_CMD'][30].param[4] = '''Empty'''
enums['MAV_CMD'][30].param[5] = '''Empty'''
enums['MAV_CMD'][30].param[6] = '''Empty'''
enums['MAV_CMD'][30].param[7] = '''Desired altitude'''
MAV_CMD_NAV_LOITER_TO_ALT = 31 # Begin loiter at the specified Latitude and Longitude. If Lat=Lon=0,
# then loiter at the current position. Don't
# consider the navigation command complete
# (don't leave loiter) until the altitude has
# been reached. Additionally, if the Heading
# Required parameter is non-zero the aircraft
# will not leave the loiter until heading
# toward the next waypoint.
enums['MAV_CMD'][31] = EnumEntry('MAV_CMD_NAV_LOITER_TO_ALT', '''Begin loiter at the specified Latitude and Longitude. If Lat=Lon=0, then loiter at the current position. Don't consider the navigation command complete (don't leave loiter) until the altitude has been reached. Additionally, if the Heading Required parameter is non-zero the aircraft will not leave the loiter until heading toward the next waypoint.''')
enums['MAV_CMD'][31].param[1] = '''Heading Required (0 = False)'''
enums['MAV_CMD'][31].param[2] = '''Radius. If positive loiter clockwise, negative counter-clockwise, 0 means no change to standard loiter.'''
enums['MAV_CMD'][31].param[3] = '''Empty'''
enums['MAV_CMD'][31].param[4] = '''Forward moving aircraft this sets exit xtrack location: 0 for center of loiter wp, 1 for exit location'''
enums['MAV_CMD'][31].param[5] = '''Latitude'''
enums['MAV_CMD'][31].param[6] = '''Longitude'''
enums['MAV_CMD'][31].param[7] = '''Altitude'''
MAV_CMD_DO_FOLLOW = 32 # Begin following a target
enums['MAV_CMD'][32] = EnumEntry('MAV_CMD_DO_FOLLOW', '''Begin following a target''')
enums['MAV_CMD'][32].param[1] = '''System ID (of the FOLLOW_TARGET beacon). Send 0 to disable follow-me and return to the default position hold mode.'''
enums['MAV_CMD'][32].param[2] = '''RESERVED'''
enums['MAV_CMD'][32].param[3] = '''RESERVED'''
enums['MAV_CMD'][32].param[4] = '''Altitude mode: 0: Keep current altitude, 1: keep altitude difference to target, 2: go to a fixed altitude above home.'''
enums['MAV_CMD'][32].param[5] = '''Altitude above home. (used if mode=2)'''
enums['MAV_CMD'][32].param[6] = '''RESERVED'''
enums['MAV_CMD'][32].param[7] = '''Time to land in which the MAV should go to the default position hold mode after a message RX timeout.'''
MAV_CMD_DO_FOLLOW_REPOSITION = 33 # Reposition the MAV after a follow target command has been sent
enums['MAV_CMD'][33] = EnumEntry('MAV_CMD_DO_FOLLOW_REPOSITION', '''Reposition the MAV after a follow target command has been sent''')
enums['MAV_CMD'][33].param[1] = '''Camera q1 (where 0 is on the ray from the camera to the tracking device)'''
enums['MAV_CMD'][33].param[2] = '''Camera q2'''
enums['MAV_CMD'][33].param[3] = '''Camera q3'''
enums['MAV_CMD'][33].param[4] = '''Camera q4'''
enums['MAV_CMD'][33].param[5] = '''altitude offset from target'''
enums['MAV_CMD'][33].param[6] = '''X offset from target'''
enums['MAV_CMD'][33].param[7] = '''Y offset from target'''
MAV_CMD_NAV_ROI = 80 # Sets the region of interest (ROI) for a sensor set or the vehicle
# itself. This can then be used by the
# vehicles control system to control the
# vehicle attitude and the attitude of various
# sensors such as cameras.
enums['MAV_CMD'][80] = EnumEntry('MAV_CMD_NAV_ROI', '''Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicles control system to control the vehicle attitude and the attitude of various sensors such as cameras.''')
enums['MAV_CMD'][80].param[1] = '''Region of interest mode.'''
enums['MAV_CMD'][80].param[2] = '''Waypoint index/ target ID. (see MAV_ROI enum)'''
enums['MAV_CMD'][80].param[3] = '''ROI index (allows a vehicle to manage multiple ROI's)'''
enums['MAV_CMD'][80].param[4] = '''Empty'''
enums['MAV_CMD'][80].param[5] = '''x the location of the fixed ROI (see MAV_FRAME)'''
enums['MAV_CMD'][80].param[6] = '''y'''
enums['MAV_CMD'][80].param[7] = '''z'''
MAV_CMD_NAV_PATHPLANNING = 81 # Control autonomous path planning on the MAV.
enums['MAV_CMD'][81] = EnumEntry('MAV_CMD_NAV_PATHPLANNING', '''Control autonomous path planning on the MAV.''')
enums['MAV_CMD'][81].param[1] = '''0: Disable local obstacle avoidance / local path planning (without resetting map), 1: Enable local path planning, 2: Enable and reset local path planning'''
enums['MAV_CMD'][81].param[2] = '''0: Disable full path planning (without resetting map), 1: Enable, 2: Enable and reset map/occupancy grid, 3: Enable and reset planned route, but not occupancy grid'''
enums['MAV_CMD'][81].param[3] = '''Empty'''
enums['MAV_CMD'][81].param[4] = '''Yaw angle at goal'''
enums['MAV_CMD'][81].param[5] = '''Latitude/X of goal'''
enums['MAV_CMD'][81].param[6] = '''Longitude/Y of goal'''
enums['MAV_CMD'][81].param[7] = '''Altitude/Z of goal'''
MAV_CMD_NAV_SPLINE_WAYPOINT = 82 # Navigate to waypoint using a spline path.
enums['MAV_CMD'][82] = EnumEntry('MAV_CMD_NAV_SPLINE_WAYPOINT', '''Navigate to waypoint using a spline path.''')
enums['MAV_CMD'][82].param[1] = '''Hold time. (ignored by fixed wing, time to stay at waypoint for rotary wing)'''
enums['MAV_CMD'][82].param[2] = '''Empty'''
enums['MAV_CMD'][82].param[3] = '''Empty'''
enums['MAV_CMD'][82].param[4] = '''Empty'''
enums['MAV_CMD'][82].param[5] = '''Latitude/X of goal'''
enums['MAV_CMD'][82].param[6] = '''Longitude/Y of goal'''
enums['MAV_CMD'][82].param[7] = '''Altitude/Z of goal'''
MAV_CMD_NAV_ALTITUDE_WAIT = 83 # Mission command to wait for an altitude or downwards vertical speed.
# This is meant for high altitude balloon
# launches, allowing the aircraft to be idle
# until either an altitude is reached or a
# negative vertical speed is reached
# (indicating early balloon burst). The wiggle
# time is how often to wiggle the control
# surfaces to prevent them seizing up.
enums['MAV_CMD'][83] = EnumEntry('MAV_CMD_NAV_ALTITUDE_WAIT', '''Mission command to wait for an altitude or downwards vertical speed. This is meant for high altitude balloon launches, allowing the aircraft to be idle until either an altitude is reached or a negative vertical speed is reached (indicating early balloon burst). The wiggle time is how often to wiggle the control surfaces to prevent them seizing up.''')
enums['MAV_CMD'][83].param[1] = '''Altitude.'''
enums['MAV_CMD'][83].param[2] = '''Descent speed.'''
enums['MAV_CMD'][83].param[3] = '''How long to wiggle the control surfaces to prevent them seizing up.'''
enums['MAV_CMD'][83].param[4] = '''Empty.'''
enums['MAV_CMD'][83].param[5] = '''Empty.'''
enums['MAV_CMD'][83].param[6] = '''Empty.'''
enums['MAV_CMD'][83].param[7] = '''Empty.'''
MAV_CMD_NAV_VTOL_TAKEOFF = 84 # Takeoff from ground using VTOL mode, and transition to forward flight
# with specified heading.
enums['MAV_CMD'][84] = EnumEntry('MAV_CMD_NAV_VTOL_TAKEOFF', '''Takeoff from ground using VTOL mode, and transition to forward flight with specified heading.''')
enums['MAV_CMD'][84].param[1] = '''Empty'''
enums['MAV_CMD'][84].param[2] = '''Front transition heading.'''
enums['MAV_CMD'][84].param[3] = '''Empty'''
enums['MAV_CMD'][84].param[4] = '''Yaw angle. NaN to use the current system yaw heading mode (e.g. yaw towards next waypoint, yaw to home, etc.).'''
enums['MAV_CMD'][84].param[5] = '''Latitude'''
enums['MAV_CMD'][84].param[6] = '''Longitude'''
enums['MAV_CMD'][84].param[7] = '''Altitude'''
MAV_CMD_NAV_VTOL_LAND = 85 # Land using VTOL mode
enums['MAV_CMD'][85] = EnumEntry('MAV_CMD_NAV_VTOL_LAND', '''Land using VTOL mode''')
enums['MAV_CMD'][85].param[1] = '''Empty'''
enums['MAV_CMD'][85].param[2] = '''Empty'''
enums['MAV_CMD'][85].param[3] = '''Approach altitude (with the same reference as the Altitude field). NaN if unspecified.'''
enums['MAV_CMD'][85].param[4] = '''Yaw angle. NaN to use the current system yaw heading mode (e.g. yaw towards next waypoint, yaw to home, etc.).'''
enums['MAV_CMD'][85].param[5] = '''Latitude'''
enums['MAV_CMD'][85].param[6] = '''Longitude'''
enums['MAV_CMD'][85].param[7] = '''Altitude (ground level)'''
MAV_CMD_NAV_GUIDED_ENABLE = 92 # hand control over to an external controller
enums['MAV_CMD'][92] = EnumEntry('MAV_CMD_NAV_GUIDED_ENABLE', '''hand control over to an external controller''')
enums['MAV_CMD'][92].param[1] = '''On / Off (> 0.5f on)'''
enums['MAV_CMD'][92].param[2] = '''Empty'''
enums['MAV_CMD'][92].param[3] = '''Empty'''
enums['MAV_CMD'][92].param[4] = '''Empty'''
enums['MAV_CMD'][92].param[5] = '''Empty'''
enums['MAV_CMD'][92].param[6] = '''Empty'''
enums['MAV_CMD'][92].param[7] = '''Empty'''
MAV_CMD_NAV_DELAY = 93 # Delay the next navigation command a number of seconds or until a
# specified time
enums['MAV_CMD'][93] = EnumEntry('MAV_CMD_NAV_DELAY', '''Delay the next navigation command a number of seconds or until a specified time''')
enums['MAV_CMD'][93].param[1] = '''Delay (-1 to enable time-of-day fields)'''
enums['MAV_CMD'][93].param[2] = '''hour (24h format, UTC, -1 to ignore)'''
enums['MAV_CMD'][93].param[3] = '''minute (24h format, UTC, -1 to ignore)'''
enums['MAV_CMD'][93].param[4] = '''second (24h format, UTC)'''
enums['MAV_CMD'][93].param[5] = '''Empty'''
enums['MAV_CMD'][93].param[6] = '''Empty'''
enums['MAV_CMD'][93].param[7] = '''Empty'''
MAV_CMD_NAV_PAYLOAD_PLACE = 94 # Descend and place payload. Vehicle moves to specified location,
# descends until it detects a hanging payload
# has reached the ground, and then releases
# the payload. If ground is not detected
# before the reaching the maximum descent
# value (param1), the command will complete
# without releasing the payload.
enums['MAV_CMD'][94] = EnumEntry('MAV_CMD_NAV_PAYLOAD_PLACE', '''Descend and place payload. Vehicle moves to specified location, descends until it detects a hanging payload has reached the ground, and then releases the payload. If ground is not detected before the reaching the maximum descent value (param1), the command will complete without releasing the payload.''')
enums['MAV_CMD'][94].param[1] = '''Maximum distance to descend.'''
enums['MAV_CMD'][94].param[2] = '''Empty'''
enums['MAV_CMD'][94].param[3] = '''Empty'''
enums['MAV_CMD'][94].param[4] = '''Empty'''
enums['MAV_CMD'][94].param[5] = '''Latitude'''
enums['MAV_CMD'][94].param[6] = '''Longitude'''
enums['MAV_CMD'][94].param[7] = '''Altitude'''
MAV_CMD_NAV_LAST = 95 # NOP - This command is only used to mark the upper limit of the
# NAV/ACTION commands in the enumeration
enums['MAV_CMD'][95] = EnumEntry('MAV_CMD_NAV_LAST', '''NOP - This command is only used to mark the upper limit of the NAV/ACTION commands in the enumeration''')
enums['MAV_CMD'][95].param[1] = '''Empty'''
enums['MAV_CMD'][95].param[2] = '''Empty'''
enums['MAV_CMD'][95].param[3] = '''Empty'''
enums['MAV_CMD'][95].param[4] = '''Empty'''
enums['MAV_CMD'][95].param[5] = '''Empty'''
enums['MAV_CMD'][95].param[6] = '''Empty'''
enums['MAV_CMD'][95].param[7] = '''Empty'''
MAV_CMD_CONDITION_DELAY = 112 # Delay mission state machine.
enums['MAV_CMD'][112] = EnumEntry('MAV_CMD_CONDITION_DELAY', '''Delay mission state machine.''')
enums['MAV_CMD'][112].param[1] = '''Delay'''
enums['MAV_CMD'][112].param[2] = '''Empty'''
enums['MAV_CMD'][112].param[3] = '''Empty'''
enums['MAV_CMD'][112].param[4] = '''Empty'''
enums['MAV_CMD'][112].param[5] = '''Empty'''
enums['MAV_CMD'][112].param[6] = '''Empty'''
enums['MAV_CMD'][112].param[7] = '''Empty'''
MAV_CMD_CONDITION_CHANGE_ALT = 113 # Ascend/descend at rate. Delay mission state machine until desired
# altitude reached.
enums['MAV_CMD'][113] = EnumEntry('MAV_CMD_CONDITION_CHANGE_ALT', '''Ascend/descend at rate. Delay mission state machine until desired altitude reached.''')
enums['MAV_CMD'][113].param[1] = '''Descent / Ascend rate.'''
enums['MAV_CMD'][113].param[2] = '''Empty'''
enums['MAV_CMD'][113].param[3] = '''Empty'''
enums['MAV_CMD'][113].param[4] = '''Empty'''
enums['MAV_CMD'][113].param[5] = '''Empty'''
enums['MAV_CMD'][113].param[6] = '''Empty'''
enums['MAV_CMD'][113].param[7] = '''Target Altitude'''
MAV_CMD_CONDITION_DISTANCE = 114 # Delay mission state machine until within desired distance of next NAV
# point.
enums['MAV_CMD'][114] = EnumEntry('MAV_CMD_CONDITION_DISTANCE', '''Delay mission state machine until within desired distance of next NAV point.''')
enums['MAV_CMD'][114].param[1] = '''Distance.'''
enums['MAV_CMD'][114].param[2] = '''Empty'''
enums['MAV_CMD'][114].param[3] = '''Empty'''
enums['MAV_CMD'][114].param[4] = '''Empty'''
enums['MAV_CMD'][114].param[5] = '''Empty'''
enums['MAV_CMD'][114].param[6] = '''Empty'''
enums['MAV_CMD'][114].param[7] = '''Empty'''
MAV_CMD_CONDITION_YAW = 115 # Reach a certain target angle.
enums['MAV_CMD'][115] = EnumEntry('MAV_CMD_CONDITION_YAW', '''Reach a certain target angle.''')
enums['MAV_CMD'][115].param[1] = '''target angle, 0 is north'''
enums['MAV_CMD'][115].param[2] = '''angular speed'''
enums['MAV_CMD'][115].param[3] = '''direction: -1: counter clockwise, 1: clockwise'''
enums['MAV_CMD'][115].param[4] = '''0: absolute angle, 1: relative offset'''
enums['MAV_CMD'][115].param[5] = '''Empty'''
enums['MAV_CMD'][115].param[6] = '''Empty'''
enums['MAV_CMD'][115].param[7] = '''Empty'''
MAV_CMD_CONDITION_LAST = 159 # NOP - This command is only used to mark the upper limit of the
# CONDITION commands in the enumeration
enums['MAV_CMD'][159] = EnumEntry('MAV_CMD_CONDITION_LAST', '''NOP - This command is only used to mark the upper limit of the CONDITION commands in the enumeration''')
enums['MAV_CMD'][159].param[1] = '''Empty'''
enums['MAV_CMD'][159].param[2] = '''Empty'''
enums['MAV_CMD'][159].param[3] = '''Empty'''
enums['MAV_CMD'][159].param[4] = '''Empty'''
enums['MAV_CMD'][159].param[5] = '''Empty'''
enums['MAV_CMD'][159].param[6] = '''Empty'''
enums['MAV_CMD'][159].param[7] = '''Empty'''
MAV_CMD_DO_SET_MODE = 176 # Set system mode.
enums['MAV_CMD'][176] = EnumEntry('MAV_CMD_DO_SET_MODE', '''Set system mode.''')
enums['MAV_CMD'][176].param[1] = '''Mode'''
enums['MAV_CMD'][176].param[2] = '''Custom mode - this is system specific, please refer to the individual autopilot specifications for details.'''
enums['MAV_CMD'][176].param[3] = '''Custom sub mode - this is system specific, please refer to the individual autopilot specifications for details.'''
enums['MAV_CMD'][176].param[4] = '''Empty'''
enums['MAV_CMD'][176].param[5] = '''Empty'''
enums['MAV_CMD'][176].param[6] = '''Empty'''
enums['MAV_CMD'][176].param[7] = '''Empty'''
MAV_CMD_DO_JUMP = 177 # Jump to the desired command in the mission list. Repeat this action
# only the specified number of times
enums['MAV_CMD'][177] = EnumEntry('MAV_CMD_DO_JUMP', '''Jump to the desired command in the mission list. Repeat this action only the specified number of times''')
enums['MAV_CMD'][177].param[1] = '''Sequence number'''
enums['MAV_CMD'][177].param[2] = '''Repeat count'''
enums['MAV_CMD'][177].param[3] = '''Empty'''
enums['MAV_CMD'][177].param[4] = '''Empty'''
enums['MAV_CMD'][177].param[5] = '''Empty'''
enums['MAV_CMD'][177].param[6] = '''Empty'''
enums['MAV_CMD'][177].param[7] = '''Empty'''
MAV_CMD_DO_CHANGE_SPEED = 178 # Change speed and/or throttle set points.
enums['MAV_CMD'][178] = EnumEntry('MAV_CMD_DO_CHANGE_SPEED', '''Change speed and/or throttle set points.''')
enums['MAV_CMD'][178].param[1] = '''Speed type (0=Airspeed, 1=Ground Speed, 2=Climb Speed, 3=Descent Speed)'''
enums['MAV_CMD'][178].param[2] = '''Speed (-1 indicates no change)'''
enums['MAV_CMD'][178].param[3] = '''Throttle (-1 indicates no change)'''
enums['MAV_CMD'][178].param[4] = '''0: absolute, 1: relative'''
enums['MAV_CMD'][178].param[5] = '''Empty'''
enums['MAV_CMD'][178].param[6] = '''Empty'''
enums['MAV_CMD'][178].param[7] = '''Empty'''
MAV_CMD_DO_SET_HOME = 179 # Changes the home location either to the current location or a
# specified location.
enums['MAV_CMD'][179] = EnumEntry('MAV_CMD_DO_SET_HOME', '''Changes the home location either to the current location or a specified location.''')
enums['MAV_CMD'][179].param[1] = '''Use current (1=use current location, 0=use specified location)'''
enums['MAV_CMD'][179].param[2] = '''Empty'''
enums['MAV_CMD'][179].param[3] = '''Empty'''
enums['MAV_CMD'][179].param[4] = '''Empty'''
enums['MAV_CMD'][179].param[5] = '''Latitude'''
enums['MAV_CMD'][179].param[6] = '''Longitude'''
enums['MAV_CMD'][179].param[7] = '''Altitude'''
MAV_CMD_DO_SET_PARAMETER = 180 # Set a system parameter. Caution! Use of this command requires
# knowledge of the numeric enumeration value
# of the parameter.
enums['MAV_CMD'][180] = EnumEntry('MAV_CMD_DO_SET_PARAMETER', '''Set a system parameter. Caution! Use of this command requires knowledge of the numeric enumeration value of the parameter.''')
enums['MAV_CMD'][180].param[1] = '''Parameter number'''
enums['MAV_CMD'][180].param[2] = '''Parameter value'''
enums['MAV_CMD'][180].param[3] = '''Empty'''
enums['MAV_CMD'][180].param[4] = '''Empty'''
enums['MAV_CMD'][180].param[5] = '''Empty'''
enums['MAV_CMD'][180].param[6] = '''Empty'''
enums['MAV_CMD'][180].param[7] = '''Empty'''
MAV_CMD_DO_SET_RELAY = 181 # Set a relay to a condition.
enums['MAV_CMD'][181] = EnumEntry('MAV_CMD_DO_SET_RELAY', '''Set a relay to a condition.''')
enums['MAV_CMD'][181].param[1] = '''Relay instance number.'''
enums['MAV_CMD'][181].param[2] = '''Setting. (1=on, 0=off, others possible depending on system hardware)'''
enums['MAV_CMD'][181].param[3] = '''Empty'''
enums['MAV_CMD'][181].param[4] = '''Empty'''
enums['MAV_CMD'][181].param[5] = '''Empty'''
enums['MAV_CMD'][181].param[6] = '''Empty'''
enums['MAV_CMD'][181].param[7] = '''Empty'''
MAV_CMD_DO_REPEAT_RELAY = 182 # Cycle a relay on and off for a desired number of cycles with a desired
# period.
enums['MAV_CMD'][182] = EnumEntry('MAV_CMD_DO_REPEAT_RELAY', '''Cycle a relay on and off for a desired number of cycles with a desired period.''')
enums['MAV_CMD'][182].param[1] = '''Relay instance number.'''
enums['MAV_CMD'][182].param[2] = '''Cycle count.'''
enums['MAV_CMD'][182].param[3] = '''Cycle time.'''
enums['MAV_CMD'][182].param[4] = '''Empty'''
enums['MAV_CMD'][182].param[5] = '''Empty'''
enums['MAV_CMD'][182].param[6] = '''Empty'''
enums['MAV_CMD'][182].param[7] = '''Empty'''
MAV_CMD_DO_SET_SERVO = 183 # Set a servo to a desired PWM value.
enums['MAV_CMD'][183] = EnumEntry('MAV_CMD_DO_SET_SERVO', '''Set a servo to a desired PWM value.''')
enums['MAV_CMD'][183].param[1] = '''Servo instance number.'''
enums['MAV_CMD'][183].param[2] = '''Pulse Width Modulation.'''
enums['MAV_CMD'][183].param[3] = '''Empty'''
enums['MAV_CMD'][183].param[4] = '''Empty'''
enums['MAV_CMD'][183].param[5] = '''Empty'''
enums['MAV_CMD'][183].param[6] = '''Empty'''
enums['MAV_CMD'][183].param[7] = '''Empty'''
MAV_CMD_DO_REPEAT_SERVO = 184 # Cycle a between its nominal setting and a desired PWM for a desired
# number of cycles with a desired period.
enums['MAV_CMD'][184] = EnumEntry('MAV_CMD_DO_REPEAT_SERVO', '''Cycle a between its nominal setting and a desired PWM for a desired number of cycles with a desired period.''')
enums['MAV_CMD'][184].param[1] = '''Servo instance number.'''
enums['MAV_CMD'][184].param[2] = '''Pulse Width Modulation.'''
enums['MAV_CMD'][184].param[3] = '''Cycle count.'''
enums['MAV_CMD'][184].param[4] = '''Cycle time.'''
enums['MAV_CMD'][184].param[5] = '''Empty'''
enums['MAV_CMD'][184].param[6] = '''Empty'''
enums['MAV_CMD'][184].param[7] = '''Empty'''
MAV_CMD_DO_FLIGHTTERMINATION = 185 # Terminate flight immediately
enums['MAV_CMD'][185] = EnumEntry('MAV_CMD_DO_FLIGHTTERMINATION', '''Terminate flight immediately''')
enums['MAV_CMD'][185].param[1] = '''Flight termination activated if > 0.5'''
enums['MAV_CMD'][185].param[2] = '''Empty'''
enums['MAV_CMD'][185].param[3] = '''Empty'''
enums['MAV_CMD'][185].param[4] = '''Empty'''
enums['MAV_CMD'][185].param[5] = '''Empty'''
enums['MAV_CMD'][185].param[6] = '''Empty'''
enums['MAV_CMD'][185].param[7] = '''Empty'''
MAV_CMD_DO_CHANGE_ALTITUDE = 186 # Change altitude set point.
enums['MAV_CMD'][186] = EnumEntry('MAV_CMD_DO_CHANGE_ALTITUDE', '''Change altitude set point.''')
enums['MAV_CMD'][186].param[1] = '''Altitude.'''
enums['MAV_CMD'][186].param[2] = '''Frame of new altitude.'''
enums['MAV_CMD'][186].param[3] = '''Empty'''
enums['MAV_CMD'][186].param[4] = '''Empty'''
enums['MAV_CMD'][186].param[5] = '''Empty'''
enums['MAV_CMD'][186].param[6] = '''Empty'''
enums['MAV_CMD'][186].param[7] = '''Empty'''
MAV_CMD_DO_LAND_START = 189 # Mission command to perform a landing. This is used as a marker in a
# mission to tell the autopilot where a
# sequence of mission items that represents a
# landing starts. It may also be sent via a
# COMMAND_LONG to trigger a landing, in which
# case the nearest (geographically) landing
# sequence in the mission will be used. The
# Latitude/Longitude is optional, and may be
# set to 0 if not needed. If specified then it
# will be used to help find the closest
# landing sequence.
enums['MAV_CMD'][189] = EnumEntry('MAV_CMD_DO_LAND_START', '''Mission command to perform a landing. This is used as a marker in a mission to tell the autopilot where a sequence of mission items that represents a landing starts. It may also be sent via a COMMAND_LONG to trigger a landing, in which case the nearest (geographically) landing sequence in the mission will be used. The Latitude/Longitude is optional, and may be set to 0 if not needed. If specified then it will be used to help find the closest landing sequence.''')
enums['MAV_CMD'][189].param[1] = '''Empty'''
enums['MAV_CMD'][189].param[2] = '''Empty'''
enums['MAV_CMD'][189].param[3] = '''Empty'''
enums['MAV_CMD'][189].param[4] = '''Empty'''
enums['MAV_CMD'][189].param[5] = '''Latitude'''
enums['MAV_CMD'][189].param[6] = '''Longitude'''
enums['MAV_CMD'][189].param[7] = '''Empty'''
MAV_CMD_DO_RALLY_LAND = 190 # Mission command to perform a landing from a rally point.
enums['MAV_CMD'][190] = EnumEntry('MAV_CMD_DO_RALLY_LAND', '''Mission command to perform a landing from a rally point.''')
enums['MAV_CMD'][190].param[1] = '''Break altitude'''
enums['MAV_CMD'][190].param[2] = '''Landing speed'''
enums['MAV_CMD'][190].param[3] = '''Empty'''
enums['MAV_CMD'][190].param[4] = '''Empty'''
enums['MAV_CMD'][190].param[5] = '''Empty'''
enums['MAV_CMD'][190].param[6] = '''Empty'''
enums['MAV_CMD'][190].param[7] = '''Empty'''
MAV_CMD_DO_GO_AROUND = 191 # Mission command to safely abort an autonomous landing.
enums['MAV_CMD'][191] = EnumEntry('MAV_CMD_DO_GO_AROUND', '''Mission command to safely abort an autonomous landing.''')
enums['MAV_CMD'][191].param[1] = '''Altitude'''
enums['MAV_CMD'][191].param[2] = '''Empty'''
enums['MAV_CMD'][191].param[3] = '''Empty'''
enums['MAV_CMD'][191].param[4] = '''Empty'''
enums['MAV_CMD'][191].param[5] = '''Empty'''
enums['MAV_CMD'][191].param[6] = '''Empty'''
enums['MAV_CMD'][191].param[7] = '''Empty'''
MAV_CMD_DO_REPOSITION = 192 # Reposition the vehicle to a specific WGS84 global position.
enums['MAV_CMD'][192] = EnumEntry('MAV_CMD_DO_REPOSITION', '''Reposition the vehicle to a specific WGS84 global position.''')
enums['MAV_CMD'][192].param[1] = '''Ground speed, less than 0 (-1) for default'''
enums['MAV_CMD'][192].param[2] = '''Bitmask of option flags.'''
enums['MAV_CMD'][192].param[3] = '''Reserved'''
enums['MAV_CMD'][192].param[4] = '''Yaw heading. NaN to use the current system yaw heading mode (e.g. yaw towards next waypoint, yaw to home, etc.). For planes indicates loiter direction (0: clockwise, 1: counter clockwise)'''
enums['MAV_CMD'][192].param[5] = '''Latitude'''
enums['MAV_CMD'][192].param[6] = '''Longitude'''
enums['MAV_CMD'][192].param[7] = '''Altitude'''
MAV_CMD_DO_PAUSE_CONTINUE = 193 # If in a GPS controlled position mode, hold the current position or
# continue.
enums['MAV_CMD'][193] = EnumEntry('MAV_CMD_DO_PAUSE_CONTINUE', '''If in a GPS controlled position mode, hold the current position or continue.''')
enums['MAV_CMD'][193].param[1] = '''0: Pause current mission or reposition command, hold current position. 1: Continue mission. A VTOL capable vehicle should enter hover mode (multicopter and VTOL planes). A plane should loiter with the default loiter radius.'''
enums['MAV_CMD'][193].param[2] = '''Reserved'''
enums['MAV_CMD'][193].param[3] = '''Reserved'''
enums['MAV_CMD'][193].param[4] = '''Reserved'''
enums['MAV_CMD'][193].param[5] = '''Reserved'''
enums['MAV_CMD'][193].param[6] = '''Reserved'''
enums['MAV_CMD'][193].param[7] = '''Reserved'''
MAV_CMD_DO_SET_REVERSE = 194 # Set moving direction to forward or reverse.
enums['MAV_CMD'][194] = EnumEntry('MAV_CMD_DO_SET_REVERSE', '''Set moving direction to forward or reverse.''')
enums['MAV_CMD'][194].param[1] = '''Direction (0=Forward, 1=Reverse)'''
enums['MAV_CMD'][194].param[2] = '''Empty'''
enums['MAV_CMD'][194].param[3] = '''Empty'''
enums['MAV_CMD'][194].param[4] = '''Empty'''
enums['MAV_CMD'][194].param[5] = '''Empty'''
enums['MAV_CMD'][194].param[6] = '''Empty'''
enums['MAV_CMD'][194].param[7] = '''Empty'''
MAV_CMD_DO_SET_ROI_LOCATION = 195 # Sets the region of interest (ROI) to a location. This can then be used
# by the vehicles control system to control
# the vehicle attitude and the attitude of
# various sensors such as cameras.
enums['MAV_CMD'][195] = EnumEntry('MAV_CMD_DO_SET_ROI_LOCATION', '''Sets the region of interest (ROI) to a location. This can then be used by the vehicles control system to control the vehicle attitude and the attitude of various sensors such as cameras.''')
enums['MAV_CMD'][195].param[1] = '''Empty'''
enums['MAV_CMD'][195].param[2] = '''Empty'''
enums['MAV_CMD'][195].param[3] = '''Empty'''
enums['MAV_CMD'][195].param[4] = '''Empty'''
enums['MAV_CMD'][195].param[5] = '''Latitude'''
enums['MAV_CMD'][195].param[6] = '''Longitude'''
enums['MAV_CMD'][195].param[7] = '''Altitude'''
MAV_CMD_DO_SET_ROI_WPNEXT_OFFSET = 196 # Sets the region of interest (ROI) to be toward next waypoint, with
# optional pitch/roll/yaw offset. This can
# then be used by the vehicles control system
# to control the vehicle attitude and the
# attitude of various sensors such as cameras.
enums['MAV_CMD'][196] = EnumEntry('MAV_CMD_DO_SET_ROI_WPNEXT_OFFSET', '''Sets the region of interest (ROI) to be toward next waypoint, with optional pitch/roll/yaw offset. This can then be used by the vehicles control system to control the vehicle attitude and the attitude of various sensors such as cameras.''')
enums['MAV_CMD'][196].param[1] = '''Empty'''
enums['MAV_CMD'][196].param[2] = '''Empty'''
enums['MAV_CMD'][196].param[3] = '''Empty'''
enums['MAV_CMD'][196].param[4] = '''Empty'''
enums['MAV_CMD'][196].param[5] = '''pitch offset from next waypoint'''
enums['MAV_CMD'][196].param[6] = '''roll offset from next waypoint'''
enums['MAV_CMD'][196].param[7] = '''yaw offset from next waypoint'''
MAV_CMD_DO_SET_ROI_NONE = 197 # Cancels any previous ROI command returning the vehicle/sensors to
# default flight characteristics. This can
# then be used by the vehicles control system
# to control the vehicle attitude and the
# attitude of various sensors such as cameras.
enums['MAV_CMD'][197] = EnumEntry('MAV_CMD_DO_SET_ROI_NONE', '''Cancels any previous ROI command returning the vehicle/sensors to default flight characteristics. This can then be used by the vehicles control system to control the vehicle attitude and the attitude of various sensors such as cameras.''')
enums['MAV_CMD'][197].param[1] = '''Empty'''
enums['MAV_CMD'][197].param[2] = '''Empty'''
enums['MAV_CMD'][197].param[3] = '''Empty'''
enums['MAV_CMD'][197].param[4] = '''Empty'''
enums['MAV_CMD'][197].param[5] = '''Empty'''
enums['MAV_CMD'][197].param[6] = '''Empty'''
enums['MAV_CMD'][197].param[7] = '''Empty'''
MAV_CMD_DO_SET_ROI_SYSID = 198 # Mount tracks system with specified system ID. Determination of target
# vehicle position may be done with
# GLOBAL_POSITION_INT or any other means.
enums['MAV_CMD'][198] = EnumEntry('MAV_CMD_DO_SET_ROI_SYSID', '''Mount tracks system with specified system ID. Determination of target vehicle position may be done with GLOBAL_POSITION_INT or any other means.''')
enums['MAV_CMD'][198].param[1] = '''sysid'''
enums['MAV_CMD'][198].param[2] = '''Reserved (default:0)'''
enums['MAV_CMD'][198].param[3] = '''Reserved (default:0)'''
enums['MAV_CMD'][198].param[4] = '''Reserved (default:0)'''
enums['MAV_CMD'][198].param[5] = '''Reserved (default:0)'''
enums['MAV_CMD'][198].param[6] = '''Reserved (default:0)'''
enums['MAV_CMD'][198].param[7] = '''Reserved (default:0)'''
MAV_CMD_DO_CONTROL_VIDEO = 200 # Control onboard camera system.
enums['MAV_CMD'][200] = EnumEntry('MAV_CMD_DO_CONTROL_VIDEO', '''Control onboard camera system.''')
enums['MAV_CMD'][200].param[1] = '''Camera ID (-1 for all)'''
enums['MAV_CMD'][200].param[2] = '''Transmission: 0: disabled, 1: enabled compressed, 2: enabled raw'''
enums['MAV_CMD'][200].param[3] = '''Transmission mode: 0: video stream, >0: single images every n seconds'''
enums['MAV_CMD'][200].param[4] = '''Recording: 0: disabled, 1: enabled compressed, 2: enabled raw'''
enums['MAV_CMD'][200].param[5] = '''Empty'''
enums['MAV_CMD'][200].param[6] = '''Empty'''
enums['MAV_CMD'][200].param[7] = '''Empty'''
MAV_CMD_DO_SET_ROI = 201 # Sets the region of interest (ROI) for a sensor set or the vehicle
# itself. This can then be used by the
# vehicles control system to control the
# vehicle attitude and the attitude of various
# sensors such as cameras.
enums['MAV_CMD'][201] = EnumEntry('MAV_CMD_DO_SET_ROI', '''Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicles control system to control the vehicle attitude and the attitude of various sensors such as cameras.''')
enums['MAV_CMD'][201].param[1] = '''Region of interest mode.'''
enums['MAV_CMD'][201].param[2] = '''Waypoint index/ target ID (depends on param 1).'''
enums['MAV_CMD'][201].param[3] = '''Region of interest index. (allows a vehicle to manage multiple ROI's)'''
enums['MAV_CMD'][201].param[4] = '''Empty'''
enums['MAV_CMD'][201].param[5] = '''x the location of the fixed ROI (see MAV_FRAME)'''
enums['MAV_CMD'][201].param[6] = '''y'''
enums['MAV_CMD'][201].param[7] = '''z'''
MAV_CMD_DO_DIGICAM_CONFIGURE = 202 # Configure digital camera. This is a fallback message for systems that
# have not yet implemented PARAM_EXT_XXX
# messages and camera definition files (see ht
# tps://mavlink.io/en/services/camera_def.html
# ).
enums['MAV_CMD'][202] = EnumEntry('MAV_CMD_DO_DIGICAM_CONFIGURE', '''Configure digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see https://mavlink.io/en/services/camera_def.html ).''')
enums['MAV_CMD'][202].param[1] = '''Modes: P, TV, AV, M, Etc.'''
enums['MAV_CMD'][202].param[2] = '''Shutter speed: Divisor number for one second.'''
enums['MAV_CMD'][202].param[3] = '''Aperture: F stop number.'''
enums['MAV_CMD'][202].param[4] = '''ISO number e.g. 80, 100, 200, Etc.'''
enums['MAV_CMD'][202].param[5] = '''Exposure type enumerator.'''
enums['MAV_CMD'][202].param[6] = '''Command Identity.'''
enums['MAV_CMD'][202].param[7] = '''Main engine cut-off time before camera trigger. (0 means no cut-off)'''
MAV_CMD_DO_DIGICAM_CONTROL = 203 # Control digital camera. This is a fallback message for systems that
# have not yet implemented PARAM_EXT_XXX
# messages and camera definition files (see ht
# tps://mavlink.io/en/services/camera_def.html
# ).
enums['MAV_CMD'][203] = EnumEntry('MAV_CMD_DO_DIGICAM_CONTROL', '''Control digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see https://mavlink.io/en/services/camera_def.html ).''')
enums['MAV_CMD'][203].param[1] = '''Session control e.g. show/hide lens'''
enums['MAV_CMD'][203].param[2] = '''Zoom's absolute position'''
enums['MAV_CMD'][203].param[3] = '''Zooming step value to offset zoom from the current position'''
enums['MAV_CMD'][203].param[4] = '''Focus Locking, Unlocking or Re-locking'''
enums['MAV_CMD'][203].param[5] = '''Shooting Command'''
enums['MAV_CMD'][203].param[6] = '''Command Identity'''
enums['MAV_CMD'][203].param[7] = '''Test shot identifier. If set to 1, image will only be captured, but not counted towards internal frame count.'''
MAV_CMD_DO_MOUNT_CONFIGURE = 204 # Mission command to configure a camera or antenna mount
enums['MAV_CMD'][204] = EnumEntry('MAV_CMD_DO_MOUNT_CONFIGURE', '''Mission command to configure a camera or antenna mount''')
enums['MAV_CMD'][204].param[1] = '''Mount operation mode'''
enums['MAV_CMD'][204].param[2] = '''stabilize roll? (1 = yes, 0 = no)'''
enums['MAV_CMD'][204].param[3] = '''stabilize pitch? (1 = yes, 0 = no)'''
enums['MAV_CMD'][204].param[4] = '''stabilize yaw? (1 = yes, 0 = no)'''
enums['MAV_CMD'][204].param[5] = '''Empty'''
enums['MAV_CMD'][204].param[6] = '''Empty'''
enums['MAV_CMD'][204].param[7] = '''Empty'''
MAV_CMD_DO_MOUNT_CONTROL = 205 # Mission command to control a camera or antenna mount
enums['MAV_CMD'][205] = EnumEntry('MAV_CMD_DO_MOUNT_CONTROL', '''Mission command to control a camera or antenna mount''')
enums['MAV_CMD'][205].param[1] = '''pitch (WIP: DEPRECATED: or lat in degrees) depending on mount mode.'''
enums['MAV_CMD'][205].param[2] = '''roll (WIP: DEPRECATED: or lon in degrees) depending on mount mode.'''
enums['MAV_CMD'][205].param[3] = '''yaw (WIP: DEPRECATED: or alt in meters) depending on mount mode.'''
enums['MAV_CMD'][205].param[4] = '''WIP: alt in meters depending on mount mode.'''
enums['MAV_CMD'][205].param[5] = '''WIP: latitude in degrees * 1E7, set if appropriate mount mode.'''
enums['MAV_CMD'][205].param[6] = '''WIP: longitude in degrees * 1E7, set if appropriate mount mode.'''
enums['MAV_CMD'][205].param[7] = '''Mount mode.'''
MAV_CMD_DO_SET_CAM_TRIGG_DIST = 206 # Mission command to set camera trigger distance for this flight. The
# camera is triggered each time this distance
# is exceeded. This command can also be used
# to set the shutter integration time for the
# camera.
enums['MAV_CMD'][206] = EnumEntry('MAV_CMD_DO_SET_CAM_TRIGG_DIST', '''Mission command to set camera trigger distance for this flight. The camera is triggered each time this distance is exceeded. This command can also be used to set the shutter integration time for the camera.''')
enums['MAV_CMD'][206].param[1] = '''Camera trigger distance. 0 to stop triggering.'''
enums['MAV_CMD'][206].param[2] = '''Camera shutter integration time. -1 or 0 to ignore'''
enums['MAV_CMD'][206].param[3] = '''Trigger camera once immediately. (0 = no trigger, 1 = trigger)'''
enums['MAV_CMD'][206].param[4] = '''Empty'''
enums['MAV_CMD'][206].param[5] = '''Empty'''
enums['MAV_CMD'][206].param[6] = '''Empty'''
enums['MAV_CMD'][206].param[7] = '''Empty'''
MAV_CMD_DO_FENCE_ENABLE = 207 # Mission command to enable the geofence
enums['MAV_CMD'][207] = EnumEntry('MAV_CMD_DO_FENCE_ENABLE', '''Mission command to enable the geofence''')
enums['MAV_CMD'][207].param[1] = '''enable? (0=disable, 1=enable, 2=disable_floor_only)'''
enums['MAV_CMD'][207].param[2] = '''Empty'''
enums['MAV_CMD'][207].param[3] = '''Empty'''
enums['MAV_CMD'][207].param[4] = '''Empty'''
enums['MAV_CMD'][207].param[5] = '''Empty'''
enums['MAV_CMD'][207].param[6] = '''Empty'''
enums['MAV_CMD'][207].param[7] = '''Empty'''
MAV_CMD_DO_PARACHUTE = 208 # Mission command to trigger a parachute
enums['MAV_CMD'][208] = EnumEntry('MAV_CMD_DO_PARACHUTE', '''Mission command to trigger a parachute''')
enums['MAV_CMD'][208].param[1] = '''action'''
enums['MAV_CMD'][208].param[2] = '''Empty'''
enums['MAV_CMD'][208].param[3] = '''Empty'''
enums['MAV_CMD'][208].param[4] = '''Empty'''
enums['MAV_CMD'][208].param[5] = '''Empty'''
enums['MAV_CMD'][208].param[6] = '''Empty'''
enums['MAV_CMD'][208].param[7] = '''Empty'''
MAV_CMD_DO_MOTOR_TEST = 209 # Mission command to perform motor test.
enums['MAV_CMD'][209] = EnumEntry('MAV_CMD_DO_MOTOR_TEST', '''Mission command to perform motor test.''')
enums['MAV_CMD'][209].param[1] = '''Motor instance number. (from 1 to max number of motors on the vehicle)'''
enums['MAV_CMD'][209].param[2] = '''Throttle type.'''
enums['MAV_CMD'][209].param[3] = '''Throttle.'''
enums['MAV_CMD'][209].param[4] = '''Timeout.'''
enums['MAV_CMD'][209].param[5] = '''Motor count. (number of motors to test to test in sequence, waiting for the timeout above between them; 0=1 motor, 1=1 motor, 2=2 motors...)'''
enums['MAV_CMD'][209].param[6] = '''Motor test order.'''
enums['MAV_CMD'][209].param[7] = '''Empty'''
MAV_CMD_DO_INVERTED_FLIGHT = 210 # Change to/from inverted flight.
enums['MAV_CMD'][210] = EnumEntry('MAV_CMD_DO_INVERTED_FLIGHT', '''Change to/from inverted flight.''')
enums['MAV_CMD'][210].param[1] = '''Inverted flight. (0=normal, 1=inverted)'''
enums['MAV_CMD'][210].param[2] = '''Empty'''
enums['MAV_CMD'][210].param[3] = '''Empty'''
enums['MAV_CMD'][210].param[4] = '''Empty'''
enums['MAV_CMD'][210].param[5] = '''Empty'''
enums['MAV_CMD'][210].param[6] = '''Empty'''
enums['MAV_CMD'][210].param[7] = '''Empty'''
MAV_CMD_DO_GRIPPER = 211 # Mission command to operate EPM gripper.
enums['MAV_CMD'][211] = EnumEntry('MAV_CMD_DO_GRIPPER', '''Mission command to operate EPM gripper.''')
enums['MAV_CMD'][211].param[1] = '''Gripper instance number (from 1 to max number of grippers on the vehicle).'''
enums['MAV_CMD'][211].param[2] = '''Gripper action.'''
enums['MAV_CMD'][211].param[3] = '''Empty.'''
enums['MAV_CMD'][211].param[4] = '''Empty.'''
enums['MAV_CMD'][211].param[5] = '''Empty.'''
enums['MAV_CMD'][211].param[6] = '''Empty.'''
enums['MAV_CMD'][211].param[7] = '''Empty.'''
MAV_CMD_DO_AUTOTUNE_ENABLE = 212 # Enable/disable autotune.
enums['MAV_CMD'][212] = EnumEntry('MAV_CMD_DO_AUTOTUNE_ENABLE', '''Enable/disable autotune.''')
enums['MAV_CMD'][212].param[1] = '''Enable (1: enable, 0:disable).'''
enums['MAV_CMD'][212].param[2] = '''Empty.'''
enums['MAV_CMD'][212].param[3] = '''Empty.'''
enums['MAV_CMD'][212].param[4] = '''Empty.'''
enums['MAV_CMD'][212].param[5] = '''Empty.'''
enums['MAV_CMD'][212].param[6] = '''Empty.'''
enums['MAV_CMD'][212].param[7] = '''Empty.'''
MAV_CMD_NAV_SET_YAW_SPEED = 213 # Sets a desired vehicle turn angle and speed change.
enums['MAV_CMD'][213] = EnumEntry('MAV_CMD_NAV_SET_YAW_SPEED', '''Sets a desired vehicle turn angle and speed change.''')
enums['MAV_CMD'][213].param[1] = '''Yaw angle to adjust steering by.'''
enums['MAV_CMD'][213].param[2] = '''Speed.'''
enums['MAV_CMD'][213].param[3] = '''Final angle. (0=absolute, 1=relative)'''
enums['MAV_CMD'][213].param[4] = '''Empty'''
enums['MAV_CMD'][213].param[5] = '''Empty'''
enums['MAV_CMD'][213].param[6] = '''Empty'''
enums['MAV_CMD'][213].param[7] = '''Empty'''
MAV_CMD_DO_SET_CAM_TRIGG_INTERVAL = 214 # Mission command to set camera trigger interval for this flight. If
# triggering is enabled, the camera is
# triggered each time this interval expires.
# This command can also be used to set the
# shutter integration time for the camera.
enums['MAV_CMD'][214] = EnumEntry('MAV_CMD_DO_SET_CAM_TRIGG_INTERVAL', '''Mission command to set camera trigger interval for this flight. If triggering is enabled, the camera is triggered each time this interval expires. This command can also be used to set the shutter integration time for the camera.''')
enums['MAV_CMD'][214].param[1] = '''Camera trigger cycle time. -1 or 0 to ignore.'''
enums['MAV_CMD'][214].param[2] = '''Camera shutter integration time. Should be less than trigger cycle time. -1 or 0 to ignore.'''
enums['MAV_CMD'][214].param[3] = '''Empty'''
enums['MAV_CMD'][214].param[4] = '''Empty'''
enums['MAV_CMD'][214].param[5] = '''Empty'''
enums['MAV_CMD'][214].param[6] = '''Empty'''
enums['MAV_CMD'][214].param[7] = '''Empty'''
MAV_CMD_DO_SET_RESUME_REPEAT_DIST = 215 # Set the distance to be repeated on mission resume
enums['MAV_CMD'][215] = EnumEntry('MAV_CMD_DO_SET_RESUME_REPEAT_DIST', '''Set the distance to be repeated on mission resume''')
enums['MAV_CMD'][215].param[1] = '''Distance.'''
enums['MAV_CMD'][215].param[2] = '''Empty.'''
enums['MAV_CMD'][215].param[3] = '''Empty.'''
enums['MAV_CMD'][215].param[4] = '''Empty.'''
enums['MAV_CMD'][215].param[5] = '''Empty.'''
enums['MAV_CMD'][215].param[6] = '''Empty.'''
enums['MAV_CMD'][215].param[7] = '''Empty.'''
MAV_CMD_DO_MOUNT_CONTROL_QUAT = 220 # Mission command to control a camera or antenna mount, using a
# quaternion as reference.
enums['MAV_CMD'][220] = EnumEntry('MAV_CMD_DO_MOUNT_CONTROL_QUAT', '''Mission command to control a camera or antenna mount, using a quaternion as reference.''')
enums['MAV_CMD'][220].param[1] = '''quaternion param q1, w (1 in null-rotation)'''
enums['MAV_CMD'][220].param[2] = '''quaternion param q2, x (0 in null-rotation)'''
enums['MAV_CMD'][220].param[3] = '''quaternion param q3, y (0 in null-rotation)'''
enums['MAV_CMD'][220].param[4] = '''quaternion param q4, z (0 in null-rotation)'''
enums['MAV_CMD'][220].param[5] = '''Empty'''
enums['MAV_CMD'][220].param[6] = '''Empty'''
enums['MAV_CMD'][220].param[7] = '''Empty'''
MAV_CMD_DO_GUIDED_MASTER = 221 # set id of master controller
enums['MAV_CMD'][221] = EnumEntry('MAV_CMD_DO_GUIDED_MASTER', '''set id of master controller''')
enums['MAV_CMD'][221].param[1] = '''System ID'''
enums['MAV_CMD'][221].param[2] = '''Component ID'''
enums['MAV_CMD'][221].param[3] = '''Empty'''
enums['MAV_CMD'][221].param[4] = '''Empty'''
enums['MAV_CMD'][221].param[5] = '''Empty'''
enums['MAV_CMD'][221].param[6] = '''Empty'''
enums['MAV_CMD'][221].param[7] = '''Empty'''
MAV_CMD_DO_GUIDED_LIMITS = 222 # Set limits for external control
enums['MAV_CMD'][222] = EnumEntry('MAV_CMD_DO_GUIDED_LIMITS', '''Set limits for external control''')
enums['MAV_CMD'][222].param[1] = '''Timeout - maximum time that external controller will be allowed to control vehicle. 0 means no timeout.'''
enums['MAV_CMD'][222].param[2] = '''Altitude (MSL) min - if vehicle moves below this alt, the command will be aborted and the mission will continue. 0 means no lower altitude limit.'''
enums['MAV_CMD'][222].param[3] = '''Altitude (MSL) max - if vehicle moves above this alt, the command will be aborted and the mission will continue. 0 means no upper altitude limit.'''
enums['MAV_CMD'][222].param[4] = '''Horizontal move limit - if vehicle moves more than this distance from its location at the moment the command was executed, the command will be aborted and the mission will continue. 0 means no horizontal move limit.'''
enums['MAV_CMD'][222].param[5] = '''Empty'''
enums['MAV_CMD'][222].param[6] = '''Empty'''
enums['MAV_CMD'][222].param[7] = '''Empty'''
MAV_CMD_DO_ENGINE_CONTROL = 223 # Control vehicle engine. This is interpreted by the vehicles engine
# controller to change the target engine
# state. It is intended for vehicles with
# internal combustion engines
enums['MAV_CMD'][223] = EnumEntry('MAV_CMD_DO_ENGINE_CONTROL', '''Control vehicle engine. This is interpreted by the vehicles engine controller to change the target engine state. It is intended for vehicles with internal combustion engines''')
enums['MAV_CMD'][223].param[1] = '''0: Stop engine, 1:Start Engine'''
enums['MAV_CMD'][223].param[2] = '''0: Warm start, 1:Cold start. Controls use of choke where applicable'''
enums['MAV_CMD'][223].param[3] = '''Height delay. This is for commanding engine start only after the vehicle has gained the specified height. Used in VTOL vehicles during takeoff to start engine after the aircraft is off the ground. Zero for no delay.'''
enums['MAV_CMD'][223].param[4] = '''Empty'''
enums['MAV_CMD'][223].param[5] = '''Empty'''
enums['MAV_CMD'][223].param[6] = '''Empty'''
enums['MAV_CMD'][223].param[7] = '''Empty'''
MAV_CMD_DO_SET_MISSION_CURRENT = 224 # Set the mission item with sequence number seq as current item. This
# means that the MAV will continue to this
# mission item on the shortest path (not
# following the mission items in-between).
enums['MAV_CMD'][224] = EnumEntry('MAV_CMD_DO_SET_MISSION_CURRENT', '''Set the mission item with sequence number seq as current item. This means that the MAV will continue to this mission item on the shortest path (not following the mission items in-between).''')
enums['MAV_CMD'][224].param[1] = '''Mission sequence value to set'''
enums['MAV_CMD'][224].param[2] = '''Empty'''
enums['MAV_CMD'][224].param[3] = '''Empty'''
enums['MAV_CMD'][224].param[4] = '''Empty'''
enums['MAV_CMD'][224].param[5] = '''Empty'''
enums['MAV_CMD'][224].param[6] = '''Empty'''
enums['MAV_CMD'][224].param[7] = '''Empty'''
MAV_CMD_DO_LAST = 240 # NOP - This command is only used to mark the upper limit of the DO
# commands in the enumeration
enums['MAV_CMD'][240] = EnumEntry('MAV_CMD_DO_LAST', '''NOP - This command is only used to mark the upper limit of the DO commands in the enumeration''')
enums['MAV_CMD'][240].param[1] = '''Empty'''
enums['MAV_CMD'][240].param[2] = '''Empty'''
enums['MAV_CMD'][240].param[3] = '''Empty'''
enums['MAV_CMD'][240].param[4] = '''Empty'''
enums['MAV_CMD'][240].param[5] = '''Empty'''
enums['MAV_CMD'][240].param[6] = '''Empty'''
enums['MAV_CMD'][240].param[7] = '''Empty'''
MAV_CMD_PREFLIGHT_CALIBRATION = 241 # Trigger calibration. This command will be only accepted if in pre-
# flight mode. Except for Temperature
# Calibration, only one sensor should be set
# in a single message and all others should be
# zero.
enums['MAV_CMD'][241] = EnumEntry('MAV_CMD_PREFLIGHT_CALIBRATION', '''Trigger calibration. This command will be only accepted if in pre-flight mode. Except for Temperature Calibration, only one sensor should be set in a single message and all others should be zero.''')
enums['MAV_CMD'][241].param[1] = '''1: gyro calibration, 3: gyro temperature calibration'''
enums['MAV_CMD'][241].param[2] = '''1: magnetometer calibration'''
enums['MAV_CMD'][241].param[3] = '''1: ground pressure calibration'''
enums['MAV_CMD'][241].param[4] = '''1: radio RC calibration, 2: RC trim calibration'''
enums['MAV_CMD'][241].param[5] = '''1: accelerometer calibration, 2: board level calibration, 3: accelerometer temperature calibration, 4: simple accelerometer calibration'''
enums['MAV_CMD'][241].param[6] = '''1: APM: compass/motor interference calibration (PX4: airspeed calibration, deprecated), 2: airspeed calibration'''
enums['MAV_CMD'][241].param[7] = '''1: ESC calibration, 3: barometer temperature calibration'''
MAV_CMD_PREFLIGHT_SET_SENSOR_OFFSETS = 242 # Set sensor offsets. This command will be only accepted if in pre-
# flight mode.
enums['MAV_CMD'][242] = EnumEntry('MAV_CMD_PREFLIGHT_SET_SENSOR_OFFSETS', '''Set sensor offsets. This command will be only accepted if in pre-flight mode.''')
enums['MAV_CMD'][242].param[1] = '''Sensor to adjust the offsets for: 0: gyros, 1: accelerometer, 2: magnetometer, 3: barometer, 4: optical flow, 5: second magnetometer, 6: third magnetometer'''
enums['MAV_CMD'][242].param[2] = '''X axis offset (or generic dimension 1), in the sensor's raw units'''
enums['MAV_CMD'][242].param[3] = '''Y axis offset (or generic dimension 2), in the sensor's raw units'''
enums['MAV_CMD'][242].param[4] = '''Z axis offset (or generic dimension 3), in the sensor's raw units'''
enums['MAV_CMD'][242].param[5] = '''Generic dimension 4, in the sensor's raw units'''
enums['MAV_CMD'][242].param[6] = '''Generic dimension 5, in the sensor's raw units'''
enums['MAV_CMD'][242].param[7] = '''Generic dimension 6, in the sensor's raw units'''
MAV_CMD_PREFLIGHT_UAVCAN = 243 # Trigger UAVCAN config. This command will be only accepted if in pre-
# flight mode.
enums['MAV_CMD'][243] = EnumEntry('MAV_CMD_PREFLIGHT_UAVCAN', '''Trigger UAVCAN config. This command will be only accepted if in pre-flight mode.''')
enums['MAV_CMD'][243].param[1] = '''1: Trigger actuator ID assignment and direction mapping.'''
enums['MAV_CMD'][243].param[2] = '''Reserved'''
enums['MAV_CMD'][243].param[3] = '''Reserved'''
enums['MAV_CMD'][243].param[4] = '''Reserved'''
enums['MAV_CMD'][243].param[5] = '''Reserved'''
enums['MAV_CMD'][243].param[6] = '''Reserved'''
enums['MAV_CMD'][243].param[7] = '''Reserved'''
MAV_CMD_PREFLIGHT_STORAGE = 245 # Request storage of different parameter values and logs. This command
# will be only accepted if in pre-flight mode.
enums['MAV_CMD'][245] = EnumEntry('MAV_CMD_PREFLIGHT_STORAGE', '''Request storage of different parameter values and logs. This command will be only accepted if in pre-flight mode.''')
enums['MAV_CMD'][245].param[1] = '''Parameter storage: 0: READ FROM FLASH/EEPROM, 1: WRITE CURRENT TO FLASH/EEPROM, 2: Reset to defaults'''
enums['MAV_CMD'][245].param[2] = '''Mission storage: 0: READ FROM FLASH/EEPROM, 1: WRITE CURRENT TO FLASH/EEPROM, 2: Reset to defaults'''
enums['MAV_CMD'][245].param[3] = '''Onboard logging: 0: Ignore, 1: Start default rate logging, -1: Stop logging, > 1: logging rate (e.g. set to 1000 for 1000 Hz logging)'''
enums['MAV_CMD'][245].param[4] = '''Reserved'''
enums['MAV_CMD'][245].param[5] = '''Empty'''
enums['MAV_CMD'][245].param[6] = '''Empty'''
enums['MAV_CMD'][245].param[7] = '''Empty'''
MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN = 246 # Request the reboot or shutdown of system components.
enums['MAV_CMD'][246] = EnumEntry('MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN', '''Request the reboot or shutdown of system components.''')
enums['MAV_CMD'][246].param[1] = '''0: Do nothing for autopilot, 1: Reboot autopilot, 2: Shutdown autopilot, 3: Reboot autopilot and keep it in the bootloader until upgraded.'''
enums['MAV_CMD'][246].param[2] = '''0: Do nothing for onboard computer, 1: Reboot onboard computer, 2: Shutdown onboard computer, 3: Reboot onboard computer and keep it in the bootloader until upgraded.'''
enums['MAV_CMD'][246].param[3] = '''WIP: 0: Do nothing for camera, 1: Reboot onboard camera, 2: Shutdown onboard camera, 3: Reboot onboard camera and keep it in the bootloader until upgraded'''
enums['MAV_CMD'][246].param[4] = '''WIP: 0: Do nothing for mount (e.g. gimbal), 1: Reboot mount, 2: Shutdown mount, 3: Reboot mount and keep it in the bootloader until upgraded'''
enums['MAV_CMD'][246].param[5] = '''Reserved, send 0'''
enums['MAV_CMD'][246].param[6] = '''Reserved, send 0'''
enums['MAV_CMD'][246].param[7] = '''WIP: ID (e.g. camera ID -1 for all IDs)'''
MAV_CMD_OVERRIDE_GOTO = 252 # Override current mission with command to pause mission, pause mission
# and move to position, continue/resume
# mission. When param 1 indicates that the
# mission is paused (MAV_GOTO_DO_HOLD), param
# 2 defines whether it holds in place or moves
# to another position.
enums['MAV_CMD'][252] = EnumEntry('MAV_CMD_OVERRIDE_GOTO', '''Override current mission with command to pause mission, pause mission and move to position, continue/resume mission. When param 1 indicates that the mission is paused (MAV_GOTO_DO_HOLD), param 2 defines whether it holds in place or moves to another position.''')
enums['MAV_CMD'][252].param[1] = '''MAV_GOTO_DO_HOLD: pause mission and either hold or move to specified position (depending on param2), MAV_GOTO_DO_CONTINUE: resume mission.'''
enums['MAV_CMD'][252].param[2] = '''MAV_GOTO_HOLD_AT_CURRENT_POSITION: hold at current position, MAV_GOTO_HOLD_AT_SPECIFIED_POSITION: hold at specified position.'''
enums['MAV_CMD'][252].param[3] = '''Coordinate frame of hold point.'''
enums['MAV_CMD'][252].param[4] = '''Desired yaw angle.'''
enums['MAV_CMD'][252].param[5] = '''Latitude / X position.'''
enums['MAV_CMD'][252].param[6] = '''Longitude / Y position.'''
enums['MAV_CMD'][252].param[7] = '''Altitude / Z position.'''
MAV_CMD_MISSION_START = 300 # start running a mission
enums['MAV_CMD'][300] = EnumEntry('MAV_CMD_MISSION_START', '''start running a mission''')
enums['MAV_CMD'][300].param[1] = '''first_item: the first mission item to run'''
enums['MAV_CMD'][300].param[2] = '''last_item: the last mission item to run (after this item is run, the mission ends)'''
enums['MAV_CMD'][300].param[3] = '''Reserved (default:0)'''
enums['MAV_CMD'][300].param[4] = '''Reserved (default:0)'''
enums['MAV_CMD'][300].param[5] = '''Reserved (default:0)'''
enums['MAV_CMD'][300].param[6] = '''Reserved (default:0)'''
enums['MAV_CMD'][300].param[7] = '''Reserved (default:0)'''
MAV_CMD_COMPONENT_ARM_DISARM = 400 # Arms / Disarms a component
enums['MAV_CMD'][400] = EnumEntry('MAV_CMD_COMPONENT_ARM_DISARM', '''Arms / Disarms a component''')
enums['MAV_CMD'][400].param[1] = '''0: disarm, 1: arm'''
enums['MAV_CMD'][400].param[2] = '''0: arm-disarm unless prevented by safety checks (i.e. when landed), 21196: force arming/disarming (e.g. allow arming to override preflight checks and disarming in flight)'''
enums['MAV_CMD'][400].param[3] = '''Reserved (default:0)'''
enums['MAV_CMD'][400].param[4] = '''Reserved (default:0)'''
enums['MAV_CMD'][400].param[5] = '''Reserved (default:0)'''
enums['MAV_CMD'][400].param[6] = '''Reserved (default:0)'''
enums['MAV_CMD'][400].param[7] = '''Reserved (default:0)'''
MAV_CMD_GET_HOME_POSITION = 410 # Request the home position from the vehicle.
enums['MAV_CMD'][410] = EnumEntry('MAV_CMD_GET_HOME_POSITION', '''Request the home position from the vehicle.''')
enums['MAV_CMD'][410].param[1] = '''Reserved'''
enums['MAV_CMD'][410].param[2] = '''Reserved'''
enums['MAV_CMD'][410].param[3] = '''Reserved'''
enums['MAV_CMD'][410].param[4] = '''Reserved'''
enums['MAV_CMD'][410].param[5] = '''Reserved'''
enums['MAV_CMD'][410].param[6] = '''Reserved'''
enums['MAV_CMD'][410].param[7] = '''Reserved'''
MAV_CMD_START_RX_PAIR = 500 # Starts receiver pairing.
enums['MAV_CMD'][500] = EnumEntry('MAV_CMD_START_RX_PAIR', '''Starts receiver pairing.''')
enums['MAV_CMD'][500].param[1] = '''0:Spektrum.'''
enums['MAV_CMD'][500].param[2] = '''RC type.'''
enums['MAV_CMD'][500].param[3] = '''Reserved (default:0)'''
enums['MAV_CMD'][500].param[4] = '''Reserved (default:0)'''
enums['MAV_CMD'][500].param[5] = '''Reserved (default:0)'''
enums['MAV_CMD'][500].param[6] = '''Reserved (default:0)'''
enums['MAV_CMD'][500].param[7] = '''Reserved (default:0)'''
MAV_CMD_GET_MESSAGE_INTERVAL = 510 # Request the interval between messages for a particular MAVLink message
# ID. The receiver should ACK the command and
# then emit its response in a MESSAGE_INTERVAL
# message.
enums['MAV_CMD'][510] = EnumEntry('MAV_CMD_GET_MESSAGE_INTERVAL', '''Request the interval between messages for a particular MAVLink message ID. The receiver should ACK the command and then emit its response in a MESSAGE_INTERVAL message.''')
enums['MAV_CMD'][510].param[1] = '''The MAVLink message ID'''
enums['MAV_CMD'][510].param[2] = '''Reserved (default:0)'''
enums['MAV_CMD'][510].param[3] = '''Reserved (default:0)'''
enums['MAV_CMD'][510].param[4] = '''Reserved (default:0)'''
enums['MAV_CMD'][510].param[5] = '''Reserved (default:0)'''
enums['MAV_CMD'][510].param[6] = '''Reserved (default:0)'''
enums['MAV_CMD'][510].param[7] = '''Reserved (default:0)'''
MAV_CMD_SET_MESSAGE_INTERVAL = 511 # Set the interval between messages for a particular MAVLink message ID.
# This interface replaces REQUEST_DATA_STREAM.
enums['MAV_CMD'][511] = EnumEntry('MAV_CMD_SET_MESSAGE_INTERVAL', '''Set the interval between messages for a particular MAVLink message ID. This interface replaces REQUEST_DATA_STREAM.''')
enums['MAV_CMD'][511].param[1] = '''The MAVLink message ID'''
enums['MAV_CMD'][511].param[2] = '''The interval between two messages. Set to -1 to disable and 0 to request default rate.'''
enums['MAV_CMD'][511].param[3] = '''Reserved (default:0)'''
enums['MAV_CMD'][511].param[4] = '''Reserved (default:0)'''
enums['MAV_CMD'][511].param[5] = '''Reserved (default:0)'''
enums['MAV_CMD'][511].param[6] = '''Reserved (default:0)'''
enums['MAV_CMD'][511].param[7] = '''Target address of message stream (if message has target address fields). 0: Flight-stack default (recommended), 1: address of requestor, 2: broadcast.'''
MAV_CMD_REQUEST_MESSAGE = 512 # Request the target system(s) emit a single instance of a specified
# message (i.e. a "one-shot" version of
# MAV_CMD_SET_MESSAGE_INTERVAL).
enums['MAV_CMD'][512] = EnumEntry('MAV_CMD_REQUEST_MESSAGE', '''Request the target system(s) emit a single instance of a specified message (i.e. a "one-shot" version of MAV_CMD_SET_MESSAGE_INTERVAL).''')
enums['MAV_CMD'][512].param[1] = '''The MAVLink message ID of the requested message.'''
enums['MAV_CMD'][512].param[2] = '''Index id (if appropriate). The use of this parameter (if any), must be defined in the requested message.'''
enums['MAV_CMD'][512].param[3] = '''The use of this parameter (if any), must be defined in the requested message. By default assumed not used (0).'''
enums['MAV_CMD'][512].param[4] = '''The use of this parameter (if any), must be defined in the requested message. By default assumed not used (0).'''
enums['MAV_CMD'][512].param[5] = '''The use of this parameter (if any), must be defined in the requested message. By default assumed not used (0).'''
enums['MAV_CMD'][512].param[6] = '''The use of this parameter (if any), must be defined in the requested message. By default assumed not used (0).'''
enums['MAV_CMD'][512].param[7] = '''Target address for requested message (if message has target address fields). 0: Flight-stack default, 1: address of requestor, 2: broadcast.'''
MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES = 520 # Request autopilot capabilities. The receiver should ACK the command
# and then emit its capabilities in an
# AUTOPILOT_VERSION message
enums['MAV_CMD'][520] = EnumEntry('MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES', '''Request autopilot capabilities. The receiver should ACK the command and then emit its capabilities in an AUTOPILOT_VERSION message''')
enums['MAV_CMD'][520].param[1] = '''1: Request autopilot version'''
enums['MAV_CMD'][520].param[2] = '''Reserved (all remaining params)'''
enums['MAV_CMD'][520].param[3] = '''Reserved (default:0)'''
enums['MAV_CMD'][520].param[4] = '''Reserved (default:0)'''
enums['MAV_CMD'][520].param[5] = '''Reserved (default:0)'''
enums['MAV_CMD'][520].param[6] = '''Reserved (default:0)'''
enums['MAV_CMD'][520].param[7] = '''Reserved (default:0)'''
MAV_CMD_REQUEST_CAMERA_INFORMATION = 521 # Request camera information (CAMERA_INFORMATION).
enums['MAV_CMD'][521] = EnumEntry('MAV_CMD_REQUEST_CAMERA_INFORMATION', '''Request camera information (CAMERA_INFORMATION).''')
enums['MAV_CMD'][521].param[1] = '''0: No action 1: Request camera capabilities'''
enums['MAV_CMD'][521].param[2] = '''Reserved (all remaining params)'''
enums['MAV_CMD'][521].param[3] = '''Reserved (default:0)'''
enums['MAV_CMD'][521].param[4] = '''Reserved (default:0)'''
enums['MAV_CMD'][521].param[5] = '''Reserved (default:0)'''
enums['MAV_CMD'][521].param[6] = '''Reserved (default:0)'''
enums['MAV_CMD'][521].param[7] = '''Reserved (default:0)'''
MAV_CMD_REQUEST_CAMERA_SETTINGS = 522 # Request camera settings (CAMERA_SETTINGS).
enums['MAV_CMD'][522] = EnumEntry('MAV_CMD_REQUEST_CAMERA_SETTINGS', '''Request camera settings (CAMERA_SETTINGS).''')
enums['MAV_CMD'][522].param[1] = '''0: No Action 1: Request camera settings'''
enums['MAV_CMD'][522].param[2] = '''Reserved (all remaining params)'''
enums['MAV_CMD'][522].param[3] = '''Reserved (default:0)'''
enums['MAV_CMD'][522].param[4] = '''Reserved (default:0)'''
enums['MAV_CMD'][522].param[5] = '''Reserved (default:0)'''
enums['MAV_CMD'][522].param[6] = '''Reserved (default:0)'''
enums['MAV_CMD'][522].param[7] = '''Reserved (default:0)'''
MAV_CMD_REQUEST_STORAGE_INFORMATION = 525 # Request storage information (STORAGE_INFORMATION). Use the command's
# target_component to target a specific
# component's storage.
enums['MAV_CMD'][525] = EnumEntry('MAV_CMD_REQUEST_STORAGE_INFORMATION', '''Request storage information (STORAGE_INFORMATION). Use the command's target_component to target a specific component's storage.''')
enums['MAV_CMD'][525].param[1] = '''Storage ID (0 for all, 1 for first, 2 for second, etc.)'''
enums['MAV_CMD'][525].param[2] = '''0: No Action 1: Request storage information'''
enums['MAV_CMD'][525].param[3] = '''Reserved (all remaining params)'''
enums['MAV_CMD'][525].param[4] = '''Reserved (default:0)'''
enums['MAV_CMD'][525].param[5] = '''Reserved (default:0)'''
enums['MAV_CMD'][525].param[6] = '''Reserved (default:0)'''
enums['MAV_CMD'][525].param[7] = '''Reserved (default:0)'''
MAV_CMD_STORAGE_FORMAT = 526 # Format a storage medium. Once format is complete, a
# STORAGE_INFORMATION message is sent. Use the
# command's target_component to target a
# specific component's storage.
enums['MAV_CMD'][526] = EnumEntry('MAV_CMD_STORAGE_FORMAT', '''Format a storage medium. Once format is complete, a STORAGE_INFORMATION message is sent. Use the command's target_component to target a specific component's storage.''')
enums['MAV_CMD'][526].param[1] = '''Storage ID (1 for first, 2 for second, etc.)'''
enums['MAV_CMD'][526].param[2] = '''0: No action 1: Format storage'''
enums['MAV_CMD'][526].param[3] = '''Reserved (all remaining params)'''
enums['MAV_CMD'][526].param[4] = '''Reserved (default:0)'''
enums['MAV_CMD'][526].param[5] = '''Reserved (default:0)'''
enums['MAV_CMD'][526].param[6] = '''Reserved (default:0)'''
enums['MAV_CMD'][526].param[7] = '''Reserved (default:0)'''
MAV_CMD_REQUEST_CAMERA_CAPTURE_STATUS = 527 # Request camera capture status (CAMERA_CAPTURE_STATUS)
enums['MAV_CMD'][527] = EnumEntry('MAV_CMD_REQUEST_CAMERA_CAPTURE_STATUS', '''Request camera capture status (CAMERA_CAPTURE_STATUS)''')
enums['MAV_CMD'][527].param[1] = '''0: No Action 1: Request camera capture status'''
enums['MAV_CMD'][527].param[2] = '''Reserved (all remaining params)'''
enums['MAV_CMD'][527].param[3] = '''Reserved (default:0)'''
enums['MAV_CMD'][527].param[4] = '''Reserved (default:0)'''
enums['MAV_CMD'][527].param[5] = '''Reserved (default:0)'''
enums['MAV_CMD'][527].param[6] = '''Reserved (default:0)'''
enums['MAV_CMD'][527].param[7] = '''Reserved (default:0)'''
MAV_CMD_REQUEST_FLIGHT_INFORMATION = 528 # Request flight information (FLIGHT_INFORMATION)
enums['MAV_CMD'][528] = EnumEntry('MAV_CMD_REQUEST_FLIGHT_INFORMATION', '''Request flight information (FLIGHT_INFORMATION)''')
enums['MAV_CMD'][528].param[1] = '''1: Request flight information'''
enums['MAV_CMD'][528].param[2] = '''Reserved (all remaining params)'''
enums['MAV_CMD'][528].param[3] = '''Reserved (default:0)'''
enums['MAV_CMD'][528].param[4] = '''Reserved (default:0)'''
enums['MAV_CMD'][528].param[5] = '''Reserved (default:0)'''
enums['MAV_CMD'][528].param[6] = '''Reserved (default:0)'''
enums['MAV_CMD'][528].param[7] = '''Reserved (default:0)'''
MAV_CMD_RESET_CAMERA_SETTINGS = 529 # Reset all camera settings to Factory Default
enums['MAV_CMD'][529] = EnumEntry('MAV_CMD_RESET_CAMERA_SETTINGS', '''Reset all camera settings to Factory Default''')
enums['MAV_CMD'][529].param[1] = '''0: No Action 1: Reset all settings'''
enums['MAV_CMD'][529].param[2] = '''Reserved (all remaining params)'''
enums['MAV_CMD'][529].param[3] = '''Reserved (default:0)'''
enums['MAV_CMD'][529].param[4] = '''Reserved (default:0)'''
enums['MAV_CMD'][529].param[5] = '''Reserved (default:0)'''
enums['MAV_CMD'][529].param[6] = '''Reserved (default:0)'''
enums['MAV_CMD'][529].param[7] = '''Reserved (default:0)'''
MAV_CMD_SET_CAMERA_MODE = 530 # Set camera running mode. Use NaN for reserved values. GCS will send a
# MAV_CMD_REQUEST_VIDEO_STREAM_STATUS command
# after a mode change if the camera supports
# video streaming.
enums['MAV_CMD'][530] = EnumEntry('MAV_CMD_SET_CAMERA_MODE', '''Set camera running mode. Use NaN for reserved values. GCS will send a MAV_CMD_REQUEST_VIDEO_STREAM_STATUS command after a mode change if the camera supports video streaming.''')
enums['MAV_CMD'][530].param[1] = '''Reserved (Set to 0)'''
enums['MAV_CMD'][530].param[2] = '''Camera mode'''
enums['MAV_CMD'][530].param[3] = '''Reserved (all remaining params)'''
enums['MAV_CMD'][530].param[4] = '''Reserved (default:0)'''
enums['MAV_CMD'][530].param[5] = '''Reserved (default:0)'''
enums['MAV_CMD'][530].param[6] = '''Reserved (default:0)'''
enums['MAV_CMD'][530].param[7] = '''Reserved (default:0)'''
MAV_CMD_JUMP_TAG = 600 # Tagged jump target. Can be jumped to with MAV_CMD_DO_JUMP_TAG.
enums['MAV_CMD'][600] = EnumEntry('MAV_CMD_JUMP_TAG', '''Tagged jump target. Can be jumped to with MAV_CMD_DO_JUMP_TAG.''')
enums['MAV_CMD'][600].param[1] = '''Tag.'''
enums['MAV_CMD'][600].param[2] = '''Reserved (default:0)'''
enums['MAV_CMD'][600].param[3] = '''Reserved (default:0)'''
enums['MAV_CMD'][600].param[4] = '''Reserved (default:0)'''
enums['MAV_CMD'][600].param[5] = '''Reserved (default:0)'''
enums['MAV_CMD'][600].param[6] = '''Reserved (default:0)'''
enums['MAV_CMD'][600].param[7] = '''Reserved (default:0)'''
MAV_CMD_DO_JUMP_TAG = 601 # Jump to the matching tag in the mission list. Repeat this action for
# the specified number of times. A mission
# should contain a single matching tag for
# each jump. If this is not the case then a
# jump to a missing tag should complete the
# mission, and a jump where there are multiple
# matching tags should always select the one
# with the lowest mission sequence number.
enums['MAV_CMD'][601] = EnumEntry('MAV_CMD_DO_JUMP_TAG', '''Jump to the matching tag in the mission list. Repeat this action for the specified number of times. A mission should contain a single matching tag for each jump. If this is not the case then a jump to a missing tag should complete the mission, and a jump where there are multiple matching tags should always select the one with the lowest mission sequence number.''')
enums['MAV_CMD'][601].param[1] = '''Target tag to jump to.'''
enums['MAV_CMD'][601].param[2] = '''Repeat count.'''
enums['MAV_CMD'][601].param[3] = '''Reserved (default:0)'''
enums['MAV_CMD'][601].param[4] = '''Reserved (default:0)'''
enums['MAV_CMD'][601].param[5] = '''Reserved (default:0)'''
enums['MAV_CMD'][601].param[6] = '''Reserved (default:0)'''
enums['MAV_CMD'][601].param[7] = '''Reserved (default:0)'''
MAV_CMD_IMAGE_START_CAPTURE = 2000 # Start image capture sequence. Sends CAMERA_IMAGE_CAPTURED after each
# capture. Use NaN for reserved values.
enums['MAV_CMD'][2000] = EnumEntry('MAV_CMD_IMAGE_START_CAPTURE', '''Start image capture sequence. Sends CAMERA_IMAGE_CAPTURED after each capture. Use NaN for reserved values.''')
enums['MAV_CMD'][2000].param[1] = '''Reserved (Set to 0)'''
enums['MAV_CMD'][2000].param[2] = '''Desired elapsed time between two consecutive pictures (in seconds). Minimum values depend on hardware (typically greater than 2 seconds).'''
enums['MAV_CMD'][2000].param[3] = '''Total number of images to capture. 0 to capture forever/until MAV_CMD_IMAGE_STOP_CAPTURE.'''
enums['MAV_CMD'][2000].param[4] = '''Capture sequence number starting from 1. This is only valid for single-capture (param3 == 1). Increment the capture ID for each capture command to prevent double captures when a command is re-transmitted. Use 0 to ignore it.'''
enums['MAV_CMD'][2000].param[5] = '''Reserved (all remaining params)'''
enums['MAV_CMD'][2000].param[6] = '''Reserved (default:0)'''
enums['MAV_CMD'][2000].param[7] = '''Reserved (default:0)'''
MAV_CMD_IMAGE_STOP_CAPTURE = 2001 # Stop image capture sequence Use NaN for reserved values.
enums['MAV_CMD'][2001] = EnumEntry('MAV_CMD_IMAGE_STOP_CAPTURE', '''Stop image capture sequence Use NaN for reserved values.''')
enums['MAV_CMD'][2001].param[1] = '''Reserved (Set to 0)'''
enums['MAV_CMD'][2001].param[2] = '''Reserved (all remaining params)'''
enums['MAV_CMD'][2001].param[3] = '''Reserved (default:0)'''
enums['MAV_CMD'][2001].param[4] = '''Reserved (default:0)'''
enums['MAV_CMD'][2001].param[5] = '''Reserved (default:0)'''
enums['MAV_CMD'][2001].param[6] = '''Reserved (default:0)'''
enums['MAV_CMD'][2001].param[7] = '''Reserved (default:0)'''
MAV_CMD_DO_TRIGGER_CONTROL = 2003 # Enable or disable on-board camera triggering system.
enums['MAV_CMD'][2003] = EnumEntry('MAV_CMD_DO_TRIGGER_CONTROL', '''Enable or disable on-board camera triggering system.''')
enums['MAV_CMD'][2003].param[1] = '''Trigger enable/disable (0 for disable, 1 for start), -1 to ignore'''
enums['MAV_CMD'][2003].param[2] = '''1 to reset the trigger sequence, -1 or 0 to ignore'''
enums['MAV_CMD'][2003].param[3] = '''1 to pause triggering, but without switching the camera off or retracting it. -1 to ignore'''
enums['MAV_CMD'][2003].param[4] = '''Reserved (default:0)'''
enums['MAV_CMD'][2003].param[5] = '''Reserved (default:0)'''
enums['MAV_CMD'][2003].param[6] = '''Reserved (default:0)'''
enums['MAV_CMD'][2003].param[7] = '''Reserved (default:0)'''
MAV_CMD_VIDEO_START_CAPTURE = 2500 # Starts video capture (recording). Use NaN for reserved values.
enums['MAV_CMD'][2500] = EnumEntry('MAV_CMD_VIDEO_START_CAPTURE', '''Starts video capture (recording). Use NaN for reserved values.''')
enums['MAV_CMD'][2500].param[1] = '''Video Stream ID (0 for all streams)'''
enums['MAV_CMD'][2500].param[2] = '''Frequency CAMERA_CAPTURE_STATUS messages should be sent while recording (0 for no messages, otherwise frequency)'''
enums['MAV_CMD'][2500].param[3] = '''Reserved (all remaining params)'''
enums['MAV_CMD'][2500].param[4] = '''Reserved (default:0)'''
enums['MAV_CMD'][2500].param[5] = '''Reserved (default:0)'''
enums['MAV_CMD'][2500].param[6] = '''Reserved (default:0)'''
enums['MAV_CMD'][2500].param[7] = '''Reserved (default:0)'''
MAV_CMD_VIDEO_STOP_CAPTURE = 2501 # Stop the current video capture (recording). Use NaN for reserved
# values.
enums['MAV_CMD'][2501] = EnumEntry('MAV_CMD_VIDEO_STOP_CAPTURE', '''Stop the current video capture (recording). Use NaN for reserved values.''')
enums['MAV_CMD'][2501].param[1] = '''Video Stream ID (0 for all streams)'''
enums['MAV_CMD'][2501].param[2] = '''Reserved (all remaining params)'''
enums['MAV_CMD'][2501].param[3] = '''Reserved (default:0)'''
enums['MAV_CMD'][2501].param[4] = '''Reserved (default:0)'''
enums['MAV_CMD'][2501].param[5] = '''Reserved (default:0)'''
enums['MAV_CMD'][2501].param[6] = '''Reserved (default:0)'''
enums['MAV_CMD'][2501].param[7] = '''Reserved (default:0)'''
MAV_CMD_LOGGING_START = 2510 # Request to start streaming logging data over MAVLink (see also
# LOGGING_DATA message)
enums['MAV_CMD'][2510] = EnumEntry('MAV_CMD_LOGGING_START', '''Request to start streaming logging data over MAVLink (see also LOGGING_DATA message)''')
enums['MAV_CMD'][2510].param[1] = '''Format: 0: ULog'''
enums['MAV_CMD'][2510].param[2] = '''Reserved (set to 0)'''
enums['MAV_CMD'][2510].param[3] = '''Reserved (set to 0)'''
enums['MAV_CMD'][2510].param[4] = '''Reserved (set to 0)'''
enums['MAV_CMD'][2510].param[5] = '''Reserved (set to 0)'''
enums['MAV_CMD'][2510].param[6] = '''Reserved (set to 0)'''
enums['MAV_CMD'][2510].param[7] = '''Reserved (set to 0)'''
MAV_CMD_LOGGING_STOP = 2511 # Request to stop streaming log data over MAVLink
enums['MAV_CMD'][2511] = EnumEntry('MAV_CMD_LOGGING_STOP', '''Request to stop streaming log data over MAVLink''')
enums['MAV_CMD'][2511].param[1] = '''Reserved (set to 0)'''
enums['MAV_CMD'][2511].param[2] = '''Reserved (set to 0)'''
enums['MAV_CMD'][2511].param[3] = '''Reserved (set to 0)'''
enums['MAV_CMD'][2511].param[4] = '''Reserved (set to 0)'''
enums['MAV_CMD'][2511].param[5] = '''Reserved (set to 0)'''
enums['MAV_CMD'][2511].param[6] = '''Reserved (set to 0)'''
enums['MAV_CMD'][2511].param[7] = '''Reserved (set to 0)'''
MAV_CMD_AIRFRAME_CONFIGURATION = 2520 #
enums['MAV_CMD'][2520] = EnumEntry('MAV_CMD_AIRFRAME_CONFIGURATION', '''''')
enums['MAV_CMD'][2520].param[1] = '''Landing gear ID (default: 0, -1 for all)'''
enums['MAV_CMD'][2520].param[2] = '''Landing gear position (Down: 0, Up: 1, NaN for no change)'''
enums['MAV_CMD'][2520].param[3] = '''Reserved, set to NaN'''
enums['MAV_CMD'][2520].param[4] = '''Reserved, set to NaN'''
enums['MAV_CMD'][2520].param[5] = '''Reserved, set to NaN'''
enums['MAV_CMD'][2520].param[6] = '''Reserved, set to NaN'''
enums['MAV_CMD'][2520].param[7] = '''Reserved, set to NaN'''
MAV_CMD_CONTROL_HIGH_LATENCY = 2600 # Request to start/stop transmitting over the high latency telemetry
enums['MAV_CMD'][2600] = EnumEntry('MAV_CMD_CONTROL_HIGH_LATENCY', '''Request to start/stop transmitting over the high latency telemetry''')
enums['MAV_CMD'][2600].param[1] = '''Control transmission over high latency telemetry (0: stop, 1: start)'''
enums['MAV_CMD'][2600].param[2] = '''Empty'''
enums['MAV_CMD'][2600].param[3] = '''Empty'''
enums['MAV_CMD'][2600].param[4] = '''Empty'''
enums['MAV_CMD'][2600].param[5] = '''Empty'''
enums['MAV_CMD'][2600].param[6] = '''Empty'''
enums['MAV_CMD'][2600].param[7] = '''Empty'''
MAV_CMD_PANORAMA_CREATE = 2800 # Create a panorama at the current position
enums['MAV_CMD'][2800] = EnumEntry('MAV_CMD_PANORAMA_CREATE', '''Create a panorama at the current position''')
enums['MAV_CMD'][2800].param[1] = '''Viewing angle horizontal of the panorama (+- 0.5 the total angle)'''
enums['MAV_CMD'][2800].param[2] = '''Viewing angle vertical of panorama.'''
enums['MAV_CMD'][2800].param[3] = '''Speed of the horizontal rotation.'''
enums['MAV_CMD'][2800].param[4] = '''Speed of the vertical rotation.'''
enums['MAV_CMD'][2800].param[5] = '''Reserved (default:0)'''
enums['MAV_CMD'][2800].param[6] = '''Reserved (default:0)'''
enums['MAV_CMD'][2800].param[7] = '''Reserved (default:0)'''
MAV_CMD_DO_VTOL_TRANSITION = 3000 # Request VTOL transition
enums['MAV_CMD'][3000] = EnumEntry('MAV_CMD_DO_VTOL_TRANSITION', '''Request VTOL transition''')
enums['MAV_CMD'][3000].param[1] = '''The target VTOL state. Only MAV_VTOL_STATE_MC and MAV_VTOL_STATE_FW can be used.'''
enums['MAV_CMD'][3000].param[2] = '''Reserved (default:0)'''
enums['MAV_CMD'][3000].param[3] = '''Reserved (default:0)'''
enums['MAV_CMD'][3000].param[4] = '''Reserved (default:0)'''
enums['MAV_CMD'][3000].param[5] = '''Reserved (default:0)'''
enums['MAV_CMD'][3000].param[6] = '''Reserved (default:0)'''
enums['MAV_CMD'][3000].param[7] = '''Reserved (default:0)'''
MAV_CMD_ARM_AUTHORIZATION_REQUEST = 3001 # Request authorization to arm the vehicle to a external entity, the arm
# authorizer is responsible to request all
# data that is needs from the vehicle before
# authorize or deny the request. If approved
# the progress of command_ack message should
# be set with period of time that this
# authorization is valid in seconds or in case
# it was denied it should be set with one of
# the reasons in ARM_AUTH_DENIED_REASON.
enums['MAV_CMD'][3001] = EnumEntry('MAV_CMD_ARM_AUTHORIZATION_REQUEST', '''Request authorization to arm the vehicle to a external entity, the arm authorizer is responsible to request all data that is needs from the vehicle before authorize or deny the request. If approved the progress of command_ack message should be set with period of time that this authorization is valid in seconds or in case it was denied it should be set with one of the reasons in ARM_AUTH_DENIED_REASON.
''')
enums['MAV_CMD'][3001].param[1] = '''Vehicle system id, this way ground station can request arm authorization on behalf of any vehicle'''
enums['MAV_CMD'][3001].param[2] = '''Reserved (default:0)'''
enums['MAV_CMD'][3001].param[3] = '''Reserved (default:0)'''
enums['MAV_CMD'][3001].param[4] = '''Reserved (default:0)'''
enums['MAV_CMD'][3001].param[5] = '''Reserved (default:0)'''
enums['MAV_CMD'][3001].param[6] = '''Reserved (default:0)'''
enums['MAV_CMD'][3001].param[7] = '''Reserved (default:0)'''
MAV_CMD_SET_GUIDED_SUBMODE_STANDARD = 4000 # This command sets the submode to standard guided when vehicle is in
# guided mode. The vehicle holds position and
# altitude and the user can input the desired
# velocities along all three axes.
enums['MAV_CMD'][4000] = EnumEntry('MAV_CMD_SET_GUIDED_SUBMODE_STANDARD', '''This command sets the submode to standard guided when vehicle is in guided mode. The vehicle holds position and altitude and the user can input the desired velocities along all three axes.
''')
enums['MAV_CMD'][4000].param[1] = '''Reserved (default:0)'''
enums['MAV_CMD'][4000].param[2] = '''Reserved (default:0)'''
enums['MAV_CMD'][4000].param[3] = '''Reserved (default:0)'''
enums['MAV_CMD'][4000].param[4] = '''Reserved (default:0)'''
enums['MAV_CMD'][4000].param[5] = '''Reserved (default:0)'''
enums['MAV_CMD'][4000].param[6] = '''Reserved (default:0)'''
enums['MAV_CMD'][4000].param[7] = '''Reserved (default:0)'''
MAV_CMD_SET_GUIDED_SUBMODE_CIRCLE = 4001 # This command sets submode circle when vehicle is in guided mode.
# Vehicle flies along a circle facing the
# center of the circle. The user can input the
# velocity along the circle and change the
# radius. If no input is given the vehicle
# will hold position.
enums['MAV_CMD'][4001] = EnumEntry('MAV_CMD_SET_GUIDED_SUBMODE_CIRCLE', '''This command sets submode circle when vehicle is in guided mode. Vehicle flies along a circle facing the center of the circle. The user can input the velocity along the circle and change the radius. If no input is given the vehicle will hold position.
''')
enums['MAV_CMD'][4001].param[1] = '''Radius of desired circle in CIRCLE_MODE'''
enums['MAV_CMD'][4001].param[2] = '''User defined'''
enums['MAV_CMD'][4001].param[3] = '''User defined'''
enums['MAV_CMD'][4001].param[4] = '''User defined'''
enums['MAV_CMD'][4001].param[5] = '''Unscaled target latitude of center of circle in CIRCLE_MODE'''
enums['MAV_CMD'][4001].param[6] = '''Unscaled target longitude of center of circle in CIRCLE_MODE'''
enums['MAV_CMD'][4001].param[7] = '''Reserved (default:0)'''
MAV_CMD_NAV_FENCE_RETURN_POINT = 5000 # Fence return point. There can only be one fence return point.
enums['MAV_CMD'][5000] = EnumEntry('MAV_CMD_NAV_FENCE_RETURN_POINT', '''Fence return point. There can only be one fence return point.
''')
enums['MAV_CMD'][5000].param[1] = '''Reserved'''
enums['MAV_CMD'][5000].param[2] = '''Reserved'''
enums['MAV_CMD'][5000].param[3] = '''Reserved'''
enums['MAV_CMD'][5000].param[4] = '''Reserved'''
enums['MAV_CMD'][5000].param[5] = '''Latitude'''
enums['MAV_CMD'][5000].param[6] = '''Longitude'''
enums['MAV_CMD'][5000].param[7] = '''Altitude'''
MAV_CMD_NAV_FENCE_POLYGON_VERTEX_INCLUSION = 5001 # Fence vertex for an inclusion polygon (the polygon must not be self-
# intersecting). The vehicle must stay within
# this area. Minimum of 3 vertices required.
enums['MAV_CMD'][5001] = EnumEntry('MAV_CMD_NAV_FENCE_POLYGON_VERTEX_INCLUSION', '''Fence vertex for an inclusion polygon (the polygon must not be self-intersecting). The vehicle must stay within this area. Minimum of 3 vertices required.
''')
enums['MAV_CMD'][5001].param[1] = '''Polygon vertex count'''
enums['MAV_CMD'][5001].param[2] = '''Reserved'''
enums['MAV_CMD'][5001].param[3] = '''Reserved'''
enums['MAV_CMD'][5001].param[4] = '''Reserved'''
enums['MAV_CMD'][5001].param[5] = '''Latitude'''
enums['MAV_CMD'][5001].param[6] = '''Longitude'''
enums['MAV_CMD'][5001].param[7] = '''Reserved'''
MAV_CMD_NAV_FENCE_POLYGON_VERTEX_EXCLUSION = 5002 # Fence vertex for an exclusion polygon (the polygon must not be self-
# intersecting). The vehicle must stay outside
# this area. Minimum of 3 vertices required.
enums['MAV_CMD'][5002] = EnumEntry('MAV_CMD_NAV_FENCE_POLYGON_VERTEX_EXCLUSION', '''Fence vertex for an exclusion polygon (the polygon must not be self-intersecting). The vehicle must stay outside this area. Minimum of 3 vertices required.
''')
enums['MAV_CMD'][5002].param[1] = '''Polygon vertex count'''
enums['MAV_CMD'][5002].param[2] = '''Reserved'''
enums['MAV_CMD'][5002].param[3] = '''Reserved'''
enums['MAV_CMD'][5002].param[4] = '''Reserved'''
enums['MAV_CMD'][5002].param[5] = '''Latitude'''
enums['MAV_CMD'][5002].param[6] = '''Longitude'''
enums['MAV_CMD'][5002].param[7] = '''Reserved'''
MAV_CMD_NAV_FENCE_CIRCLE_INCLUSION = 5003 # Circular fence area. The vehicle must stay inside this area.
enums['MAV_CMD'][5003] = EnumEntry('MAV_CMD_NAV_FENCE_CIRCLE_INCLUSION', '''Circular fence area. The vehicle must stay inside this area.
''')
enums['MAV_CMD'][5003].param[1] = '''Radius.'''
enums['MAV_CMD'][5003].param[2] = '''Reserved'''
enums['MAV_CMD'][5003].param[3] = '''Reserved'''
enums['MAV_CMD'][5003].param[4] = '''Reserved'''
enums['MAV_CMD'][5003].param[5] = '''Latitude'''
enums['MAV_CMD'][5003].param[6] = '''Longitude'''
enums['MAV_CMD'][5003].param[7] = '''Reserved'''
MAV_CMD_NAV_FENCE_CIRCLE_EXCLUSION = 5004 # Circular fence area. The vehicle must stay outside this area.
enums['MAV_CMD'][5004] = EnumEntry('MAV_CMD_NAV_FENCE_CIRCLE_EXCLUSION', '''Circular fence area. The vehicle must stay outside this area.
''')
enums['MAV_CMD'][5004].param[1] = '''Radius.'''
enums['MAV_CMD'][5004].param[2] = '''Reserved'''
enums['MAV_CMD'][5004].param[3] = '''Reserved'''
enums['MAV_CMD'][5004].param[4] = '''Reserved'''
enums['MAV_CMD'][5004].param[5] = '''Latitude'''
enums['MAV_CMD'][5004].param[6] = '''Longitude'''
enums['MAV_CMD'][5004].param[7] = '''Reserved'''
MAV_CMD_NAV_RALLY_POINT = 5100 # Rally point. You can have multiple rally points defined.
enums['MAV_CMD'][5100] = EnumEntry('MAV_CMD_NAV_RALLY_POINT', '''Rally point. You can have multiple rally points defined.
''')
enums['MAV_CMD'][5100].param[1] = '''Reserved'''
enums['MAV_CMD'][5100].param[2] = '''Reserved'''
enums['MAV_CMD'][5100].param[3] = '''Reserved'''
enums['MAV_CMD'][5100].param[4] = '''Reserved'''
enums['MAV_CMD'][5100].param[5] = '''Latitude'''
enums['MAV_CMD'][5100].param[6] = '''Longitude'''
enums['MAV_CMD'][5100].param[7] = '''Altitude'''
MAV_CMD_UAVCAN_GET_NODE_INFO = 5200 # Commands the vehicle to respond with a sequence of messages
# UAVCAN_NODE_INFO, one message per every
# UAVCAN node that is online. Note that some
# of the response messages can be lost, which
# the receiver can detect easily by checking
# whether every received UAVCAN_NODE_STATUS
# has a matching message UAVCAN_NODE_INFO
# received earlier; if not, this command
# should be sent again in order to request re-
# transmission of the node information
# messages.
enums['MAV_CMD'][5200] = EnumEntry('MAV_CMD_UAVCAN_GET_NODE_INFO', '''Commands the vehicle to respond with a sequence of messages UAVCAN_NODE_INFO, one message per every UAVCAN node that is online. Note that some of the response messages can be lost, which the receiver can detect easily by checking whether every received UAVCAN_NODE_STATUS has a matching message UAVCAN_NODE_INFO received earlier; if not, this command should be sent again in order to request re-transmission of the node information messages.''')
enums['MAV_CMD'][5200].param[1] = '''Reserved (set to 0)'''
enums['MAV_CMD'][5200].param[2] = '''Reserved (set to 0)'''
enums['MAV_CMD'][5200].param[3] = '''Reserved (set to 0)'''
enums['MAV_CMD'][5200].param[4] = '''Reserved (set to 0)'''
enums['MAV_CMD'][5200].param[5] = '''Reserved (set to 0)'''
enums['MAV_CMD'][5200].param[6] = '''Reserved (set to 0)'''
enums['MAV_CMD'][5200].param[7] = '''Reserved (set to 0)'''
MAV_CMD_PAYLOAD_PREPARE_DEPLOY = 30001 # Deploy payload on a Lat / Lon / Alt position. This includes the
# navigation to reach the required release
# position and velocity.
enums['MAV_CMD'][30001] = EnumEntry('MAV_CMD_PAYLOAD_PREPARE_DEPLOY', '''Deploy payload on a Lat / Lon / Alt position. This includes the navigation to reach the required release position and velocity.''')
enums['MAV_CMD'][30001].param[1] = '''Operation mode. 0: prepare single payload deploy (overwriting previous requests), but do not execute it. 1: execute payload deploy immediately (rejecting further deploy commands during execution, but allowing abort). 2: add payload deploy to existing deployment list.'''
enums['MAV_CMD'][30001].param[2] = '''Desired approach vector in compass heading. A negative value indicates the system can define the approach vector at will.'''
enums['MAV_CMD'][30001].param[3] = '''Desired ground speed at release time. This can be overridden by the airframe in case it needs to meet minimum airspeed. A negative value indicates the system can define the ground speed at will.'''
enums['MAV_CMD'][30001].param[4] = '''Minimum altitude clearance to the release position. A negative value indicates the system can define the clearance at will.'''
enums['MAV_CMD'][30001].param[5] = '''Latitude unscaled for MISSION_ITEM or in 1e7 degrees for MISSION_ITEM_INT'''
enums['MAV_CMD'][30001].param[6] = '''Longitude unscaled for MISSION_ITEM or in 1e7 degrees for MISSION_ITEM_INT'''
enums['MAV_CMD'][30001].param[7] = '''Altitude (MSL)'''
MAV_CMD_PAYLOAD_CONTROL_DEPLOY = 30002 # Control the payload deployment.
enums['MAV_CMD'][30002] = EnumEntry('MAV_CMD_PAYLOAD_CONTROL_DEPLOY', '''Control the payload deployment.''')
enums['MAV_CMD'][30002].param[1] = '''Operation mode. 0: Abort deployment, continue normal mission. 1: switch to payload deployment mode. 100: delete first payload deployment request. 101: delete all payload deployment requests.'''
enums['MAV_CMD'][30002].param[2] = '''Reserved'''
enums['MAV_CMD'][30002].param[3] = '''Reserved'''
enums['MAV_CMD'][30002].param[4] = '''Reserved'''
enums['MAV_CMD'][30002].param[5] = '''Reserved'''
enums['MAV_CMD'][30002].param[6] = '''Reserved'''
enums['MAV_CMD'][30002].param[7] = '''Reserved'''
MAV_CMD_WAYPOINT_USER_1 = 31000 # User defined waypoint item. Ground Station will show the Vehicle as
# flying through this item.
enums['MAV_CMD'][31000] = EnumEntry('MAV_CMD_WAYPOINT_USER_1', '''User defined waypoint item. Ground Station will show the Vehicle as flying through this item.''')
enums['MAV_CMD'][31000].param[1] = '''User defined'''
enums['MAV_CMD'][31000].param[2] = '''User defined'''
enums['MAV_CMD'][31000].param[3] = '''User defined'''
enums['MAV_CMD'][31000].param[4] = '''User defined'''
enums['MAV_CMD'][31000].param[5] = '''Latitude unscaled'''
enums['MAV_CMD'][31000].param[6] = '''Longitude unscaled'''
enums['MAV_CMD'][31000].param[7] = '''Altitude (MSL)'''
MAV_CMD_WAYPOINT_USER_2 = 31001 # User defined waypoint item. Ground Station will show the Vehicle as
# flying through this item.
enums['MAV_CMD'][31001] = EnumEntry('MAV_CMD_WAYPOINT_USER_2', '''User defined waypoint item. Ground Station will show the Vehicle as flying through this item.''')
enums['MAV_CMD'][31001].param[1] = '''User defined'''
enums['MAV_CMD'][31001].param[2] = '''User defined'''
enums['MAV_CMD'][31001].param[3] = '''User defined'''
enums['MAV_CMD'][31001].param[4] = '''User defined'''
enums['MAV_CMD'][31001].param[5] = '''Latitude unscaled'''
enums['MAV_CMD'][31001].param[6] = '''Longitude unscaled'''
enums['MAV_CMD'][31001].param[7] = '''Altitude (MSL)'''
MAV_CMD_WAYPOINT_USER_3 = 31002 # User defined waypoint item. Ground Station will show the Vehicle as
# flying through this item.
enums['MAV_CMD'][31002] = EnumEntry('MAV_CMD_WAYPOINT_USER_3', '''User defined waypoint item. Ground Station will show the Vehicle as flying through this item.''')
enums['MAV_CMD'][31002].param[1] = '''User defined'''
enums['MAV_CMD'][31002].param[2] = '''User defined'''
enums['MAV_CMD'][31002].param[3] = '''User defined'''
enums['MAV_CMD'][31002].param[4] = '''User defined'''
enums['MAV_CMD'][31002].param[5] = '''Latitude unscaled'''
enums['MAV_CMD'][31002].param[6] = '''Longitude unscaled'''
enums['MAV_CMD'][31002].param[7] = '''Altitude (MSL)'''
MAV_CMD_WAYPOINT_USER_4 = 31003 # User defined waypoint item. Ground Station will show the Vehicle as
# flying through this item.
enums['MAV_CMD'][31003] = EnumEntry('MAV_CMD_WAYPOINT_USER_4', '''User defined waypoint item. Ground Station will show the Vehicle as flying through this item.''')
enums['MAV_CMD'][31003].param[1] = '''User defined'''
enums['MAV_CMD'][31003].param[2] = '''User defined'''
enums['MAV_CMD'][31003].param[3] = '''User defined'''
enums['MAV_CMD'][31003].param[4] = '''User defined'''
enums['MAV_CMD'][31003].param[5] = '''Latitude unscaled'''
enums['MAV_CMD'][31003].param[6] = '''Longitude unscaled'''
enums['MAV_CMD'][31003].param[7] = '''Altitude (MSL)'''
MAV_CMD_WAYPOINT_USER_5 = 31004 # User defined waypoint item. Ground Station will show the Vehicle as
# flying through this item.
enums['MAV_CMD'][31004] = EnumEntry('MAV_CMD_WAYPOINT_USER_5', '''User defined waypoint item. Ground Station will show the Vehicle as flying through this item.''')
enums['MAV_CMD'][31004].param[1] = '''User defined'''
enums['MAV_CMD'][31004].param[2] = '''User defined'''
enums['MAV_CMD'][31004].param[3] = '''User defined'''
enums['MAV_CMD'][31004].param[4] = '''User defined'''
enums['MAV_CMD'][31004].param[5] = '''Latitude unscaled'''
enums['MAV_CMD'][31004].param[6] = '''Longitude unscaled'''
enums['MAV_CMD'][31004].param[7] = '''Altitude (MSL)'''
MAV_CMD_SPATIAL_USER_1 = 31005 # User defined spatial item. Ground Station will not show the Vehicle as
# flying through this item. Example: ROI item.
enums['MAV_CMD'][31005] = EnumEntry('MAV_CMD_SPATIAL_USER_1', '''User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item.''')
enums['MAV_CMD'][31005].param[1] = '''User defined'''
enums['MAV_CMD'][31005].param[2] = '''User defined'''
enums['MAV_CMD'][31005].param[3] = '''User defined'''
enums['MAV_CMD'][31005].param[4] = '''User defined'''
enums['MAV_CMD'][31005].param[5] = '''Latitude unscaled'''
enums['MAV_CMD'][31005].param[6] = '''Longitude unscaled'''
enums['MAV_CMD'][31005].param[7] = '''Altitude (MSL)'''
MAV_CMD_SPATIAL_USER_2 = 31006 # User defined spatial item. Ground Station will not show the Vehicle as
# flying through this item. Example: ROI item.
enums['MAV_CMD'][31006] = EnumEntry('MAV_CMD_SPATIAL_USER_2', '''User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item.''')
enums['MAV_CMD'][31006].param[1] = '''User defined'''
enums['MAV_CMD'][31006].param[2] = '''User defined'''
enums['MAV_CMD'][31006].param[3] = '''User defined'''
enums['MAV_CMD'][31006].param[4] = '''User defined'''
enums['MAV_CMD'][31006].param[5] = '''Latitude unscaled'''
enums['MAV_CMD'][31006].param[6] = '''Longitude unscaled'''
enums['MAV_CMD'][31006].param[7] = '''Altitude (MSL)'''
MAV_CMD_SPATIAL_USER_3 = 31007 # User defined spatial item. Ground Station will not show the Vehicle as
# flying through this item. Example: ROI item.
enums['MAV_CMD'][31007] = EnumEntry('MAV_CMD_SPATIAL_USER_3', '''User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item.''')
enums['MAV_CMD'][31007].param[1] = '''User defined'''
enums['MAV_CMD'][31007].param[2] = '''User defined'''
enums['MAV_CMD'][31007].param[3] = '''User defined'''
enums['MAV_CMD'][31007].param[4] = '''User defined'''
enums['MAV_CMD'][31007].param[5] = '''Latitude unscaled'''
enums['MAV_CMD'][31007].param[6] = '''Longitude unscaled'''
enums['MAV_CMD'][31007].param[7] = '''Altitude (MSL)'''
MAV_CMD_SPATIAL_USER_4 = 31008 # User defined spatial item. Ground Station will not show the Vehicle as
# flying through this item. Example: ROI item.
enums['MAV_CMD'][31008] = EnumEntry('MAV_CMD_SPATIAL_USER_4', '''User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item.''')
enums['MAV_CMD'][31008].param[1] = '''User defined'''
enums['MAV_CMD'][31008].param[2] = '''User defined'''
enums['MAV_CMD'][31008].param[3] = '''User defined'''
enums['MAV_CMD'][31008].param[4] = '''User defined'''
enums['MAV_CMD'][31008].param[5] = '''Latitude unscaled'''
enums['MAV_CMD'][31008].param[6] = '''Longitude unscaled'''
enums['MAV_CMD'][31008].param[7] = '''Altitude (MSL)'''
MAV_CMD_SPATIAL_USER_5 = 31009 # User defined spatial item. Ground Station will not show the Vehicle as
# flying through this item. Example: ROI item.
enums['MAV_CMD'][31009] = EnumEntry('MAV_CMD_SPATIAL_USER_5', '''User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item.''')
enums['MAV_CMD'][31009].param[1] = '''User defined'''
enums['MAV_CMD'][31009].param[2] = '''User defined'''
enums['MAV_CMD'][31009].param[3] = '''User defined'''
enums['MAV_CMD'][31009].param[4] = '''User defined'''
enums['MAV_CMD'][31009].param[5] = '''Latitude unscaled'''
enums['MAV_CMD'][31009].param[6] = '''Longitude unscaled'''
enums['MAV_CMD'][31009].param[7] = '''Altitude (MSL)'''
MAV_CMD_USER_1 = 31010 # User defined command. Ground Station will not show the Vehicle as
# flying through this item. Example:
# MAV_CMD_DO_SET_PARAMETER item.
enums['MAV_CMD'][31010] = EnumEntry('MAV_CMD_USER_1', '''User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item.''')
enums['MAV_CMD'][31010].param[1] = '''User defined'''
enums['MAV_CMD'][31010].param[2] = '''User defined'''
enums['MAV_CMD'][31010].param[3] = '''User defined'''
enums['MAV_CMD'][31010].param[4] = '''User defined'''
enums['MAV_CMD'][31010].param[5] = '''User defined'''
enums['MAV_CMD'][31010].param[6] = '''User defined'''
enums['MAV_CMD'][31010].param[7] = '''User defined'''
MAV_CMD_USER_2 = 31011 # User defined command. Ground Station will not show the Vehicle as
# flying through this item. Example:
# MAV_CMD_DO_SET_PARAMETER item.
enums['MAV_CMD'][31011] = EnumEntry('MAV_CMD_USER_2', '''User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item.''')
enums['MAV_CMD'][31011].param[1] = '''User defined'''
enums['MAV_CMD'][31011].param[2] = '''User defined'''
enums['MAV_CMD'][31011].param[3] = '''User defined'''
enums['MAV_CMD'][31011].param[4] = '''User defined'''
enums['MAV_CMD'][31011].param[5] = '''User defined'''
enums['MAV_CMD'][31011].param[6] = '''User defined'''
enums['MAV_CMD'][31011].param[7] = '''User defined'''
MAV_CMD_USER_3 = 31012 # User defined command. Ground Station will not show the Vehicle as
# flying through this item. Example:
# MAV_CMD_DO_SET_PARAMETER item.
enums['MAV_CMD'][31012] = EnumEntry('MAV_CMD_USER_3', '''User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item.''')
enums['MAV_CMD'][31012].param[1] = '''User defined'''
enums['MAV_CMD'][31012].param[2] = '''User defined'''
enums['MAV_CMD'][31012].param[3] = '''User defined'''
enums['MAV_CMD'][31012].param[4] = '''User defined'''
enums['MAV_CMD'][31012].param[5] = '''User defined'''
enums['MAV_CMD'][31012].param[6] = '''User defined'''
enums['MAV_CMD'][31012].param[7] = '''User defined'''
MAV_CMD_USER_4 = 31013 # User defined command. Ground Station will not show the Vehicle as
# flying through this item. Example:
# MAV_CMD_DO_SET_PARAMETER item.
enums['MAV_CMD'][31013] = EnumEntry('MAV_CMD_USER_4', '''User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item.''')
enums['MAV_CMD'][31013].param[1] = '''User defined'''
enums['MAV_CMD'][31013].param[2] = '''User defined'''
enums['MAV_CMD'][31013].param[3] = '''User defined'''
enums['MAV_CMD'][31013].param[4] = '''User defined'''
enums['MAV_CMD'][31013].param[5] = '''User defined'''
enums['MAV_CMD'][31013].param[6] = '''User defined'''
enums['MAV_CMD'][31013].param[7] = '''User defined'''
MAV_CMD_USER_5 = 31014 # User defined command. Ground Station will not show the Vehicle as
# flying through this item. Example:
# MAV_CMD_DO_SET_PARAMETER item.
enums['MAV_CMD'][31014] = EnumEntry('MAV_CMD_USER_5', '''User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item.''')
enums['MAV_CMD'][31014].param[1] = '''User defined'''
enums['MAV_CMD'][31014].param[2] = '''User defined'''
enums['MAV_CMD'][31014].param[3] = '''User defined'''
enums['MAV_CMD'][31014].param[4] = '''User defined'''
enums['MAV_CMD'][31014].param[5] = '''User defined'''
enums['MAV_CMD'][31014].param[6] = '''User defined'''
enums['MAV_CMD'][31014].param[7] = '''User defined'''
MAV_CMD_POWER_OFF_INITIATED = 42000 # A system wide power-off event has been initiated.
enums['MAV_CMD'][42000] = EnumEntry('MAV_CMD_POWER_OFF_INITIATED', '''A system wide power-off event has been initiated.''')
enums['MAV_CMD'][42000].param[1] = '''Empty.'''
enums['MAV_CMD'][42000].param[2] = '''Empty.'''
enums['MAV_CMD'][42000].param[3] = '''Empty.'''
enums['MAV_CMD'][42000].param[4] = '''Empty.'''
enums['MAV_CMD'][42000].param[5] = '''Empty.'''
enums['MAV_CMD'][42000].param[6] = '''Empty.'''
enums['MAV_CMD'][42000].param[7] = '''Empty.'''
MAV_CMD_SOLO_BTN_FLY_CLICK = 42001 # FLY button has been clicked.
enums['MAV_CMD'][42001] = EnumEntry('MAV_CMD_SOLO_BTN_FLY_CLICK', '''FLY button has been clicked.''')
enums['MAV_CMD'][42001].param[1] = '''Empty.'''
enums['MAV_CMD'][42001].param[2] = '''Empty.'''
enums['MAV_CMD'][42001].param[3] = '''Empty.'''
enums['MAV_CMD'][42001].param[4] = '''Empty.'''
enums['MAV_CMD'][42001].param[5] = '''Empty.'''
enums['MAV_CMD'][42001].param[6] = '''Empty.'''
enums['MAV_CMD'][42001].param[7] = '''Empty.'''
MAV_CMD_SOLO_BTN_FLY_HOLD = 42002 # FLY button has been held for 1.5 seconds.
enums['MAV_CMD'][42002] = EnumEntry('MAV_CMD_SOLO_BTN_FLY_HOLD', '''FLY button has been held for 1.5 seconds.''')
enums['MAV_CMD'][42002].param[1] = '''Takeoff altitude.'''
enums['MAV_CMD'][42002].param[2] = '''Empty.'''
enums['MAV_CMD'][42002].param[3] = '''Empty.'''
enums['MAV_CMD'][42002].param[4] = '''Empty.'''
enums['MAV_CMD'][42002].param[5] = '''Empty.'''
enums['MAV_CMD'][42002].param[6] = '''Empty.'''
enums['MAV_CMD'][42002].param[7] = '''Empty.'''
MAV_CMD_SOLO_BTN_PAUSE_CLICK = 42003 # PAUSE button has been clicked.
enums['MAV_CMD'][42003] = EnumEntry('MAV_CMD_SOLO_BTN_PAUSE_CLICK', '''PAUSE button has been clicked.''')
enums['MAV_CMD'][42003].param[1] = '''1 if Solo is in a shot mode, 0 otherwise.'''
enums['MAV_CMD'][42003].param[2] = '''Empty.'''
enums['MAV_CMD'][42003].param[3] = '''Empty.'''
enums['MAV_CMD'][42003].param[4] = '''Empty.'''
enums['MAV_CMD'][42003].param[5] = '''Empty.'''
enums['MAV_CMD'][42003].param[6] = '''Empty.'''
enums['MAV_CMD'][42003].param[7] = '''Empty.'''
MAV_CMD_FIXED_MAG_CAL = 42004 # Magnetometer calibration based on fixed position in earth
# field given by inclination, declination and
# intensity.
enums['MAV_CMD'][42004] = EnumEntry('MAV_CMD_FIXED_MAG_CAL', '''Magnetometer calibration based on fixed position
in earth field given by inclination, declination and intensity.''')
enums['MAV_CMD'][42004].param[1] = '''Magnetic declination.'''
enums['MAV_CMD'][42004].param[2] = '''Magnetic inclination.'''
enums['MAV_CMD'][42004].param[3] = '''Magnetic intensity.'''
enums['MAV_CMD'][42004].param[4] = '''Yaw.'''
enums['MAV_CMD'][42004].param[5] = '''Empty.'''
enums['MAV_CMD'][42004].param[6] = '''Empty.'''
enums['MAV_CMD'][42004].param[7] = '''Empty.'''
MAV_CMD_FIXED_MAG_CAL_FIELD = 42005 # Magnetometer calibration based on fixed expected field values.
enums['MAV_CMD'][42005] = EnumEntry('MAV_CMD_FIXED_MAG_CAL_FIELD', '''Magnetometer calibration based on fixed expected field values.''')
enums['MAV_CMD'][42005].param[1] = '''Field strength X.'''
enums['MAV_CMD'][42005].param[2] = '''Field strength Y.'''
enums['MAV_CMD'][42005].param[3] = '''Field strength Z.'''
enums['MAV_CMD'][42005].param[4] = '''Empty.'''
enums['MAV_CMD'][42005].param[5] = '''Empty.'''
enums['MAV_CMD'][42005].param[6] = '''Empty.'''
enums['MAV_CMD'][42005].param[7] = '''Empty.'''
MAV_CMD_FIXED_MAG_CAL_YAW = 42006 # Magnetometer calibration based on provided known yaw. This allows for
# fast calibration using WMM field tables in
# the vehicle, given only the known yaw of the
# vehicle. If Latitude and longitude are both
# zero then use the current vehicle location.
enums['MAV_CMD'][42006] = EnumEntry('MAV_CMD_FIXED_MAG_CAL_YAW', '''Magnetometer calibration based on provided known yaw. This allows for fast calibration using WMM field tables in the vehicle, given only the known yaw of the vehicle. If Latitude and longitude are both zero then use the current vehicle location.''')
enums['MAV_CMD'][42006].param[1] = '''Yaw of vehicle in earth frame.'''
enums['MAV_CMD'][42006].param[2] = '''CompassMask, 0 for all.'''
enums['MAV_CMD'][42006].param[3] = '''Latitude.'''
enums['MAV_CMD'][42006].param[4] = '''Longitude.'''
enums['MAV_CMD'][42006].param[5] = '''Empty.'''
enums['MAV_CMD'][42006].param[6] = '''Empty.'''
enums['MAV_CMD'][42006].param[7] = '''Empty.'''
MAV_CMD_DO_START_MAG_CAL = 42424 # Initiate a magnetometer calibration.
enums['MAV_CMD'][42424] = EnumEntry('MAV_CMD_DO_START_MAG_CAL', '''Initiate a magnetometer calibration.''')
enums['MAV_CMD'][42424].param[1] = '''Bitmask of magnetometers to calibrate. Use 0 to calibrate all sensors that can be started (sensors may not start if disabled, unhealthy, etc.). The command will NACK if calibration does not start for a sensor explicitly specified by the bitmask.'''
enums['MAV_CMD'][42424].param[2] = '''Automatically retry on failure (0=no retry, 1=retry).'''
enums['MAV_CMD'][42424].param[3] = '''Save without user input (0=require input, 1=autosave).'''
enums['MAV_CMD'][42424].param[4] = '''Delay.'''
enums['MAV_CMD'][42424].param[5] = '''Autoreboot (0=user reboot, 1=autoreboot).'''
enums['MAV_CMD'][42424].param[6] = '''Empty.'''
enums['MAV_CMD'][42424].param[7] = '''Empty.'''
MAV_CMD_DO_ACCEPT_MAG_CAL = 42425 # Accept a magnetometer calibration.
enums['MAV_CMD'][42425] = EnumEntry('MAV_CMD_DO_ACCEPT_MAG_CAL', '''Accept a magnetometer calibration.''')
enums['MAV_CMD'][42425].param[1] = '''Bitmask of magnetometers that calibration is accepted (0 means all).'''
enums['MAV_CMD'][42425].param[2] = '''Empty.'''
enums['MAV_CMD'][42425].param[3] = '''Empty.'''
enums['MAV_CMD'][42425].param[4] = '''Empty.'''
enums['MAV_CMD'][42425].param[5] = '''Empty.'''
enums['MAV_CMD'][42425].param[6] = '''Empty.'''
enums['MAV_CMD'][42425].param[7] = '''Empty.'''
MAV_CMD_DO_CANCEL_MAG_CAL = 42426 # Cancel a running magnetometer calibration.
enums['MAV_CMD'][42426] = EnumEntry('MAV_CMD_DO_CANCEL_MAG_CAL', '''Cancel a running magnetometer calibration.''')
enums['MAV_CMD'][42426].param[1] = '''Bitmask of magnetometers to cancel a running calibration (0 means all).'''
enums['MAV_CMD'][42426].param[2] = '''Empty.'''
enums['MAV_CMD'][42426].param[3] = '''Empty.'''
enums['MAV_CMD'][42426].param[4] = '''Empty.'''
enums['MAV_CMD'][42426].param[5] = '''Empty.'''
enums['MAV_CMD'][42426].param[6] = '''Empty.'''
enums['MAV_CMD'][42426].param[7] = '''Empty.'''
MAV_CMD_SET_FACTORY_TEST_MODE = 42427 # Command autopilot to get into factory test/diagnostic mode.
enums['MAV_CMD'][42427] = EnumEntry('MAV_CMD_SET_FACTORY_TEST_MODE', '''Command autopilot to get into factory test/diagnostic mode.''')
enums['MAV_CMD'][42427].param[1] = '''0: activate test mode, 1: exit test mode.'''
enums['MAV_CMD'][42427].param[2] = '''Empty.'''
enums['MAV_CMD'][42427].param[3] = '''Empty.'''
enums['MAV_CMD'][42427].param[4] = '''Empty.'''
enums['MAV_CMD'][42427].param[5] = '''Empty.'''
enums['MAV_CMD'][42427].param[6] = '''Empty.'''
enums['MAV_CMD'][42427].param[7] = '''Empty.'''
MAV_CMD_DO_SEND_BANNER = 42428 # Reply with the version banner.
enums['MAV_CMD'][42428] = EnumEntry('MAV_CMD_DO_SEND_BANNER', '''Reply with the version banner.''')
enums['MAV_CMD'][42428].param[1] = '''Empty.'''
enums['MAV_CMD'][42428].param[2] = '''Empty.'''
enums['MAV_CMD'][42428].param[3] = '''Empty.'''
enums['MAV_CMD'][42428].param[4] = '''Empty.'''
enums['MAV_CMD'][42428].param[5] = '''Empty.'''
enums['MAV_CMD'][42428].param[6] = '''Empty.'''
enums['MAV_CMD'][42428].param[7] = '''Empty.'''
MAV_CMD_ACCELCAL_VEHICLE_POS = 42429 # Used when doing accelerometer calibration. When sent to the GCS tells
# it what position to put the vehicle in. When
# sent to the vehicle says what position the
# vehicle is in.
enums['MAV_CMD'][42429] = EnumEntry('MAV_CMD_ACCELCAL_VEHICLE_POS', '''Used when doing accelerometer calibration. When sent to the GCS tells it what position to put the vehicle in. When sent to the vehicle says what position the vehicle is in.''')
enums['MAV_CMD'][42429].param[1] = '''Position.'''
enums['MAV_CMD'][42429].param[2] = '''Empty.'''
enums['MAV_CMD'][42429].param[3] = '''Empty.'''
enums['MAV_CMD'][42429].param[4] = '''Empty.'''
enums['MAV_CMD'][42429].param[5] = '''Empty.'''
enums['MAV_CMD'][42429].param[6] = '''Empty.'''
enums['MAV_CMD'][42429].param[7] = '''Empty.'''
MAV_CMD_GIMBAL_RESET = 42501 # Causes the gimbal to reset and boot as if it was just powered on.
enums['MAV_CMD'][42501] = EnumEntry('MAV_CMD_GIMBAL_RESET', '''Causes the gimbal to reset and boot as if it was just powered on.''')
enums['MAV_CMD'][42501].param[1] = '''Empty.'''
enums['MAV_CMD'][42501].param[2] = '''Empty.'''
enums['MAV_CMD'][42501].param[3] = '''Empty.'''
enums['MAV_CMD'][42501].param[4] = '''Empty.'''
enums['MAV_CMD'][42501].param[5] = '''Empty.'''
enums['MAV_CMD'][42501].param[6] = '''Empty.'''
enums['MAV_CMD'][42501].param[7] = '''Empty.'''
MAV_CMD_GIMBAL_AXIS_CALIBRATION_STATUS = 42502 # Reports progress and success or failure of gimbal axis calibration
# procedure.
enums['MAV_CMD'][42502] = EnumEntry('MAV_CMD_GIMBAL_AXIS_CALIBRATION_STATUS', '''Reports progress and success or failure of gimbal axis calibration procedure.''')
enums['MAV_CMD'][42502].param[1] = '''Gimbal axis we're reporting calibration progress for.'''
enums['MAV_CMD'][42502].param[2] = '''Current calibration progress for this axis.'''
enums['MAV_CMD'][42502].param[3] = '''Status of the calibration.'''
enums['MAV_CMD'][42502].param[4] = '''Empty.'''
enums['MAV_CMD'][42502].param[5] = '''Empty.'''
enums['MAV_CMD'][42502].param[6] = '''Empty.'''
enums['MAV_CMD'][42502].param[7] = '''Empty.'''
MAV_CMD_GIMBAL_REQUEST_AXIS_CALIBRATION = 42503 # Starts commutation calibration on the gimbal.
enums['MAV_CMD'][42503] = EnumEntry('MAV_CMD_GIMBAL_REQUEST_AXIS_CALIBRATION', '''Starts commutation calibration on the gimbal.''')
enums['MAV_CMD'][42503].param[1] = '''Empty.'''
enums['MAV_CMD'][42503].param[2] = '''Empty.'''
enums['MAV_CMD'][42503].param[3] = '''Empty.'''
enums['MAV_CMD'][42503].param[4] = '''Empty.'''
enums['MAV_CMD'][42503].param[5] = '''Empty.'''
enums['MAV_CMD'][42503].param[6] = '''Empty.'''
enums['MAV_CMD'][42503].param[7] = '''Empty.'''
MAV_CMD_GIMBAL_FULL_RESET = 42505 # Erases gimbal application and parameters.
enums['MAV_CMD'][42505] = EnumEntry('MAV_CMD_GIMBAL_FULL_RESET', '''Erases gimbal application and parameters.''')
enums['MAV_CMD'][42505].param[1] = '''Magic number.'''
enums['MAV_CMD'][42505].param[2] = '''Magic number.'''
enums['MAV_CMD'][42505].param[3] = '''Magic number.'''
enums['MAV_CMD'][42505].param[4] = '''Magic number.'''
enums['MAV_CMD'][42505].param[5] = '''Magic number.'''
enums['MAV_CMD'][42505].param[6] = '''Magic number.'''
enums['MAV_CMD'][42505].param[7] = '''Magic number.'''
MAV_CMD_DO_WINCH = 42600 # Command to operate winch.
enums['MAV_CMD'][42600] = EnumEntry('MAV_CMD_DO_WINCH', '''Command to operate winch.''')
enums['MAV_CMD'][42600].param[1] = '''Winch instance number (0 for the default winch, otherwise a number from 1 to max number of winches on the vehicle).'''
enums['MAV_CMD'][42600].param[2] = '''Action.'''
enums['MAV_CMD'][42600].param[3] = '''Release length (cable distance to unwind, negative numbers to wind in cable).'''
enums['MAV_CMD'][42600].param[4] = '''Release rate.'''
enums['MAV_CMD'][42600].param[5] = '''Empty.'''
enums['MAV_CMD'][42600].param[6] = '''Empty.'''
enums['MAV_CMD'][42600].param[7] = '''Empty.'''
MAV_CMD_FLASH_BOOTLOADER = 42650 # Update the bootloader
enums['MAV_CMD'][42650] = EnumEntry('MAV_CMD_FLASH_BOOTLOADER', '''Update the bootloader''')
enums['MAV_CMD'][42650].param[1] = '''Empty'''
enums['MAV_CMD'][42650].param[2] = '''Empty'''
enums['MAV_CMD'][42650].param[3] = '''Empty'''
enums['MAV_CMD'][42650].param[4] = '''Empty'''
enums['MAV_CMD'][42650].param[5] = '''Magic number - set to 290876 to actually flash'''
enums['MAV_CMD'][42650].param[6] = '''Empty'''
enums['MAV_CMD'][42650].param[7] = '''Empty'''
MAV_CMD_BATTERY_RESET = 42651 # Reset battery capacity for batteries that accumulate consumed battery
# via integration.
enums['MAV_CMD'][42651] = EnumEntry('MAV_CMD_BATTERY_RESET', '''Reset battery capacity for batteries that accumulate consumed battery via integration.''')
enums['MAV_CMD'][42651].param[1] = '''Bitmask of batteries to reset. Least significant bit is for the first battery.'''
enums['MAV_CMD'][42651].param[2] = '''Battery percentage remaining to set.'''
enums['MAV_CMD'][42651].param[3] = '''Reserved (default:0)'''
enums['MAV_CMD'][42651].param[4] = '''Reserved (default:0)'''
enums['MAV_CMD'][42651].param[5] = '''Reserved (default:0)'''
enums['MAV_CMD'][42651].param[6] = '''Reserved (default:0)'''
enums['MAV_CMD'][42651].param[7] = '''Reserved (default:0)'''
MAV_CMD_DEBUG_TRAP = 42700 # Issue a trap signal to the autopilot process, presumably to enter the
# debugger.
enums['MAV_CMD'][42700] = EnumEntry('MAV_CMD_DEBUG_TRAP', '''Issue a trap signal to the autopilot process, presumably to enter the debugger.''')
enums['MAV_CMD'][42700].param[1] = '''Magic number - set to 32451 to actually trap.'''
enums['MAV_CMD'][42700].param[2] = '''Empty.'''
enums['MAV_CMD'][42700].param[3] = '''Empty.'''
enums['MAV_CMD'][42700].param[4] = '''Empty.'''
enums['MAV_CMD'][42700].param[5] = '''Empty.'''
enums['MAV_CMD'][42700].param[6] = '''Empty.'''
enums['MAV_CMD'][42700].param[7] = '''Empty.'''
MAV_CMD_SCRIPTING = 42701 # Control onboard scripting.
enums['MAV_CMD'][42701] = EnumEntry('MAV_CMD_SCRIPTING', '''Control onboard scripting.''')
enums['MAV_CMD'][42701].param[1] = '''Scripting command to execute'''
enums['MAV_CMD'][42701].param[2] = '''Reserved (default:0)'''
enums['MAV_CMD'][42701].param[3] = '''Reserved (default:0)'''
enums['MAV_CMD'][42701].param[4] = '''Reserved (default:0)'''
enums['MAV_CMD'][42701].param[5] = '''Reserved (default:0)'''
enums['MAV_CMD'][42701].param[6] = '''Reserved (default:0)'''
enums['MAV_CMD'][42701].param[7] = '''Reserved (default:0)'''
MAV_CMD_GUIDED_CHANGE_SPEED = 43000 # Change flight speed at a given rate. This slews the vehicle at a
# controllable rate between it's previous
# speed and the new one. (affects GUIDED only.
# Outside GUIDED, aircraft ignores these
# commands. Designed for onboard companion-
# computer command-and-control, not normally
# operator/GCS control.)
enums['MAV_CMD'][43000] = EnumEntry('MAV_CMD_GUIDED_CHANGE_SPEED', '''Change flight speed at a given rate. This slews the vehicle at a controllable rate between it's previous speed and the new one. (affects GUIDED only. Outside GUIDED, aircraft ignores these commands. Designed for onboard companion-computer command-and-control, not normally operator/GCS control.)''')
enums['MAV_CMD'][43000].param[1] = '''Airspeed or groundspeed.'''
enums['MAV_CMD'][43000].param[2] = '''Target Speed'''
enums['MAV_CMD'][43000].param[3] = '''Acceleration rate, 0 to take effect instantly'''
enums['MAV_CMD'][43000].param[4] = '''Empty'''
enums['MAV_CMD'][43000].param[5] = '''Empty'''
enums['MAV_CMD'][43000].param[6] = '''Empty'''
enums['MAV_CMD'][43000].param[7] = '''Empty'''
MAV_CMD_GUIDED_CHANGE_ALTITUDE = 43001 # Change target altitude at a given rate. This slews the vehicle at a
# controllable rate between it's previous
# altitude and the new one. (affects GUIDED
# only. Outside GUIDED, aircraft ignores these
# commands. Designed for onboard companion-
# computer command-and-control, not normally
# operator/GCS control.)
enums['MAV_CMD'][43001] = EnumEntry('MAV_CMD_GUIDED_CHANGE_ALTITUDE', '''Change target altitude at a given rate. This slews the vehicle at a controllable rate between it's previous altitude and the new one. (affects GUIDED only. Outside GUIDED, aircraft ignores these commands. Designed for onboard companion-computer command-and-control, not normally operator/GCS control.)''')
enums['MAV_CMD'][43001].param[1] = '''Empty'''
enums['MAV_CMD'][43001].param[2] = '''Empty'''
enums['MAV_CMD'][43001].param[3] = '''Rate of change, toward new altitude. 0 for maximum rate change. Positive numbers only, as negative numbers will not converge on the new target alt.'''
enums['MAV_CMD'][43001].param[4] = '''Empty'''
enums['MAV_CMD'][43001].param[5] = '''Empty'''
enums['MAV_CMD'][43001].param[6] = '''Empty'''
enums['MAV_CMD'][43001].param[7] = '''Target Altitude'''
MAV_CMD_GUIDED_CHANGE_HEADING = 43002 # Change to target heading at a given rate, overriding previous
# heading/s. This slews the vehicle at a
# controllable rate between it's previous
# heading and the new one. (affects GUIDED
# only. Exiting GUIDED returns aircraft to
# normal behaviour defined elsewhere. Designed
# for onboard companion-computer command-and-
# control, not normally operator/GCS control.)
enums['MAV_CMD'][43002] = EnumEntry('MAV_CMD_GUIDED_CHANGE_HEADING', '''Change to target heading at a given rate, overriding previous heading/s. This slews the vehicle at a controllable rate between it's previous heading and the new one. (affects GUIDED only. Exiting GUIDED returns aircraft to normal behaviour defined elsewhere. Designed for onboard companion-computer command-and-control, not normally operator/GCS control.)''')
enums['MAV_CMD'][43002].param[1] = '''course-over-ground or raw vehicle heading.'''
enums['MAV_CMD'][43002].param[2] = '''Target heading.'''
enums['MAV_CMD'][43002].param[3] = '''Maximum centripetal accelearation, ie rate of change, toward new heading.'''
enums['MAV_CMD'][43002].param[4] = '''Empty'''
enums['MAV_CMD'][43002].param[5] = '''Empty'''
enums['MAV_CMD'][43002].param[6] = '''Empty'''
enums['MAV_CMD'][43002].param[7] = '''Empty'''
MAV_CMD_ENUM_END = 43003 #
enums['MAV_CMD'][43003] = EnumEntry('MAV_CMD_ENUM_END', '''''')
# SCRIPTING_CMD
enums['SCRIPTING_CMD'] = {}
SCRIPTING_CMD_REPL_START = 0 # Start a REPL session.
enums['SCRIPTING_CMD'][0] = EnumEntry('SCRIPTING_CMD_REPL_START', '''Start a REPL session.''')
SCRIPTING_CMD_REPL_STOP = 1 # End a REPL session.
enums['SCRIPTING_CMD'][1] = EnumEntry('SCRIPTING_CMD_REPL_STOP', '''End a REPL session.''')
SCRIPTING_CMD_ENUM_END = 2 #
enums['SCRIPTING_CMD'][2] = EnumEntry('SCRIPTING_CMD_ENUM_END', '''''')
# LIMITS_STATE
enums['LIMITS_STATE'] = {}
LIMITS_INIT = 0 # Pre-initialization.
enums['LIMITS_STATE'][0] = EnumEntry('LIMITS_INIT', '''Pre-initialization.''')
LIMITS_DISABLED = 1 # Disabled.
enums['LIMITS_STATE'][1] = EnumEntry('LIMITS_DISABLED', '''Disabled.''')
LIMITS_ENABLED = 2 # Checking limits.
enums['LIMITS_STATE'][2] = EnumEntry('LIMITS_ENABLED', '''Checking limits.''')
LIMITS_TRIGGERED = 3 # A limit has been breached.
enums['LIMITS_STATE'][3] = EnumEntry('LIMITS_TRIGGERED', '''A limit has been breached.''')
LIMITS_RECOVERING = 4 # Taking action e.g. Return/RTL.
enums['LIMITS_STATE'][4] = EnumEntry('LIMITS_RECOVERING', '''Taking action e.g. Return/RTL.''')
LIMITS_RECOVERED = 5 # We're no longer in breach of a limit.
enums['LIMITS_STATE'][5] = EnumEntry('LIMITS_RECOVERED', '''We're no longer in breach of a limit.''')
LIMITS_STATE_ENUM_END = 6 #
enums['LIMITS_STATE'][6] = EnumEntry('LIMITS_STATE_ENUM_END', '''''')
# LIMIT_MODULE
enums['LIMIT_MODULE'] = {}
LIMIT_GPSLOCK = 1 # Pre-initialization.
enums['LIMIT_MODULE'][1] = EnumEntry('LIMIT_GPSLOCK', '''Pre-initialization.''')
LIMIT_GEOFENCE = 2 # Disabled.
enums['LIMIT_MODULE'][2] = EnumEntry('LIMIT_GEOFENCE', '''Disabled.''')
LIMIT_ALTITUDE = 4 # Checking limits.
enums['LIMIT_MODULE'][4] = EnumEntry('LIMIT_ALTITUDE', '''Checking limits.''')
LIMIT_MODULE_ENUM_END = 5 #
enums['LIMIT_MODULE'][5] = EnumEntry('LIMIT_MODULE_ENUM_END', '''''')
# RALLY_FLAGS
enums['RALLY_FLAGS'] = {}
FAVORABLE_WIND = 1 # Flag set when requiring favorable winds for landing.
enums['RALLY_FLAGS'][1] = EnumEntry('FAVORABLE_WIND', '''Flag set when requiring favorable winds for landing.''')
LAND_IMMEDIATELY = 2 # Flag set when plane is to immediately descend to break altitude and
# land without GCS intervention. Flag not set
# when plane is to loiter at Rally point until
# commanded to land.
enums['RALLY_FLAGS'][2] = EnumEntry('LAND_IMMEDIATELY', '''Flag set when plane is to immediately descend to break altitude and land without GCS intervention. Flag not set when plane is to loiter at Rally point until commanded to land.''')
RALLY_FLAGS_ENUM_END = 3 #
enums['RALLY_FLAGS'][3] = EnumEntry('RALLY_FLAGS_ENUM_END', '''''')
# GRIPPER_ACTIONS
enums['GRIPPER_ACTIONS'] = {}
GRIPPER_ACTION_RELEASE = 0 # Gripper release cargo.
enums['GRIPPER_ACTIONS'][0] = EnumEntry('GRIPPER_ACTION_RELEASE', '''Gripper release cargo.''')
GRIPPER_ACTION_GRAB = 1 # Gripper grab onto cargo.
enums['GRIPPER_ACTIONS'][1] = EnumEntry('GRIPPER_ACTION_GRAB', '''Gripper grab onto cargo.''')
GRIPPER_ACTIONS_ENUM_END = 2 #
enums['GRIPPER_ACTIONS'][2] = EnumEntry('GRIPPER_ACTIONS_ENUM_END', '''''')
# WINCH_ACTIONS
enums['WINCH_ACTIONS'] = {}
WINCH_RELAXED = 0 # Relax winch.
enums['WINCH_ACTIONS'][0] = EnumEntry('WINCH_RELAXED', '''Relax winch.''')
WINCH_RELATIVE_LENGTH_CONTROL = 1 # Winch unwinds or winds specified length of cable optionally using
# specified rate.
enums['WINCH_ACTIONS'][1] = EnumEntry('WINCH_RELATIVE_LENGTH_CONTROL', '''Winch unwinds or winds specified length of cable optionally using specified rate.''')
WINCH_RATE_CONTROL = 2 # Winch unwinds or winds cable at specified rate in meters/seconds.
enums['WINCH_ACTIONS'][2] = EnumEntry('WINCH_RATE_CONTROL', '''Winch unwinds or winds cable at specified rate in meters/seconds.''')
WINCH_ACTIONS_ENUM_END = 3 #
enums['WINCH_ACTIONS'][3] = EnumEntry('WINCH_ACTIONS_ENUM_END', '''''')
# CAMERA_STATUS_TYPES
enums['CAMERA_STATUS_TYPES'] = {}
CAMERA_STATUS_TYPE_HEARTBEAT = 0 # Camera heartbeat, announce camera component ID at 1Hz.
enums['CAMERA_STATUS_TYPES'][0] = EnumEntry('CAMERA_STATUS_TYPE_HEARTBEAT', '''Camera heartbeat, announce camera component ID at 1Hz.''')
CAMERA_STATUS_TYPE_TRIGGER = 1 # Camera image triggered.
enums['CAMERA_STATUS_TYPES'][1] = EnumEntry('CAMERA_STATUS_TYPE_TRIGGER', '''Camera image triggered.''')
CAMERA_STATUS_TYPE_DISCONNECT = 2 # Camera connection lost.
enums['CAMERA_STATUS_TYPES'][2] = EnumEntry('CAMERA_STATUS_TYPE_DISCONNECT', '''Camera connection lost.''')
CAMERA_STATUS_TYPE_ERROR = 3 # Camera unknown error.
enums['CAMERA_STATUS_TYPES'][3] = EnumEntry('CAMERA_STATUS_TYPE_ERROR', '''Camera unknown error.''')
CAMERA_STATUS_TYPE_LOWBATT = 4 # Camera battery low. Parameter p1 shows reported voltage.
enums['CAMERA_STATUS_TYPES'][4] = EnumEntry('CAMERA_STATUS_TYPE_LOWBATT', '''Camera battery low. Parameter p1 shows reported voltage.''')
CAMERA_STATUS_TYPE_LOWSTORE = 5 # Camera storage low. Parameter p1 shows reported shots remaining.
enums['CAMERA_STATUS_TYPES'][5] = EnumEntry('CAMERA_STATUS_TYPE_LOWSTORE', '''Camera storage low. Parameter p1 shows reported shots remaining.''')
CAMERA_STATUS_TYPE_LOWSTOREV = 6 # Camera storage low. Parameter p1 shows reported video minutes
# remaining.
enums['CAMERA_STATUS_TYPES'][6] = EnumEntry('CAMERA_STATUS_TYPE_LOWSTOREV', '''Camera storage low. Parameter p1 shows reported video minutes remaining.''')
CAMERA_STATUS_TYPES_ENUM_END = 7 #
enums['CAMERA_STATUS_TYPES'][7] = EnumEntry('CAMERA_STATUS_TYPES_ENUM_END', '''''')
# CAMERA_FEEDBACK_FLAGS
enums['CAMERA_FEEDBACK_FLAGS'] = {}
CAMERA_FEEDBACK_PHOTO = 0 # Shooting photos, not video.
enums['CAMERA_FEEDBACK_FLAGS'][0] = EnumEntry('CAMERA_FEEDBACK_PHOTO', '''Shooting photos, not video.''')
CAMERA_FEEDBACK_VIDEO = 1 # Shooting video, not stills.
enums['CAMERA_FEEDBACK_FLAGS'][1] = EnumEntry('CAMERA_FEEDBACK_VIDEO', '''Shooting video, not stills.''')
CAMERA_FEEDBACK_BADEXPOSURE = 2 # Unable to achieve requested exposure (e.g. shutter speed too low).
enums['CAMERA_FEEDBACK_FLAGS'][2] = EnumEntry('CAMERA_FEEDBACK_BADEXPOSURE', '''Unable to achieve requested exposure (e.g. shutter speed too low).''')
CAMERA_FEEDBACK_CLOSEDLOOP = 3 # Closed loop feedback from camera, we know for sure it has successfully
# taken a picture.
enums['CAMERA_FEEDBACK_FLAGS'][3] = EnumEntry('CAMERA_FEEDBACK_CLOSEDLOOP', '''Closed loop feedback from camera, we know for sure it has successfully taken a picture.''')
CAMERA_FEEDBACK_OPENLOOP = 4 # Open loop camera, an image trigger has been requested but we can't
# know for sure it has successfully taken a
# picture.
enums['CAMERA_FEEDBACK_FLAGS'][4] = EnumEntry('CAMERA_FEEDBACK_OPENLOOP', '''Open loop camera, an image trigger has been requested but we can't know for sure it has successfully taken a picture.''')
CAMERA_FEEDBACK_FLAGS_ENUM_END = 5 #
enums['CAMERA_FEEDBACK_FLAGS'][5] = EnumEntry('CAMERA_FEEDBACK_FLAGS_ENUM_END', '''''')
# MAV_MODE_GIMBAL
enums['MAV_MODE_GIMBAL'] = {}
MAV_MODE_GIMBAL_UNINITIALIZED = 0 # Gimbal is powered on but has not started initializing yet.
enums['MAV_MODE_GIMBAL'][0] = EnumEntry('MAV_MODE_GIMBAL_UNINITIALIZED', '''Gimbal is powered on but has not started initializing yet.''')
MAV_MODE_GIMBAL_CALIBRATING_PITCH = 1 # Gimbal is currently running calibration on the pitch axis.
enums['MAV_MODE_GIMBAL'][1] = EnumEntry('MAV_MODE_GIMBAL_CALIBRATING_PITCH', '''Gimbal is currently running calibration on the pitch axis.''')
MAV_MODE_GIMBAL_CALIBRATING_ROLL = 2 # Gimbal is currently running calibration on the roll axis.
enums['MAV_MODE_GIMBAL'][2] = EnumEntry('MAV_MODE_GIMBAL_CALIBRATING_ROLL', '''Gimbal is currently running calibration on the roll axis.''')
MAV_MODE_GIMBAL_CALIBRATING_YAW = 3 # Gimbal is currently running calibration on the yaw axis.
enums['MAV_MODE_GIMBAL'][3] = EnumEntry('MAV_MODE_GIMBAL_CALIBRATING_YAW', '''Gimbal is currently running calibration on the yaw axis.''')
MAV_MODE_GIMBAL_INITIALIZED = 4 # Gimbal has finished calibrating and initializing, but is relaxed
# pending reception of first rate command from
# copter.
enums['MAV_MODE_GIMBAL'][4] = EnumEntry('MAV_MODE_GIMBAL_INITIALIZED', '''Gimbal has finished calibrating and initializing, but is relaxed pending reception of first rate command from copter.''')
MAV_MODE_GIMBAL_ACTIVE = 5 # Gimbal is actively stabilizing.
enums['MAV_MODE_GIMBAL'][5] = EnumEntry('MAV_MODE_GIMBAL_ACTIVE', '''Gimbal is actively stabilizing.''')
MAV_MODE_GIMBAL_RATE_CMD_TIMEOUT = 6 # Gimbal is relaxed because it missed more than 10 expected rate command
# messages in a row. Gimbal will move back to
# active mode when it receives a new rate
# command.
enums['MAV_MODE_GIMBAL'][6] = EnumEntry('MAV_MODE_GIMBAL_RATE_CMD_TIMEOUT', '''Gimbal is relaxed because it missed more than 10 expected rate command messages in a row. Gimbal will move back to active mode when it receives a new rate command.''')
MAV_MODE_GIMBAL_ENUM_END = 7 #
enums['MAV_MODE_GIMBAL'][7] = EnumEntry('MAV_MODE_GIMBAL_ENUM_END', '''''')
# GIMBAL_AXIS
enums['GIMBAL_AXIS'] = {}
GIMBAL_AXIS_YAW = 0 # Gimbal yaw axis.
enums['GIMBAL_AXIS'][0] = EnumEntry('GIMBAL_AXIS_YAW', '''Gimbal yaw axis.''')
GIMBAL_AXIS_PITCH = 1 # Gimbal pitch axis.
enums['GIMBAL_AXIS'][1] = EnumEntry('GIMBAL_AXIS_PITCH', '''Gimbal pitch axis.''')
GIMBAL_AXIS_ROLL = 2 # Gimbal roll axis.
enums['GIMBAL_AXIS'][2] = EnumEntry('GIMBAL_AXIS_ROLL', '''Gimbal roll axis.''')
GIMBAL_AXIS_ENUM_END = 3 #
enums['GIMBAL_AXIS'][3] = EnumEntry('GIMBAL_AXIS_ENUM_END', '''''')
# GIMBAL_AXIS_CALIBRATION_STATUS
enums['GIMBAL_AXIS_CALIBRATION_STATUS'] = {}
GIMBAL_AXIS_CALIBRATION_STATUS_IN_PROGRESS = 0 # Axis calibration is in progress.
enums['GIMBAL_AXIS_CALIBRATION_STATUS'][0] = EnumEntry('GIMBAL_AXIS_CALIBRATION_STATUS_IN_PROGRESS', '''Axis calibration is in progress.''')
GIMBAL_AXIS_CALIBRATION_STATUS_SUCCEEDED = 1 # Axis calibration succeeded.
enums['GIMBAL_AXIS_CALIBRATION_STATUS'][1] = EnumEntry('GIMBAL_AXIS_CALIBRATION_STATUS_SUCCEEDED', '''Axis calibration succeeded.''')
GIMBAL_AXIS_CALIBRATION_STATUS_FAILED = 2 # Axis calibration failed.
enums['GIMBAL_AXIS_CALIBRATION_STATUS'][2] = EnumEntry('GIMBAL_AXIS_CALIBRATION_STATUS_FAILED', '''Axis calibration failed.''')
GIMBAL_AXIS_CALIBRATION_STATUS_ENUM_END = 3 #
enums['GIMBAL_AXIS_CALIBRATION_STATUS'][3] = EnumEntry('GIMBAL_AXIS_CALIBRATION_STATUS_ENUM_END', '''''')
# GIMBAL_AXIS_CALIBRATION_REQUIRED
enums['GIMBAL_AXIS_CALIBRATION_REQUIRED'] = {}
GIMBAL_AXIS_CALIBRATION_REQUIRED_UNKNOWN = 0 # Whether or not this axis requires calibration is unknown at this time.
enums['GIMBAL_AXIS_CALIBRATION_REQUIRED'][0] = EnumEntry('GIMBAL_AXIS_CALIBRATION_REQUIRED_UNKNOWN', '''Whether or not this axis requires calibration is unknown at this time.''')
GIMBAL_AXIS_CALIBRATION_REQUIRED_TRUE = 1 # This axis requires calibration.
enums['GIMBAL_AXIS_CALIBRATION_REQUIRED'][1] = EnumEntry('GIMBAL_AXIS_CALIBRATION_REQUIRED_TRUE', '''This axis requires calibration.''')
GIMBAL_AXIS_CALIBRATION_REQUIRED_FALSE = 2 # This axis does not require calibration.
enums['GIMBAL_AXIS_CALIBRATION_REQUIRED'][2] = EnumEntry('GIMBAL_AXIS_CALIBRATION_REQUIRED_FALSE', '''This axis does not require calibration.''')
GIMBAL_AXIS_CALIBRATION_REQUIRED_ENUM_END = 3 #
enums['GIMBAL_AXIS_CALIBRATION_REQUIRED'][3] = EnumEntry('GIMBAL_AXIS_CALIBRATION_REQUIRED_ENUM_END', '''''')
# GOPRO_HEARTBEAT_STATUS
enums['GOPRO_HEARTBEAT_STATUS'] = {}
GOPRO_HEARTBEAT_STATUS_DISCONNECTED = 0 # No GoPro connected.
enums['GOPRO_HEARTBEAT_STATUS'][0] = EnumEntry('GOPRO_HEARTBEAT_STATUS_DISCONNECTED', '''No GoPro connected.''')
GOPRO_HEARTBEAT_STATUS_INCOMPATIBLE = 1 # The detected GoPro is not HeroBus compatible.
enums['GOPRO_HEARTBEAT_STATUS'][1] = EnumEntry('GOPRO_HEARTBEAT_STATUS_INCOMPATIBLE', '''The detected GoPro is not HeroBus compatible.''')
GOPRO_HEARTBEAT_STATUS_CONNECTED = 2 # A HeroBus compatible GoPro is connected.
enums['GOPRO_HEARTBEAT_STATUS'][2] = EnumEntry('GOPRO_HEARTBEAT_STATUS_CONNECTED', '''A HeroBus compatible GoPro is connected.''')
GOPRO_HEARTBEAT_STATUS_ERROR = 3 # An unrecoverable error was encountered with the connected GoPro, it
# may require a power cycle.
enums['GOPRO_HEARTBEAT_STATUS'][3] = EnumEntry('GOPRO_HEARTBEAT_STATUS_ERROR', '''An unrecoverable error was encountered with the connected GoPro, it may require a power cycle.''')
GOPRO_HEARTBEAT_STATUS_ENUM_END = 4 #
enums['GOPRO_HEARTBEAT_STATUS'][4] = EnumEntry('GOPRO_HEARTBEAT_STATUS_ENUM_END', '''''')
# GOPRO_HEARTBEAT_FLAGS
enums['GOPRO_HEARTBEAT_FLAGS'] = {}
GOPRO_FLAG_RECORDING = 1 # GoPro is currently recording.
enums['GOPRO_HEARTBEAT_FLAGS'][1] = EnumEntry('GOPRO_FLAG_RECORDING', '''GoPro is currently recording.''')
GOPRO_HEARTBEAT_FLAGS_ENUM_END = 2 #
enums['GOPRO_HEARTBEAT_FLAGS'][2] = EnumEntry('GOPRO_HEARTBEAT_FLAGS_ENUM_END', '''''')
# GOPRO_REQUEST_STATUS
enums['GOPRO_REQUEST_STATUS'] = {}
GOPRO_REQUEST_SUCCESS = 0 # The write message with ID indicated succeeded.
enums['GOPRO_REQUEST_STATUS'][0] = EnumEntry('GOPRO_REQUEST_SUCCESS', '''The write message with ID indicated succeeded.''')
GOPRO_REQUEST_FAILED = 1 # The write message with ID indicated failed.
enums['GOPRO_REQUEST_STATUS'][1] = EnumEntry('GOPRO_REQUEST_FAILED', '''The write message with ID indicated failed.''')
GOPRO_REQUEST_STATUS_ENUM_END = 2 #
enums['GOPRO_REQUEST_STATUS'][2] = EnumEntry('GOPRO_REQUEST_STATUS_ENUM_END', '''''')
# GOPRO_COMMAND
enums['GOPRO_COMMAND'] = {}
GOPRO_COMMAND_POWER = 0 # (Get/Set).
enums['GOPRO_COMMAND'][0] = EnumEntry('GOPRO_COMMAND_POWER', '''(Get/Set).''')
GOPRO_COMMAND_CAPTURE_MODE = 1 # (Get/Set).
enums['GOPRO_COMMAND'][1] = EnumEntry('GOPRO_COMMAND_CAPTURE_MODE', '''(Get/Set).''')
GOPRO_COMMAND_SHUTTER = 2 # (___/Set).
enums['GOPRO_COMMAND'][2] = EnumEntry('GOPRO_COMMAND_SHUTTER', '''(___/Set).''')
GOPRO_COMMAND_BATTERY = 3 # (Get/___).
enums['GOPRO_COMMAND'][3] = EnumEntry('GOPRO_COMMAND_BATTERY', '''(Get/___).''')
GOPRO_COMMAND_MODEL = 4 # (Get/___).
enums['GOPRO_COMMAND'][4] = EnumEntry('GOPRO_COMMAND_MODEL', '''(Get/___).''')
GOPRO_COMMAND_VIDEO_SETTINGS = 5 # (Get/Set).
enums['GOPRO_COMMAND'][5] = EnumEntry('GOPRO_COMMAND_VIDEO_SETTINGS', '''(Get/Set).''')
GOPRO_COMMAND_LOW_LIGHT = 6 # (Get/Set).
enums['GOPRO_COMMAND'][6] = EnumEntry('GOPRO_COMMAND_LOW_LIGHT', '''(Get/Set).''')
GOPRO_COMMAND_PHOTO_RESOLUTION = 7 # (Get/Set).
enums['GOPRO_COMMAND'][7] = EnumEntry('GOPRO_COMMAND_PHOTO_RESOLUTION', '''(Get/Set).''')
GOPRO_COMMAND_PHOTO_BURST_RATE = 8 # (Get/Set).
enums['GOPRO_COMMAND'][8] = EnumEntry('GOPRO_COMMAND_PHOTO_BURST_RATE', '''(Get/Set).''')
GOPRO_COMMAND_PROTUNE = 9 # (Get/Set).
enums['GOPRO_COMMAND'][9] = EnumEntry('GOPRO_COMMAND_PROTUNE', '''(Get/Set).''')
GOPRO_COMMAND_PROTUNE_WHITE_BALANCE = 10 # (Get/Set) Hero 3+ Only.
enums['GOPRO_COMMAND'][10] = EnumEntry('GOPRO_COMMAND_PROTUNE_WHITE_BALANCE', '''(Get/Set) Hero 3+ Only.''')
GOPRO_COMMAND_PROTUNE_COLOUR = 11 # (Get/Set) Hero 3+ Only.
enums['GOPRO_COMMAND'][11] = EnumEntry('GOPRO_COMMAND_PROTUNE_COLOUR', '''(Get/Set) Hero 3+ Only.''')
GOPRO_COMMAND_PROTUNE_GAIN = 12 # (Get/Set) Hero 3+ Only.
enums['GOPRO_COMMAND'][12] = EnumEntry('GOPRO_COMMAND_PROTUNE_GAIN', '''(Get/Set) Hero 3+ Only.''')
GOPRO_COMMAND_PROTUNE_SHARPNESS = 13 # (Get/Set) Hero 3+ Only.
enums['GOPRO_COMMAND'][13] = EnumEntry('GOPRO_COMMAND_PROTUNE_SHARPNESS', '''(Get/Set) Hero 3+ Only.''')
GOPRO_COMMAND_PROTUNE_EXPOSURE = 14 # (Get/Set) Hero 3+ Only.
enums['GOPRO_COMMAND'][14] = EnumEntry('GOPRO_COMMAND_PROTUNE_EXPOSURE', '''(Get/Set) Hero 3+ Only.''')
GOPRO_COMMAND_TIME = 15 # (Get/Set).
enums['GOPRO_COMMAND'][15] = EnumEntry('GOPRO_COMMAND_TIME', '''(Get/Set).''')
GOPRO_COMMAND_CHARGING = 16 # (Get/Set).
enums['GOPRO_COMMAND'][16] = EnumEntry('GOPRO_COMMAND_CHARGING', '''(Get/Set).''')
GOPRO_COMMAND_ENUM_END = 17 #
enums['GOPRO_COMMAND'][17] = EnumEntry('GOPRO_COMMAND_ENUM_END', '''''')
# GOPRO_CAPTURE_MODE
enums['GOPRO_CAPTURE_MODE'] = {}
GOPRO_CAPTURE_MODE_VIDEO = 0 # Video mode.
enums['GOPRO_CAPTURE_MODE'][0] = EnumEntry('GOPRO_CAPTURE_MODE_VIDEO', '''Video mode.''')
GOPRO_CAPTURE_MODE_PHOTO = 1 # Photo mode.
enums['GOPRO_CAPTURE_MODE'][1] = EnumEntry('GOPRO_CAPTURE_MODE_PHOTO', '''Photo mode.''')
GOPRO_CAPTURE_MODE_BURST = 2 # Burst mode, Hero 3+ only.
enums['GOPRO_CAPTURE_MODE'][2] = EnumEntry('GOPRO_CAPTURE_MODE_BURST', '''Burst mode, Hero 3+ only.''')
GOPRO_CAPTURE_MODE_TIME_LAPSE = 3 # Time lapse mode, Hero 3+ only.
enums['GOPRO_CAPTURE_MODE'][3] = EnumEntry('GOPRO_CAPTURE_MODE_TIME_LAPSE', '''Time lapse mode, Hero 3+ only.''')
GOPRO_CAPTURE_MODE_MULTI_SHOT = 4 # Multi shot mode, Hero 4 only.
enums['GOPRO_CAPTURE_MODE'][4] = EnumEntry('GOPRO_CAPTURE_MODE_MULTI_SHOT', '''Multi shot mode, Hero 4 only.''')
GOPRO_CAPTURE_MODE_PLAYBACK = 5 # Playback mode, Hero 4 only, silver only except when LCD or HDMI is
# connected to black.
enums['GOPRO_CAPTURE_MODE'][5] = EnumEntry('GOPRO_CAPTURE_MODE_PLAYBACK', '''Playback mode, Hero 4 only, silver only except when LCD or HDMI is connected to black.''')
GOPRO_CAPTURE_MODE_SETUP = 6 # Playback mode, Hero 4 only.
enums['GOPRO_CAPTURE_MODE'][6] = EnumEntry('GOPRO_CAPTURE_MODE_SETUP', '''Playback mode, Hero 4 only.''')
GOPRO_CAPTURE_MODE_UNKNOWN = 255 # Mode not yet known.
enums['GOPRO_CAPTURE_MODE'][255] = EnumEntry('GOPRO_CAPTURE_MODE_UNKNOWN', '''Mode not yet known.''')
GOPRO_CAPTURE_MODE_ENUM_END = 256 #
enums['GOPRO_CAPTURE_MODE'][256] = EnumEntry('GOPRO_CAPTURE_MODE_ENUM_END', '''''')
# GOPRO_RESOLUTION
enums['GOPRO_RESOLUTION'] = {}
GOPRO_RESOLUTION_480p = 0 # 848 x 480 (480p).
enums['GOPRO_RESOLUTION'][0] = EnumEntry('GOPRO_RESOLUTION_480p', '''848 x 480 (480p).''')
GOPRO_RESOLUTION_720p = 1 # 1280 x 720 (720p).
enums['GOPRO_RESOLUTION'][1] = EnumEntry('GOPRO_RESOLUTION_720p', '''1280 x 720 (720p).''')
GOPRO_RESOLUTION_960p = 2 # 1280 x 960 (960p).
enums['GOPRO_RESOLUTION'][2] = EnumEntry('GOPRO_RESOLUTION_960p', '''1280 x 960 (960p).''')
GOPRO_RESOLUTION_1080p = 3 # 1920 x 1080 (1080p).
enums['GOPRO_RESOLUTION'][3] = EnumEntry('GOPRO_RESOLUTION_1080p', '''1920 x 1080 (1080p).''')
GOPRO_RESOLUTION_1440p = 4 # 1920 x 1440 (1440p).
enums['GOPRO_RESOLUTION'][4] = EnumEntry('GOPRO_RESOLUTION_1440p', '''1920 x 1440 (1440p).''')
GOPRO_RESOLUTION_2_7k_17_9 = 5 # 2704 x 1440 (2.7k-17:9).
enums['GOPRO_RESOLUTION'][5] = EnumEntry('GOPRO_RESOLUTION_2_7k_17_9', '''2704 x 1440 (2.7k-17:9).''')
GOPRO_RESOLUTION_2_7k_16_9 = 6 # 2704 x 1524 (2.7k-16:9).
enums['GOPRO_RESOLUTION'][6] = EnumEntry('GOPRO_RESOLUTION_2_7k_16_9', '''2704 x 1524 (2.7k-16:9).''')
GOPRO_RESOLUTION_2_7k_4_3 = 7 # 2704 x 2028 (2.7k-4:3).
enums['GOPRO_RESOLUTION'][7] = EnumEntry('GOPRO_RESOLUTION_2_7k_4_3', '''2704 x 2028 (2.7k-4:3).''')
GOPRO_RESOLUTION_4k_16_9 = 8 # 3840 x 2160 (4k-16:9).
enums['GOPRO_RESOLUTION'][8] = EnumEntry('GOPRO_RESOLUTION_4k_16_9', '''3840 x 2160 (4k-16:9).''')
GOPRO_RESOLUTION_4k_17_9 = 9 # 4096 x 2160 (4k-17:9).
enums['GOPRO_RESOLUTION'][9] = EnumEntry('GOPRO_RESOLUTION_4k_17_9', '''4096 x 2160 (4k-17:9).''')
GOPRO_RESOLUTION_720p_SUPERVIEW = 10 # 1280 x 720 (720p-SuperView).
enums['GOPRO_RESOLUTION'][10] = EnumEntry('GOPRO_RESOLUTION_720p_SUPERVIEW', '''1280 x 720 (720p-SuperView).''')
GOPRO_RESOLUTION_1080p_SUPERVIEW = 11 # 1920 x 1080 (1080p-SuperView).
enums['GOPRO_RESOLUTION'][11] = EnumEntry('GOPRO_RESOLUTION_1080p_SUPERVIEW', '''1920 x 1080 (1080p-SuperView).''')
GOPRO_RESOLUTION_2_7k_SUPERVIEW = 12 # 2704 x 1520 (2.7k-SuperView).
enums['GOPRO_RESOLUTION'][12] = EnumEntry('GOPRO_RESOLUTION_2_7k_SUPERVIEW', '''2704 x 1520 (2.7k-SuperView).''')
GOPRO_RESOLUTION_4k_SUPERVIEW = 13 # 3840 x 2160 (4k-SuperView).
enums['GOPRO_RESOLUTION'][13] = EnumEntry('GOPRO_RESOLUTION_4k_SUPERVIEW', '''3840 x 2160 (4k-SuperView).''')
GOPRO_RESOLUTION_ENUM_END = 14 #
enums['GOPRO_RESOLUTION'][14] = EnumEntry('GOPRO_RESOLUTION_ENUM_END', '''''')
# GOPRO_FRAME_RATE
enums['GOPRO_FRAME_RATE'] = {}
GOPRO_FRAME_RATE_12 = 0 # 12 FPS.
enums['GOPRO_FRAME_RATE'][0] = EnumEntry('GOPRO_FRAME_RATE_12', '''12 FPS.''')
GOPRO_FRAME_RATE_15 = 1 # 15 FPS.
enums['GOPRO_FRAME_RATE'][1] = EnumEntry('GOPRO_FRAME_RATE_15', '''15 FPS.''')
GOPRO_FRAME_RATE_24 = 2 # 24 FPS.
enums['GOPRO_FRAME_RATE'][2] = EnumEntry('GOPRO_FRAME_RATE_24', '''24 FPS.''')
GOPRO_FRAME_RATE_25 = 3 # 25 FPS.
enums['GOPRO_FRAME_RATE'][3] = EnumEntry('GOPRO_FRAME_RATE_25', '''25 FPS.''')
GOPRO_FRAME_RATE_30 = 4 # 30 FPS.
enums['GOPRO_FRAME_RATE'][4] = EnumEntry('GOPRO_FRAME_RATE_30', '''30 FPS.''')
GOPRO_FRAME_RATE_48 = 5 # 48 FPS.
enums['GOPRO_FRAME_RATE'][5] = EnumEntry('GOPRO_FRAME_RATE_48', '''48 FPS.''')
GOPRO_FRAME_RATE_50 = 6 # 50 FPS.
enums['GOPRO_FRAME_RATE'][6] = EnumEntry('GOPRO_FRAME_RATE_50', '''50 FPS.''')
GOPRO_FRAME_RATE_60 = 7 # 60 FPS.
enums['GOPRO_FRAME_RATE'][7] = EnumEntry('GOPRO_FRAME_RATE_60', '''60 FPS.''')
GOPRO_FRAME_RATE_80 = 8 # 80 FPS.
enums['GOPRO_FRAME_RATE'][8] = EnumEntry('GOPRO_FRAME_RATE_80', '''80 FPS.''')
GOPRO_FRAME_RATE_90 = 9 # 90 FPS.
enums['GOPRO_FRAME_RATE'][9] = EnumEntry('GOPRO_FRAME_RATE_90', '''90 FPS.''')
GOPRO_FRAME_RATE_100 = 10 # 100 FPS.
enums['GOPRO_FRAME_RATE'][10] = EnumEntry('GOPRO_FRAME_RATE_100', '''100 FPS.''')
GOPRO_FRAME_RATE_120 = 11 # 120 FPS.
enums['GOPRO_FRAME_RATE'][11] = EnumEntry('GOPRO_FRAME_RATE_120', '''120 FPS.''')
GOPRO_FRAME_RATE_240 = 12 # 240 FPS.
enums['GOPRO_FRAME_RATE'][12] = EnumEntry('GOPRO_FRAME_RATE_240', '''240 FPS.''')
GOPRO_FRAME_RATE_12_5 = 13 # 12.5 FPS.
enums['GOPRO_FRAME_RATE'][13] = EnumEntry('GOPRO_FRAME_RATE_12_5', '''12.5 FPS.''')
GOPRO_FRAME_RATE_ENUM_END = 14 #
enums['GOPRO_FRAME_RATE'][14] = EnumEntry('GOPRO_FRAME_RATE_ENUM_END', '''''')
# GOPRO_FIELD_OF_VIEW
enums['GOPRO_FIELD_OF_VIEW'] = {}
GOPRO_FIELD_OF_VIEW_WIDE = 0 # 0x00: Wide.
enums['GOPRO_FIELD_OF_VIEW'][0] = EnumEntry('GOPRO_FIELD_OF_VIEW_WIDE', '''0x00: Wide.''')
GOPRO_FIELD_OF_VIEW_MEDIUM = 1 # 0x01: Medium.
enums['GOPRO_FIELD_OF_VIEW'][1] = EnumEntry('GOPRO_FIELD_OF_VIEW_MEDIUM', '''0x01: Medium.''')
GOPRO_FIELD_OF_VIEW_NARROW = 2 # 0x02: Narrow.
enums['GOPRO_FIELD_OF_VIEW'][2] = EnumEntry('GOPRO_FIELD_OF_VIEW_NARROW', '''0x02: Narrow.''')
GOPRO_FIELD_OF_VIEW_ENUM_END = 3 #
enums['GOPRO_FIELD_OF_VIEW'][3] = EnumEntry('GOPRO_FIELD_OF_VIEW_ENUM_END', '''''')
# GOPRO_VIDEO_SETTINGS_FLAGS
enums['GOPRO_VIDEO_SETTINGS_FLAGS'] = {}
GOPRO_VIDEO_SETTINGS_TV_MODE = 1 # 0=NTSC, 1=PAL.
enums['GOPRO_VIDEO_SETTINGS_FLAGS'][1] = EnumEntry('GOPRO_VIDEO_SETTINGS_TV_MODE', '''0=NTSC, 1=PAL.''')
GOPRO_VIDEO_SETTINGS_FLAGS_ENUM_END = 2 #
enums['GOPRO_VIDEO_SETTINGS_FLAGS'][2] = EnumEntry('GOPRO_VIDEO_SETTINGS_FLAGS_ENUM_END', '''''')
# GOPRO_PHOTO_RESOLUTION
enums['GOPRO_PHOTO_RESOLUTION'] = {}
GOPRO_PHOTO_RESOLUTION_5MP_MEDIUM = 0 # 5MP Medium.
enums['GOPRO_PHOTO_RESOLUTION'][0] = EnumEntry('GOPRO_PHOTO_RESOLUTION_5MP_MEDIUM', '''5MP Medium.''')
GOPRO_PHOTO_RESOLUTION_7MP_MEDIUM = 1 # 7MP Medium.
enums['GOPRO_PHOTO_RESOLUTION'][1] = EnumEntry('GOPRO_PHOTO_RESOLUTION_7MP_MEDIUM', '''7MP Medium.''')
GOPRO_PHOTO_RESOLUTION_7MP_WIDE = 2 # 7MP Wide.
enums['GOPRO_PHOTO_RESOLUTION'][2] = EnumEntry('GOPRO_PHOTO_RESOLUTION_7MP_WIDE', '''7MP Wide.''')
GOPRO_PHOTO_RESOLUTION_10MP_WIDE = 3 # 10MP Wide.
enums['GOPRO_PHOTO_RESOLUTION'][3] = EnumEntry('GOPRO_PHOTO_RESOLUTION_10MP_WIDE', '''10MP Wide.''')
GOPRO_PHOTO_RESOLUTION_12MP_WIDE = 4 # 12MP Wide.
enums['GOPRO_PHOTO_RESOLUTION'][4] = EnumEntry('GOPRO_PHOTO_RESOLUTION_12MP_WIDE', '''12MP Wide.''')
GOPRO_PHOTO_RESOLUTION_ENUM_END = 5 #
enums['GOPRO_PHOTO_RESOLUTION'][5] = EnumEntry('GOPRO_PHOTO_RESOLUTION_ENUM_END', '''''')
# GOPRO_PROTUNE_WHITE_BALANCE
enums['GOPRO_PROTUNE_WHITE_BALANCE'] = {}
GOPRO_PROTUNE_WHITE_BALANCE_AUTO = 0 # Auto.
enums['GOPRO_PROTUNE_WHITE_BALANCE'][0] = EnumEntry('GOPRO_PROTUNE_WHITE_BALANCE_AUTO', '''Auto.''')
GOPRO_PROTUNE_WHITE_BALANCE_3000K = 1 # 3000K.
enums['GOPRO_PROTUNE_WHITE_BALANCE'][1] = EnumEntry('GOPRO_PROTUNE_WHITE_BALANCE_3000K', '''3000K.''')
GOPRO_PROTUNE_WHITE_BALANCE_5500K = 2 # 5500K.
enums['GOPRO_PROTUNE_WHITE_BALANCE'][2] = EnumEntry('GOPRO_PROTUNE_WHITE_BALANCE_5500K', '''5500K.''')
GOPRO_PROTUNE_WHITE_BALANCE_6500K = 3 # 6500K.
enums['GOPRO_PROTUNE_WHITE_BALANCE'][3] = EnumEntry('GOPRO_PROTUNE_WHITE_BALANCE_6500K', '''6500K.''')
GOPRO_PROTUNE_WHITE_BALANCE_RAW = 4 # Camera Raw.
enums['GOPRO_PROTUNE_WHITE_BALANCE'][4] = EnumEntry('GOPRO_PROTUNE_WHITE_BALANCE_RAW', '''Camera Raw.''')
GOPRO_PROTUNE_WHITE_BALANCE_ENUM_END = 5 #
enums['GOPRO_PROTUNE_WHITE_BALANCE'][5] = EnumEntry('GOPRO_PROTUNE_WHITE_BALANCE_ENUM_END', '''''')
# GOPRO_PROTUNE_COLOUR
enums['GOPRO_PROTUNE_COLOUR'] = {}
GOPRO_PROTUNE_COLOUR_STANDARD = 0 # Auto.
enums['GOPRO_PROTUNE_COLOUR'][0] = EnumEntry('GOPRO_PROTUNE_COLOUR_STANDARD', '''Auto.''')
GOPRO_PROTUNE_COLOUR_NEUTRAL = 1 # Neutral.
enums['GOPRO_PROTUNE_COLOUR'][1] = EnumEntry('GOPRO_PROTUNE_COLOUR_NEUTRAL', '''Neutral.''')
GOPRO_PROTUNE_COLOUR_ENUM_END = 2 #
enums['GOPRO_PROTUNE_COLOUR'][2] = EnumEntry('GOPRO_PROTUNE_COLOUR_ENUM_END', '''''')
# GOPRO_PROTUNE_GAIN
enums['GOPRO_PROTUNE_GAIN'] = {}
GOPRO_PROTUNE_GAIN_400 = 0 # ISO 400.
enums['GOPRO_PROTUNE_GAIN'][0] = EnumEntry('GOPRO_PROTUNE_GAIN_400', '''ISO 400.''')
GOPRO_PROTUNE_GAIN_800 = 1 # ISO 800 (Only Hero 4).
enums['GOPRO_PROTUNE_GAIN'][1] = EnumEntry('GOPRO_PROTUNE_GAIN_800', '''ISO 800 (Only Hero 4).''')
GOPRO_PROTUNE_GAIN_1600 = 2 # ISO 1600.
enums['GOPRO_PROTUNE_GAIN'][2] = EnumEntry('GOPRO_PROTUNE_GAIN_1600', '''ISO 1600.''')
GOPRO_PROTUNE_GAIN_3200 = 3 # ISO 3200 (Only Hero 4).
enums['GOPRO_PROTUNE_GAIN'][3] = EnumEntry('GOPRO_PROTUNE_GAIN_3200', '''ISO 3200 (Only Hero 4).''')
GOPRO_PROTUNE_GAIN_6400 = 4 # ISO 6400.
enums['GOPRO_PROTUNE_GAIN'][4] = EnumEntry('GOPRO_PROTUNE_GAIN_6400', '''ISO 6400.''')
GOPRO_PROTUNE_GAIN_ENUM_END = 5 #
enums['GOPRO_PROTUNE_GAIN'][5] = EnumEntry('GOPRO_PROTUNE_GAIN_ENUM_END', '''''')
# GOPRO_PROTUNE_SHARPNESS
enums['GOPRO_PROTUNE_SHARPNESS'] = {}
GOPRO_PROTUNE_SHARPNESS_LOW = 0 # Low Sharpness.
enums['GOPRO_PROTUNE_SHARPNESS'][0] = EnumEntry('GOPRO_PROTUNE_SHARPNESS_LOW', '''Low Sharpness.''')
GOPRO_PROTUNE_SHARPNESS_MEDIUM = 1 # Medium Sharpness.
enums['GOPRO_PROTUNE_SHARPNESS'][1] = EnumEntry('GOPRO_PROTUNE_SHARPNESS_MEDIUM', '''Medium Sharpness.''')
GOPRO_PROTUNE_SHARPNESS_HIGH = 2 # High Sharpness.
enums['GOPRO_PROTUNE_SHARPNESS'][2] = EnumEntry('GOPRO_PROTUNE_SHARPNESS_HIGH', '''High Sharpness.''')
GOPRO_PROTUNE_SHARPNESS_ENUM_END = 3 #
enums['GOPRO_PROTUNE_SHARPNESS'][3] = EnumEntry('GOPRO_PROTUNE_SHARPNESS_ENUM_END', '''''')
# GOPRO_PROTUNE_EXPOSURE
enums['GOPRO_PROTUNE_EXPOSURE'] = {}
GOPRO_PROTUNE_EXPOSURE_NEG_5_0 = 0 # -5.0 EV (Hero 3+ Only).
enums['GOPRO_PROTUNE_EXPOSURE'][0] = EnumEntry('GOPRO_PROTUNE_EXPOSURE_NEG_5_0', '''-5.0 EV (Hero 3+ Only).''')
GOPRO_PROTUNE_EXPOSURE_NEG_4_5 = 1 # -4.5 EV (Hero 3+ Only).
enums['GOPRO_PROTUNE_EXPOSURE'][1] = EnumEntry('GOPRO_PROTUNE_EXPOSURE_NEG_4_5', '''-4.5 EV (Hero 3+ Only).''')
GOPRO_PROTUNE_EXPOSURE_NEG_4_0 = 2 # -4.0 EV (Hero 3+ Only).
enums['GOPRO_PROTUNE_EXPOSURE'][2] = EnumEntry('GOPRO_PROTUNE_EXPOSURE_NEG_4_0', '''-4.0 EV (Hero 3+ Only).''')
GOPRO_PROTUNE_EXPOSURE_NEG_3_5 = 3 # -3.5 EV (Hero 3+ Only).
enums['GOPRO_PROTUNE_EXPOSURE'][3] = EnumEntry('GOPRO_PROTUNE_EXPOSURE_NEG_3_5', '''-3.5 EV (Hero 3+ Only).''')
GOPRO_PROTUNE_EXPOSURE_NEG_3_0 = 4 # -3.0 EV (Hero 3+ Only).
enums['GOPRO_PROTUNE_EXPOSURE'][4] = EnumEntry('GOPRO_PROTUNE_EXPOSURE_NEG_3_0', '''-3.0 EV (Hero 3+ Only).''')
GOPRO_PROTUNE_EXPOSURE_NEG_2_5 = 5 # -2.5 EV (Hero 3+ Only).
enums['GOPRO_PROTUNE_EXPOSURE'][5] = EnumEntry('GOPRO_PROTUNE_EXPOSURE_NEG_2_5', '''-2.5 EV (Hero 3+ Only).''')
GOPRO_PROTUNE_EXPOSURE_NEG_2_0 = 6 # -2.0 EV.
enums['GOPRO_PROTUNE_EXPOSURE'][6] = EnumEntry('GOPRO_PROTUNE_EXPOSURE_NEG_2_0', '''-2.0 EV.''')
GOPRO_PROTUNE_EXPOSURE_NEG_1_5 = 7 # -1.5 EV.
enums['GOPRO_PROTUNE_EXPOSURE'][7] = EnumEntry('GOPRO_PROTUNE_EXPOSURE_NEG_1_5', '''-1.5 EV.''')
GOPRO_PROTUNE_EXPOSURE_NEG_1_0 = 8 # -1.0 EV.
enums['GOPRO_PROTUNE_EXPOSURE'][8] = EnumEntry('GOPRO_PROTUNE_EXPOSURE_NEG_1_0', '''-1.0 EV.''')
GOPRO_PROTUNE_EXPOSURE_NEG_0_5 = 9 # -0.5 EV.
enums['GOPRO_PROTUNE_EXPOSURE'][9] = EnumEntry('GOPRO_PROTUNE_EXPOSURE_NEG_0_5', '''-0.5 EV.''')
GOPRO_PROTUNE_EXPOSURE_ZERO = 10 # 0.0 EV.
enums['GOPRO_PROTUNE_EXPOSURE'][10] = EnumEntry('GOPRO_PROTUNE_EXPOSURE_ZERO', '''0.0 EV.''')
GOPRO_PROTUNE_EXPOSURE_POS_0_5 = 11 # +0.5 EV.
enums['GOPRO_PROTUNE_EXPOSURE'][11] = EnumEntry('GOPRO_PROTUNE_EXPOSURE_POS_0_5', '''+0.5 EV.''')
GOPRO_PROTUNE_EXPOSURE_POS_1_0 = 12 # +1.0 EV.
enums['GOPRO_PROTUNE_EXPOSURE'][12] = EnumEntry('GOPRO_PROTUNE_EXPOSURE_POS_1_0', '''+1.0 EV.''')
GOPRO_PROTUNE_EXPOSURE_POS_1_5 = 13 # +1.5 EV.
enums['GOPRO_PROTUNE_EXPOSURE'][13] = EnumEntry('GOPRO_PROTUNE_EXPOSURE_POS_1_5', '''+1.5 EV.''')
GOPRO_PROTUNE_EXPOSURE_POS_2_0 = 14 # +2.0 EV.
enums['GOPRO_PROTUNE_EXPOSURE'][14] = EnumEntry('GOPRO_PROTUNE_EXPOSURE_POS_2_0', '''+2.0 EV.''')
GOPRO_PROTUNE_EXPOSURE_POS_2_5 = 15 # +2.5 EV (Hero 3+ Only).
enums['GOPRO_PROTUNE_EXPOSURE'][15] = EnumEntry('GOPRO_PROTUNE_EXPOSURE_POS_2_5', '''+2.5 EV (Hero 3+ Only).''')
GOPRO_PROTUNE_EXPOSURE_POS_3_0 = 16 # +3.0 EV (Hero 3+ Only).
enums['GOPRO_PROTUNE_EXPOSURE'][16] = EnumEntry('GOPRO_PROTUNE_EXPOSURE_POS_3_0', '''+3.0 EV (Hero 3+ Only).''')
GOPRO_PROTUNE_EXPOSURE_POS_3_5 = 17 # +3.5 EV (Hero 3+ Only).
enums['GOPRO_PROTUNE_EXPOSURE'][17] = EnumEntry('GOPRO_PROTUNE_EXPOSURE_POS_3_5', '''+3.5 EV (Hero 3+ Only).''')
GOPRO_PROTUNE_EXPOSURE_POS_4_0 = 18 # +4.0 EV (Hero 3+ Only).
enums['GOPRO_PROTUNE_EXPOSURE'][18] = EnumEntry('GOPRO_PROTUNE_EXPOSURE_POS_4_0', '''+4.0 EV (Hero 3+ Only).''')
GOPRO_PROTUNE_EXPOSURE_POS_4_5 = 19 # +4.5 EV (Hero 3+ Only).
enums['GOPRO_PROTUNE_EXPOSURE'][19] = EnumEntry('GOPRO_PROTUNE_EXPOSURE_POS_4_5', '''+4.5 EV (Hero 3+ Only).''')
GOPRO_PROTUNE_EXPOSURE_POS_5_0 = 20 # +5.0 EV (Hero 3+ Only).
enums['GOPRO_PROTUNE_EXPOSURE'][20] = EnumEntry('GOPRO_PROTUNE_EXPOSURE_POS_5_0', '''+5.0 EV (Hero 3+ Only).''')
GOPRO_PROTUNE_EXPOSURE_ENUM_END = 21 #
enums['GOPRO_PROTUNE_EXPOSURE'][21] = EnumEntry('GOPRO_PROTUNE_EXPOSURE_ENUM_END', '''''')
# GOPRO_CHARGING
enums['GOPRO_CHARGING'] = {}
GOPRO_CHARGING_DISABLED = 0 # Charging disabled.
enums['GOPRO_CHARGING'][0] = EnumEntry('GOPRO_CHARGING_DISABLED', '''Charging disabled.''')
GOPRO_CHARGING_ENABLED = 1 # Charging enabled.
enums['GOPRO_CHARGING'][1] = EnumEntry('GOPRO_CHARGING_ENABLED', '''Charging enabled.''')
GOPRO_CHARGING_ENUM_END = 2 #
enums['GOPRO_CHARGING'][2] = EnumEntry('GOPRO_CHARGING_ENUM_END', '''''')
# GOPRO_MODEL
enums['GOPRO_MODEL'] = {}
GOPRO_MODEL_UNKNOWN = 0 # Unknown gopro model.
enums['GOPRO_MODEL'][0] = EnumEntry('GOPRO_MODEL_UNKNOWN', '''Unknown gopro model.''')
GOPRO_MODEL_HERO_3_PLUS_SILVER = 1 # Hero 3+ Silver (HeroBus not supported by GoPro).
enums['GOPRO_MODEL'][1] = EnumEntry('GOPRO_MODEL_HERO_3_PLUS_SILVER', '''Hero 3+ Silver (HeroBus not supported by GoPro).''')
GOPRO_MODEL_HERO_3_PLUS_BLACK = 2 # Hero 3+ Black.
enums['GOPRO_MODEL'][2] = EnumEntry('GOPRO_MODEL_HERO_3_PLUS_BLACK', '''Hero 3+ Black.''')
GOPRO_MODEL_HERO_4_SILVER = 3 # Hero 4 Silver.
enums['GOPRO_MODEL'][3] = EnumEntry('GOPRO_MODEL_HERO_4_SILVER', '''Hero 4 Silver.''')
GOPRO_MODEL_HERO_4_BLACK = 4 # Hero 4 Black.
enums['GOPRO_MODEL'][4] = EnumEntry('GOPRO_MODEL_HERO_4_BLACK', '''Hero 4 Black.''')
GOPRO_MODEL_ENUM_END = 5 #
enums['GOPRO_MODEL'][5] = EnumEntry('GOPRO_MODEL_ENUM_END', '''''')
# GOPRO_BURST_RATE
enums['GOPRO_BURST_RATE'] = {}
GOPRO_BURST_RATE_3_IN_1_SECOND = 0 # 3 Shots / 1 Second.
enums['GOPRO_BURST_RATE'][0] = EnumEntry('GOPRO_BURST_RATE_3_IN_1_SECOND', '''3 Shots / 1 Second.''')
GOPRO_BURST_RATE_5_IN_1_SECOND = 1 # 5 Shots / 1 Second.
enums['GOPRO_BURST_RATE'][1] = EnumEntry('GOPRO_BURST_RATE_5_IN_1_SECOND', '''5 Shots / 1 Second.''')
GOPRO_BURST_RATE_10_IN_1_SECOND = 2 # 10 Shots / 1 Second.
enums['GOPRO_BURST_RATE'][2] = EnumEntry('GOPRO_BURST_RATE_10_IN_1_SECOND', '''10 Shots / 1 Second.''')
GOPRO_BURST_RATE_10_IN_2_SECOND = 3 # 10 Shots / 2 Second.
enums['GOPRO_BURST_RATE'][3] = EnumEntry('GOPRO_BURST_RATE_10_IN_2_SECOND', '''10 Shots / 2 Second.''')
GOPRO_BURST_RATE_10_IN_3_SECOND = 4 # 10 Shots / 3 Second (Hero 4 Only).
enums['GOPRO_BURST_RATE'][4] = EnumEntry('GOPRO_BURST_RATE_10_IN_3_SECOND', '''10 Shots / 3 Second (Hero 4 Only).''')
GOPRO_BURST_RATE_30_IN_1_SECOND = 5 # 30 Shots / 1 Second.
enums['GOPRO_BURST_RATE'][5] = EnumEntry('GOPRO_BURST_RATE_30_IN_1_SECOND', '''30 Shots / 1 Second.''')
GOPRO_BURST_RATE_30_IN_2_SECOND = 6 # 30 Shots / 2 Second.
enums['GOPRO_BURST_RATE'][6] = EnumEntry('GOPRO_BURST_RATE_30_IN_2_SECOND', '''30 Shots / 2 Second.''')
GOPRO_BURST_RATE_30_IN_3_SECOND = 7 # 30 Shots / 3 Second.
enums['GOPRO_BURST_RATE'][7] = EnumEntry('GOPRO_BURST_RATE_30_IN_3_SECOND', '''30 Shots / 3 Second.''')
GOPRO_BURST_RATE_30_IN_6_SECOND = 8 # 30 Shots / 6 Second.
enums['GOPRO_BURST_RATE'][8] = EnumEntry('GOPRO_BURST_RATE_30_IN_6_SECOND', '''30 Shots / 6 Second.''')
GOPRO_BURST_RATE_ENUM_END = 9 #
enums['GOPRO_BURST_RATE'][9] = EnumEntry('GOPRO_BURST_RATE_ENUM_END', '''''')
# LED_CONTROL_PATTERN
enums['LED_CONTROL_PATTERN'] = {}
LED_CONTROL_PATTERN_OFF = 0 # LED patterns off (return control to regular vehicle control).
enums['LED_CONTROL_PATTERN'][0] = EnumEntry('LED_CONTROL_PATTERN_OFF', '''LED patterns off (return control to regular vehicle control).''')
LED_CONTROL_PATTERN_FIRMWAREUPDATE = 1 # LEDs show pattern during firmware update.
enums['LED_CONTROL_PATTERN'][1] = EnumEntry('LED_CONTROL_PATTERN_FIRMWAREUPDATE', '''LEDs show pattern during firmware update.''')
LED_CONTROL_PATTERN_CUSTOM = 255 # Custom Pattern using custom bytes fields.
enums['LED_CONTROL_PATTERN'][255] = EnumEntry('LED_CONTROL_PATTERN_CUSTOM', '''Custom Pattern using custom bytes fields.''')
LED_CONTROL_PATTERN_ENUM_END = 256 #
enums['LED_CONTROL_PATTERN'][256] = EnumEntry('LED_CONTROL_PATTERN_ENUM_END', '''''')
# EKF_STATUS_FLAGS
enums['EKF_STATUS_FLAGS'] = {}
EKF_ATTITUDE = 1 # Set if EKF's attitude estimate is good.
enums['EKF_STATUS_FLAGS'][1] = EnumEntry('EKF_ATTITUDE', '''Set if EKF's attitude estimate is good.''')
EKF_VELOCITY_HORIZ = 2 # Set if EKF's horizontal velocity estimate is good.
enums['EKF_STATUS_FLAGS'][2] = EnumEntry('EKF_VELOCITY_HORIZ', '''Set if EKF's horizontal velocity estimate is good.''')
EKF_VELOCITY_VERT = 4 # Set if EKF's vertical velocity estimate is good.
enums['EKF_STATUS_FLAGS'][4] = EnumEntry('EKF_VELOCITY_VERT', '''Set if EKF's vertical velocity estimate is good.''')
EKF_POS_HORIZ_REL = 8 # Set if EKF's horizontal position (relative) estimate is good.
enums['EKF_STATUS_FLAGS'][8] = EnumEntry('EKF_POS_HORIZ_REL', '''Set if EKF's horizontal position (relative) estimate is good.''')
EKF_POS_HORIZ_ABS = 16 # Set if EKF's horizontal position (absolute) estimate is good.
enums['EKF_STATUS_FLAGS'][16] = EnumEntry('EKF_POS_HORIZ_ABS', '''Set if EKF's horizontal position (absolute) estimate is good.''')
EKF_POS_VERT_ABS = 32 # Set if EKF's vertical position (absolute) estimate is good.
enums['EKF_STATUS_FLAGS'][32] = EnumEntry('EKF_POS_VERT_ABS', '''Set if EKF's vertical position (absolute) estimate is good.''')
EKF_POS_VERT_AGL = 64 # Set if EKF's vertical position (above ground) estimate is good.
enums['EKF_STATUS_FLAGS'][64] = EnumEntry('EKF_POS_VERT_AGL', '''Set if EKF's vertical position (above ground) estimate is good.''')
EKF_CONST_POS_MODE = 128 # EKF is in constant position mode and does not know it's absolute or
# relative position.
enums['EKF_STATUS_FLAGS'][128] = EnumEntry('EKF_CONST_POS_MODE', '''EKF is in constant position mode and does not know it's absolute or relative position.''')
EKF_PRED_POS_HORIZ_REL = 256 # Set if EKF's predicted horizontal position (relative) estimate is
# good.
enums['EKF_STATUS_FLAGS'][256] = EnumEntry('EKF_PRED_POS_HORIZ_REL', '''Set if EKF's predicted horizontal position (relative) estimate is good.''')
EKF_PRED_POS_HORIZ_ABS = 512 # Set if EKF's predicted horizontal position (absolute) estimate is
# good.
enums['EKF_STATUS_FLAGS'][512] = EnumEntry('EKF_PRED_POS_HORIZ_ABS', '''Set if EKF's predicted horizontal position (absolute) estimate is good.''')
EKF_UNINITIALIZED = 1024 # Set if EKF has never been healthy.
enums['EKF_STATUS_FLAGS'][1024] = EnumEntry('EKF_UNINITIALIZED', '''Set if EKF has never been healthy.''')
EKF_STATUS_FLAGS_ENUM_END = 1025 #
enums['EKF_STATUS_FLAGS'][1025] = EnumEntry('EKF_STATUS_FLAGS_ENUM_END', '''''')
# PID_TUNING_AXIS
enums['PID_TUNING_AXIS'] = {}
PID_TUNING_ROLL = 1 #
enums['PID_TUNING_AXIS'][1] = EnumEntry('PID_TUNING_ROLL', '''''')
PID_TUNING_PITCH = 2 #
enums['PID_TUNING_AXIS'][2] = EnumEntry('PID_TUNING_PITCH', '''''')
PID_TUNING_YAW = 3 #
enums['PID_TUNING_AXIS'][3] = EnumEntry('PID_TUNING_YAW', '''''')
PID_TUNING_ACCZ = 4 #
enums['PID_TUNING_AXIS'][4] = EnumEntry('PID_TUNING_ACCZ', '''''')
PID_TUNING_STEER = 5 #
enums['PID_TUNING_AXIS'][5] = EnumEntry('PID_TUNING_STEER', '''''')
PID_TUNING_LANDING = 6 #
enums['PID_TUNING_AXIS'][6] = EnumEntry('PID_TUNING_LANDING', '''''')
PID_TUNING_AXIS_ENUM_END = 7 #
enums['PID_TUNING_AXIS'][7] = EnumEntry('PID_TUNING_AXIS_ENUM_END', '''''')
# MAG_CAL_STATUS
enums['MAG_CAL_STATUS'] = {}
MAG_CAL_NOT_STARTED = 0 #
enums['MAG_CAL_STATUS'][0] = EnumEntry('MAG_CAL_NOT_STARTED', '''''')
MAG_CAL_WAITING_TO_START = 1 #
enums['MAG_CAL_STATUS'][1] = EnumEntry('MAG_CAL_WAITING_TO_START', '''''')
MAG_CAL_RUNNING_STEP_ONE = 2 #
enums['MAG_CAL_STATUS'][2] = EnumEntry('MAG_CAL_RUNNING_STEP_ONE', '''''')
MAG_CAL_RUNNING_STEP_TWO = 3 #
enums['MAG_CAL_STATUS'][3] = EnumEntry('MAG_CAL_RUNNING_STEP_TWO', '''''')
MAG_CAL_SUCCESS = 4 #
enums['MAG_CAL_STATUS'][4] = EnumEntry('MAG_CAL_SUCCESS', '''''')
MAG_CAL_FAILED = 5 #
enums['MAG_CAL_STATUS'][5] = EnumEntry('MAG_CAL_FAILED', '''''')
MAG_CAL_BAD_ORIENTATION = 6 #
enums['MAG_CAL_STATUS'][6] = EnumEntry('MAG_CAL_BAD_ORIENTATION', '''''')
MAG_CAL_BAD_RADIUS = 7 #
enums['MAG_CAL_STATUS'][7] = EnumEntry('MAG_CAL_BAD_RADIUS', '''''')
MAG_CAL_STATUS_ENUM_END = 8 #
enums['MAG_CAL_STATUS'][8] = EnumEntry('MAG_CAL_STATUS_ENUM_END', '''''')
# MAV_REMOTE_LOG_DATA_BLOCK_COMMANDS
enums['MAV_REMOTE_LOG_DATA_BLOCK_COMMANDS'] = {}
MAV_REMOTE_LOG_DATA_BLOCK_STOP = 2147483645 # UAV to stop sending DataFlash blocks.
enums['MAV_REMOTE_LOG_DATA_BLOCK_COMMANDS'][2147483645] = EnumEntry('MAV_REMOTE_LOG_DATA_BLOCK_STOP', '''UAV to stop sending DataFlash blocks.''')
MAV_REMOTE_LOG_DATA_BLOCK_START = 2147483646 # UAV to start sending DataFlash blocks.
enums['MAV_REMOTE_LOG_DATA_BLOCK_COMMANDS'][2147483646] = EnumEntry('MAV_REMOTE_LOG_DATA_BLOCK_START', '''UAV to start sending DataFlash blocks.''')
MAV_REMOTE_LOG_DATA_BLOCK_COMMANDS_ENUM_END = 2147483647 #
enums['MAV_REMOTE_LOG_DATA_BLOCK_COMMANDS'][2147483647] = EnumEntry('MAV_REMOTE_LOG_DATA_BLOCK_COMMANDS_ENUM_END', '''''')
# MAV_REMOTE_LOG_DATA_BLOCK_STATUSES
enums['MAV_REMOTE_LOG_DATA_BLOCK_STATUSES'] = {}
MAV_REMOTE_LOG_DATA_BLOCK_NACK = 0 # This block has NOT been received.
enums['MAV_REMOTE_LOG_DATA_BLOCK_STATUSES'][0] = EnumEntry('MAV_REMOTE_LOG_DATA_BLOCK_NACK', '''This block has NOT been received.''')
MAV_REMOTE_LOG_DATA_BLOCK_ACK = 1 # This block has been received.
enums['MAV_REMOTE_LOG_DATA_BLOCK_STATUSES'][1] = EnumEntry('MAV_REMOTE_LOG_DATA_BLOCK_ACK', '''This block has been received.''')
MAV_REMOTE_LOG_DATA_BLOCK_STATUSES_ENUM_END = 2 #
enums['MAV_REMOTE_LOG_DATA_BLOCK_STATUSES'][2] = EnumEntry('MAV_REMOTE_LOG_DATA_BLOCK_STATUSES_ENUM_END', '''''')
# DEVICE_OP_BUSTYPE
enums['DEVICE_OP_BUSTYPE'] = {}
DEVICE_OP_BUSTYPE_I2C = 0 # I2C Device operation.
enums['DEVICE_OP_BUSTYPE'][0] = EnumEntry('DEVICE_OP_BUSTYPE_I2C', '''I2C Device operation.''')
DEVICE_OP_BUSTYPE_SPI = 1 # SPI Device operation.
enums['DEVICE_OP_BUSTYPE'][1] = EnumEntry('DEVICE_OP_BUSTYPE_SPI', '''SPI Device operation.''')
DEVICE_OP_BUSTYPE_ENUM_END = 2 #
enums['DEVICE_OP_BUSTYPE'][2] = EnumEntry('DEVICE_OP_BUSTYPE_ENUM_END', '''''')
# DEEPSTALL_STAGE
enums['DEEPSTALL_STAGE'] = {}
DEEPSTALL_STAGE_FLY_TO_LANDING = 0 # Flying to the landing point.
enums['DEEPSTALL_STAGE'][0] = EnumEntry('DEEPSTALL_STAGE_FLY_TO_LANDING', '''Flying to the landing point.''')
DEEPSTALL_STAGE_ESTIMATE_WIND = 1 # Building an estimate of the wind.
enums['DEEPSTALL_STAGE'][1] = EnumEntry('DEEPSTALL_STAGE_ESTIMATE_WIND', '''Building an estimate of the wind.''')
DEEPSTALL_STAGE_WAIT_FOR_BREAKOUT = 2 # Waiting to breakout of the loiter to fly the approach.
enums['DEEPSTALL_STAGE'][2] = EnumEntry('DEEPSTALL_STAGE_WAIT_FOR_BREAKOUT', '''Waiting to breakout of the loiter to fly the approach.''')
DEEPSTALL_STAGE_FLY_TO_ARC = 3 # Flying to the first arc point to turn around to the landing point.
enums['DEEPSTALL_STAGE'][3] = EnumEntry('DEEPSTALL_STAGE_FLY_TO_ARC', '''Flying to the first arc point to turn around to the landing point.''')
DEEPSTALL_STAGE_ARC = 4 # Turning around back to the deepstall landing point.
enums['DEEPSTALL_STAGE'][4] = EnumEntry('DEEPSTALL_STAGE_ARC', '''Turning around back to the deepstall landing point.''')
DEEPSTALL_STAGE_APPROACH = 5 # Approaching the landing point.
enums['DEEPSTALL_STAGE'][5] = EnumEntry('DEEPSTALL_STAGE_APPROACH', '''Approaching the landing point.''')
DEEPSTALL_STAGE_LAND = 6 # Stalling and steering towards the land point.
enums['DEEPSTALL_STAGE'][6] = EnumEntry('DEEPSTALL_STAGE_LAND', '''Stalling and steering towards the land point.''')
DEEPSTALL_STAGE_ENUM_END = 7 #
enums['DEEPSTALL_STAGE'][7] = EnumEntry('DEEPSTALL_STAGE_ENUM_END', '''''')
# PLANE_MODE
enums['PLANE_MODE'] = {}
PLANE_MODE_MANUAL = 0 #
enums['PLANE_MODE'][0] = EnumEntry('PLANE_MODE_MANUAL', '''''')
PLANE_MODE_CIRCLE = 1 #
enums['PLANE_MODE'][1] = EnumEntry('PLANE_MODE_CIRCLE', '''''')
PLANE_MODE_STABILIZE = 2 #
enums['PLANE_MODE'][2] = EnumEntry('PLANE_MODE_STABILIZE', '''''')
PLANE_MODE_TRAINING = 3 #
enums['PLANE_MODE'][3] = EnumEntry('PLANE_MODE_TRAINING', '''''')
PLANE_MODE_ACRO = 4 #
enums['PLANE_MODE'][4] = EnumEntry('PLANE_MODE_ACRO', '''''')
PLANE_MODE_FLY_BY_WIRE_A = 5 #
enums['PLANE_MODE'][5] = EnumEntry('PLANE_MODE_FLY_BY_WIRE_A', '''''')
PLANE_MODE_FLY_BY_WIRE_B = 6 #
enums['PLANE_MODE'][6] = EnumEntry('PLANE_MODE_FLY_BY_WIRE_B', '''''')
PLANE_MODE_CRUISE = 7 #
enums['PLANE_MODE'][7] = EnumEntry('PLANE_MODE_CRUISE', '''''')
PLANE_MODE_AUTOTUNE = 8 #
enums['PLANE_MODE'][8] = EnumEntry('PLANE_MODE_AUTOTUNE', '''''')
PLANE_MODE_AUTO = 10 #
enums['PLANE_MODE'][10] = EnumEntry('PLANE_MODE_AUTO', '''''')
PLANE_MODE_RTL = 11 #
enums['PLANE_MODE'][11] = EnumEntry('PLANE_MODE_RTL', '''''')
PLANE_MODE_LOITER = 12 #
enums['PLANE_MODE'][12] = EnumEntry('PLANE_MODE_LOITER', '''''')
PLANE_MODE_TAKEOFF = 13 #
enums['PLANE_MODE'][13] = EnumEntry('PLANE_MODE_TAKEOFF', '''''')
PLANE_MODE_AVOID_ADSB = 14 #
enums['PLANE_MODE'][14] = EnumEntry('PLANE_MODE_AVOID_ADSB', '''''')
PLANE_MODE_GUIDED = 15 #
enums['PLANE_MODE'][15] = EnumEntry('PLANE_MODE_GUIDED', '''''')
PLANE_MODE_INITIALIZING = 16 #
enums['PLANE_MODE'][16] = EnumEntry('PLANE_MODE_INITIALIZING', '''''')
PLANE_MODE_QSTABILIZE = 17 #
enums['PLANE_MODE'][17] = EnumEntry('PLANE_MODE_QSTABILIZE', '''''')
PLANE_MODE_QHOVER = 18 #
enums['PLANE_MODE'][18] = EnumEntry('PLANE_MODE_QHOVER', '''''')
PLANE_MODE_QLOITER = 19 #
enums['PLANE_MODE'][19] = EnumEntry('PLANE_MODE_QLOITER', '''''')
PLANE_MODE_QLAND = 20 #
enums['PLANE_MODE'][20] = EnumEntry('PLANE_MODE_QLAND', '''''')
PLANE_MODE_QRTL = 21 #
enums['PLANE_MODE'][21] = EnumEntry('PLANE_MODE_QRTL', '''''')
PLANE_MODE_QAUTOTUNE = 22 #
enums['PLANE_MODE'][22] = EnumEntry('PLANE_MODE_QAUTOTUNE', '''''')
PLANE_MODE_QACRO = 23 #
enums['PLANE_MODE'][23] = EnumEntry('PLANE_MODE_QACRO', '''''')
PLANE_MODE_ENUM_END = 24 #
enums['PLANE_MODE'][24] = EnumEntry('PLANE_MODE_ENUM_END', '''''')
# COPTER_MODE
enums['COPTER_MODE'] = {}
COPTER_MODE_STABILIZE = 0 #
enums['COPTER_MODE'][0] = EnumEntry('COPTER_MODE_STABILIZE', '''''')
COPTER_MODE_ACRO = 1 #
enums['COPTER_MODE'][1] = EnumEntry('COPTER_MODE_ACRO', '''''')
COPTER_MODE_ALT_HOLD = 2 #
enums['COPTER_MODE'][2] = EnumEntry('COPTER_MODE_ALT_HOLD', '''''')
COPTER_MODE_AUTO = 3 #
enums['COPTER_MODE'][3] = EnumEntry('COPTER_MODE_AUTO', '''''')
COPTER_MODE_GUIDED = 4 #
enums['COPTER_MODE'][4] = EnumEntry('COPTER_MODE_GUIDED', '''''')
COPTER_MODE_LOITER = 5 #
enums['COPTER_MODE'][5] = EnumEntry('COPTER_MODE_LOITER', '''''')
COPTER_MODE_RTL = 6 #
enums['COPTER_MODE'][6] = EnumEntry('COPTER_MODE_RTL', '''''')
COPTER_MODE_CIRCLE = 7 #
enums['COPTER_MODE'][7] = EnumEntry('COPTER_MODE_CIRCLE', '''''')
COPTER_MODE_LAND = 9 #
enums['COPTER_MODE'][9] = EnumEntry('COPTER_MODE_LAND', '''''')
COPTER_MODE_DRIFT = 11 #
enums['COPTER_MODE'][11] = EnumEntry('COPTER_MODE_DRIFT', '''''')
COPTER_MODE_SPORT = 13 #
enums['COPTER_MODE'][13] = EnumEntry('COPTER_MODE_SPORT', '''''')
COPTER_MODE_FLIP = 14 #
enums['COPTER_MODE'][14] = EnumEntry('COPTER_MODE_FLIP', '''''')
COPTER_MODE_AUTOTUNE = 15 #
enums['COPTER_MODE'][15] = EnumEntry('COPTER_MODE_AUTOTUNE', '''''')
COPTER_MODE_POSHOLD = 16 #
enums['COPTER_MODE'][16] = EnumEntry('COPTER_MODE_POSHOLD', '''''')
COPTER_MODE_BRAKE = 17 #
enums['COPTER_MODE'][17] = EnumEntry('COPTER_MODE_BRAKE', '''''')
COPTER_MODE_THROW = 18 #
enums['COPTER_MODE'][18] = EnumEntry('COPTER_MODE_THROW', '''''')
COPTER_MODE_AVOID_ADSB = 19 #
enums['COPTER_MODE'][19] = EnumEntry('COPTER_MODE_AVOID_ADSB', '''''')
COPTER_MODE_GUIDED_NOGPS = 20 #
enums['COPTER_MODE'][20] = EnumEntry('COPTER_MODE_GUIDED_NOGPS', '''''')
COPTER_MODE_SMART_RTL = 21 #
enums['COPTER_MODE'][21] = EnumEntry('COPTER_MODE_SMART_RTL', '''''')
COPTER_MODE_FLOWHOLD = 22 #
enums['COPTER_MODE'][22] = EnumEntry('COPTER_MODE_FLOWHOLD', '''''')
COPTER_MODE_FOLLOW = 23 #
enums['COPTER_MODE'][23] = EnumEntry('COPTER_MODE_FOLLOW', '''''')
COPTER_MODE_ZIGZAG = 24 #
enums['COPTER_MODE'][24] = EnumEntry('COPTER_MODE_ZIGZAG', '''''')
COPTER_MODE_SYSTEMID = 25 #
enums['COPTER_MODE'][25] = EnumEntry('COPTER_MODE_SYSTEMID', '''''')
COPTER_MODE_AUTOROTATE = 26 #
enums['COPTER_MODE'][26] = EnumEntry('COPTER_MODE_AUTOROTATE', '''''')
COPTER_MODE_ENUM_END = 27 #
enums['COPTER_MODE'][27] = EnumEntry('COPTER_MODE_ENUM_END', '''''')
# SUB_MODE
enums['SUB_MODE'] = {}
SUB_MODE_STABILIZE = 0 #
enums['SUB_MODE'][0] = EnumEntry('SUB_MODE_STABILIZE', '''''')
SUB_MODE_ACRO = 1 #
enums['SUB_MODE'][1] = EnumEntry('SUB_MODE_ACRO', '''''')
SUB_MODE_ALT_HOLD = 2 #
enums['SUB_MODE'][2] = EnumEntry('SUB_MODE_ALT_HOLD', '''''')
SUB_MODE_AUTO = 3 #
enums['SUB_MODE'][3] = EnumEntry('SUB_MODE_AUTO', '''''')
SUB_MODE_GUIDED = 4 #
enums['SUB_MODE'][4] = EnumEntry('SUB_MODE_GUIDED', '''''')
SUB_MODE_CIRCLE = 7 #
enums['SUB_MODE'][7] = EnumEntry('SUB_MODE_CIRCLE', '''''')
SUB_MODE_SURFACE = 9 #
enums['SUB_MODE'][9] = EnumEntry('SUB_MODE_SURFACE', '''''')
SUB_MODE_POSHOLD = 16 #
enums['SUB_MODE'][16] = EnumEntry('SUB_MODE_POSHOLD', '''''')
SUB_MODE_MANUAL = 19 #
enums['SUB_MODE'][19] = EnumEntry('SUB_MODE_MANUAL', '''''')
SUB_MODE_ENUM_END = 20 #
enums['SUB_MODE'][20] = EnumEntry('SUB_MODE_ENUM_END', '''''')
# ROVER_MODE
enums['ROVER_MODE'] = {}
ROVER_MODE_MANUAL = 0 #
enums['ROVER_MODE'][0] = EnumEntry('ROVER_MODE_MANUAL', '''''')
ROVER_MODE_ACRO = 1 #
enums['ROVER_MODE'][1] = EnumEntry('ROVER_MODE_ACRO', '''''')
ROVER_MODE_STEERING = 3 #
enums['ROVER_MODE'][3] = EnumEntry('ROVER_MODE_STEERING', '''''')
ROVER_MODE_HOLD = 4 #
enums['ROVER_MODE'][4] = EnumEntry('ROVER_MODE_HOLD', '''''')
ROVER_MODE_LOITER = 5 #
enums['ROVER_MODE'][5] = EnumEntry('ROVER_MODE_LOITER', '''''')
ROVER_MODE_FOLLOW = 6 #
enums['ROVER_MODE'][6] = EnumEntry('ROVER_MODE_FOLLOW', '''''')
ROVER_MODE_SIMPLE = 7 #
enums['ROVER_MODE'][7] = EnumEntry('ROVER_MODE_SIMPLE', '''''')
ROVER_MODE_AUTO = 10 #
enums['ROVER_MODE'][10] = EnumEntry('ROVER_MODE_AUTO', '''''')
ROVER_MODE_RTL = 11 #
enums['ROVER_MODE'][11] = EnumEntry('ROVER_MODE_RTL', '''''')
ROVER_MODE_SMART_RTL = 12 #
enums['ROVER_MODE'][12] = EnumEntry('ROVER_MODE_SMART_RTL', '''''')
ROVER_MODE_GUIDED = 15 #
enums['ROVER_MODE'][15] = EnumEntry('ROVER_MODE_GUIDED', '''''')
ROVER_MODE_INITIALIZING = 16 #
enums['ROVER_MODE'][16] = EnumEntry('ROVER_MODE_INITIALIZING', '''''')
ROVER_MODE_ENUM_END = 17 #
enums['ROVER_MODE'][17] = EnumEntry('ROVER_MODE_ENUM_END', '''''')
# TRACKER_MODE
enums['TRACKER_MODE'] = {}
TRACKER_MODE_MANUAL = 0 #
enums['TRACKER_MODE'][0] = EnumEntry('TRACKER_MODE_MANUAL', '''''')
TRACKER_MODE_STOP = 1 #
enums['TRACKER_MODE'][1] = EnumEntry('TRACKER_MODE_STOP', '''''')
TRACKER_MODE_SCAN = 2 #
enums['TRACKER_MODE'][2] = EnumEntry('TRACKER_MODE_SCAN', '''''')
TRACKER_MODE_SERVO_TEST = 3 #
enums['TRACKER_MODE'][3] = EnumEntry('TRACKER_MODE_SERVO_TEST', '''''')
TRACKER_MODE_AUTO = 10 #
enums['TRACKER_MODE'][10] = EnumEntry('TRACKER_MODE_AUTO', '''''')
TRACKER_MODE_INITIALIZING = 16 #
enums['TRACKER_MODE'][16] = EnumEntry('TRACKER_MODE_INITIALIZING', '''''')
TRACKER_MODE_ENUM_END = 17 #
enums['TRACKER_MODE'][17] = EnumEntry('TRACKER_MODE_ENUM_END', '''''')
# OSD_PARAM_CONFIG_TYPE
enums['OSD_PARAM_CONFIG_TYPE'] = {}
OSD_PARAM_NONE = 0 #
enums['OSD_PARAM_CONFIG_TYPE'][0] = EnumEntry('OSD_PARAM_NONE', '''''')
OSD_PARAM_SERIAL_PROTOCOL = 1 #
enums['OSD_PARAM_CONFIG_TYPE'][1] = EnumEntry('OSD_PARAM_SERIAL_PROTOCOL', '''''')
OSD_PARAM_SERVO_FUNCTION = 2 #
enums['OSD_PARAM_CONFIG_TYPE'][2] = EnumEntry('OSD_PARAM_SERVO_FUNCTION', '''''')
OSD_PARAM_AUX_FUNCTION = 3 #
enums['OSD_PARAM_CONFIG_TYPE'][3] = EnumEntry('OSD_PARAM_AUX_FUNCTION', '''''')
OSD_PARAM_FLIGHT_MODE = 4 #
enums['OSD_PARAM_CONFIG_TYPE'][4] = EnumEntry('OSD_PARAM_FLIGHT_MODE', '''''')
OSD_PARAM_FAILSAFE_ACTION = 5 #
enums['OSD_PARAM_CONFIG_TYPE'][5] = EnumEntry('OSD_PARAM_FAILSAFE_ACTION', '''''')
OSD_PARAM_FAILSAFE_ACTION_1 = 6 #
enums['OSD_PARAM_CONFIG_TYPE'][6] = EnumEntry('OSD_PARAM_FAILSAFE_ACTION_1', '''''')
OSD_PARAM_FAILSAFE_ACTION_2 = 7 #
enums['OSD_PARAM_CONFIG_TYPE'][7] = EnumEntry('OSD_PARAM_FAILSAFE_ACTION_2', '''''')
OSD_PARAM_NUM_TYPES = 8 #
enums['OSD_PARAM_CONFIG_TYPE'][8] = EnumEntry('OSD_PARAM_NUM_TYPES', '''''')
OSD_PARAM_CONFIG_TYPE_ENUM_END = 9 #
enums['OSD_PARAM_CONFIG_TYPE'][9] = EnumEntry('OSD_PARAM_CONFIG_TYPE_ENUM_END', '''''')
# OSD_PARAM_CONFIG_ERROR
enums['OSD_PARAM_CONFIG_ERROR'] = {}
OSD_PARAM_SUCCESS = 0 #
enums['OSD_PARAM_CONFIG_ERROR'][0] = EnumEntry('OSD_PARAM_SUCCESS', '''''')
OSD_PARAM_INVALID_SCREEN = 1 #
enums['OSD_PARAM_CONFIG_ERROR'][1] = EnumEntry('OSD_PARAM_INVALID_SCREEN', '''''')
OSD_PARAM_INVALID_PARAMETER_INDEX = 2 #
enums['OSD_PARAM_CONFIG_ERROR'][2] = EnumEntry('OSD_PARAM_INVALID_PARAMETER_INDEX', '''''')
OSD_PARAM_INVALID_PARAMETER = 3 #
enums['OSD_PARAM_CONFIG_ERROR'][3] = EnumEntry('OSD_PARAM_INVALID_PARAMETER', '''''')
OSD_PARAM_CONFIG_ERROR_ENUM_END = 4 #
enums['OSD_PARAM_CONFIG_ERROR'][4] = EnumEntry('OSD_PARAM_CONFIG_ERROR_ENUM_END', '''''')
# MAV_AUTOPILOT
enums['MAV_AUTOPILOT'] = {}
MAV_AUTOPILOT_GENERIC = 0 # Generic autopilot, full support for everything
enums['MAV_AUTOPILOT'][0] = EnumEntry('MAV_AUTOPILOT_GENERIC', '''Generic autopilot, full support for everything''')
MAV_AUTOPILOT_RESERVED = 1 # Reserved for future use.
enums['MAV_AUTOPILOT'][1] = EnumEntry('MAV_AUTOPILOT_RESERVED', '''Reserved for future use.''')
MAV_AUTOPILOT_SLUGS = 2 # SLUGS autopilot, http://slugsuav.soe.ucsc.edu
enums['MAV_AUTOPILOT'][2] = EnumEntry('MAV_AUTOPILOT_SLUGS', '''SLUGS autopilot, http://slugsuav.soe.ucsc.edu''')
MAV_AUTOPILOT_ARDUPILOTMEGA = 3 # ArduPilot - Plane/Copter/Rover/Sub/Tracker, https://ardupilot.org
enums['MAV_AUTOPILOT'][3] = EnumEntry('MAV_AUTOPILOT_ARDUPILOTMEGA', '''ArduPilot - Plane/Copter/Rover/Sub/Tracker, https://ardupilot.org''')
MAV_AUTOPILOT_OPENPILOT = 4 # OpenPilot, http://openpilot.org
enums['MAV_AUTOPILOT'][4] = EnumEntry('MAV_AUTOPILOT_OPENPILOT', '''OpenPilot, http://openpilot.org''')
MAV_AUTOPILOT_GENERIC_WAYPOINTS_ONLY = 5 # Generic autopilot only supporting simple waypoints
enums['MAV_AUTOPILOT'][5] = EnumEntry('MAV_AUTOPILOT_GENERIC_WAYPOINTS_ONLY', '''Generic autopilot only supporting simple waypoints''')
MAV_AUTOPILOT_GENERIC_WAYPOINTS_AND_SIMPLE_NAVIGATION_ONLY = 6 # Generic autopilot supporting waypoints and other simple navigation
# commands
enums['MAV_AUTOPILOT'][6] = EnumEntry('MAV_AUTOPILOT_GENERIC_WAYPOINTS_AND_SIMPLE_NAVIGATION_ONLY', '''Generic autopilot supporting waypoints and other simple navigation commands''')
MAV_AUTOPILOT_GENERIC_MISSION_FULL = 7 # Generic autopilot supporting the full mission command set
enums['MAV_AUTOPILOT'][7] = EnumEntry('MAV_AUTOPILOT_GENERIC_MISSION_FULL', '''Generic autopilot supporting the full mission command set''')
MAV_AUTOPILOT_INVALID = 8 # No valid autopilot, e.g. a GCS or other MAVLink component
enums['MAV_AUTOPILOT'][8] = EnumEntry('MAV_AUTOPILOT_INVALID', '''No valid autopilot, e.g. a GCS or other MAVLink component''')
MAV_AUTOPILOT_PPZ = 9 # PPZ UAV - http://nongnu.org/paparazzi
enums['MAV_AUTOPILOT'][9] = EnumEntry('MAV_AUTOPILOT_PPZ', '''PPZ UAV - http://nongnu.org/paparazzi''')
MAV_AUTOPILOT_UDB = 10 # UAV Dev Board
enums['MAV_AUTOPILOT'][10] = EnumEntry('MAV_AUTOPILOT_UDB', '''UAV Dev Board''')
MAV_AUTOPILOT_FP = 11 # FlexiPilot
enums['MAV_AUTOPILOT'][11] = EnumEntry('MAV_AUTOPILOT_FP', '''FlexiPilot''')
MAV_AUTOPILOT_PX4 = 12 # PX4 Autopilot - http://px4.io/
enums['MAV_AUTOPILOT'][12] = EnumEntry('MAV_AUTOPILOT_PX4', '''PX4 Autopilot - http://px4.io/''')
MAV_AUTOPILOT_SMACCMPILOT = 13 # SMACCMPilot - http://smaccmpilot.org
enums['MAV_AUTOPILOT'][13] = EnumEntry('MAV_AUTOPILOT_SMACCMPILOT', '''SMACCMPilot - http://smaccmpilot.org''')
MAV_AUTOPILOT_AUTOQUAD = 14 # AutoQuad -- http://autoquad.org
enums['MAV_AUTOPILOT'][14] = EnumEntry('MAV_AUTOPILOT_AUTOQUAD', '''AutoQuad -- http://autoquad.org''')
MAV_AUTOPILOT_ARMAZILA = 15 # Armazila -- http://armazila.com
enums['MAV_AUTOPILOT'][15] = EnumEntry('MAV_AUTOPILOT_ARMAZILA', '''Armazila -- http://armazila.com''')
MAV_AUTOPILOT_AEROB = 16 # Aerob -- http://aerob.ru
enums['MAV_AUTOPILOT'][16] = EnumEntry('MAV_AUTOPILOT_AEROB', '''Aerob -- http://aerob.ru''')
MAV_AUTOPILOT_ASLUAV = 17 # ASLUAV autopilot -- http://www.asl.ethz.ch
enums['MAV_AUTOPILOT'][17] = EnumEntry('MAV_AUTOPILOT_ASLUAV', '''ASLUAV autopilot -- http://www.asl.ethz.ch''')
MAV_AUTOPILOT_SMARTAP = 18 # SmartAP Autopilot - http://sky-drones.com
enums['MAV_AUTOPILOT'][18] = EnumEntry('MAV_AUTOPILOT_SMARTAP', '''SmartAP Autopilot - http://sky-drones.com''')
MAV_AUTOPILOT_AIRRAILS = 19 # AirRails - http://uaventure.com
enums['MAV_AUTOPILOT'][19] = EnumEntry('MAV_AUTOPILOT_AIRRAILS', '''AirRails - http://uaventure.com''')
MAV_AUTOPILOT_ENUM_END = 20 #
enums['MAV_AUTOPILOT'][20] = EnumEntry('MAV_AUTOPILOT_ENUM_END', '''''')
# MAV_TYPE
enums['MAV_TYPE'] = {}
MAV_TYPE_GENERIC = 0 # Generic micro air vehicle
enums['MAV_TYPE'][0] = EnumEntry('MAV_TYPE_GENERIC', '''Generic micro air vehicle''')
MAV_TYPE_FIXED_WING = 1 # Fixed wing aircraft.
enums['MAV_TYPE'][1] = EnumEntry('MAV_TYPE_FIXED_WING', '''Fixed wing aircraft.''')
MAV_TYPE_QUADROTOR = 2 # Quadrotor
enums['MAV_TYPE'][2] = EnumEntry('MAV_TYPE_QUADROTOR', '''Quadrotor''')
MAV_TYPE_COAXIAL = 3 # Coaxial helicopter
enums['MAV_TYPE'][3] = EnumEntry('MAV_TYPE_COAXIAL', '''Coaxial helicopter''')
MAV_TYPE_HELICOPTER = 4 # Normal helicopter with tail rotor.
enums['MAV_TYPE'][4] = EnumEntry('MAV_TYPE_HELICOPTER', '''Normal helicopter with tail rotor.''')
MAV_TYPE_ANTENNA_TRACKER = 5 # Ground installation
enums['MAV_TYPE'][5] = EnumEntry('MAV_TYPE_ANTENNA_TRACKER', '''Ground installation''')
MAV_TYPE_GCS = 6 # Operator control unit / ground control station
enums['MAV_TYPE'][6] = EnumEntry('MAV_TYPE_GCS', '''Operator control unit / ground control station''')
MAV_TYPE_AIRSHIP = 7 # Airship, controlled
enums['MAV_TYPE'][7] = EnumEntry('MAV_TYPE_AIRSHIP', '''Airship, controlled''')
MAV_TYPE_FREE_BALLOON = 8 # Free balloon, uncontrolled
enums['MAV_TYPE'][8] = EnumEntry('MAV_TYPE_FREE_BALLOON', '''Free balloon, uncontrolled''')
MAV_TYPE_ROCKET = 9 # Rocket
enums['MAV_TYPE'][9] = EnumEntry('MAV_TYPE_ROCKET', '''Rocket''')
MAV_TYPE_GROUND_ROVER = 10 # Ground rover
enums['MAV_TYPE'][10] = EnumEntry('MAV_TYPE_GROUND_ROVER', '''Ground rover''')
MAV_TYPE_SURFACE_BOAT = 11 # Surface vessel, boat, ship
enums['MAV_TYPE'][11] = EnumEntry('MAV_TYPE_SURFACE_BOAT', '''Surface vessel, boat, ship''')
MAV_TYPE_SUBMARINE = 12 # Submarine
enums['MAV_TYPE'][12] = EnumEntry('MAV_TYPE_SUBMARINE', '''Submarine''')
MAV_TYPE_HEXAROTOR = 13 # Hexarotor
enums['MAV_TYPE'][13] = EnumEntry('MAV_TYPE_HEXAROTOR', '''Hexarotor''')
MAV_TYPE_OCTOROTOR = 14 # Octorotor
enums['MAV_TYPE'][14] = EnumEntry('MAV_TYPE_OCTOROTOR', '''Octorotor''')
MAV_TYPE_TRICOPTER = 15 # Tricopter
enums['MAV_TYPE'][15] = EnumEntry('MAV_TYPE_TRICOPTER', '''Tricopter''')
MAV_TYPE_FLAPPING_WING = 16 # Flapping wing
enums['MAV_TYPE'][16] = EnumEntry('MAV_TYPE_FLAPPING_WING', '''Flapping wing''')
MAV_TYPE_KITE = 17 # Kite
enums['MAV_TYPE'][17] = EnumEntry('MAV_TYPE_KITE', '''Kite''')
MAV_TYPE_ONBOARD_CONTROLLER = 18 # Onboard companion controller
enums['MAV_TYPE'][18] = EnumEntry('MAV_TYPE_ONBOARD_CONTROLLER', '''Onboard companion controller''')
MAV_TYPE_VTOL_DUOROTOR = 19 # Two-rotor VTOL using control surfaces in vertical operation in
# addition. Tailsitter.
enums['MAV_TYPE'][19] = EnumEntry('MAV_TYPE_VTOL_DUOROTOR', '''Two-rotor VTOL using control surfaces in vertical operation in addition. Tailsitter.''')
MAV_TYPE_VTOL_QUADROTOR = 20 # Quad-rotor VTOL using a V-shaped quad config in vertical operation.
# Tailsitter.
enums['MAV_TYPE'][20] = EnumEntry('MAV_TYPE_VTOL_QUADROTOR', '''Quad-rotor VTOL using a V-shaped quad config in vertical operation. Tailsitter.''')
MAV_TYPE_VTOL_TILTROTOR = 21 # Tiltrotor VTOL
enums['MAV_TYPE'][21] = EnumEntry('MAV_TYPE_VTOL_TILTROTOR', '''Tiltrotor VTOL''')
MAV_TYPE_VTOL_RESERVED2 = 22 # VTOL reserved 2
enums['MAV_TYPE'][22] = EnumEntry('MAV_TYPE_VTOL_RESERVED2', '''VTOL reserved 2''')
MAV_TYPE_VTOL_RESERVED3 = 23 # VTOL reserved 3
enums['MAV_TYPE'][23] = EnumEntry('MAV_TYPE_VTOL_RESERVED3', '''VTOL reserved 3''')
MAV_TYPE_VTOL_RESERVED4 = 24 # VTOL reserved 4
enums['MAV_TYPE'][24] = EnumEntry('MAV_TYPE_VTOL_RESERVED4', '''VTOL reserved 4''')
MAV_TYPE_VTOL_RESERVED5 = 25 # VTOL reserved 5
enums['MAV_TYPE'][25] = EnumEntry('MAV_TYPE_VTOL_RESERVED5', '''VTOL reserved 5''')
MAV_TYPE_GIMBAL = 26 # Gimbal
enums['MAV_TYPE'][26] = EnumEntry('MAV_TYPE_GIMBAL', '''Gimbal''')
MAV_TYPE_ADSB = 27 # ADSB system
enums['MAV_TYPE'][27] = EnumEntry('MAV_TYPE_ADSB', '''ADSB system''')
MAV_TYPE_PARAFOIL = 28 # Steerable, nonrigid airfoil
enums['MAV_TYPE'][28] = EnumEntry('MAV_TYPE_PARAFOIL', '''Steerable, nonrigid airfoil''')
MAV_TYPE_DODECAROTOR = 29 # Dodecarotor
enums['MAV_TYPE'][29] = EnumEntry('MAV_TYPE_DODECAROTOR', '''Dodecarotor''')
MAV_TYPE_CAMERA = 30 # Camera
enums['MAV_TYPE'][30] = EnumEntry('MAV_TYPE_CAMERA', '''Camera''')
MAV_TYPE_CHARGING_STATION = 31 # Charging station
enums['MAV_TYPE'][31] = EnumEntry('MAV_TYPE_CHARGING_STATION', '''Charging station''')
MAV_TYPE_FLARM = 32 # FLARM collision avoidance system
enums['MAV_TYPE'][32] = EnumEntry('MAV_TYPE_FLARM', '''FLARM collision avoidance system''')
MAV_TYPE_SERVO = 33 # Servo
enums['MAV_TYPE'][33] = EnumEntry('MAV_TYPE_SERVO', '''Servo''')
MAV_TYPE_ENUM_END = 34 #
enums['MAV_TYPE'][34] = EnumEntry('MAV_TYPE_ENUM_END', '''''')
# FIRMWARE_VERSION_TYPE
enums['FIRMWARE_VERSION_TYPE'] = {}
FIRMWARE_VERSION_TYPE_DEV = 0 # development release
enums['FIRMWARE_VERSION_TYPE'][0] = EnumEntry('FIRMWARE_VERSION_TYPE_DEV', '''development release''')
FIRMWARE_VERSION_TYPE_ALPHA = 64 # alpha release
enums['FIRMWARE_VERSION_TYPE'][64] = EnumEntry('FIRMWARE_VERSION_TYPE_ALPHA', '''alpha release''')
FIRMWARE_VERSION_TYPE_BETA = 128 # beta release
enums['FIRMWARE_VERSION_TYPE'][128] = EnumEntry('FIRMWARE_VERSION_TYPE_BETA', '''beta release''')
FIRMWARE_VERSION_TYPE_RC = 192 # release candidate
enums['FIRMWARE_VERSION_TYPE'][192] = EnumEntry('FIRMWARE_VERSION_TYPE_RC', '''release candidate''')
FIRMWARE_VERSION_TYPE_OFFICIAL = 255 # official stable release
enums['FIRMWARE_VERSION_TYPE'][255] = EnumEntry('FIRMWARE_VERSION_TYPE_OFFICIAL', '''official stable release''')
FIRMWARE_VERSION_TYPE_ENUM_END = 256 #
enums['FIRMWARE_VERSION_TYPE'][256] = EnumEntry('FIRMWARE_VERSION_TYPE_ENUM_END', '''''')
# MAV_MODE_FLAG
enums['MAV_MODE_FLAG'] = {}
MAV_MODE_FLAG_CUSTOM_MODE_ENABLED = 1 # 0b00000001 Reserved for future use.
enums['MAV_MODE_FLAG'][1] = EnumEntry('MAV_MODE_FLAG_CUSTOM_MODE_ENABLED', '''0b00000001 Reserved for future use.''')
MAV_MODE_FLAG_TEST_ENABLED = 2 # 0b00000010 system has a test mode enabled. This flag is intended for
# temporary system tests and should not be
# used for stable implementations.
enums['MAV_MODE_FLAG'][2] = EnumEntry('MAV_MODE_FLAG_TEST_ENABLED', '''0b00000010 system has a test mode enabled. This flag is intended for temporary system tests and should not be used for stable implementations.''')
MAV_MODE_FLAG_AUTO_ENABLED = 4 # 0b00000100 autonomous mode enabled, system finds its own goal
# positions. Guided flag can be set or not,
# depends on the actual implementation.
enums['MAV_MODE_FLAG'][4] = EnumEntry('MAV_MODE_FLAG_AUTO_ENABLED', '''0b00000100 autonomous mode enabled, system finds its own goal positions. Guided flag can be set or not, depends on the actual implementation.''')
MAV_MODE_FLAG_GUIDED_ENABLED = 8 # 0b00001000 guided mode enabled, system flies waypoints / mission
# items.
enums['MAV_MODE_FLAG'][8] = EnumEntry('MAV_MODE_FLAG_GUIDED_ENABLED', '''0b00001000 guided mode enabled, system flies waypoints / mission items.''')
MAV_MODE_FLAG_STABILIZE_ENABLED = 16 # 0b00010000 system stabilizes electronically its attitude (and
# optionally position). It needs however
# further control inputs to move around.
enums['MAV_MODE_FLAG'][16] = EnumEntry('MAV_MODE_FLAG_STABILIZE_ENABLED', '''0b00010000 system stabilizes electronically its attitude (and optionally position). It needs however further control inputs to move around.''')
MAV_MODE_FLAG_HIL_ENABLED = 32 # 0b00100000 hardware in the loop simulation. All motors / actuators are
# blocked, but internal software is full
# operational.
enums['MAV_MODE_FLAG'][32] = EnumEntry('MAV_MODE_FLAG_HIL_ENABLED', '''0b00100000 hardware in the loop simulation. All motors / actuators are blocked, but internal software is full operational.''')
MAV_MODE_FLAG_MANUAL_INPUT_ENABLED = 64 # 0b01000000 remote control input is enabled.
enums['MAV_MODE_FLAG'][64] = EnumEntry('MAV_MODE_FLAG_MANUAL_INPUT_ENABLED', '''0b01000000 remote control input is enabled.''')
MAV_MODE_FLAG_SAFETY_ARMED = 128 # 0b10000000 MAV safety set to armed. Motors are enabled / running / can
# start. Ready to fly. Additional note: this
# flag is to be ignore when sent in the
# command MAV_CMD_DO_SET_MODE and
# MAV_CMD_COMPONENT_ARM_DISARM shall be used
# instead. The flag can still be used to
# report the armed state.
enums['MAV_MODE_FLAG'][128] = EnumEntry('MAV_MODE_FLAG_SAFETY_ARMED', '''0b10000000 MAV safety set to armed. Motors are enabled / running / can start. Ready to fly. Additional note: this flag is to be ignore when sent in the command MAV_CMD_DO_SET_MODE and MAV_CMD_COMPONENT_ARM_DISARM shall be used instead. The flag can still be used to report the armed state.''')
MAV_MODE_FLAG_ENUM_END = 129 #
enums['MAV_MODE_FLAG'][129] = EnumEntry('MAV_MODE_FLAG_ENUM_END', '''''')
# MAV_MODE_FLAG_DECODE_POSITION
enums['MAV_MODE_FLAG_DECODE_POSITION'] = {}
MAV_MODE_FLAG_DECODE_POSITION_CUSTOM_MODE = 1 # Eighth bit: 00000001
enums['MAV_MODE_FLAG_DECODE_POSITION'][1] = EnumEntry('MAV_MODE_FLAG_DECODE_POSITION_CUSTOM_MODE', '''Eighth bit: 00000001''')
MAV_MODE_FLAG_DECODE_POSITION_TEST = 2 # Seventh bit: 00000010
enums['MAV_MODE_FLAG_DECODE_POSITION'][2] = EnumEntry('MAV_MODE_FLAG_DECODE_POSITION_TEST', '''Seventh bit: 00000010''')
MAV_MODE_FLAG_DECODE_POSITION_AUTO = 4 # Sixth bit: 00000100
enums['MAV_MODE_FLAG_DECODE_POSITION'][4] = EnumEntry('MAV_MODE_FLAG_DECODE_POSITION_AUTO', '''Sixth bit: 00000100''')
MAV_MODE_FLAG_DECODE_POSITION_GUIDED = 8 # Fifth bit: 00001000
enums['MAV_MODE_FLAG_DECODE_POSITION'][8] = EnumEntry('MAV_MODE_FLAG_DECODE_POSITION_GUIDED', '''Fifth bit: 00001000''')
MAV_MODE_FLAG_DECODE_POSITION_STABILIZE = 16 # Fourth bit: 00010000
enums['MAV_MODE_FLAG_DECODE_POSITION'][16] = EnumEntry('MAV_MODE_FLAG_DECODE_POSITION_STABILIZE', '''Fourth bit: 00010000''')
MAV_MODE_FLAG_DECODE_POSITION_HIL = 32 # Third bit: 00100000
enums['MAV_MODE_FLAG_DECODE_POSITION'][32] = EnumEntry('MAV_MODE_FLAG_DECODE_POSITION_HIL', '''Third bit: 00100000''')
MAV_MODE_FLAG_DECODE_POSITION_MANUAL = 64 # Second bit: 01000000
enums['MAV_MODE_FLAG_DECODE_POSITION'][64] = EnumEntry('MAV_MODE_FLAG_DECODE_POSITION_MANUAL', '''Second bit: 01000000''')
MAV_MODE_FLAG_DECODE_POSITION_SAFETY = 128 # First bit: 10000000
enums['MAV_MODE_FLAG_DECODE_POSITION'][128] = EnumEntry('MAV_MODE_FLAG_DECODE_POSITION_SAFETY', '''First bit: 10000000''')
MAV_MODE_FLAG_DECODE_POSITION_ENUM_END = 129 #
enums['MAV_MODE_FLAG_DECODE_POSITION'][129] = EnumEntry('MAV_MODE_FLAG_DECODE_POSITION_ENUM_END', '''''')
# MAV_GOTO
enums['MAV_GOTO'] = {}
MAV_GOTO_DO_HOLD = 0 # Hold at the current position.
enums['MAV_GOTO'][0] = EnumEntry('MAV_GOTO_DO_HOLD', '''Hold at the current position.''')
MAV_GOTO_DO_CONTINUE = 1 # Continue with the next item in mission execution.
enums['MAV_GOTO'][1] = EnumEntry('MAV_GOTO_DO_CONTINUE', '''Continue with the next item in mission execution.''')
MAV_GOTO_HOLD_AT_CURRENT_POSITION = 2 # Hold at the current position of the system
enums['MAV_GOTO'][2] = EnumEntry('MAV_GOTO_HOLD_AT_CURRENT_POSITION', '''Hold at the current position of the system''')
MAV_GOTO_HOLD_AT_SPECIFIED_POSITION = 3 # Hold at the position specified in the parameters of the DO_HOLD action
enums['MAV_GOTO'][3] = EnumEntry('MAV_GOTO_HOLD_AT_SPECIFIED_POSITION', '''Hold at the position specified in the parameters of the DO_HOLD action''')
MAV_GOTO_ENUM_END = 4 #
enums['MAV_GOTO'][4] = EnumEntry('MAV_GOTO_ENUM_END', '''''')
# MAV_MODE
enums['MAV_MODE'] = {}
MAV_MODE_PREFLIGHT = 0 # System is not ready to fly, booting, calibrating, etc. No flag is set.
enums['MAV_MODE'][0] = EnumEntry('MAV_MODE_PREFLIGHT', '''System is not ready to fly, booting, calibrating, etc. No flag is set.''')
MAV_MODE_MANUAL_DISARMED = 64 # System is allowed to be active, under manual (RC) control, no
# stabilization
enums['MAV_MODE'][64] = EnumEntry('MAV_MODE_MANUAL_DISARMED', '''System is allowed to be active, under manual (RC) control, no stabilization''')
MAV_MODE_TEST_DISARMED = 66 # UNDEFINED mode. This solely depends on the autopilot - use with
# caution, intended for developers only.
enums['MAV_MODE'][66] = EnumEntry('MAV_MODE_TEST_DISARMED', '''UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only.''')
MAV_MODE_STABILIZE_DISARMED = 80 # System is allowed to be active, under assisted RC control.
enums['MAV_MODE'][80] = EnumEntry('MAV_MODE_STABILIZE_DISARMED', '''System is allowed to be active, under assisted RC control.''')
MAV_MODE_GUIDED_DISARMED = 88 # System is allowed to be active, under autonomous control, manual
# setpoint
enums['MAV_MODE'][88] = EnumEntry('MAV_MODE_GUIDED_DISARMED', '''System is allowed to be active, under autonomous control, manual setpoint''')
MAV_MODE_AUTO_DISARMED = 92 # System is allowed to be active, under autonomous control and
# navigation (the trajectory is decided
# onboard and not pre-programmed by waypoints)
enums['MAV_MODE'][92] = EnumEntry('MAV_MODE_AUTO_DISARMED', '''System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints)''')
MAV_MODE_MANUAL_ARMED = 192 # System is allowed to be active, under manual (RC) control, no
# stabilization
enums['MAV_MODE'][192] = EnumEntry('MAV_MODE_MANUAL_ARMED', '''System is allowed to be active, under manual (RC) control, no stabilization''')
MAV_MODE_TEST_ARMED = 194 # UNDEFINED mode. This solely depends on the autopilot - use with
# caution, intended for developers only.
enums['MAV_MODE'][194] = EnumEntry('MAV_MODE_TEST_ARMED', '''UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only.''')
MAV_MODE_STABILIZE_ARMED = 208 # System is allowed to be active, under assisted RC control.
enums['MAV_MODE'][208] = EnumEntry('MAV_MODE_STABILIZE_ARMED', '''System is allowed to be active, under assisted RC control.''')
MAV_MODE_GUIDED_ARMED = 216 # System is allowed to be active, under autonomous control, manual
# setpoint
enums['MAV_MODE'][216] = EnumEntry('MAV_MODE_GUIDED_ARMED', '''System is allowed to be active, under autonomous control, manual setpoint''')
MAV_MODE_AUTO_ARMED = 220 # System is allowed to be active, under autonomous control and
# navigation (the trajectory is decided
# onboard and not pre-programmed by waypoints)
enums['MAV_MODE'][220] = EnumEntry('MAV_MODE_AUTO_ARMED', '''System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints)''')
MAV_MODE_ENUM_END = 221 #
enums['MAV_MODE'][221] = EnumEntry('MAV_MODE_ENUM_END', '''''')
# MAV_STATE
enums['MAV_STATE'] = {}
MAV_STATE_UNINIT = 0 # Uninitialized system, state is unknown.
enums['MAV_STATE'][0] = EnumEntry('MAV_STATE_UNINIT', '''Uninitialized system, state is unknown.''')
MAV_STATE_BOOT = 1 # System is booting up.
enums['MAV_STATE'][1] = EnumEntry('MAV_STATE_BOOT', '''System is booting up.''')
MAV_STATE_CALIBRATING = 2 # System is calibrating and not flight-ready.
enums['MAV_STATE'][2] = EnumEntry('MAV_STATE_CALIBRATING', '''System is calibrating and not flight-ready.''')
MAV_STATE_STANDBY = 3 # System is grounded and on standby. It can be launched any time.
enums['MAV_STATE'][3] = EnumEntry('MAV_STATE_STANDBY', '''System is grounded and on standby. It can be launched any time.''')
MAV_STATE_ACTIVE = 4 # System is active and might be already airborne. Motors are engaged.
enums['MAV_STATE'][4] = EnumEntry('MAV_STATE_ACTIVE', '''System is active and might be already airborne. Motors are engaged.''')
MAV_STATE_CRITICAL = 5 # System is in a non-normal flight mode. It can however still navigate.
enums['MAV_STATE'][5] = EnumEntry('MAV_STATE_CRITICAL', '''System is in a non-normal flight mode. It can however still navigate.''')
MAV_STATE_EMERGENCY = 6 # System is in a non-normal flight mode. It lost control over parts or
# over the whole airframe. It is in mayday and
# going down.
enums['MAV_STATE'][6] = EnumEntry('MAV_STATE_EMERGENCY', '''System is in a non-normal flight mode. It lost control over parts or over the whole airframe. It is in mayday and going down.''')
MAV_STATE_POWEROFF = 7 # System just initialized its power-down sequence, will shut down now.
enums['MAV_STATE'][7] = EnumEntry('MAV_STATE_POWEROFF', '''System just initialized its power-down sequence, will shut down now.''')
MAV_STATE_FLIGHT_TERMINATION = 8 # System is terminating itself.
enums['MAV_STATE'][8] = EnumEntry('MAV_STATE_FLIGHT_TERMINATION', '''System is terminating itself.''')
MAV_STATE_ENUM_END = 9 #
enums['MAV_STATE'][9] = EnumEntry('MAV_STATE_ENUM_END', '''''')
# MAV_COMPONENT
enums['MAV_COMPONENT'] = {}
MAV_COMP_ID_ALL = 0 # Target id (target_component) used to broadcast messages to all
# components of the receiving system.
# Components should attempt to process
# messages with this component ID and forward
# to components on any other interfaces. Note:
# This is not a valid *source* component id
# for a message.
enums['MAV_COMPONENT'][0] = EnumEntry('MAV_COMP_ID_ALL', '''Target id (target_component) used to broadcast messages to all components of the receiving system. Components should attempt to process messages with this component ID and forward to components on any other interfaces. Note: This is not a valid *source* component id for a message.''')
MAV_COMP_ID_AUTOPILOT1 = 1 # System flight controller component ("autopilot"). Only one autopilot
# is expected in a particular system.
enums['MAV_COMPONENT'][1] = EnumEntry('MAV_COMP_ID_AUTOPILOT1', '''System flight controller component ("autopilot"). Only one autopilot is expected in a particular system.''')
MAV_COMP_ID_USER1 = 25 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][25] = EnumEntry('MAV_COMP_ID_USER1', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER2 = 26 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][26] = EnumEntry('MAV_COMP_ID_USER2', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER3 = 27 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][27] = EnumEntry('MAV_COMP_ID_USER3', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER4 = 28 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][28] = EnumEntry('MAV_COMP_ID_USER4', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER5 = 29 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][29] = EnumEntry('MAV_COMP_ID_USER5', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER6 = 30 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][30] = EnumEntry('MAV_COMP_ID_USER6', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER7 = 31 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][31] = EnumEntry('MAV_COMP_ID_USER7', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER8 = 32 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][32] = EnumEntry('MAV_COMP_ID_USER8', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER9 = 33 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][33] = EnumEntry('MAV_COMP_ID_USER9', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER10 = 34 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][34] = EnumEntry('MAV_COMP_ID_USER10', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER11 = 35 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][35] = EnumEntry('MAV_COMP_ID_USER11', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER12 = 36 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][36] = EnumEntry('MAV_COMP_ID_USER12', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER13 = 37 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][37] = EnumEntry('MAV_COMP_ID_USER13', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER14 = 38 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][38] = EnumEntry('MAV_COMP_ID_USER14', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER15 = 39 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][39] = EnumEntry('MAV_COMP_ID_USER15', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USE16 = 40 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][40] = EnumEntry('MAV_COMP_ID_USE16', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER17 = 41 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][41] = EnumEntry('MAV_COMP_ID_USER17', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER18 = 42 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][42] = EnumEntry('MAV_COMP_ID_USER18', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER19 = 43 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][43] = EnumEntry('MAV_COMP_ID_USER19', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER20 = 44 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][44] = EnumEntry('MAV_COMP_ID_USER20', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER21 = 45 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][45] = EnumEntry('MAV_COMP_ID_USER21', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER22 = 46 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][46] = EnumEntry('MAV_COMP_ID_USER22', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER23 = 47 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][47] = EnumEntry('MAV_COMP_ID_USER23', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER24 = 48 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][48] = EnumEntry('MAV_COMP_ID_USER24', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER25 = 49 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][49] = EnumEntry('MAV_COMP_ID_USER25', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER26 = 50 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][50] = EnumEntry('MAV_COMP_ID_USER26', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER27 = 51 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][51] = EnumEntry('MAV_COMP_ID_USER27', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER28 = 52 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][52] = EnumEntry('MAV_COMP_ID_USER28', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER29 = 53 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][53] = EnumEntry('MAV_COMP_ID_USER29', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER30 = 54 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][54] = EnumEntry('MAV_COMP_ID_USER30', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER31 = 55 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][55] = EnumEntry('MAV_COMP_ID_USER31', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER32 = 56 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][56] = EnumEntry('MAV_COMP_ID_USER32', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER33 = 57 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][57] = EnumEntry('MAV_COMP_ID_USER33', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER34 = 58 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][58] = EnumEntry('MAV_COMP_ID_USER34', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER35 = 59 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][59] = EnumEntry('MAV_COMP_ID_USER35', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER36 = 60 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][60] = EnumEntry('MAV_COMP_ID_USER36', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER37 = 61 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][61] = EnumEntry('MAV_COMP_ID_USER37', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER38 = 62 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][62] = EnumEntry('MAV_COMP_ID_USER38', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER39 = 63 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][63] = EnumEntry('MAV_COMP_ID_USER39', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER40 = 64 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][64] = EnumEntry('MAV_COMP_ID_USER40', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER41 = 65 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][65] = EnumEntry('MAV_COMP_ID_USER41', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER42 = 66 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][66] = EnumEntry('MAV_COMP_ID_USER42', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER43 = 67 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][67] = EnumEntry('MAV_COMP_ID_USER43', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER44 = 68 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][68] = EnumEntry('MAV_COMP_ID_USER44', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER45 = 69 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][69] = EnumEntry('MAV_COMP_ID_USER45', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER46 = 70 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][70] = EnumEntry('MAV_COMP_ID_USER46', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER47 = 71 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][71] = EnumEntry('MAV_COMP_ID_USER47', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER48 = 72 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][72] = EnumEntry('MAV_COMP_ID_USER48', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER49 = 73 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][73] = EnumEntry('MAV_COMP_ID_USER49', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER50 = 74 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][74] = EnumEntry('MAV_COMP_ID_USER50', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER51 = 75 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][75] = EnumEntry('MAV_COMP_ID_USER51', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER52 = 76 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][76] = EnumEntry('MAV_COMP_ID_USER52', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER53 = 77 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][77] = EnumEntry('MAV_COMP_ID_USER53', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER54 = 78 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][78] = EnumEntry('MAV_COMP_ID_USER54', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER55 = 79 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][79] = EnumEntry('MAV_COMP_ID_USER55', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER56 = 80 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][80] = EnumEntry('MAV_COMP_ID_USER56', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER57 = 81 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][81] = EnumEntry('MAV_COMP_ID_USER57', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER58 = 82 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][82] = EnumEntry('MAV_COMP_ID_USER58', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER59 = 83 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][83] = EnumEntry('MAV_COMP_ID_USER59', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER60 = 84 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][84] = EnumEntry('MAV_COMP_ID_USER60', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER61 = 85 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][85] = EnumEntry('MAV_COMP_ID_USER61', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER62 = 86 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][86] = EnumEntry('MAV_COMP_ID_USER62', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER63 = 87 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][87] = EnumEntry('MAV_COMP_ID_USER63', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER64 = 88 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][88] = EnumEntry('MAV_COMP_ID_USER64', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER65 = 89 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][89] = EnumEntry('MAV_COMP_ID_USER65', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER66 = 90 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][90] = EnumEntry('MAV_COMP_ID_USER66', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER67 = 91 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][91] = EnumEntry('MAV_COMP_ID_USER67', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER68 = 92 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][92] = EnumEntry('MAV_COMP_ID_USER68', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER69 = 93 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][93] = EnumEntry('MAV_COMP_ID_USER69', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER70 = 94 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][94] = EnumEntry('MAV_COMP_ID_USER70', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER71 = 95 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][95] = EnumEntry('MAV_COMP_ID_USER71', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER72 = 96 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][96] = EnumEntry('MAV_COMP_ID_USER72', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER73 = 97 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][97] = EnumEntry('MAV_COMP_ID_USER73', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER74 = 98 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][98] = EnumEntry('MAV_COMP_ID_USER74', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_USER75 = 99 # Id for a component on privately managed MAVLink network. Can be used
# for any purpose but may not be published by
# components outside of the private network.
enums['MAV_COMPONENT'][99] = EnumEntry('MAV_COMP_ID_USER75', '''Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network.''')
MAV_COMP_ID_CAMERA = 100 # Camera #1.
enums['MAV_COMPONENT'][100] = EnumEntry('MAV_COMP_ID_CAMERA', '''Camera #1.''')
MAV_COMP_ID_CAMERA2 = 101 # Camera #2.
enums['MAV_COMPONENT'][101] = EnumEntry('MAV_COMP_ID_CAMERA2', '''Camera #2.''')
MAV_COMP_ID_CAMERA3 = 102 # Camera #3.
enums['MAV_COMPONENT'][102] = EnumEntry('MAV_COMP_ID_CAMERA3', '''Camera #3.''')
MAV_COMP_ID_CAMERA4 = 103 # Camera #4.
enums['MAV_COMPONENT'][103] = EnumEntry('MAV_COMP_ID_CAMERA4', '''Camera #4.''')
MAV_COMP_ID_CAMERA5 = 104 # Camera #5.
enums['MAV_COMPONENT'][104] = EnumEntry('MAV_COMP_ID_CAMERA5', '''Camera #5.''')
MAV_COMP_ID_CAMERA6 = 105 # Camera #6.
enums['MAV_COMPONENT'][105] = EnumEntry('MAV_COMP_ID_CAMERA6', '''Camera #6.''')
MAV_COMP_ID_SERVO1 = 140 # Servo #1.
enums['MAV_COMPONENT'][140] = EnumEntry('MAV_COMP_ID_SERVO1', '''Servo #1.''')
MAV_COMP_ID_SERVO2 = 141 # Servo #2.
enums['MAV_COMPONENT'][141] = EnumEntry('MAV_COMP_ID_SERVO2', '''Servo #2.''')
MAV_COMP_ID_SERVO3 = 142 # Servo #3.
enums['MAV_COMPONENT'][142] = EnumEntry('MAV_COMP_ID_SERVO3', '''Servo #3.''')
MAV_COMP_ID_SERVO4 = 143 # Servo #4.
enums['MAV_COMPONENT'][143] = EnumEntry('MAV_COMP_ID_SERVO4', '''Servo #4.''')
MAV_COMP_ID_SERVO5 = 144 # Servo #5.
enums['MAV_COMPONENT'][144] = EnumEntry('MAV_COMP_ID_SERVO5', '''Servo #5.''')
MAV_COMP_ID_SERVO6 = 145 # Servo #6.
enums['MAV_COMPONENT'][145] = EnumEntry('MAV_COMP_ID_SERVO6', '''Servo #6.''')
MAV_COMP_ID_SERVO7 = 146 # Servo #7.
enums['MAV_COMPONENT'][146] = EnumEntry('MAV_COMP_ID_SERVO7', '''Servo #7.''')
MAV_COMP_ID_SERVO8 = 147 # Servo #8.
enums['MAV_COMPONENT'][147] = EnumEntry('MAV_COMP_ID_SERVO8', '''Servo #8.''')
MAV_COMP_ID_SERVO9 = 148 # Servo #9.
enums['MAV_COMPONENT'][148] = EnumEntry('MAV_COMP_ID_SERVO9', '''Servo #9.''')
MAV_COMP_ID_SERVO10 = 149 # Servo #10.
enums['MAV_COMPONENT'][149] = EnumEntry('MAV_COMP_ID_SERVO10', '''Servo #10.''')
MAV_COMP_ID_SERVO11 = 150 # Servo #11.
enums['MAV_COMPONENT'][150] = EnumEntry('MAV_COMP_ID_SERVO11', '''Servo #11.''')
MAV_COMP_ID_SERVO12 = 151 # Servo #12.
enums['MAV_COMPONENT'][151] = EnumEntry('MAV_COMP_ID_SERVO12', '''Servo #12.''')
MAV_COMP_ID_SERVO13 = 152 # Servo #13.
enums['MAV_COMPONENT'][152] = EnumEntry('MAV_COMP_ID_SERVO13', '''Servo #13.''')
MAV_COMP_ID_SERVO14 = 153 # Servo #14.
enums['MAV_COMPONENT'][153] = EnumEntry('MAV_COMP_ID_SERVO14', '''Servo #14.''')
MAV_COMP_ID_GIMBAL = 154 # Gimbal #1.
enums['MAV_COMPONENT'][154] = EnumEntry('MAV_COMP_ID_GIMBAL', '''Gimbal #1.''')
MAV_COMP_ID_LOG = 155 # Logging component.
enums['MAV_COMPONENT'][155] = EnumEntry('MAV_COMP_ID_LOG', '''Logging component.''')
MAV_COMP_ID_ADSB = 156 # Automatic Dependent Surveillance-Broadcast (ADS-B) component.
enums['MAV_COMPONENT'][156] = EnumEntry('MAV_COMP_ID_ADSB', '''Automatic Dependent Surveillance-Broadcast (ADS-B) component.''')
MAV_COMP_ID_OSD = 157 # On Screen Display (OSD) devices for video links.
enums['MAV_COMPONENT'][157] = EnumEntry('MAV_COMP_ID_OSD', '''On Screen Display (OSD) devices for video links.''')
MAV_COMP_ID_PERIPHERAL = 158 # Generic autopilot peripheral component ID. Meant for devices that do
# not implement the parameter microservice.
enums['MAV_COMPONENT'][158] = EnumEntry('MAV_COMP_ID_PERIPHERAL', '''Generic autopilot peripheral component ID. Meant for devices that do not implement the parameter microservice.''')
MAV_COMP_ID_QX1_GIMBAL = 159 # Gimbal ID for QX1.
enums['MAV_COMPONENT'][159] = EnumEntry('MAV_COMP_ID_QX1_GIMBAL', '''Gimbal ID for QX1.''')
MAV_COMP_ID_FLARM = 160 # FLARM collision alert component.
enums['MAV_COMPONENT'][160] = EnumEntry('MAV_COMP_ID_FLARM', '''FLARM collision alert component.''')
MAV_COMP_ID_GIMBAL2 = 171 # Gimbal #2.
enums['MAV_COMPONENT'][171] = EnumEntry('MAV_COMP_ID_GIMBAL2', '''Gimbal #2.''')
MAV_COMP_ID_GIMBAL3 = 172 # Gimbal #3.
enums['MAV_COMPONENT'][172] = EnumEntry('MAV_COMP_ID_GIMBAL3', '''Gimbal #3.''')
MAV_COMP_ID_GIMBAL4 = 173 # Gimbal #4
enums['MAV_COMPONENT'][173] = EnumEntry('MAV_COMP_ID_GIMBAL4', '''Gimbal #4''')
MAV_COMP_ID_GIMBAL5 = 174 # Gimbal #5.
enums['MAV_COMPONENT'][174] = EnumEntry('MAV_COMP_ID_GIMBAL5', '''Gimbal #5.''')
MAV_COMP_ID_GIMBAL6 = 175 # Gimbal #6.
enums['MAV_COMPONENT'][175] = EnumEntry('MAV_COMP_ID_GIMBAL6', '''Gimbal #6.''')
MAV_COMP_ID_MISSIONPLANNER = 190 # Component that can generate/supply a mission flight plan (e.g. GCS or
# developer API).
enums['MAV_COMPONENT'][190] = EnumEntry('MAV_COMP_ID_MISSIONPLANNER', '''Component that can generate/supply a mission flight plan (e.g. GCS or developer API).''')
MAV_COMP_ID_PATHPLANNER = 195 # Component that finds an optimal path between points based on a certain
# constraint (e.g. minimum snap, shortest
# path, cost, etc.).
enums['MAV_COMPONENT'][195] = EnumEntry('MAV_COMP_ID_PATHPLANNER', '''Component that finds an optimal path between points based on a certain constraint (e.g. minimum snap, shortest path, cost, etc.).''')
MAV_COMP_ID_OBSTACLE_AVOIDANCE = 196 # Component that plans a collision free path between two points.
enums['MAV_COMPONENT'][196] = EnumEntry('MAV_COMP_ID_OBSTACLE_AVOIDANCE', '''Component that plans a collision free path between two points.''')
MAV_COMP_ID_VISUAL_INERTIAL_ODOMETRY = 197 # Component that provides position estimates using VIO techniques.
enums['MAV_COMPONENT'][197] = EnumEntry('MAV_COMP_ID_VISUAL_INERTIAL_ODOMETRY', '''Component that provides position estimates using VIO techniques.''')
MAV_COMP_ID_PAIRING_MANAGER = 198 # Component that manages pairing of vehicle and GCS.
enums['MAV_COMPONENT'][198] = EnumEntry('MAV_COMP_ID_PAIRING_MANAGER', '''Component that manages pairing of vehicle and GCS.''')
MAV_COMP_ID_IMU = 200 # Inertial Measurement Unit (IMU) #1.
enums['MAV_COMPONENT'][200] = EnumEntry('MAV_COMP_ID_IMU', '''Inertial Measurement Unit (IMU) #1.''')
MAV_COMP_ID_IMU_2 = 201 # Inertial Measurement Unit (IMU) #2.
enums['MAV_COMPONENT'][201] = EnumEntry('MAV_COMP_ID_IMU_2', '''Inertial Measurement Unit (IMU) #2.''')
MAV_COMP_ID_IMU_3 = 202 # Inertial Measurement Unit (IMU) #3.
enums['MAV_COMPONENT'][202] = EnumEntry('MAV_COMP_ID_IMU_3', '''Inertial Measurement Unit (IMU) #3.''')
MAV_COMP_ID_GPS = 220 # GPS #1.
enums['MAV_COMPONENT'][220] = EnumEntry('MAV_COMP_ID_GPS', '''GPS #1.''')
MAV_COMP_ID_GPS2 = 221 # GPS #2.
enums['MAV_COMPONENT'][221] = EnumEntry('MAV_COMP_ID_GPS2', '''GPS #2.''')
MAV_COMP_ID_UDP_BRIDGE = 240 # Component to bridge MAVLink to UDP (i.e. from a UART).
enums['MAV_COMPONENT'][240] = EnumEntry('MAV_COMP_ID_UDP_BRIDGE', '''Component to bridge MAVLink to UDP (i.e. from a UART).''')
MAV_COMP_ID_UART_BRIDGE = 241 # Component to bridge to UART (i.e. from UDP).
enums['MAV_COMPONENT'][241] = EnumEntry('MAV_COMP_ID_UART_BRIDGE', '''Component to bridge to UART (i.e. from UDP).''')
MAV_COMP_ID_SYSTEM_CONTROL = 250 # Component for handling system messages (e.g. to ARM, takeoff, etc.).
enums['MAV_COMPONENT'][250] = EnumEntry('MAV_COMP_ID_SYSTEM_CONTROL', '''Component for handling system messages (e.g. to ARM, takeoff, etc.).''')
MAV_COMPONENT_ENUM_END = 251 #
enums['MAV_COMPONENT'][251] = EnumEntry('MAV_COMPONENT_ENUM_END', '''''')
# MAV_SYS_STATUS_SENSOR
enums['MAV_SYS_STATUS_SENSOR'] = {}
MAV_SYS_STATUS_SENSOR_3D_GYRO = 1 # 0x01 3D gyro
enums['MAV_SYS_STATUS_SENSOR'][1] = EnumEntry('MAV_SYS_STATUS_SENSOR_3D_GYRO', '''0x01 3D gyro''')
MAV_SYS_STATUS_SENSOR_3D_ACCEL = 2 # 0x02 3D accelerometer
enums['MAV_SYS_STATUS_SENSOR'][2] = EnumEntry('MAV_SYS_STATUS_SENSOR_3D_ACCEL', '''0x02 3D accelerometer''')
MAV_SYS_STATUS_SENSOR_3D_MAG = 4 # 0x04 3D magnetometer
enums['MAV_SYS_STATUS_SENSOR'][4] = EnumEntry('MAV_SYS_STATUS_SENSOR_3D_MAG', '''0x04 3D magnetometer''')
MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE = 8 # 0x08 absolute pressure
enums['MAV_SYS_STATUS_SENSOR'][8] = EnumEntry('MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE', '''0x08 absolute pressure''')
MAV_SYS_STATUS_SENSOR_DIFFERENTIAL_PRESSURE = 16 # 0x10 differential pressure
enums['MAV_SYS_STATUS_SENSOR'][16] = EnumEntry('MAV_SYS_STATUS_SENSOR_DIFFERENTIAL_PRESSURE', '''0x10 differential pressure''')
MAV_SYS_STATUS_SENSOR_GPS = 32 # 0x20 GPS
enums['MAV_SYS_STATUS_SENSOR'][32] = EnumEntry('MAV_SYS_STATUS_SENSOR_GPS', '''0x20 GPS''')
MAV_SYS_STATUS_SENSOR_OPTICAL_FLOW = 64 # 0x40 optical flow
enums['MAV_SYS_STATUS_SENSOR'][64] = EnumEntry('MAV_SYS_STATUS_SENSOR_OPTICAL_FLOW', '''0x40 optical flow''')
MAV_SYS_STATUS_SENSOR_VISION_POSITION = 128 # 0x80 computer vision position
enums['MAV_SYS_STATUS_SENSOR'][128] = EnumEntry('MAV_SYS_STATUS_SENSOR_VISION_POSITION', '''0x80 computer vision position''')
MAV_SYS_STATUS_SENSOR_LASER_POSITION = 256 # 0x100 laser based position
enums['MAV_SYS_STATUS_SENSOR'][256] = EnumEntry('MAV_SYS_STATUS_SENSOR_LASER_POSITION', '''0x100 laser based position''')
MAV_SYS_STATUS_SENSOR_EXTERNAL_GROUND_TRUTH = 512 # 0x200 external ground truth (Vicon or Leica)
enums['MAV_SYS_STATUS_SENSOR'][512] = EnumEntry('MAV_SYS_STATUS_SENSOR_EXTERNAL_GROUND_TRUTH', '''0x200 external ground truth (Vicon or Leica)''')
MAV_SYS_STATUS_SENSOR_ANGULAR_RATE_CONTROL = 1024 # 0x400 3D angular rate control
enums['MAV_SYS_STATUS_SENSOR'][1024] = EnumEntry('MAV_SYS_STATUS_SENSOR_ANGULAR_RATE_CONTROL', '''0x400 3D angular rate control''')
MAV_SYS_STATUS_SENSOR_ATTITUDE_STABILIZATION = 2048 # 0x800 attitude stabilization
enums['MAV_SYS_STATUS_SENSOR'][2048] = EnumEntry('MAV_SYS_STATUS_SENSOR_ATTITUDE_STABILIZATION', '''0x800 attitude stabilization''')
MAV_SYS_STATUS_SENSOR_YAW_POSITION = 4096 # 0x1000 yaw position
enums['MAV_SYS_STATUS_SENSOR'][4096] = EnumEntry('MAV_SYS_STATUS_SENSOR_YAW_POSITION', '''0x1000 yaw position''')
MAV_SYS_STATUS_SENSOR_Z_ALTITUDE_CONTROL = 8192 # 0x2000 z/altitude control
enums['MAV_SYS_STATUS_SENSOR'][8192] = EnumEntry('MAV_SYS_STATUS_SENSOR_Z_ALTITUDE_CONTROL', '''0x2000 z/altitude control''')
MAV_SYS_STATUS_SENSOR_XY_POSITION_CONTROL = 16384 # 0x4000 x/y position control
enums['MAV_SYS_STATUS_SENSOR'][16384] = EnumEntry('MAV_SYS_STATUS_SENSOR_XY_POSITION_CONTROL', '''0x4000 x/y position control''')
MAV_SYS_STATUS_SENSOR_MOTOR_OUTPUTS = 32768 # 0x8000 motor outputs / control
enums['MAV_SYS_STATUS_SENSOR'][32768] = EnumEntry('MAV_SYS_STATUS_SENSOR_MOTOR_OUTPUTS', '''0x8000 motor outputs / control''')
MAV_SYS_STATUS_SENSOR_RC_RECEIVER = 65536 # 0x10000 rc receiver
enums['MAV_SYS_STATUS_SENSOR'][65536] = EnumEntry('MAV_SYS_STATUS_SENSOR_RC_RECEIVER', '''0x10000 rc receiver''')
MAV_SYS_STATUS_SENSOR_3D_GYRO2 = 131072 # 0x20000 2nd 3D gyro
enums['MAV_SYS_STATUS_SENSOR'][131072] = EnumEntry('MAV_SYS_STATUS_SENSOR_3D_GYRO2', '''0x20000 2nd 3D gyro''')
MAV_SYS_STATUS_SENSOR_3D_ACCEL2 = 262144 # 0x40000 2nd 3D accelerometer
enums['MAV_SYS_STATUS_SENSOR'][262144] = EnumEntry('MAV_SYS_STATUS_SENSOR_3D_ACCEL2', '''0x40000 2nd 3D accelerometer''')
MAV_SYS_STATUS_SENSOR_3D_MAG2 = 524288 # 0x80000 2nd 3D magnetometer
enums['MAV_SYS_STATUS_SENSOR'][524288] = EnumEntry('MAV_SYS_STATUS_SENSOR_3D_MAG2', '''0x80000 2nd 3D magnetometer''')
MAV_SYS_STATUS_GEOFENCE = 1048576 # 0x100000 geofence
enums['MAV_SYS_STATUS_SENSOR'][1048576] = EnumEntry('MAV_SYS_STATUS_GEOFENCE', '''0x100000 geofence''')
MAV_SYS_STATUS_AHRS = 2097152 # 0x200000 AHRS subsystem health
enums['MAV_SYS_STATUS_SENSOR'][2097152] = EnumEntry('MAV_SYS_STATUS_AHRS', '''0x200000 AHRS subsystem health''')
MAV_SYS_STATUS_TERRAIN = 4194304 # 0x400000 Terrain subsystem health
enums['MAV_SYS_STATUS_SENSOR'][4194304] = EnumEntry('MAV_SYS_STATUS_TERRAIN', '''0x400000 Terrain subsystem health''')
MAV_SYS_STATUS_REVERSE_MOTOR = 8388608 # 0x800000 Motors are reversed
enums['MAV_SYS_STATUS_SENSOR'][8388608] = EnumEntry('MAV_SYS_STATUS_REVERSE_MOTOR', '''0x800000 Motors are reversed''')
MAV_SYS_STATUS_LOGGING = 16777216 # 0x1000000 Logging
enums['MAV_SYS_STATUS_SENSOR'][16777216] = EnumEntry('MAV_SYS_STATUS_LOGGING', '''0x1000000 Logging''')
MAV_SYS_STATUS_SENSOR_BATTERY = 33554432 # 0x2000000 Battery
enums['MAV_SYS_STATUS_SENSOR'][33554432] = EnumEntry('MAV_SYS_STATUS_SENSOR_BATTERY', '''0x2000000 Battery''')
MAV_SYS_STATUS_SENSOR_PROXIMITY = 67108864 # 0x4000000 Proximity
enums['MAV_SYS_STATUS_SENSOR'][67108864] = EnumEntry('MAV_SYS_STATUS_SENSOR_PROXIMITY', '''0x4000000 Proximity''')
MAV_SYS_STATUS_SENSOR_SATCOM = 134217728 # 0x8000000 Satellite Communication
enums['MAV_SYS_STATUS_SENSOR'][134217728] = EnumEntry('MAV_SYS_STATUS_SENSOR_SATCOM', '''0x8000000 Satellite Communication ''')
MAV_SYS_STATUS_PREARM_CHECK = 268435456 # 0x10000000 pre-arm check status. Always healthy when armed
enums['MAV_SYS_STATUS_SENSOR'][268435456] = EnumEntry('MAV_SYS_STATUS_PREARM_CHECK', '''0x10000000 pre-arm check status. Always healthy when armed''')
MAV_SYS_STATUS_OBSTACLE_AVOIDANCE = 536870912 # 0x20000000 Avoidance/collision prevention
enums['MAV_SYS_STATUS_SENSOR'][536870912] = EnumEntry('MAV_SYS_STATUS_OBSTACLE_AVOIDANCE', '''0x20000000 Avoidance/collision prevention''')
MAV_SYS_STATUS_SENSOR_ENUM_END = 536870913 #
enums['MAV_SYS_STATUS_SENSOR'][536870913] = EnumEntry('MAV_SYS_STATUS_SENSOR_ENUM_END', '''''')
# MAV_FRAME
enums['MAV_FRAME'] = {}
MAV_FRAME_GLOBAL = 0 # Global (WGS84) coordinate frame + MSL altitude. First value / x:
# latitude, second value / y: longitude, third
# value / z: positive altitude over mean sea
# level (MSL).
enums['MAV_FRAME'][0] = EnumEntry('MAV_FRAME_GLOBAL', '''Global (WGS84) coordinate frame + MSL altitude. First value / x: latitude, second value / y: longitude, third value / z: positive altitude over mean sea level (MSL).''')
MAV_FRAME_LOCAL_NED = 1 # Local coordinate frame, Z-down (x: north, y: east, z: down).
enums['MAV_FRAME'][1] = EnumEntry('MAV_FRAME_LOCAL_NED', '''Local coordinate frame, Z-down (x: north, y: east, z: down).''')
MAV_FRAME_MISSION = 2 # NOT a coordinate frame, indicates a mission command.
enums['MAV_FRAME'][2] = EnumEntry('MAV_FRAME_MISSION', '''NOT a coordinate frame, indicates a mission command.''')
MAV_FRAME_GLOBAL_RELATIVE_ALT = 3 # Global (WGS84) coordinate frame + altitude relative to the home
# position. First value / x: latitude, second
# value / y: longitude, third value / z:
# positive altitude with 0 being at the
# altitude of the home location.
enums['MAV_FRAME'][3] = EnumEntry('MAV_FRAME_GLOBAL_RELATIVE_ALT', '''Global (WGS84) coordinate frame + altitude relative to the home position. First value / x: latitude, second value / y: longitude, third value / z: positive altitude with 0 being at the altitude of the home location.''')
MAV_FRAME_LOCAL_ENU = 4 # Local coordinate frame, Z-up (x: east, y: north, z: up).
enums['MAV_FRAME'][4] = EnumEntry('MAV_FRAME_LOCAL_ENU', '''Local coordinate frame, Z-up (x: east, y: north, z: up).''')
MAV_FRAME_GLOBAL_INT = 5 # Global (WGS84) coordinate frame (scaled) + MSL altitude. First value /
# x: latitude in degrees*1.0e-7, second value
# / y: longitude in degrees*1.0e-7, third
# value / z: positive altitude over mean sea
# level (MSL).
enums['MAV_FRAME'][5] = EnumEntry('MAV_FRAME_GLOBAL_INT', '''Global (WGS84) coordinate frame (scaled) + MSL altitude. First value / x: latitude in degrees*1.0e-7, second value / y: longitude in degrees*1.0e-7, third value / z: positive altitude over mean sea level (MSL).''')
MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6 # Global (WGS84) coordinate frame (scaled) + altitude relative to the
# home position. First value / x: latitude in
# degrees*10e-7, second value / y: longitude
# in degrees*10e-7, third value / z: positive
# altitude with 0 being at the altitude of the
# home location.
enums['MAV_FRAME'][6] = EnumEntry('MAV_FRAME_GLOBAL_RELATIVE_ALT_INT', '''Global (WGS84) coordinate frame (scaled) + altitude relative to the home position. First value / x: latitude in degrees*10e-7, second value / y: longitude in degrees*10e-7, third value / z: positive altitude with 0 being at the altitude of the home location.''')
MAV_FRAME_LOCAL_OFFSET_NED = 7 # Offset to the current local frame. Anything expressed in this frame
# should be added to the current local frame
# position.
enums['MAV_FRAME'][7] = EnumEntry('MAV_FRAME_LOCAL_OFFSET_NED', '''Offset to the current local frame. Anything expressed in this frame should be added to the current local frame position.''')
MAV_FRAME_BODY_NED = 8 # Setpoint in body NED frame. This makes sense if all position control
# is externalized - e.g. useful to command 2
# m/s^2 acceleration to the right.
enums['MAV_FRAME'][8] = EnumEntry('MAV_FRAME_BODY_NED', '''Setpoint in body NED frame. This makes sense if all position control is externalized - e.g. useful to command 2 m/s^2 acceleration to the right.''')
MAV_FRAME_BODY_OFFSET_NED = 9 # Offset in body NED frame. This makes sense if adding setpoints to the
# current flight path, to avoid an obstacle -
# e.g. useful to command 2 m/s^2 acceleration
# to the east.
enums['MAV_FRAME'][9] = EnumEntry('MAV_FRAME_BODY_OFFSET_NED', '''Offset in body NED frame. This makes sense if adding setpoints to the current flight path, to avoid an obstacle - e.g. useful to command 2 m/s^2 acceleration to the east.''')
MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 # Global (WGS84) coordinate frame with AGL altitude (at the waypoint
# coordinate). First value / x: latitude in
# degrees, second value / y: longitude in
# degrees, third value / z: positive altitude
# in meters with 0 being at ground level in
# terrain model.
enums['MAV_FRAME'][10] = EnumEntry('MAV_FRAME_GLOBAL_TERRAIN_ALT', '''Global (WGS84) coordinate frame with AGL altitude (at the waypoint coordinate). First value / x: latitude in degrees, second value / y: longitude in degrees, third value / z: positive altitude in meters with 0 being at ground level in terrain model.''')
MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11 # Global (WGS84) coordinate frame (scaled) with AGL altitude (at the
# waypoint coordinate). First value / x:
# latitude in degrees*10e-7, second value / y:
# longitude in degrees*10e-7, third value / z:
# positive altitude in meters with 0 being at
# ground level in terrain model.
enums['MAV_FRAME'][11] = EnumEntry('MAV_FRAME_GLOBAL_TERRAIN_ALT_INT', '''Global (WGS84) coordinate frame (scaled) with AGL altitude (at the waypoint coordinate). First value / x: latitude in degrees*10e-7, second value / y: longitude in degrees*10e-7, third value / z: positive altitude in meters with 0 being at ground level in terrain model.''')
MAV_FRAME_BODY_FRD = 12 # Body fixed frame of reference, Z-down (x: forward, y: right, z: down).
enums['MAV_FRAME'][12] = EnumEntry('MAV_FRAME_BODY_FRD', '''Body fixed frame of reference, Z-down (x: forward, y: right, z: down).''')
MAV_FRAME_BODY_FLU = 13 # Body fixed frame of reference, Z-up (x: forward, y: left, z: up).
enums['MAV_FRAME'][13] = EnumEntry('MAV_FRAME_BODY_FLU', '''Body fixed frame of reference, Z-up (x: forward, y: left, z: up).''')
MAV_FRAME_MOCAP_NED = 14 # Odometry local coordinate frame of data given by a motion capture
# system, Z-down (x: north, y: east, z: down).
enums['MAV_FRAME'][14] = EnumEntry('MAV_FRAME_MOCAP_NED', '''Odometry local coordinate frame of data given by a motion capture system, Z-down (x: north, y: east, z: down).''')
MAV_FRAME_MOCAP_ENU = 15 # Odometry local coordinate frame of data given by a motion capture
# system, Z-up (x: east, y: north, z: up).
enums['MAV_FRAME'][15] = EnumEntry('MAV_FRAME_MOCAP_ENU', '''Odometry local coordinate frame of data given by a motion capture system, Z-up (x: east, y: north, z: up).''')
MAV_FRAME_VISION_NED = 16 # Odometry local coordinate frame of data given by a vision estimation
# system, Z-down (x: north, y: east, z: down).
enums['MAV_FRAME'][16] = EnumEntry('MAV_FRAME_VISION_NED', '''Odometry local coordinate frame of data given by a vision estimation system, Z-down (x: north, y: east, z: down).''')
MAV_FRAME_VISION_ENU = 17 # Odometry local coordinate frame of data given by a vision estimation
# system, Z-up (x: east, y: north, z: up).
enums['MAV_FRAME'][17] = EnumEntry('MAV_FRAME_VISION_ENU', '''Odometry local coordinate frame of data given by a vision estimation system, Z-up (x: east, y: north, z: up).''')
MAV_FRAME_ESTIM_NED = 18 # Odometry local coordinate frame of data given by an estimator running
# onboard the vehicle, Z-down (x: north, y:
# east, z: down).
enums['MAV_FRAME'][18] = EnumEntry('MAV_FRAME_ESTIM_NED', '''Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-down (x: north, y: east, z: down).''')
MAV_FRAME_ESTIM_ENU = 19 # Odometry local coordinate frame of data given by an estimator running
# onboard the vehicle, Z-up (x: east, y: noth,
# z: up).
enums['MAV_FRAME'][19] = EnumEntry('MAV_FRAME_ESTIM_ENU', '''Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-up (x: east, y: noth, z: up).''')
MAV_FRAME_LOCAL_FRD = 20 # Forward, Right, Down coordinate frame. This is a local frame with
# Z-down and arbitrary F/R alignment (i.e. not
# aligned with NED/earth frame).
enums['MAV_FRAME'][20] = EnumEntry('MAV_FRAME_LOCAL_FRD', '''Forward, Right, Down coordinate frame. This is a local frame with Z-down and arbitrary F/R alignment (i.e. not aligned with NED/earth frame).''')
MAV_FRAME_LOCAL_FLU = 21 # Forward, Left, Up coordinate frame. This is a local frame with Z-up
# and arbitrary F/L alignment (i.e. not
# aligned with ENU/earth frame).
enums['MAV_FRAME'][21] = EnumEntry('MAV_FRAME_LOCAL_FLU', '''Forward, Left, Up coordinate frame. This is a local frame with Z-up and arbitrary F/L alignment (i.e. not aligned with ENU/earth frame).''')
MAV_FRAME_ENUM_END = 22 #
enums['MAV_FRAME'][22] = EnumEntry('MAV_FRAME_ENUM_END', '''''')
# MAVLINK_DATA_STREAM_TYPE
enums['MAVLINK_DATA_STREAM_TYPE'] = {}
MAVLINK_DATA_STREAM_IMG_JPEG = 1 #
enums['MAVLINK_DATA_STREAM_TYPE'][1] = EnumEntry('MAVLINK_DATA_STREAM_IMG_JPEG', '''''')
MAVLINK_DATA_STREAM_IMG_BMP = 2 #
enums['MAVLINK_DATA_STREAM_TYPE'][2] = EnumEntry('MAVLINK_DATA_STREAM_IMG_BMP', '''''')
MAVLINK_DATA_STREAM_IMG_RAW8U = 3 #
enums['MAVLINK_DATA_STREAM_TYPE'][3] = EnumEntry('MAVLINK_DATA_STREAM_IMG_RAW8U', '''''')
MAVLINK_DATA_STREAM_IMG_RAW32U = 4 #
enums['MAVLINK_DATA_STREAM_TYPE'][4] = EnumEntry('MAVLINK_DATA_STREAM_IMG_RAW32U', '''''')
MAVLINK_DATA_STREAM_IMG_PGM = 5 #
enums['MAVLINK_DATA_STREAM_TYPE'][5] = EnumEntry('MAVLINK_DATA_STREAM_IMG_PGM', '''''')
MAVLINK_DATA_STREAM_IMG_PNG = 6 #
enums['MAVLINK_DATA_STREAM_TYPE'][6] = EnumEntry('MAVLINK_DATA_STREAM_IMG_PNG', '''''')
MAVLINK_DATA_STREAM_TYPE_ENUM_END = 7 #
enums['MAVLINK_DATA_STREAM_TYPE'][7] = EnumEntry('MAVLINK_DATA_STREAM_TYPE_ENUM_END', '''''')
# FENCE_ACTION
enums['FENCE_ACTION'] = {}
FENCE_ACTION_NONE = 0 # Disable fenced mode
enums['FENCE_ACTION'][0] = EnumEntry('FENCE_ACTION_NONE', '''Disable fenced mode''')
FENCE_ACTION_GUIDED = 1 # Switched to guided mode to return point (fence point 0)
enums['FENCE_ACTION'][1] = EnumEntry('FENCE_ACTION_GUIDED', '''Switched to guided mode to return point (fence point 0)''')
FENCE_ACTION_REPORT = 2 # Report fence breach, but don't take action
enums['FENCE_ACTION'][2] = EnumEntry('FENCE_ACTION_REPORT', '''Report fence breach, but don't take action''')
FENCE_ACTION_GUIDED_THR_PASS = 3 # Switched to guided mode to return point (fence point 0) with manual
# throttle control
enums['FENCE_ACTION'][3] = EnumEntry('FENCE_ACTION_GUIDED_THR_PASS', '''Switched to guided mode to return point (fence point 0) with manual throttle control''')
FENCE_ACTION_RTL = 4 # Switch to RTL (return to launch) mode and head for the return point.
enums['FENCE_ACTION'][4] = EnumEntry('FENCE_ACTION_RTL', '''Switch to RTL (return to launch) mode and head for the return point.''')
FENCE_ACTION_ENUM_END = 5 #
enums['FENCE_ACTION'][5] = EnumEntry('FENCE_ACTION_ENUM_END', '''''')
# FENCE_BREACH
enums['FENCE_BREACH'] = {}
FENCE_BREACH_NONE = 0 # No last fence breach
enums['FENCE_BREACH'][0] = EnumEntry('FENCE_BREACH_NONE', '''No last fence breach''')
FENCE_BREACH_MINALT = 1 # Breached minimum altitude
enums['FENCE_BREACH'][1] = EnumEntry('FENCE_BREACH_MINALT', '''Breached minimum altitude''')
FENCE_BREACH_MAXALT = 2 # Breached maximum altitude
enums['FENCE_BREACH'][2] = EnumEntry('FENCE_BREACH_MAXALT', '''Breached maximum altitude''')
FENCE_BREACH_BOUNDARY = 3 # Breached fence boundary
enums['FENCE_BREACH'][3] = EnumEntry('FENCE_BREACH_BOUNDARY', '''Breached fence boundary''')
FENCE_BREACH_ENUM_END = 4 #
enums['FENCE_BREACH'][4] = EnumEntry('FENCE_BREACH_ENUM_END', '''''')
# FENCE_MITIGATE
enums['FENCE_MITIGATE'] = {}
FENCE_MITIGATE_UNKNOWN = 0 # Unknown
enums['FENCE_MITIGATE'][0] = EnumEntry('FENCE_MITIGATE_UNKNOWN', '''Unknown''')
FENCE_MITIGATE_NONE = 1 # No actions being taken
enums['FENCE_MITIGATE'][1] = EnumEntry('FENCE_MITIGATE_NONE', '''No actions being taken''')
FENCE_MITIGATE_VEL_LIMIT = 2 # Velocity limiting active to prevent breach
enums['FENCE_MITIGATE'][2] = EnumEntry('FENCE_MITIGATE_VEL_LIMIT', '''Velocity limiting active to prevent breach''')
FENCE_MITIGATE_ENUM_END = 3 #
enums['FENCE_MITIGATE'][3] = EnumEntry('FENCE_MITIGATE_ENUM_END', '''''')
# MAV_MOUNT_MODE
enums['MAV_MOUNT_MODE'] = {}
MAV_MOUNT_MODE_RETRACT = 0 # Load and keep safe position (Roll,Pitch,Yaw) from permant memory and
# stop stabilization
enums['MAV_MOUNT_MODE'][0] = EnumEntry('MAV_MOUNT_MODE_RETRACT', '''Load and keep safe position (Roll,Pitch,Yaw) from permant memory and stop stabilization''')
MAV_MOUNT_MODE_NEUTRAL = 1 # Load and keep neutral position (Roll,Pitch,Yaw) from permanent memory.
enums['MAV_MOUNT_MODE'][1] = EnumEntry('MAV_MOUNT_MODE_NEUTRAL', '''Load and keep neutral position (Roll,Pitch,Yaw) from permanent memory.''')
MAV_MOUNT_MODE_MAVLINK_TARGETING = 2 # Load neutral position and start MAVLink Roll,Pitch,Yaw control with
# stabilization
enums['MAV_MOUNT_MODE'][2] = EnumEntry('MAV_MOUNT_MODE_MAVLINK_TARGETING', '''Load neutral position and start MAVLink Roll,Pitch,Yaw control with stabilization''')
MAV_MOUNT_MODE_RC_TARGETING = 3 # Load neutral position and start RC Roll,Pitch,Yaw control with
# stabilization
enums['MAV_MOUNT_MODE'][3] = EnumEntry('MAV_MOUNT_MODE_RC_TARGETING', '''Load neutral position and start RC Roll,Pitch,Yaw control with stabilization''')
MAV_MOUNT_MODE_GPS_POINT = 4 # Load neutral position and start to point to Lat,Lon,Alt
enums['MAV_MOUNT_MODE'][4] = EnumEntry('MAV_MOUNT_MODE_GPS_POINT', '''Load neutral position and start to point to Lat,Lon,Alt''')
MAV_MOUNT_MODE_SYSID_TARGET = 5 # Gimbal tracks system with specified system ID
enums['MAV_MOUNT_MODE'][5] = EnumEntry('MAV_MOUNT_MODE_SYSID_TARGET', '''Gimbal tracks system with specified system ID''')
MAV_MOUNT_MODE_ENUM_END = 6 #
enums['MAV_MOUNT_MODE'][6] = EnumEntry('MAV_MOUNT_MODE_ENUM_END', '''''')
# UAVCAN_NODE_HEALTH
enums['UAVCAN_NODE_HEALTH'] = {}
UAVCAN_NODE_HEALTH_OK = 0 # The node is functioning properly.
enums['UAVCAN_NODE_HEALTH'][0] = EnumEntry('UAVCAN_NODE_HEALTH_OK', '''The node is functioning properly.''')
UAVCAN_NODE_HEALTH_WARNING = 1 # A critical parameter went out of range or the node has encountered a
# minor failure.
enums['UAVCAN_NODE_HEALTH'][1] = EnumEntry('UAVCAN_NODE_HEALTH_WARNING', '''A critical parameter went out of range or the node has encountered a minor failure.''')
UAVCAN_NODE_HEALTH_ERROR = 2 # The node has encountered a major failure.
enums['UAVCAN_NODE_HEALTH'][2] = EnumEntry('UAVCAN_NODE_HEALTH_ERROR', '''The node has encountered a major failure.''')
UAVCAN_NODE_HEALTH_CRITICAL = 3 # The node has suffered a fatal malfunction.
enums['UAVCAN_NODE_HEALTH'][3] = EnumEntry('UAVCAN_NODE_HEALTH_CRITICAL', '''The node has suffered a fatal malfunction.''')
UAVCAN_NODE_HEALTH_ENUM_END = 4 #
enums['UAVCAN_NODE_HEALTH'][4] = EnumEntry('UAVCAN_NODE_HEALTH_ENUM_END', '''''')
# UAVCAN_NODE_MODE
enums['UAVCAN_NODE_MODE'] = {}
UAVCAN_NODE_MODE_OPERATIONAL = 0 # The node is performing its primary functions.
enums['UAVCAN_NODE_MODE'][0] = EnumEntry('UAVCAN_NODE_MODE_OPERATIONAL', '''The node is performing its primary functions.''')
UAVCAN_NODE_MODE_INITIALIZATION = 1 # The node is initializing; this mode is entered immediately after
# startup.
enums['UAVCAN_NODE_MODE'][1] = EnumEntry('UAVCAN_NODE_MODE_INITIALIZATION', '''The node is initializing; this mode is entered immediately after startup.''')
UAVCAN_NODE_MODE_MAINTENANCE = 2 # The node is under maintenance.
enums['UAVCAN_NODE_MODE'][2] = EnumEntry('UAVCAN_NODE_MODE_MAINTENANCE', '''The node is under maintenance.''')
UAVCAN_NODE_MODE_SOFTWARE_UPDATE = 3 # The node is in the process of updating its software.
enums['UAVCAN_NODE_MODE'][3] = EnumEntry('UAVCAN_NODE_MODE_SOFTWARE_UPDATE', '''The node is in the process of updating its software.''')
UAVCAN_NODE_MODE_OFFLINE = 7 # The node is no longer available online.
enums['UAVCAN_NODE_MODE'][7] = EnumEntry('UAVCAN_NODE_MODE_OFFLINE', '''The node is no longer available online.''')
UAVCAN_NODE_MODE_ENUM_END = 8 #
enums['UAVCAN_NODE_MODE'][8] = EnumEntry('UAVCAN_NODE_MODE_ENUM_END', '''''')
# STORAGE_STATUS
enums['STORAGE_STATUS'] = {}
STORAGE_STATUS_EMPTY = 0 # Storage is missing (no microSD card loaded for example.)
enums['STORAGE_STATUS'][0] = EnumEntry('STORAGE_STATUS_EMPTY', '''Storage is missing (no microSD card loaded for example.)''')
STORAGE_STATUS_UNFORMATTED = 1 # Storage present but unformatted.
enums['STORAGE_STATUS'][1] = EnumEntry('STORAGE_STATUS_UNFORMATTED', '''Storage present but unformatted.''')
STORAGE_STATUS_READY = 2 # Storage present and ready.
enums['STORAGE_STATUS'][2] = EnumEntry('STORAGE_STATUS_READY', '''Storage present and ready.''')
STORAGE_STATUS_NOT_SUPPORTED = 3 # Camera does not supply storage status information. Capacity
# information in STORAGE_INFORMATION fields
# will be ignored.
enums['STORAGE_STATUS'][3] = EnumEntry('STORAGE_STATUS_NOT_SUPPORTED', '''Camera does not supply storage status information. Capacity information in STORAGE_INFORMATION fields will be ignored.''')
STORAGE_STATUS_ENUM_END = 4 #
enums['STORAGE_STATUS'][4] = EnumEntry('STORAGE_STATUS_ENUM_END', '''''')
# MAV_DATA_STREAM
enums['MAV_DATA_STREAM'] = {}
MAV_DATA_STREAM_ALL = 0 # Enable all data streams
enums['MAV_DATA_STREAM'][0] = EnumEntry('MAV_DATA_STREAM_ALL', '''Enable all data streams''')
MAV_DATA_STREAM_RAW_SENSORS = 1 # Enable IMU_RAW, GPS_RAW, GPS_STATUS packets.
enums['MAV_DATA_STREAM'][1] = EnumEntry('MAV_DATA_STREAM_RAW_SENSORS', '''Enable IMU_RAW, GPS_RAW, GPS_STATUS packets.''')
MAV_DATA_STREAM_EXTENDED_STATUS = 2 # Enable GPS_STATUS, CONTROL_STATUS, AUX_STATUS
enums['MAV_DATA_STREAM'][2] = EnumEntry('MAV_DATA_STREAM_EXTENDED_STATUS', '''Enable GPS_STATUS, CONTROL_STATUS, AUX_STATUS''')
MAV_DATA_STREAM_RC_CHANNELS = 3 # Enable RC_CHANNELS_SCALED, RC_CHANNELS_RAW, SERVO_OUTPUT_RAW
enums['MAV_DATA_STREAM'][3] = EnumEntry('MAV_DATA_STREAM_RC_CHANNELS', '''Enable RC_CHANNELS_SCALED, RC_CHANNELS_RAW, SERVO_OUTPUT_RAW''')
MAV_DATA_STREAM_RAW_CONTROLLER = 4 # Enable ATTITUDE_CONTROLLER_OUTPUT, POSITION_CONTROLLER_OUTPUT,
# NAV_CONTROLLER_OUTPUT.
enums['MAV_DATA_STREAM'][4] = EnumEntry('MAV_DATA_STREAM_RAW_CONTROLLER', '''Enable ATTITUDE_CONTROLLER_OUTPUT, POSITION_CONTROLLER_OUTPUT, NAV_CONTROLLER_OUTPUT.''')
MAV_DATA_STREAM_POSITION = 6 # Enable LOCAL_POSITION, GLOBAL_POSITION/GLOBAL_POSITION_INT messages.
enums['MAV_DATA_STREAM'][6] = EnumEntry('MAV_DATA_STREAM_POSITION', '''Enable LOCAL_POSITION, GLOBAL_POSITION/GLOBAL_POSITION_INT messages.''')
MAV_DATA_STREAM_EXTRA1 = 10 # Dependent on the autopilot
enums['MAV_DATA_STREAM'][10] = EnumEntry('MAV_DATA_STREAM_EXTRA1', '''Dependent on the autopilot''')
MAV_DATA_STREAM_EXTRA2 = 11 # Dependent on the autopilot
enums['MAV_DATA_STREAM'][11] = EnumEntry('MAV_DATA_STREAM_EXTRA2', '''Dependent on the autopilot''')
MAV_DATA_STREAM_EXTRA3 = 12 # Dependent on the autopilot
enums['MAV_DATA_STREAM'][12] = EnumEntry('MAV_DATA_STREAM_EXTRA3', '''Dependent on the autopilot''')
MAV_DATA_STREAM_ENUM_END = 13 #
enums['MAV_DATA_STREAM'][13] = EnumEntry('MAV_DATA_STREAM_ENUM_END', '''''')
# MAV_ROI
enums['MAV_ROI'] = {}
MAV_ROI_NONE = 0 # No region of interest.
enums['MAV_ROI'][0] = EnumEntry('MAV_ROI_NONE', '''No region of interest.''')
MAV_ROI_WPNEXT = 1 # Point toward next waypoint, with optional pitch/roll/yaw offset.
enums['MAV_ROI'][1] = EnumEntry('MAV_ROI_WPNEXT', '''Point toward next waypoint, with optional pitch/roll/yaw offset.''')
MAV_ROI_WPINDEX = 2 # Point toward given waypoint.
enums['MAV_ROI'][2] = EnumEntry('MAV_ROI_WPINDEX', '''Point toward given waypoint.''')
MAV_ROI_LOCATION = 3 # Point toward fixed location.
enums['MAV_ROI'][3] = EnumEntry('MAV_ROI_LOCATION', '''Point toward fixed location.''')
MAV_ROI_TARGET = 4 # Point toward of given id.
enums['MAV_ROI'][4] = EnumEntry('MAV_ROI_TARGET', '''Point toward of given id.''')
MAV_ROI_ENUM_END = 5 #
enums['MAV_ROI'][5] = EnumEntry('MAV_ROI_ENUM_END', '''''')
# MAV_CMD_ACK
enums['MAV_CMD_ACK'] = {}
MAV_CMD_ACK_OK = 1 # Command / mission item is ok.
enums['MAV_CMD_ACK'][1] = EnumEntry('MAV_CMD_ACK_OK', '''Command / mission item is ok.''')
enums['MAV_CMD_ACK'][1].param[1] = '''Reserved (default:0)'''
enums['MAV_CMD_ACK'][1].param[2] = '''Reserved (default:0)'''
enums['MAV_CMD_ACK'][1].param[3] = '''Reserved (default:0)'''
enums['MAV_CMD_ACK'][1].param[4] = '''Reserved (default:0)'''
enums['MAV_CMD_ACK'][1].param[5] = '''Reserved (default:0)'''
enums['MAV_CMD_ACK'][1].param[6] = '''Reserved (default:0)'''
enums['MAV_CMD_ACK'][1].param[7] = '''Reserved (default:0)'''
MAV_CMD_ACK_ERR_FAIL = 2 # Generic error message if none of the other reasons fails or if no
# detailed error reporting is implemented.
enums['MAV_CMD_ACK'][2] = EnumEntry('MAV_CMD_ACK_ERR_FAIL', '''Generic error message if none of the other reasons fails or if no detailed error reporting is implemented.''')
enums['MAV_CMD_ACK'][2].param[1] = '''Reserved (default:0)'''
enums['MAV_CMD_ACK'][2].param[2] = '''Reserved (default:0)'''
enums['MAV_CMD_ACK'][2].param[3] = '''Reserved (default:0)'''
enums['MAV_CMD_ACK'][2].param[4] = '''Reserved (default:0)'''
enums['MAV_CMD_ACK'][2].param[5] = '''Reserved (default:0)'''
enums['MAV_CMD_ACK'][2].param[6] = '''Reserved (default:0)'''
enums['MAV_CMD_ACK'][2].param[7] = '''Reserved (default:0)'''
MAV_CMD_ACK_ERR_ACCESS_DENIED = 3 # The system is refusing to accept this command from this source /
# communication partner.
enums['MAV_CMD_ACK'][3] = EnumEntry('MAV_CMD_ACK_ERR_ACCESS_DENIED', '''The system is refusing to accept this command from this source / communication partner.''')
enums['MAV_CMD_ACK'][3].param[1] = '''Reserved (default:0)'''
enums['MAV_CMD_ACK'][3].param[2] = '''Reserved (default:0)'''
enums['MAV_CMD_ACK'][3].param[3] = '''Reserved (default:0)'''
enums['MAV_CMD_ACK'][3].param[4] = '''Reserved (default:0)'''
enums['MAV_CMD_ACK'][3].param[5] = '''Reserved (default:0)'''
enums['MAV_CMD_ACK'][3].param[6] = '''Reserved (default:0)'''
enums['MAV_CMD_ACK'][3].param[7] = '''Reserved (default:0)'''
MAV_CMD_ACK_ERR_NOT_SUPPORTED = 4 # Command or mission item is not supported, other commands would be
# accepted.
enums['MAV_CMD_ACK'][4] = EnumEntry('MAV_CMD_ACK_ERR_NOT_SUPPORTED', '''Command or mission item is not supported, other commands would be accepted.''')
enums['MAV_CMD_ACK'][4].param[1] = '''Reserved (default:0)'''
enums['MAV_CMD_ACK'][4].param[2] = '''Reserved (default:0)'''
enums['MAV_CMD_ACK'][4].param[3] = '''Reserved (default:0)'''
enums['MAV_CMD_ACK'][4].param[4] = '''Reserved (default:0)'''
enums['MAV_CMD_ACK'][4].param[5] = '''Reserved (default:0)'''
enums['MAV_CMD_ACK'][4].param[6] = '''Reserved (default:0)'''
enums['MAV_CMD_ACK'][4].param[7] = '''Reserved (default:0)'''
MAV_CMD_ACK_ERR_COORDINATE_FRAME_NOT_SUPPORTED = 5 # The coordinate frame of this command / mission item is not supported.
enums['MAV_CMD_ACK'][5] = EnumEntry('MAV_CMD_ACK_ERR_COORDINATE_FRAME_NOT_SUPPORTED', '''The coordinate frame of this command / mission item is not supported.''')
enums['MAV_CMD_ACK'][5].param[1] = '''Reserved (default:0)'''
enums['MAV_CMD_ACK'][5].param[2] = '''Reserved (default:0)'''
enums['MAV_CMD_ACK'][5].param[3] = '''Reserved (default:0)'''
enums['MAV_CMD_ACK'][5].param[4] = '''Reserved (default:0)'''
enums['MAV_CMD_ACK'][5].param[5] = '''Reserved (default:0)'''
enums['MAV_CMD_ACK'][5].param[6] = '''Reserved (default:0)'''
enums['MAV_CMD_ACK'][5].param[7] = '''Reserved (default:0)'''
MAV_CMD_ACK_ERR_COORDINATES_OUT_OF_RANGE = 6 # The coordinate frame of this command is ok, but he coordinate values
# exceed the safety limits of this system.
# This is a generic error, please use the more
# specific error messages below if possible.
enums['MAV_CMD_ACK'][6] = EnumEntry('MAV_CMD_ACK_ERR_COORDINATES_OUT_OF_RANGE', '''The coordinate frame of this command is ok, but he coordinate values exceed the safety limits of this system. This is a generic error, please use the more specific error messages below if possible.''')
enums['MAV_CMD_ACK'][6].param[1] = '''Reserved (default:0)'''
enums['MAV_CMD_ACK'][6].param[2] = '''Reserved (default:0)'''
enums['MAV_CMD_ACK'][6].param[3] = '''Reserved (default:0)'''
enums['MAV_CMD_ACK'][6].param[4] = '''Reserved (default:0)'''
enums['MAV_CMD_ACK'][6].param[5] = '''Reserved (default:0)'''
enums['MAV_CMD_ACK'][6].param[6] = '''Reserved (default:0)'''
enums['MAV_CMD_ACK'][6].param[7] = '''Reserved (default:0)'''
MAV_CMD_ACK_ERR_X_LAT_OUT_OF_RANGE = 7 # The X or latitude value is out of range.
enums['MAV_CMD_ACK'][7] = EnumEntry('MAV_CMD_ACK_ERR_X_LAT_OUT_OF_RANGE', '''The X or latitude value is out of range.''')
enums['MAV_CMD_ACK'][7].param[1] = '''Reserved (default:0)'''
enums['MAV_CMD_ACK'][7].param[2] = '''Reserved (default:0)'''
enums['MAV_CMD_ACK'][7].param[3] = '''Reserved (default:0)'''
enums['MAV_CMD_ACK'][7].param[4] = '''Reserved (default:0)'''
enums['MAV_CMD_ACK'][7].param[5] = '''Reserved (default:0)'''
enums['MAV_CMD_ACK'][7].param[6] = '''Reserved (default:0)'''
enums['MAV_CMD_ACK'][7].param[7] = '''Reserved (default:0)'''
MAV_CMD_ACK_ERR_Y_LON_OUT_OF_RANGE = 8 # The Y or longitude value is out of range.
enums['MAV_CMD_ACK'][8] = EnumEntry('MAV_CMD_ACK_ERR_Y_LON_OUT_OF_RANGE', '''The Y or longitude value is out of range.''')
enums['MAV_CMD_ACK'][8].param[1] = '''Reserved (default:0)'''
enums['MAV_CMD_ACK'][8].param[2] = '''Reserved (default:0)'''
enums['MAV_CMD_ACK'][8].param[3] = '''Reserved (default:0)'''
enums['MAV_CMD_ACK'][8].param[4] = '''Reserved (default:0)'''
enums['MAV_CMD_ACK'][8].param[5] = '''Reserved (default:0)'''
enums['MAV_CMD_ACK'][8].param[6] = '''Reserved (default:0)'''
enums['MAV_CMD_ACK'][8].param[7] = '''Reserved (default:0)'''
MAV_CMD_ACK_ERR_Z_ALT_OUT_OF_RANGE = 9 # The Z or altitude value is out of range.
enums['MAV_CMD_ACK'][9] = EnumEntry('MAV_CMD_ACK_ERR_Z_ALT_OUT_OF_RANGE', '''The Z or altitude value is out of range.''')
enums['MAV_CMD_ACK'][9].param[1] = '''Reserved (default:0)'''
enums['MAV_CMD_ACK'][9].param[2] = '''Reserved (default:0)'''
enums['MAV_CMD_ACK'][9].param[3] = '''Reserved (default:0)'''
enums['MAV_CMD_ACK'][9].param[4] = '''Reserved (default:0)'''
enums['MAV_CMD_ACK'][9].param[5] = '''Reserved (default:0)'''
enums['MAV_CMD_ACK'][9].param[6] = '''Reserved (default:0)'''
enums['MAV_CMD_ACK'][9].param[7] = '''Reserved (default:0)'''
MAV_CMD_ACK_ENUM_END = 10 #
enums['MAV_CMD_ACK'][10] = EnumEntry('MAV_CMD_ACK_ENUM_END', '''''')
# MAV_PARAM_TYPE
enums['MAV_PARAM_TYPE'] = {}
MAV_PARAM_TYPE_UINT8 = 1 # 8-bit unsigned integer
enums['MAV_PARAM_TYPE'][1] = EnumEntry('MAV_PARAM_TYPE_UINT8', '''8-bit unsigned integer''')
MAV_PARAM_TYPE_INT8 = 2 # 8-bit signed integer
enums['MAV_PARAM_TYPE'][2] = EnumEntry('MAV_PARAM_TYPE_INT8', '''8-bit signed integer''')
MAV_PARAM_TYPE_UINT16 = 3 # 16-bit unsigned integer
enums['MAV_PARAM_TYPE'][3] = EnumEntry('MAV_PARAM_TYPE_UINT16', '''16-bit unsigned integer''')
MAV_PARAM_TYPE_INT16 = 4 # 16-bit signed integer
enums['MAV_PARAM_TYPE'][4] = EnumEntry('MAV_PARAM_TYPE_INT16', '''16-bit signed integer''')
MAV_PARAM_TYPE_UINT32 = 5 # 32-bit unsigned integer
enums['MAV_PARAM_TYPE'][5] = EnumEntry('MAV_PARAM_TYPE_UINT32', '''32-bit unsigned integer''')
MAV_PARAM_TYPE_INT32 = 6 # 32-bit signed integer
enums['MAV_PARAM_TYPE'][6] = EnumEntry('MAV_PARAM_TYPE_INT32', '''32-bit signed integer''')
MAV_PARAM_TYPE_UINT64 = 7 # 64-bit unsigned integer
enums['MAV_PARAM_TYPE'][7] = EnumEntry('MAV_PARAM_TYPE_UINT64', '''64-bit unsigned integer''')
MAV_PARAM_TYPE_INT64 = 8 # 64-bit signed integer
enums['MAV_PARAM_TYPE'][8] = EnumEntry('MAV_PARAM_TYPE_INT64', '''64-bit signed integer''')
MAV_PARAM_TYPE_REAL32 = 9 # 32-bit floating-point
enums['MAV_PARAM_TYPE'][9] = EnumEntry('MAV_PARAM_TYPE_REAL32', '''32-bit floating-point''')
MAV_PARAM_TYPE_REAL64 = 10 # 64-bit floating-point
enums['MAV_PARAM_TYPE'][10] = EnumEntry('MAV_PARAM_TYPE_REAL64', '''64-bit floating-point''')
MAV_PARAM_TYPE_ENUM_END = 11 #
enums['MAV_PARAM_TYPE'][11] = EnumEntry('MAV_PARAM_TYPE_ENUM_END', '''''')
# MAV_RESULT
enums['MAV_RESULT'] = {}
MAV_RESULT_ACCEPTED = 0 # Command is valid (is supported and has valid parameters), and was
# executed.
enums['MAV_RESULT'][0] = EnumEntry('MAV_RESULT_ACCEPTED', '''Command is valid (is supported and has valid parameters), and was executed.''')
MAV_RESULT_TEMPORARILY_REJECTED = 1 # Command is valid, but cannot be executed at this time. This is used to
# indicate a problem that should be fixed just
# by waiting (e.g. a state machine is busy,
# can't arm because have not got GPS lock,
# etc.). Retrying later should work.
enums['MAV_RESULT'][1] = EnumEntry('MAV_RESULT_TEMPORARILY_REJECTED', '''Command is valid, but cannot be executed at this time. This is used to indicate a problem that should be fixed just by waiting (e.g. a state machine is busy, can't arm because have not got GPS lock, etc.). Retrying later should work.''')
MAV_RESULT_DENIED = 2 # Command is invalid (is supported but has invalid parameters). Retrying
# same command and parameters will not work.
enums['MAV_RESULT'][2] = EnumEntry('MAV_RESULT_DENIED', '''Command is invalid (is supported but has invalid parameters). Retrying same command and parameters will not work.''')
MAV_RESULT_UNSUPPORTED = 3 # Command is not supported (unknown).
enums['MAV_RESULT'][3] = EnumEntry('MAV_RESULT_UNSUPPORTED', '''Command is not supported (unknown).''')
MAV_RESULT_FAILED = 4 # Command is valid, but execution has failed. This is used to indicate
# any non-temporary or unexpected problem,
# i.e. any problem that must be fixed before
# the command can succeed/be retried. For
# example, attempting to write a file when out
# of memory, attempting to arm when sensors
# are not calibrated, etc.
enums['MAV_RESULT'][4] = EnumEntry('MAV_RESULT_FAILED', '''Command is valid, but execution has failed. This is used to indicate any non-temporary or unexpected problem, i.e. any problem that must be fixed before the command can succeed/be retried. For example, attempting to write a file when out of memory, attempting to arm when sensors are not calibrated, etc.''')
MAV_RESULT_IN_PROGRESS = 5 # Command is valid and is being executed. This will be followed by
# further progress updates, i.e. the component
# may send further COMMAND_ACK messages with
# result MAV_RESULT_IN_PROGRESS (at a rate
# decided by the implementation), and must
# terminate by sending a COMMAND_ACK message
# with final result of the operation. The
# COMMAND_ACK.progress field can be used to
# indicate the progress of the operation.
# There is no need for the sender to retry the
# command, but if done during execution, the
# component will return MAV_RESULT_IN_PROGRESS
# with an updated progress.
enums['MAV_RESULT'][5] = EnumEntry('MAV_RESULT_IN_PROGRESS', '''Command is valid and is being executed. This will be followed by further progress updates, i.e. the component may send further COMMAND_ACK messages with result MAV_RESULT_IN_PROGRESS (at a rate decided by the implementation), and must terminate by sending a COMMAND_ACK message with final result of the operation. The COMMAND_ACK.progress field can be used to indicate the progress of the operation. There is no need for the sender to retry the command, but if done during execution, the component will return MAV_RESULT_IN_PROGRESS with an updated progress.''')
MAV_RESULT_ENUM_END = 6 #
enums['MAV_RESULT'][6] = EnumEntry('MAV_RESULT_ENUM_END', '''''')
# MAV_MISSION_RESULT
enums['MAV_MISSION_RESULT'] = {}
MAV_MISSION_ACCEPTED = 0 # mission accepted OK
enums['MAV_MISSION_RESULT'][0] = EnumEntry('MAV_MISSION_ACCEPTED', '''mission accepted OK''')
MAV_MISSION_ERROR = 1 # Generic error / not accepting mission commands at all right now.
enums['MAV_MISSION_RESULT'][1] = EnumEntry('MAV_MISSION_ERROR', '''Generic error / not accepting mission commands at all right now.''')
MAV_MISSION_UNSUPPORTED_FRAME = 2 # Coordinate frame is not supported.
enums['MAV_MISSION_RESULT'][2] = EnumEntry('MAV_MISSION_UNSUPPORTED_FRAME', '''Coordinate frame is not supported.''')
MAV_MISSION_UNSUPPORTED = 3 # Command is not supported.
enums['MAV_MISSION_RESULT'][3] = EnumEntry('MAV_MISSION_UNSUPPORTED', '''Command is not supported.''')
MAV_MISSION_NO_SPACE = 4 # Mission item exceeds storage space.
enums['MAV_MISSION_RESULT'][4] = EnumEntry('MAV_MISSION_NO_SPACE', '''Mission item exceeds storage space.''')
MAV_MISSION_INVALID = 5 # One of the parameters has an invalid value.
enums['MAV_MISSION_RESULT'][5] = EnumEntry('MAV_MISSION_INVALID', '''One of the parameters has an invalid value.''')
MAV_MISSION_INVALID_PARAM1 = 6 # param1 has an invalid value.
enums['MAV_MISSION_RESULT'][6] = EnumEntry('MAV_MISSION_INVALID_PARAM1', '''param1 has an invalid value.''')
MAV_MISSION_INVALID_PARAM2 = 7 # param2 has an invalid value.
enums['MAV_MISSION_RESULT'][7] = EnumEntry('MAV_MISSION_INVALID_PARAM2', '''param2 has an invalid value.''')
MAV_MISSION_INVALID_PARAM3 = 8 # param3 has an invalid value.
enums['MAV_MISSION_RESULT'][8] = EnumEntry('MAV_MISSION_INVALID_PARAM3', '''param3 has an invalid value.''')
MAV_MISSION_INVALID_PARAM4 = 9 # param4 has an invalid value.
enums['MAV_MISSION_RESULT'][9] = EnumEntry('MAV_MISSION_INVALID_PARAM4', '''param4 has an invalid value.''')
MAV_MISSION_INVALID_PARAM5_X = 10 # x / param5 has an invalid value.
enums['MAV_MISSION_RESULT'][10] = EnumEntry('MAV_MISSION_INVALID_PARAM5_X', '''x / param5 has an invalid value.''')
MAV_MISSION_INVALID_PARAM6_Y = 11 # y / param6 has an invalid value.
enums['MAV_MISSION_RESULT'][11] = EnumEntry('MAV_MISSION_INVALID_PARAM6_Y', '''y / param6 has an invalid value.''')
MAV_MISSION_INVALID_PARAM7 = 12 # z / param7 has an invalid value.
enums['MAV_MISSION_RESULT'][12] = EnumEntry('MAV_MISSION_INVALID_PARAM7', '''z / param7 has an invalid value.''')
MAV_MISSION_INVALID_SEQUENCE = 13 # Mission item received out of sequence
enums['MAV_MISSION_RESULT'][13] = EnumEntry('MAV_MISSION_INVALID_SEQUENCE', '''Mission item received out of sequence''')
MAV_MISSION_DENIED = 14 # Not accepting any mission commands from this communication partner.
enums['MAV_MISSION_RESULT'][14] = EnumEntry('MAV_MISSION_DENIED', '''Not accepting any mission commands from this communication partner.''')
MAV_MISSION_OPERATION_CANCELLED = 15 # Current mission operation cancelled (e.g. mission upload, mission
# download).
enums['MAV_MISSION_RESULT'][15] = EnumEntry('MAV_MISSION_OPERATION_CANCELLED', '''Current mission operation cancelled (e.g. mission upload, mission download).''')
MAV_MISSION_RESULT_ENUM_END = 16 #
enums['MAV_MISSION_RESULT'][16] = EnumEntry('MAV_MISSION_RESULT_ENUM_END', '''''')
# MAV_SEVERITY
enums['MAV_SEVERITY'] = {}
MAV_SEVERITY_EMERGENCY = 0 # System is unusable. This is a "panic" condition.
enums['MAV_SEVERITY'][0] = EnumEntry('MAV_SEVERITY_EMERGENCY', '''System is unusable. This is a "panic" condition.''')
MAV_SEVERITY_ALERT = 1 # Action should be taken immediately. Indicates error in non-critical
# systems.
enums['MAV_SEVERITY'][1] = EnumEntry('MAV_SEVERITY_ALERT', '''Action should be taken immediately. Indicates error in non-critical systems.''')
MAV_SEVERITY_CRITICAL = 2 # Action must be taken immediately. Indicates failure in a primary
# system.
enums['MAV_SEVERITY'][2] = EnumEntry('MAV_SEVERITY_CRITICAL', '''Action must be taken immediately. Indicates failure in a primary system.''')
MAV_SEVERITY_ERROR = 3 # Indicates an error in secondary/redundant systems.
enums['MAV_SEVERITY'][3] = EnumEntry('MAV_SEVERITY_ERROR', '''Indicates an error in secondary/redundant systems.''')
MAV_SEVERITY_WARNING = 4 # Indicates about a possible future error if this is not resolved within
# a given timeframe. Example would be a low
# battery warning.
enums['MAV_SEVERITY'][4] = EnumEntry('MAV_SEVERITY_WARNING', '''Indicates about a possible future error if this is not resolved within a given timeframe. Example would be a low battery warning.''')
MAV_SEVERITY_NOTICE = 5 # An unusual event has occurred, though not an error condition. This
# should be investigated for the root cause.
enums['MAV_SEVERITY'][5] = EnumEntry('MAV_SEVERITY_NOTICE', '''An unusual event has occurred, though not an error condition. This should be investigated for the root cause.''')
MAV_SEVERITY_INFO = 6 # Normal operational messages. Useful for logging. No action is required
# for these messages.
enums['MAV_SEVERITY'][6] = EnumEntry('MAV_SEVERITY_INFO', '''Normal operational messages. Useful for logging. No action is required for these messages.''')
MAV_SEVERITY_DEBUG = 7 # Useful non-operational messages that can assist in debugging. These
# should not occur during normal operation.
enums['MAV_SEVERITY'][7] = EnumEntry('MAV_SEVERITY_DEBUG', '''Useful non-operational messages that can assist in debugging. These should not occur during normal operation.''')
MAV_SEVERITY_ENUM_END = 8 #
enums['MAV_SEVERITY'][8] = EnumEntry('MAV_SEVERITY_ENUM_END', '''''')
# MAV_POWER_STATUS
enums['MAV_POWER_STATUS'] = {}
MAV_POWER_STATUS_BRICK_VALID = 1 # main brick power supply valid
enums['MAV_POWER_STATUS'][1] = EnumEntry('MAV_POWER_STATUS_BRICK_VALID', '''main brick power supply valid''')
MAV_POWER_STATUS_SERVO_VALID = 2 # main servo power supply valid for FMU
enums['MAV_POWER_STATUS'][2] = EnumEntry('MAV_POWER_STATUS_SERVO_VALID', '''main servo power supply valid for FMU''')
MAV_POWER_STATUS_USB_CONNECTED = 4 # USB power is connected
enums['MAV_POWER_STATUS'][4] = EnumEntry('MAV_POWER_STATUS_USB_CONNECTED', '''USB power is connected''')
MAV_POWER_STATUS_PERIPH_OVERCURRENT = 8 # peripheral supply is in over-current state
enums['MAV_POWER_STATUS'][8] = EnumEntry('MAV_POWER_STATUS_PERIPH_OVERCURRENT', '''peripheral supply is in over-current state''')
MAV_POWER_STATUS_PERIPH_HIPOWER_OVERCURRENT = 16 # hi-power peripheral supply is in over-current state
enums['MAV_POWER_STATUS'][16] = EnumEntry('MAV_POWER_STATUS_PERIPH_HIPOWER_OVERCURRENT', '''hi-power peripheral supply is in over-current state''')
MAV_POWER_STATUS_CHANGED = 32 # Power status has changed since boot
enums['MAV_POWER_STATUS'][32] = EnumEntry('MAV_POWER_STATUS_CHANGED', '''Power status has changed since boot''')
MAV_POWER_STATUS_ENUM_END = 33 #
enums['MAV_POWER_STATUS'][33] = EnumEntry('MAV_POWER_STATUS_ENUM_END', '''''')
# SERIAL_CONTROL_DEV
enums['SERIAL_CONTROL_DEV'] = {}
SERIAL_CONTROL_DEV_TELEM1 = 0 # First telemetry port
enums['SERIAL_CONTROL_DEV'][0] = EnumEntry('SERIAL_CONTROL_DEV_TELEM1', '''First telemetry port''')
SERIAL_CONTROL_DEV_TELEM2 = 1 # Second telemetry port
enums['SERIAL_CONTROL_DEV'][1] = EnumEntry('SERIAL_CONTROL_DEV_TELEM2', '''Second telemetry port''')
SERIAL_CONTROL_DEV_GPS1 = 2 # First GPS port
enums['SERIAL_CONTROL_DEV'][2] = EnumEntry('SERIAL_CONTROL_DEV_GPS1', '''First GPS port''')
SERIAL_CONTROL_DEV_GPS2 = 3 # Second GPS port
enums['SERIAL_CONTROL_DEV'][3] = EnumEntry('SERIAL_CONTROL_DEV_GPS2', '''Second GPS port''')
SERIAL_CONTROL_DEV_SHELL = 10 # system shell
enums['SERIAL_CONTROL_DEV'][10] = EnumEntry('SERIAL_CONTROL_DEV_SHELL', '''system shell''')
SERIAL_CONTROL_SERIAL0 = 100 # SERIAL0
enums['SERIAL_CONTROL_DEV'][100] = EnumEntry('SERIAL_CONTROL_SERIAL0', '''SERIAL0''')
SERIAL_CONTROL_SERIAL1 = 101 # SERIAL1
enums['SERIAL_CONTROL_DEV'][101] = EnumEntry('SERIAL_CONTROL_SERIAL1', '''SERIAL1''')
SERIAL_CONTROL_SERIAL2 = 102 # SERIAL2
enums['SERIAL_CONTROL_DEV'][102] = EnumEntry('SERIAL_CONTROL_SERIAL2', '''SERIAL2''')
SERIAL_CONTROL_SERIAL3 = 103 # SERIAL3
enums['SERIAL_CONTROL_DEV'][103] = EnumEntry('SERIAL_CONTROL_SERIAL3', '''SERIAL3''')
SERIAL_CONTROL_SERIAL4 = 104 # SERIAL4
enums['SERIAL_CONTROL_DEV'][104] = EnumEntry('SERIAL_CONTROL_SERIAL4', '''SERIAL4''')
SERIAL_CONTROL_SERIAL5 = 105 # SERIAL5
enums['SERIAL_CONTROL_DEV'][105] = EnumEntry('SERIAL_CONTROL_SERIAL5', '''SERIAL5''')
SERIAL_CONTROL_SERIAL6 = 106 # SERIAL6
enums['SERIAL_CONTROL_DEV'][106] = EnumEntry('SERIAL_CONTROL_SERIAL6', '''SERIAL6''')
SERIAL_CONTROL_SERIAL7 = 107 # SERIAL7
enums['SERIAL_CONTROL_DEV'][107] = EnumEntry('SERIAL_CONTROL_SERIAL7', '''SERIAL7''')
SERIAL_CONTROL_SERIAL8 = 108 # SERIAL8
enums['SERIAL_CONTROL_DEV'][108] = EnumEntry('SERIAL_CONTROL_SERIAL8', '''SERIAL8''')
SERIAL_CONTROL_SERIAL9 = 109 # SERIAL9
enums['SERIAL_CONTROL_DEV'][109] = EnumEntry('SERIAL_CONTROL_SERIAL9', '''SERIAL9''')
SERIAL_CONTROL_DEV_ENUM_END = 110 #
enums['SERIAL_CONTROL_DEV'][110] = EnumEntry('SERIAL_CONTROL_DEV_ENUM_END', '''''')
# SERIAL_CONTROL_FLAG
enums['SERIAL_CONTROL_FLAG'] = {}
SERIAL_CONTROL_FLAG_REPLY = 1 # Set if this is a reply
enums['SERIAL_CONTROL_FLAG'][1] = EnumEntry('SERIAL_CONTROL_FLAG_REPLY', '''Set if this is a reply''')
SERIAL_CONTROL_FLAG_RESPOND = 2 # Set if the sender wants the receiver to send a response as another
# SERIAL_CONTROL message
enums['SERIAL_CONTROL_FLAG'][2] = EnumEntry('SERIAL_CONTROL_FLAG_RESPOND', '''Set if the sender wants the receiver to send a response as another SERIAL_CONTROL message''')
SERIAL_CONTROL_FLAG_EXCLUSIVE = 4 # Set if access to the serial port should be removed from whatever
# driver is currently using it, giving
# exclusive access to the SERIAL_CONTROL
# protocol. The port can be handed back by
# sending a request without this flag set
enums['SERIAL_CONTROL_FLAG'][4] = EnumEntry('SERIAL_CONTROL_FLAG_EXCLUSIVE', '''Set if access to the serial port should be removed from whatever driver is currently using it, giving exclusive access to the SERIAL_CONTROL protocol. The port can be handed back by sending a request without this flag set''')
SERIAL_CONTROL_FLAG_BLOCKING = 8 # Block on writes to the serial port
enums['SERIAL_CONTROL_FLAG'][8] = EnumEntry('SERIAL_CONTROL_FLAG_BLOCKING', '''Block on writes to the serial port''')
SERIAL_CONTROL_FLAG_MULTI = 16 # Send multiple replies until port is drained
enums['SERIAL_CONTROL_FLAG'][16] = EnumEntry('SERIAL_CONTROL_FLAG_MULTI', '''Send multiple replies until port is drained''')
SERIAL_CONTROL_FLAG_ENUM_END = 17 #
enums['SERIAL_CONTROL_FLAG'][17] = EnumEntry('SERIAL_CONTROL_FLAG_ENUM_END', '''''')
# MAV_DISTANCE_SENSOR
enums['MAV_DISTANCE_SENSOR'] = {}
MAV_DISTANCE_SENSOR_LASER = 0 # Laser rangefinder, e.g. LightWare SF02/F or PulsedLight units
enums['MAV_DISTANCE_SENSOR'][0] = EnumEntry('MAV_DISTANCE_SENSOR_LASER', '''Laser rangefinder, e.g. LightWare SF02/F or PulsedLight units''')
MAV_DISTANCE_SENSOR_ULTRASOUND = 1 # Ultrasound rangefinder, e.g. MaxBotix units
enums['MAV_DISTANCE_SENSOR'][1] = EnumEntry('MAV_DISTANCE_SENSOR_ULTRASOUND', '''Ultrasound rangefinder, e.g. MaxBotix units''')
MAV_DISTANCE_SENSOR_INFRARED = 2 # Infrared rangefinder, e.g. Sharp units
enums['MAV_DISTANCE_SENSOR'][2] = EnumEntry('MAV_DISTANCE_SENSOR_INFRARED', '''Infrared rangefinder, e.g. Sharp units''')
MAV_DISTANCE_SENSOR_RADAR = 3 # Radar type, e.g. uLanding units
enums['MAV_DISTANCE_SENSOR'][3] = EnumEntry('MAV_DISTANCE_SENSOR_RADAR', '''Radar type, e.g. uLanding units''')
MAV_DISTANCE_SENSOR_UNKNOWN = 4 # Broken or unknown type, e.g. analog units
enums['MAV_DISTANCE_SENSOR'][4] = EnumEntry('MAV_DISTANCE_SENSOR_UNKNOWN', '''Broken or unknown type, e.g. analog units''')
MAV_DISTANCE_SENSOR_ENUM_END = 5 #
enums['MAV_DISTANCE_SENSOR'][5] = EnumEntry('MAV_DISTANCE_SENSOR_ENUM_END', '''''')
# MAV_SENSOR_ORIENTATION
enums['MAV_SENSOR_ORIENTATION'] = {}
MAV_SENSOR_ROTATION_NONE = 0 # Roll: 0, Pitch: 0, Yaw: 0
enums['MAV_SENSOR_ORIENTATION'][0] = EnumEntry('MAV_SENSOR_ROTATION_NONE', '''Roll: 0, Pitch: 0, Yaw: 0''')
MAV_SENSOR_ROTATION_YAW_45 = 1 # Roll: 0, Pitch: 0, Yaw: 45
enums['MAV_SENSOR_ORIENTATION'][1] = EnumEntry('MAV_SENSOR_ROTATION_YAW_45', '''Roll: 0, Pitch: 0, Yaw: 45''')
MAV_SENSOR_ROTATION_YAW_90 = 2 # Roll: 0, Pitch: 0, Yaw: 90
enums['MAV_SENSOR_ORIENTATION'][2] = EnumEntry('MAV_SENSOR_ROTATION_YAW_90', '''Roll: 0, Pitch: 0, Yaw: 90''')
MAV_SENSOR_ROTATION_YAW_135 = 3 # Roll: 0, Pitch: 0, Yaw: 135
enums['MAV_SENSOR_ORIENTATION'][3] = EnumEntry('MAV_SENSOR_ROTATION_YAW_135', '''Roll: 0, Pitch: 0, Yaw: 135''')
MAV_SENSOR_ROTATION_YAW_180 = 4 # Roll: 0, Pitch: 0, Yaw: 180
enums['MAV_SENSOR_ORIENTATION'][4] = EnumEntry('MAV_SENSOR_ROTATION_YAW_180', '''Roll: 0, Pitch: 0, Yaw: 180''')
MAV_SENSOR_ROTATION_YAW_225 = 5 # Roll: 0, Pitch: 0, Yaw: 225
enums['MAV_SENSOR_ORIENTATION'][5] = EnumEntry('MAV_SENSOR_ROTATION_YAW_225', '''Roll: 0, Pitch: 0, Yaw: 225''')
MAV_SENSOR_ROTATION_YAW_270 = 6 # Roll: 0, Pitch: 0, Yaw: 270
enums['MAV_SENSOR_ORIENTATION'][6] = EnumEntry('MAV_SENSOR_ROTATION_YAW_270', '''Roll: 0, Pitch: 0, Yaw: 270''')
MAV_SENSOR_ROTATION_YAW_315 = 7 # Roll: 0, Pitch: 0, Yaw: 315
enums['MAV_SENSOR_ORIENTATION'][7] = EnumEntry('MAV_SENSOR_ROTATION_YAW_315', '''Roll: 0, Pitch: 0, Yaw: 315''')
MAV_SENSOR_ROTATION_ROLL_180 = 8 # Roll: 180, Pitch: 0, Yaw: 0
enums['MAV_SENSOR_ORIENTATION'][8] = EnumEntry('MAV_SENSOR_ROTATION_ROLL_180', '''Roll: 180, Pitch: 0, Yaw: 0''')
MAV_SENSOR_ROTATION_ROLL_180_YAW_45 = 9 # Roll: 180, Pitch: 0, Yaw: 45
enums['MAV_SENSOR_ORIENTATION'][9] = EnumEntry('MAV_SENSOR_ROTATION_ROLL_180_YAW_45', '''Roll: 180, Pitch: 0, Yaw: 45''')
MAV_SENSOR_ROTATION_ROLL_180_YAW_90 = 10 # Roll: 180, Pitch: 0, Yaw: 90
enums['MAV_SENSOR_ORIENTATION'][10] = EnumEntry('MAV_SENSOR_ROTATION_ROLL_180_YAW_90', '''Roll: 180, Pitch: 0, Yaw: 90''')
MAV_SENSOR_ROTATION_ROLL_180_YAW_135 = 11 # Roll: 180, Pitch: 0, Yaw: 135
enums['MAV_SENSOR_ORIENTATION'][11] = EnumEntry('MAV_SENSOR_ROTATION_ROLL_180_YAW_135', '''Roll: 180, Pitch: 0, Yaw: 135''')
MAV_SENSOR_ROTATION_PITCH_180 = 12 # Roll: 0, Pitch: 180, Yaw: 0
enums['MAV_SENSOR_ORIENTATION'][12] = EnumEntry('MAV_SENSOR_ROTATION_PITCH_180', '''Roll: 0, Pitch: 180, Yaw: 0''')
MAV_SENSOR_ROTATION_ROLL_180_YAW_225 = 13 # Roll: 180, Pitch: 0, Yaw: 225
enums['MAV_SENSOR_ORIENTATION'][13] = EnumEntry('MAV_SENSOR_ROTATION_ROLL_180_YAW_225', '''Roll: 180, Pitch: 0, Yaw: 225''')
MAV_SENSOR_ROTATION_ROLL_180_YAW_270 = 14 # Roll: 180, Pitch: 0, Yaw: 270
enums['MAV_SENSOR_ORIENTATION'][14] = EnumEntry('MAV_SENSOR_ROTATION_ROLL_180_YAW_270', '''Roll: 180, Pitch: 0, Yaw: 270''')
MAV_SENSOR_ROTATION_ROLL_180_YAW_315 = 15 # Roll: 180, Pitch: 0, Yaw: 315
enums['MAV_SENSOR_ORIENTATION'][15] = EnumEntry('MAV_SENSOR_ROTATION_ROLL_180_YAW_315', '''Roll: 180, Pitch: 0, Yaw: 315''')
MAV_SENSOR_ROTATION_ROLL_90 = 16 # Roll: 90, Pitch: 0, Yaw: 0
enums['MAV_SENSOR_ORIENTATION'][16] = EnumEntry('MAV_SENSOR_ROTATION_ROLL_90', '''Roll: 90, Pitch: 0, Yaw: 0''')
MAV_SENSOR_ROTATION_ROLL_90_YAW_45 = 17 # Roll: 90, Pitch: 0, Yaw: 45
enums['MAV_SENSOR_ORIENTATION'][17] = EnumEntry('MAV_SENSOR_ROTATION_ROLL_90_YAW_45', '''Roll: 90, Pitch: 0, Yaw: 45''')
MAV_SENSOR_ROTATION_ROLL_90_YAW_90 = 18 # Roll: 90, Pitch: 0, Yaw: 90
enums['MAV_SENSOR_ORIENTATION'][18] = EnumEntry('MAV_SENSOR_ROTATION_ROLL_90_YAW_90', '''Roll: 90, Pitch: 0, Yaw: 90''')
MAV_SENSOR_ROTATION_ROLL_90_YAW_135 = 19 # Roll: 90, Pitch: 0, Yaw: 135
enums['MAV_SENSOR_ORIENTATION'][19] = EnumEntry('MAV_SENSOR_ROTATION_ROLL_90_YAW_135', '''Roll: 90, Pitch: 0, Yaw: 135''')
MAV_SENSOR_ROTATION_ROLL_270 = 20 # Roll: 270, Pitch: 0, Yaw: 0
enums['MAV_SENSOR_ORIENTATION'][20] = EnumEntry('MAV_SENSOR_ROTATION_ROLL_270', '''Roll: 270, Pitch: 0, Yaw: 0''')
MAV_SENSOR_ROTATION_ROLL_270_YAW_45 = 21 # Roll: 270, Pitch: 0, Yaw: 45
enums['MAV_SENSOR_ORIENTATION'][21] = EnumEntry('MAV_SENSOR_ROTATION_ROLL_270_YAW_45', '''Roll: 270, Pitch: 0, Yaw: 45''')
MAV_SENSOR_ROTATION_ROLL_270_YAW_90 = 22 # Roll: 270, Pitch: 0, Yaw: 90
enums['MAV_SENSOR_ORIENTATION'][22] = EnumEntry('MAV_SENSOR_ROTATION_ROLL_270_YAW_90', '''Roll: 270, Pitch: 0, Yaw: 90''')
MAV_SENSOR_ROTATION_ROLL_270_YAW_135 = 23 # Roll: 270, Pitch: 0, Yaw: 135
enums['MAV_SENSOR_ORIENTATION'][23] = EnumEntry('MAV_SENSOR_ROTATION_ROLL_270_YAW_135', '''Roll: 270, Pitch: 0, Yaw: 135''')
MAV_SENSOR_ROTATION_PITCH_90 = 24 # Roll: 0, Pitch: 90, Yaw: 0
enums['MAV_SENSOR_ORIENTATION'][24] = EnumEntry('MAV_SENSOR_ROTATION_PITCH_90', '''Roll: 0, Pitch: 90, Yaw: 0''')
MAV_SENSOR_ROTATION_PITCH_270 = 25 # Roll: 0, Pitch: 270, Yaw: 0
enums['MAV_SENSOR_ORIENTATION'][25] = EnumEntry('MAV_SENSOR_ROTATION_PITCH_270', '''Roll: 0, Pitch: 270, Yaw: 0''')
MAV_SENSOR_ROTATION_PITCH_180_YAW_90 = 26 # Roll: 0, Pitch: 180, Yaw: 90
enums['MAV_SENSOR_ORIENTATION'][26] = EnumEntry('MAV_SENSOR_ROTATION_PITCH_180_YAW_90', '''Roll: 0, Pitch: 180, Yaw: 90''')
MAV_SENSOR_ROTATION_PITCH_180_YAW_270 = 27 # Roll: 0, Pitch: 180, Yaw: 270
enums['MAV_SENSOR_ORIENTATION'][27] = EnumEntry('MAV_SENSOR_ROTATION_PITCH_180_YAW_270', '''Roll: 0, Pitch: 180, Yaw: 270''')
MAV_SENSOR_ROTATION_ROLL_90_PITCH_90 = 28 # Roll: 90, Pitch: 90, Yaw: 0
enums['MAV_SENSOR_ORIENTATION'][28] = EnumEntry('MAV_SENSOR_ROTATION_ROLL_90_PITCH_90', '''Roll: 90, Pitch: 90, Yaw: 0''')
MAV_SENSOR_ROTATION_ROLL_180_PITCH_90 = 29 # Roll: 180, Pitch: 90, Yaw: 0
enums['MAV_SENSOR_ORIENTATION'][29] = EnumEntry('MAV_SENSOR_ROTATION_ROLL_180_PITCH_90', '''Roll: 180, Pitch: 90, Yaw: 0''')
MAV_SENSOR_ROTATION_ROLL_270_PITCH_90 = 30 # Roll: 270, Pitch: 90, Yaw: 0
enums['MAV_SENSOR_ORIENTATION'][30] = EnumEntry('MAV_SENSOR_ROTATION_ROLL_270_PITCH_90', '''Roll: 270, Pitch: 90, Yaw: 0''')
MAV_SENSOR_ROTATION_ROLL_90_PITCH_180 = 31 # Roll: 90, Pitch: 180, Yaw: 0
enums['MAV_SENSOR_ORIENTATION'][31] = EnumEntry('MAV_SENSOR_ROTATION_ROLL_90_PITCH_180', '''Roll: 90, Pitch: 180, Yaw: 0''')
MAV_SENSOR_ROTATION_ROLL_270_PITCH_180 = 32 # Roll: 270, Pitch: 180, Yaw: 0
enums['MAV_SENSOR_ORIENTATION'][32] = EnumEntry('MAV_SENSOR_ROTATION_ROLL_270_PITCH_180', '''Roll: 270, Pitch: 180, Yaw: 0''')
MAV_SENSOR_ROTATION_ROLL_90_PITCH_270 = 33 # Roll: 90, Pitch: 270, Yaw: 0
enums['MAV_SENSOR_ORIENTATION'][33] = EnumEntry('MAV_SENSOR_ROTATION_ROLL_90_PITCH_270', '''Roll: 90, Pitch: 270, Yaw: 0''')
MAV_SENSOR_ROTATION_ROLL_180_PITCH_270 = 34 # Roll: 180, Pitch: 270, Yaw: 0
enums['MAV_SENSOR_ORIENTATION'][34] = EnumEntry('MAV_SENSOR_ROTATION_ROLL_180_PITCH_270', '''Roll: 180, Pitch: 270, Yaw: 0''')
MAV_SENSOR_ROTATION_ROLL_270_PITCH_270 = 35 # Roll: 270, Pitch: 270, Yaw: 0
enums['MAV_SENSOR_ORIENTATION'][35] = EnumEntry('MAV_SENSOR_ROTATION_ROLL_270_PITCH_270', '''Roll: 270, Pitch: 270, Yaw: 0''')
MAV_SENSOR_ROTATION_ROLL_90_PITCH_180_YAW_90 = 36 # Roll: 90, Pitch: 180, Yaw: 90
enums['MAV_SENSOR_ORIENTATION'][36] = EnumEntry('MAV_SENSOR_ROTATION_ROLL_90_PITCH_180_YAW_90', '''Roll: 90, Pitch: 180, Yaw: 90''')
MAV_SENSOR_ROTATION_ROLL_90_YAW_270 = 37 # Roll: 90, Pitch: 0, Yaw: 270
enums['MAV_SENSOR_ORIENTATION'][37] = EnumEntry('MAV_SENSOR_ROTATION_ROLL_90_YAW_270', '''Roll: 90, Pitch: 0, Yaw: 270''')
MAV_SENSOR_ROTATION_ROLL_90_PITCH_68_YAW_293 = 38 # Roll: 90, Pitch: 68, Yaw: 293
enums['MAV_SENSOR_ORIENTATION'][38] = EnumEntry('MAV_SENSOR_ROTATION_ROLL_90_PITCH_68_YAW_293', '''Roll: 90, Pitch: 68, Yaw: 293''')
MAV_SENSOR_ROTATION_PITCH_315 = 39 # Pitch: 315
enums['MAV_SENSOR_ORIENTATION'][39] = EnumEntry('MAV_SENSOR_ROTATION_PITCH_315', '''Pitch: 315''')
MAV_SENSOR_ROTATION_ROLL_90_PITCH_315 = 40 # Roll: 90, Pitch: 315
enums['MAV_SENSOR_ORIENTATION'][40] = EnumEntry('MAV_SENSOR_ROTATION_ROLL_90_PITCH_315', '''Roll: 90, Pitch: 315''')
MAV_SENSOR_ROTATION_CUSTOM = 100 # Custom orientation
enums['MAV_SENSOR_ORIENTATION'][100] = EnumEntry('MAV_SENSOR_ROTATION_CUSTOM', '''Custom orientation''')
MAV_SENSOR_ORIENTATION_ENUM_END = 101 #
enums['MAV_SENSOR_ORIENTATION'][101] = EnumEntry('MAV_SENSOR_ORIENTATION_ENUM_END', '''''')
# MAV_PROTOCOL_CAPABILITY
enums['MAV_PROTOCOL_CAPABILITY'] = {}
MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT = 1 # Autopilot supports MISSION float message type.
enums['MAV_PROTOCOL_CAPABILITY'][1] = EnumEntry('MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT', '''Autopilot supports MISSION float message type.''')
MAV_PROTOCOL_CAPABILITY_PARAM_FLOAT = 2 # Autopilot supports the new param float message type.
enums['MAV_PROTOCOL_CAPABILITY'][2] = EnumEntry('MAV_PROTOCOL_CAPABILITY_PARAM_FLOAT', '''Autopilot supports the new param float message type.''')
MAV_PROTOCOL_CAPABILITY_MISSION_INT = 4 # Autopilot supports MISSION_INT scaled integer message type.
enums['MAV_PROTOCOL_CAPABILITY'][4] = EnumEntry('MAV_PROTOCOL_CAPABILITY_MISSION_INT', '''Autopilot supports MISSION_INT scaled integer message type.''')
MAV_PROTOCOL_CAPABILITY_COMMAND_INT = 8 # Autopilot supports COMMAND_INT scaled integer message type.
enums['MAV_PROTOCOL_CAPABILITY'][8] = EnumEntry('MAV_PROTOCOL_CAPABILITY_COMMAND_INT', '''Autopilot supports COMMAND_INT scaled integer message type.''')
MAV_PROTOCOL_CAPABILITY_PARAM_UNION = 16 # Autopilot supports the new param union message type.
enums['MAV_PROTOCOL_CAPABILITY'][16] = EnumEntry('MAV_PROTOCOL_CAPABILITY_PARAM_UNION', '''Autopilot supports the new param union message type.''')
MAV_PROTOCOL_CAPABILITY_FTP = 32 # Autopilot supports the new FILE_TRANSFER_PROTOCOL message type.
enums['MAV_PROTOCOL_CAPABILITY'][32] = EnumEntry('MAV_PROTOCOL_CAPABILITY_FTP', '''Autopilot supports the new FILE_TRANSFER_PROTOCOL message type.''')
MAV_PROTOCOL_CAPABILITY_SET_ATTITUDE_TARGET = 64 # Autopilot supports commanding attitude offboard.
enums['MAV_PROTOCOL_CAPABILITY'][64] = EnumEntry('MAV_PROTOCOL_CAPABILITY_SET_ATTITUDE_TARGET', '''Autopilot supports commanding attitude offboard.''')
MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_LOCAL_NED = 128 # Autopilot supports commanding position and velocity targets in local
# NED frame.
enums['MAV_PROTOCOL_CAPABILITY'][128] = EnumEntry('MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_LOCAL_NED', '''Autopilot supports commanding position and velocity targets in local NED frame.''')
MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_GLOBAL_INT = 256 # Autopilot supports commanding position and velocity targets in global
# scaled integers.
enums['MAV_PROTOCOL_CAPABILITY'][256] = EnumEntry('MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_GLOBAL_INT', '''Autopilot supports commanding position and velocity targets in global scaled integers.''')
MAV_PROTOCOL_CAPABILITY_TERRAIN = 512 # Autopilot supports terrain protocol / data handling.
enums['MAV_PROTOCOL_CAPABILITY'][512] = EnumEntry('MAV_PROTOCOL_CAPABILITY_TERRAIN', '''Autopilot supports terrain protocol / data handling.''')
MAV_PROTOCOL_CAPABILITY_SET_ACTUATOR_TARGET = 1024 # Autopilot supports direct actuator control.
enums['MAV_PROTOCOL_CAPABILITY'][1024] = EnumEntry('MAV_PROTOCOL_CAPABILITY_SET_ACTUATOR_TARGET', '''Autopilot supports direct actuator control.''')
MAV_PROTOCOL_CAPABILITY_FLIGHT_TERMINATION = 2048 # Autopilot supports the flight termination command.
enums['MAV_PROTOCOL_CAPABILITY'][2048] = EnumEntry('MAV_PROTOCOL_CAPABILITY_FLIGHT_TERMINATION', '''Autopilot supports the flight termination command.''')
MAV_PROTOCOL_CAPABILITY_COMPASS_CALIBRATION = 4096 # Autopilot supports onboard compass calibration.
enums['MAV_PROTOCOL_CAPABILITY'][4096] = EnumEntry('MAV_PROTOCOL_CAPABILITY_COMPASS_CALIBRATION', '''Autopilot supports onboard compass calibration.''')
MAV_PROTOCOL_CAPABILITY_MAVLINK2 = 8192 # Autopilot supports MAVLink version 2.
enums['MAV_PROTOCOL_CAPABILITY'][8192] = EnumEntry('MAV_PROTOCOL_CAPABILITY_MAVLINK2', '''Autopilot supports MAVLink version 2.''')
MAV_PROTOCOL_CAPABILITY_MISSION_FENCE = 16384 # Autopilot supports mission fence protocol.
enums['MAV_PROTOCOL_CAPABILITY'][16384] = EnumEntry('MAV_PROTOCOL_CAPABILITY_MISSION_FENCE', '''Autopilot supports mission fence protocol.''')
MAV_PROTOCOL_CAPABILITY_MISSION_RALLY = 32768 # Autopilot supports mission rally point protocol.
enums['MAV_PROTOCOL_CAPABILITY'][32768] = EnumEntry('MAV_PROTOCOL_CAPABILITY_MISSION_RALLY', '''Autopilot supports mission rally point protocol.''')
MAV_PROTOCOL_CAPABILITY_FLIGHT_INFORMATION = 65536 # Autopilot supports the flight information protocol.
enums['MAV_PROTOCOL_CAPABILITY'][65536] = EnumEntry('MAV_PROTOCOL_CAPABILITY_FLIGHT_INFORMATION', '''Autopilot supports the flight information protocol.''')
MAV_PROTOCOL_CAPABILITY_ENUM_END = 65537 #
enums['MAV_PROTOCOL_CAPABILITY'][65537] = EnumEntry('MAV_PROTOCOL_CAPABILITY_ENUM_END', '''''')
# MAV_MISSION_TYPE
enums['MAV_MISSION_TYPE'] = {}
MAV_MISSION_TYPE_MISSION = 0 # Items are mission commands for main mission.
enums['MAV_MISSION_TYPE'][0] = EnumEntry('MAV_MISSION_TYPE_MISSION', '''Items are mission commands for main mission.''')
MAV_MISSION_TYPE_FENCE = 1 # Specifies GeoFence area(s). Items are MAV_CMD_NAV_FENCE_ GeoFence
# items.
enums['MAV_MISSION_TYPE'][1] = EnumEntry('MAV_MISSION_TYPE_FENCE', '''Specifies GeoFence area(s). Items are MAV_CMD_NAV_FENCE_ GeoFence items.''')
MAV_MISSION_TYPE_RALLY = 2 # Specifies the rally points for the vehicle. Rally points are
# alternative RTL points. Items are
# MAV_CMD_NAV_RALLY_POINT rally point items.
enums['MAV_MISSION_TYPE'][2] = EnumEntry('MAV_MISSION_TYPE_RALLY', '''Specifies the rally points for the vehicle. Rally points are alternative RTL points. Items are MAV_CMD_NAV_RALLY_POINT rally point items.''')
MAV_MISSION_TYPE_ALL = 255 # Only used in MISSION_CLEAR_ALL to clear all mission types.
enums['MAV_MISSION_TYPE'][255] = EnumEntry('MAV_MISSION_TYPE_ALL', '''Only used in MISSION_CLEAR_ALL to clear all mission types.''')
MAV_MISSION_TYPE_ENUM_END = 256 #
enums['MAV_MISSION_TYPE'][256] = EnumEntry('MAV_MISSION_TYPE_ENUM_END', '''''')
# MAV_ESTIMATOR_TYPE
enums['MAV_ESTIMATOR_TYPE'] = {}
MAV_ESTIMATOR_TYPE_UNKNOWN = 0 # Unknown type of the estimator.
enums['MAV_ESTIMATOR_TYPE'][0] = EnumEntry('MAV_ESTIMATOR_TYPE_UNKNOWN', '''Unknown type of the estimator.''')
MAV_ESTIMATOR_TYPE_NAIVE = 1 # This is a naive estimator without any real covariance feedback.
enums['MAV_ESTIMATOR_TYPE'][1] = EnumEntry('MAV_ESTIMATOR_TYPE_NAIVE', '''This is a naive estimator without any real covariance feedback.''')
MAV_ESTIMATOR_TYPE_VISION = 2 # Computer vision based estimate. Might be up to scale.
enums['MAV_ESTIMATOR_TYPE'][2] = EnumEntry('MAV_ESTIMATOR_TYPE_VISION', '''Computer vision based estimate. Might be up to scale.''')
MAV_ESTIMATOR_TYPE_VIO = 3 # Visual-inertial estimate.
enums['MAV_ESTIMATOR_TYPE'][3] = EnumEntry('MAV_ESTIMATOR_TYPE_VIO', '''Visual-inertial estimate.''')
MAV_ESTIMATOR_TYPE_GPS = 4 # Plain GPS estimate.
enums['MAV_ESTIMATOR_TYPE'][4] = EnumEntry('MAV_ESTIMATOR_TYPE_GPS', '''Plain GPS estimate.''')
MAV_ESTIMATOR_TYPE_GPS_INS = 5 # Estimator integrating GPS and inertial sensing.
enums['MAV_ESTIMATOR_TYPE'][5] = EnumEntry('MAV_ESTIMATOR_TYPE_GPS_INS', '''Estimator integrating GPS and inertial sensing.''')
MAV_ESTIMATOR_TYPE_MOCAP = 6 # Estimate from external motion capturing system.
enums['MAV_ESTIMATOR_TYPE'][6] = EnumEntry('MAV_ESTIMATOR_TYPE_MOCAP', '''Estimate from external motion capturing system.''')
MAV_ESTIMATOR_TYPE_LIDAR = 7 # Estimator based on lidar sensor input.
enums['MAV_ESTIMATOR_TYPE'][7] = EnumEntry('MAV_ESTIMATOR_TYPE_LIDAR', '''Estimator based on lidar sensor input.''')
MAV_ESTIMATOR_TYPE_AUTOPILOT = 8 # Estimator on autopilot.
enums['MAV_ESTIMATOR_TYPE'][8] = EnumEntry('MAV_ESTIMATOR_TYPE_AUTOPILOT', '''Estimator on autopilot.''')
MAV_ESTIMATOR_TYPE_ENUM_END = 9 #
enums['MAV_ESTIMATOR_TYPE'][9] = EnumEntry('MAV_ESTIMATOR_TYPE_ENUM_END', '''''')
# MAV_BATTERY_TYPE
enums['MAV_BATTERY_TYPE'] = {}
MAV_BATTERY_TYPE_UNKNOWN = 0 # Not specified.
enums['MAV_BATTERY_TYPE'][0] = EnumEntry('MAV_BATTERY_TYPE_UNKNOWN', '''Not specified.''')
MAV_BATTERY_TYPE_LIPO = 1 # Lithium polymer battery
enums['MAV_BATTERY_TYPE'][1] = EnumEntry('MAV_BATTERY_TYPE_LIPO', '''Lithium polymer battery''')
MAV_BATTERY_TYPE_LIFE = 2 # Lithium-iron-phosphate battery
enums['MAV_BATTERY_TYPE'][2] = EnumEntry('MAV_BATTERY_TYPE_LIFE', '''Lithium-iron-phosphate battery''')
MAV_BATTERY_TYPE_LION = 3 # Lithium-ION battery
enums['MAV_BATTERY_TYPE'][3] = EnumEntry('MAV_BATTERY_TYPE_LION', '''Lithium-ION battery''')
MAV_BATTERY_TYPE_NIMH = 4 # Nickel metal hydride battery
enums['MAV_BATTERY_TYPE'][4] = EnumEntry('MAV_BATTERY_TYPE_NIMH', '''Nickel metal hydride battery''')
MAV_BATTERY_TYPE_ENUM_END = 5 #
enums['MAV_BATTERY_TYPE'][5] = EnumEntry('MAV_BATTERY_TYPE_ENUM_END', '''''')
# MAV_BATTERY_FUNCTION
enums['MAV_BATTERY_FUNCTION'] = {}
MAV_BATTERY_FUNCTION_UNKNOWN = 0 # Battery function is unknown
enums['MAV_BATTERY_FUNCTION'][0] = EnumEntry('MAV_BATTERY_FUNCTION_UNKNOWN', '''Battery function is unknown''')
MAV_BATTERY_FUNCTION_ALL = 1 # Battery supports all flight systems
enums['MAV_BATTERY_FUNCTION'][1] = EnumEntry('MAV_BATTERY_FUNCTION_ALL', '''Battery supports all flight systems''')
MAV_BATTERY_FUNCTION_PROPULSION = 2 # Battery for the propulsion system
enums['MAV_BATTERY_FUNCTION'][2] = EnumEntry('MAV_BATTERY_FUNCTION_PROPULSION', '''Battery for the propulsion system''')
MAV_BATTERY_FUNCTION_AVIONICS = 3 # Avionics battery
enums['MAV_BATTERY_FUNCTION'][3] = EnumEntry('MAV_BATTERY_FUNCTION_AVIONICS', '''Avionics battery''')
MAV_BATTERY_TYPE_PAYLOAD = 4 # Payload battery
enums['MAV_BATTERY_FUNCTION'][4] = EnumEntry('MAV_BATTERY_TYPE_PAYLOAD', '''Payload battery''')
MAV_BATTERY_FUNCTION_ENUM_END = 5 #
enums['MAV_BATTERY_FUNCTION'][5] = EnumEntry('MAV_BATTERY_FUNCTION_ENUM_END', '''''')
# MAV_BATTERY_CHARGE_STATE
enums['MAV_BATTERY_CHARGE_STATE'] = {}
MAV_BATTERY_CHARGE_STATE_UNDEFINED = 0 # Low battery state is not provided
enums['MAV_BATTERY_CHARGE_STATE'][0] = EnumEntry('MAV_BATTERY_CHARGE_STATE_UNDEFINED', '''Low battery state is not provided''')
MAV_BATTERY_CHARGE_STATE_OK = 1 # Battery is not in low state. Normal operation.
enums['MAV_BATTERY_CHARGE_STATE'][1] = EnumEntry('MAV_BATTERY_CHARGE_STATE_OK', '''Battery is not in low state. Normal operation.''')
MAV_BATTERY_CHARGE_STATE_LOW = 2 # Battery state is low, warn and monitor close.
enums['MAV_BATTERY_CHARGE_STATE'][2] = EnumEntry('MAV_BATTERY_CHARGE_STATE_LOW', '''Battery state is low, warn and monitor close.''')
MAV_BATTERY_CHARGE_STATE_CRITICAL = 3 # Battery state is critical, return or abort immediately.
enums['MAV_BATTERY_CHARGE_STATE'][3] = EnumEntry('MAV_BATTERY_CHARGE_STATE_CRITICAL', '''Battery state is critical, return or abort immediately.''')
MAV_BATTERY_CHARGE_STATE_EMERGENCY = 4 # Battery state is too low for ordinary abort sequence. Perform fastest
# possible emergency stop to prevent damage.
enums['MAV_BATTERY_CHARGE_STATE'][4] = EnumEntry('MAV_BATTERY_CHARGE_STATE_EMERGENCY', '''Battery state is too low for ordinary abort sequence. Perform fastest possible emergency stop to prevent damage.''')
MAV_BATTERY_CHARGE_STATE_FAILED = 5 # Battery failed, damage unavoidable.
enums['MAV_BATTERY_CHARGE_STATE'][5] = EnumEntry('MAV_BATTERY_CHARGE_STATE_FAILED', '''Battery failed, damage unavoidable.''')
MAV_BATTERY_CHARGE_STATE_UNHEALTHY = 6 # Battery is diagnosed to be defective or an error occurred, usage is
# discouraged / prohibited.
enums['MAV_BATTERY_CHARGE_STATE'][6] = EnumEntry('MAV_BATTERY_CHARGE_STATE_UNHEALTHY', '''Battery is diagnosed to be defective or an error occurred, usage is discouraged / prohibited.''')
MAV_BATTERY_CHARGE_STATE_CHARGING = 7 # Battery is charging.
enums['MAV_BATTERY_CHARGE_STATE'][7] = EnumEntry('MAV_BATTERY_CHARGE_STATE_CHARGING', '''Battery is charging.''')
MAV_BATTERY_CHARGE_STATE_ENUM_END = 8 #
enums['MAV_BATTERY_CHARGE_STATE'][8] = EnumEntry('MAV_BATTERY_CHARGE_STATE_ENUM_END', '''''')
# MAV_GENERATOR_STATUS_FLAG
enums['MAV_GENERATOR_STATUS_FLAG'] = {}
MAV_GENERATOR_STATUS_FLAG_OFF = 1 # Generator is off.
enums['MAV_GENERATOR_STATUS_FLAG'][1] = EnumEntry('MAV_GENERATOR_STATUS_FLAG_OFF', '''Generator is off.''')
MAV_GENERATOR_STATUS_FLAG_READY = 2 # Generator is ready to start generating power.
enums['MAV_GENERATOR_STATUS_FLAG'][2] = EnumEntry('MAV_GENERATOR_STATUS_FLAG_READY', '''Generator is ready to start generating power.''')
MAV_GENERATOR_STATUS_FLAG_GENERATING = 4 # Generator is generating power.
enums['MAV_GENERATOR_STATUS_FLAG'][4] = EnumEntry('MAV_GENERATOR_STATUS_FLAG_GENERATING', '''Generator is generating power.''')
MAV_GENERATOR_STATUS_FLAG_CHARGING = 8 # Generator is charging the batteries (generating enough power to charge
# and provide the load).
enums['MAV_GENERATOR_STATUS_FLAG'][8] = EnumEntry('MAV_GENERATOR_STATUS_FLAG_CHARGING', '''Generator is charging the batteries (generating enough power to charge and provide the load).''')
MAV_GENERATOR_STATUS_FLAG_REDUCED_POWER = 16 # Generator is operating at a reduced maximum power.
enums['MAV_GENERATOR_STATUS_FLAG'][16] = EnumEntry('MAV_GENERATOR_STATUS_FLAG_REDUCED_POWER', '''Generator is operating at a reduced maximum power.''')
MAV_GENERATOR_STATUS_FLAG_MAXPOWER = 32 # Generator is providing the maximum output.
enums['MAV_GENERATOR_STATUS_FLAG'][32] = EnumEntry('MAV_GENERATOR_STATUS_FLAG_MAXPOWER', '''Generator is providing the maximum output.''')
MAV_GENERATOR_STATUS_FLAG_OVERTEMP_WARNING = 64 # Generator is near the maximum operating temperature, cooling is
# insufficient.
enums['MAV_GENERATOR_STATUS_FLAG'][64] = EnumEntry('MAV_GENERATOR_STATUS_FLAG_OVERTEMP_WARNING', '''Generator is near the maximum operating temperature, cooling is insufficient.''')
MAV_GENERATOR_STATUS_FLAG_OVERTEMP_FAULT = 128 # Generator hit the maximum operating temperature and shutdown.
enums['MAV_GENERATOR_STATUS_FLAG'][128] = EnumEntry('MAV_GENERATOR_STATUS_FLAG_OVERTEMP_FAULT', '''Generator hit the maximum operating temperature and shutdown.''')
MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_WARNING = 256 # Power electronics are near the maximum operating temperature, cooling
# is insufficient.
enums['MAV_GENERATOR_STATUS_FLAG'][256] = EnumEntry('MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_WARNING', '''Power electronics are near the maximum operating temperature, cooling is insufficient.''')
MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_FAULT = 512 # Power electronics hit the maximum operating temperature and shutdown.
enums['MAV_GENERATOR_STATUS_FLAG'][512] = EnumEntry('MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_FAULT', '''Power electronics hit the maximum operating temperature and shutdown.''')
MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_FAULT = 1024 # Power electronics experienced a fault and shutdown.
enums['MAV_GENERATOR_STATUS_FLAG'][1024] = EnumEntry('MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_FAULT', '''Power electronics experienced a fault and shutdown.''')
MAV_GENERATOR_STATUS_FLAG_POWERSOURCE_FAULT = 2048 # The power source supplying the generator failed e.g. mechanical
# generator stopped, tether is no longer
# providing power, solar cell is in shade,
# hydrogen reaction no longer happening.
enums['MAV_GENERATOR_STATUS_FLAG'][2048] = EnumEntry('MAV_GENERATOR_STATUS_FLAG_POWERSOURCE_FAULT', '''The power source supplying the generator failed e.g. mechanical generator stopped, tether is no longer providing power, solar cell is in shade, hydrogen reaction no longer happening.''')
MAV_GENERATOR_STATUS_FLAG_COMMUNICATION_WARNING = 4096 # Generator controller having communication problems.
enums['MAV_GENERATOR_STATUS_FLAG'][4096] = EnumEntry('MAV_GENERATOR_STATUS_FLAG_COMMUNICATION_WARNING', '''Generator controller having communication problems.''')
MAV_GENERATOR_STATUS_FLAG_COOLING_WARNING = 8192 # Power electronic or generator cooling system error.
enums['MAV_GENERATOR_STATUS_FLAG'][8192] = EnumEntry('MAV_GENERATOR_STATUS_FLAG_COOLING_WARNING', '''Power electronic or generator cooling system error.''')
MAV_GENERATOR_STATUS_FLAG_POWER_RAIL_FAULT = 16384 # Generator controller power rail experienced a fault.
enums['MAV_GENERATOR_STATUS_FLAG'][16384] = EnumEntry('MAV_GENERATOR_STATUS_FLAG_POWER_RAIL_FAULT', '''Generator controller power rail experienced a fault.''')
MAV_GENERATOR_STATUS_FLAG_OVERCURRENT_FAULT = 32768 # Generator controller exceeded the overcurrent threshold and shutdown
# to prevent damage.
enums['MAV_GENERATOR_STATUS_FLAG'][32768] = EnumEntry('MAV_GENERATOR_STATUS_FLAG_OVERCURRENT_FAULT', '''Generator controller exceeded the overcurrent threshold and shutdown to prevent damage.''')
MAV_GENERATOR_STATUS_FLAG_BATTERY_OVERCHARGE_CURRENT_FAULT = 65536 # Generator controller detected a high current going into the batteries
# and shutdown to prevent battery damage.
enums['MAV_GENERATOR_STATUS_FLAG'][65536] = EnumEntry('MAV_GENERATOR_STATUS_FLAG_BATTERY_OVERCHARGE_CURRENT_FAULT', '''Generator controller detected a high current going into the batteries and shutdown to prevent battery damage.''')
MAV_GENERATOR_STATUS_FLAG_OVERVOLTAGE_FAULT = 131072 # Generator controller exceeded it's overvoltage threshold and shutdown
# to prevent it exceeding the voltage rating.
enums['MAV_GENERATOR_STATUS_FLAG'][131072] = EnumEntry('MAV_GENERATOR_STATUS_FLAG_OVERVOLTAGE_FAULT', '''Generator controller exceeded it's overvoltage threshold and shutdown to prevent it exceeding the voltage rating.''')
MAV_GENERATOR_STATUS_FLAG_BATTERY_UNDERVOLT_FAULT = 262144 # Batteries are under voltage.
enums['MAV_GENERATOR_STATUS_FLAG'][262144] = EnumEntry('MAV_GENERATOR_STATUS_FLAG_BATTERY_UNDERVOLT_FAULT', '''Batteries are under voltage.''')
MAV_GENERATOR_STATUS_FLAG_START_INHIBITED = 524288 # Generator start is inhibited by e.g. a safety switch.
enums['MAV_GENERATOR_STATUS_FLAG'][524288] = EnumEntry('MAV_GENERATOR_STATUS_FLAG_START_INHIBITED', '''Generator start is inhibited by e.g. a safety switch.''')
MAV_GENERATOR_STATUS_FLAG_MAINTENANCE_REQUIRED = 1048576 # Generator requires maintenance.
enums['MAV_GENERATOR_STATUS_FLAG'][1048576] = EnumEntry('MAV_GENERATOR_STATUS_FLAG_MAINTENANCE_REQUIRED', '''Generator requires maintenance.''')
MAV_GENERATOR_STATUS_FLAG_WARMING_UP = 2097152 # Generator is not ready to generate yet.
enums['MAV_GENERATOR_STATUS_FLAG'][2097152] = EnumEntry('MAV_GENERATOR_STATUS_FLAG_WARMING_UP', '''Generator is not ready to generate yet.''')
MAV_GENERATOR_STATUS_FLAG_IDLE = 4194304 # Generator is idle.
enums['MAV_GENERATOR_STATUS_FLAG'][4194304] = EnumEntry('MAV_GENERATOR_STATUS_FLAG_IDLE', '''Generator is idle.''')
MAV_GENERATOR_STATUS_FLAG_ENUM_END = 4194305 #
enums['MAV_GENERATOR_STATUS_FLAG'][4194305] = EnumEntry('MAV_GENERATOR_STATUS_FLAG_ENUM_END', '''''')
# MAV_VTOL_STATE
enums['MAV_VTOL_STATE'] = {}
MAV_VTOL_STATE_UNDEFINED = 0 # MAV is not configured as VTOL
enums['MAV_VTOL_STATE'][0] = EnumEntry('MAV_VTOL_STATE_UNDEFINED', '''MAV is not configured as VTOL''')
MAV_VTOL_STATE_TRANSITION_TO_FW = 1 # VTOL is in transition from multicopter to fixed-wing
enums['MAV_VTOL_STATE'][1] = EnumEntry('MAV_VTOL_STATE_TRANSITION_TO_FW', '''VTOL is in transition from multicopter to fixed-wing''')
MAV_VTOL_STATE_TRANSITION_TO_MC = 2 # VTOL is in transition from fixed-wing to multicopter
enums['MAV_VTOL_STATE'][2] = EnumEntry('MAV_VTOL_STATE_TRANSITION_TO_MC', '''VTOL is in transition from fixed-wing to multicopter''')
MAV_VTOL_STATE_MC = 3 # VTOL is in multicopter state
enums['MAV_VTOL_STATE'][3] = EnumEntry('MAV_VTOL_STATE_MC', '''VTOL is in multicopter state''')
MAV_VTOL_STATE_FW = 4 # VTOL is in fixed-wing state
enums['MAV_VTOL_STATE'][4] = EnumEntry('MAV_VTOL_STATE_FW', '''VTOL is in fixed-wing state''')
MAV_VTOL_STATE_ENUM_END = 5 #
enums['MAV_VTOL_STATE'][5] = EnumEntry('MAV_VTOL_STATE_ENUM_END', '''''')
# MAV_LANDED_STATE
enums['MAV_LANDED_STATE'] = {}
MAV_LANDED_STATE_UNDEFINED = 0 # MAV landed state is unknown
enums['MAV_LANDED_STATE'][0] = EnumEntry('MAV_LANDED_STATE_UNDEFINED', '''MAV landed state is unknown''')
MAV_LANDED_STATE_ON_GROUND = 1 # MAV is landed (on ground)
enums['MAV_LANDED_STATE'][1] = EnumEntry('MAV_LANDED_STATE_ON_GROUND', '''MAV is landed (on ground)''')
MAV_LANDED_STATE_IN_AIR = 2 # MAV is in air
enums['MAV_LANDED_STATE'][2] = EnumEntry('MAV_LANDED_STATE_IN_AIR', '''MAV is in air''')
MAV_LANDED_STATE_TAKEOFF = 3 # MAV currently taking off
enums['MAV_LANDED_STATE'][3] = EnumEntry('MAV_LANDED_STATE_TAKEOFF', '''MAV currently taking off''')
MAV_LANDED_STATE_LANDING = 4 # MAV currently landing
enums['MAV_LANDED_STATE'][4] = EnumEntry('MAV_LANDED_STATE_LANDING', '''MAV currently landing''')
MAV_LANDED_STATE_ENUM_END = 5 #
enums['MAV_LANDED_STATE'][5] = EnumEntry('MAV_LANDED_STATE_ENUM_END', '''''')
# ADSB_ALTITUDE_TYPE
enums['ADSB_ALTITUDE_TYPE'] = {}
ADSB_ALTITUDE_TYPE_PRESSURE_QNH = 0 # Altitude reported from a Baro source using QNH reference
enums['ADSB_ALTITUDE_TYPE'][0] = EnumEntry('ADSB_ALTITUDE_TYPE_PRESSURE_QNH', '''Altitude reported from a Baro source using QNH reference''')
ADSB_ALTITUDE_TYPE_GEOMETRIC = 1 # Altitude reported from a GNSS source
enums['ADSB_ALTITUDE_TYPE'][1] = EnumEntry('ADSB_ALTITUDE_TYPE_GEOMETRIC', '''Altitude reported from a GNSS source''')
ADSB_ALTITUDE_TYPE_ENUM_END = 2 #
enums['ADSB_ALTITUDE_TYPE'][2] = EnumEntry('ADSB_ALTITUDE_TYPE_ENUM_END', '''''')
# ADSB_EMITTER_TYPE
enums['ADSB_EMITTER_TYPE'] = {}
ADSB_EMITTER_TYPE_NO_INFO = 0 #
enums['ADSB_EMITTER_TYPE'][0] = EnumEntry('ADSB_EMITTER_TYPE_NO_INFO', '''''')
ADSB_EMITTER_TYPE_LIGHT = 1 #
enums['ADSB_EMITTER_TYPE'][1] = EnumEntry('ADSB_EMITTER_TYPE_LIGHT', '''''')
ADSB_EMITTER_TYPE_SMALL = 2 #
enums['ADSB_EMITTER_TYPE'][2] = EnumEntry('ADSB_EMITTER_TYPE_SMALL', '''''')
ADSB_EMITTER_TYPE_LARGE = 3 #
enums['ADSB_EMITTER_TYPE'][3] = EnumEntry('ADSB_EMITTER_TYPE_LARGE', '''''')
ADSB_EMITTER_TYPE_HIGH_VORTEX_LARGE = 4 #
enums['ADSB_EMITTER_TYPE'][4] = EnumEntry('ADSB_EMITTER_TYPE_HIGH_VORTEX_LARGE', '''''')
ADSB_EMITTER_TYPE_HEAVY = 5 #
enums['ADSB_EMITTER_TYPE'][5] = EnumEntry('ADSB_EMITTER_TYPE_HEAVY', '''''')
ADSB_EMITTER_TYPE_HIGHLY_MANUV = 6 #
enums['ADSB_EMITTER_TYPE'][6] = EnumEntry('ADSB_EMITTER_TYPE_HIGHLY_MANUV', '''''')
ADSB_EMITTER_TYPE_ROTOCRAFT = 7 #
enums['ADSB_EMITTER_TYPE'][7] = EnumEntry('ADSB_EMITTER_TYPE_ROTOCRAFT', '''''')
ADSB_EMITTER_TYPE_UNASSIGNED = 8 #
enums['ADSB_EMITTER_TYPE'][8] = EnumEntry('ADSB_EMITTER_TYPE_UNASSIGNED', '''''')
ADSB_EMITTER_TYPE_GLIDER = 9 #
enums['ADSB_EMITTER_TYPE'][9] = EnumEntry('ADSB_EMITTER_TYPE_GLIDER', '''''')
ADSB_EMITTER_TYPE_LIGHTER_AIR = 10 #
enums['ADSB_EMITTER_TYPE'][10] = EnumEntry('ADSB_EMITTER_TYPE_LIGHTER_AIR', '''''')
ADSB_EMITTER_TYPE_PARACHUTE = 11 #
enums['ADSB_EMITTER_TYPE'][11] = EnumEntry('ADSB_EMITTER_TYPE_PARACHUTE', '''''')
ADSB_EMITTER_TYPE_ULTRA_LIGHT = 12 #
enums['ADSB_EMITTER_TYPE'][12] = EnumEntry('ADSB_EMITTER_TYPE_ULTRA_LIGHT', '''''')
ADSB_EMITTER_TYPE_UNASSIGNED2 = 13 #
enums['ADSB_EMITTER_TYPE'][13] = EnumEntry('ADSB_EMITTER_TYPE_UNASSIGNED2', '''''')
ADSB_EMITTER_TYPE_UAV = 14 #
enums['ADSB_EMITTER_TYPE'][14] = EnumEntry('ADSB_EMITTER_TYPE_UAV', '''''')
ADSB_EMITTER_TYPE_SPACE = 15 #
enums['ADSB_EMITTER_TYPE'][15] = EnumEntry('ADSB_EMITTER_TYPE_SPACE', '''''')
ADSB_EMITTER_TYPE_UNASSGINED3 = 16 #
enums['ADSB_EMITTER_TYPE'][16] = EnumEntry('ADSB_EMITTER_TYPE_UNASSGINED3', '''''')
ADSB_EMITTER_TYPE_EMERGENCY_SURFACE = 17 #
enums['ADSB_EMITTER_TYPE'][17] = EnumEntry('ADSB_EMITTER_TYPE_EMERGENCY_SURFACE', '''''')
ADSB_EMITTER_TYPE_SERVICE_SURFACE = 18 #
enums['ADSB_EMITTER_TYPE'][18] = EnumEntry('ADSB_EMITTER_TYPE_SERVICE_SURFACE', '''''')
ADSB_EMITTER_TYPE_POINT_OBSTACLE = 19 #
enums['ADSB_EMITTER_TYPE'][19] = EnumEntry('ADSB_EMITTER_TYPE_POINT_OBSTACLE', '''''')
ADSB_EMITTER_TYPE_ENUM_END = 20 #
enums['ADSB_EMITTER_TYPE'][20] = EnumEntry('ADSB_EMITTER_TYPE_ENUM_END', '''''')
# ADSB_FLAGS
enums['ADSB_FLAGS'] = {}
ADSB_FLAGS_VALID_COORDS = 1 #
enums['ADSB_FLAGS'][1] = EnumEntry('ADSB_FLAGS_VALID_COORDS', '''''')
ADSB_FLAGS_VALID_ALTITUDE = 2 #
enums['ADSB_FLAGS'][2] = EnumEntry('ADSB_FLAGS_VALID_ALTITUDE', '''''')
ADSB_FLAGS_VALID_HEADING = 4 #
enums['ADSB_FLAGS'][4] = EnumEntry('ADSB_FLAGS_VALID_HEADING', '''''')
ADSB_FLAGS_VALID_VELOCITY = 8 #
enums['ADSB_FLAGS'][8] = EnumEntry('ADSB_FLAGS_VALID_VELOCITY', '''''')
ADSB_FLAGS_VALID_CALLSIGN = 16 #
enums['ADSB_FLAGS'][16] = EnumEntry('ADSB_FLAGS_VALID_CALLSIGN', '''''')
ADSB_FLAGS_VALID_SQUAWK = 32 #
enums['ADSB_FLAGS'][32] = EnumEntry('ADSB_FLAGS_VALID_SQUAWK', '''''')
ADSB_FLAGS_SIMULATED = 64 #
enums['ADSB_FLAGS'][64] = EnumEntry('ADSB_FLAGS_SIMULATED', '''''')
ADSB_FLAGS_VERTICAL_VELOCITY_VALID = 128 #
enums['ADSB_FLAGS'][128] = EnumEntry('ADSB_FLAGS_VERTICAL_VELOCITY_VALID', '''''')
ADSB_FLAGS_BARO_VALID = 256 #
enums['ADSB_FLAGS'][256] = EnumEntry('ADSB_FLAGS_BARO_VALID', '''''')
ADSB_FLAGS_SOURCE_UAT = 32768 #
enums['ADSB_FLAGS'][32768] = EnumEntry('ADSB_FLAGS_SOURCE_UAT', '''''')
ADSB_FLAGS_ENUM_END = 32769 #
enums['ADSB_FLAGS'][32769] = EnumEntry('ADSB_FLAGS_ENUM_END', '''''')
# MAV_DO_REPOSITION_FLAGS
enums['MAV_DO_REPOSITION_FLAGS'] = {}
MAV_DO_REPOSITION_FLAGS_CHANGE_MODE = 1 # The aircraft should immediately transition into guided. This should
# not be set for follow me applications
enums['MAV_DO_REPOSITION_FLAGS'][1] = EnumEntry('MAV_DO_REPOSITION_FLAGS_CHANGE_MODE', '''The aircraft should immediately transition into guided. This should not be set for follow me applications''')
MAV_DO_REPOSITION_FLAGS_ENUM_END = 2 #
enums['MAV_DO_REPOSITION_FLAGS'][2] = EnumEntry('MAV_DO_REPOSITION_FLAGS_ENUM_END', '''''')
# ESTIMATOR_STATUS_FLAGS
enums['ESTIMATOR_STATUS_FLAGS'] = {}
ESTIMATOR_ATTITUDE = 1 # True if the attitude estimate is good
enums['ESTIMATOR_STATUS_FLAGS'][1] = EnumEntry('ESTIMATOR_ATTITUDE', '''True if the attitude estimate is good''')
ESTIMATOR_VELOCITY_HORIZ = 2 # True if the horizontal velocity estimate is good
enums['ESTIMATOR_STATUS_FLAGS'][2] = EnumEntry('ESTIMATOR_VELOCITY_HORIZ', '''True if the horizontal velocity estimate is good''')
ESTIMATOR_VELOCITY_VERT = 4 # True if the vertical velocity estimate is good
enums['ESTIMATOR_STATUS_FLAGS'][4] = EnumEntry('ESTIMATOR_VELOCITY_VERT', '''True if the vertical velocity estimate is good''')
ESTIMATOR_POS_HORIZ_REL = 8 # True if the horizontal position (relative) estimate is good
enums['ESTIMATOR_STATUS_FLAGS'][8] = EnumEntry('ESTIMATOR_POS_HORIZ_REL', '''True if the horizontal position (relative) estimate is good''')
ESTIMATOR_POS_HORIZ_ABS = 16 # True if the horizontal position (absolute) estimate is good
enums['ESTIMATOR_STATUS_FLAGS'][16] = EnumEntry('ESTIMATOR_POS_HORIZ_ABS', '''True if the horizontal position (absolute) estimate is good''')
ESTIMATOR_POS_VERT_ABS = 32 # True if the vertical position (absolute) estimate is good
enums['ESTIMATOR_STATUS_FLAGS'][32] = EnumEntry('ESTIMATOR_POS_VERT_ABS', '''True if the vertical position (absolute) estimate is good''')
ESTIMATOR_POS_VERT_AGL = 64 # True if the vertical position (above ground) estimate is good
enums['ESTIMATOR_STATUS_FLAGS'][64] = EnumEntry('ESTIMATOR_POS_VERT_AGL', '''True if the vertical position (above ground) estimate is good''')
ESTIMATOR_CONST_POS_MODE = 128 # True if the EKF is in a constant position mode and is not using
# external measurements (eg GPS or optical
# flow)
enums['ESTIMATOR_STATUS_FLAGS'][128] = EnumEntry('ESTIMATOR_CONST_POS_MODE', '''True if the EKF is in a constant position mode and is not using external measurements (eg GPS or optical flow)''')
ESTIMATOR_PRED_POS_HORIZ_REL = 256 # True if the EKF has sufficient data to enter a mode that will provide
# a (relative) position estimate
enums['ESTIMATOR_STATUS_FLAGS'][256] = EnumEntry('ESTIMATOR_PRED_POS_HORIZ_REL', '''True if the EKF has sufficient data to enter a mode that will provide a (relative) position estimate''')
ESTIMATOR_PRED_POS_HORIZ_ABS = 512 # True if the EKF has sufficient data to enter a mode that will provide
# a (absolute) position estimate
enums['ESTIMATOR_STATUS_FLAGS'][512] = EnumEntry('ESTIMATOR_PRED_POS_HORIZ_ABS', '''True if the EKF has sufficient data to enter a mode that will provide a (absolute) position estimate''')
ESTIMATOR_GPS_GLITCH = 1024 # True if the EKF has detected a GPS glitch
enums['ESTIMATOR_STATUS_FLAGS'][1024] = EnumEntry('ESTIMATOR_GPS_GLITCH', '''True if the EKF has detected a GPS glitch''')
ESTIMATOR_ACCEL_ERROR = 2048 # True if the EKF has detected bad accelerometer data
enums['ESTIMATOR_STATUS_FLAGS'][2048] = EnumEntry('ESTIMATOR_ACCEL_ERROR', '''True if the EKF has detected bad accelerometer data''')
ESTIMATOR_STATUS_FLAGS_ENUM_END = 2049 #
enums['ESTIMATOR_STATUS_FLAGS'][2049] = EnumEntry('ESTIMATOR_STATUS_FLAGS_ENUM_END', '''''')
# MOTOR_TEST_ORDER
enums['MOTOR_TEST_ORDER'] = {}
MOTOR_TEST_ORDER_DEFAULT = 0 # default autopilot motor test method
enums['MOTOR_TEST_ORDER'][0] = EnumEntry('MOTOR_TEST_ORDER_DEFAULT', '''default autopilot motor test method''')
MOTOR_TEST_ORDER_SEQUENCE = 1 # motor numbers are specified as their index in a predefined vehicle-
# specific sequence
enums['MOTOR_TEST_ORDER'][1] = EnumEntry('MOTOR_TEST_ORDER_SEQUENCE', '''motor numbers are specified as their index in a predefined vehicle-specific sequence''')
MOTOR_TEST_ORDER_BOARD = 2 # motor numbers are specified as the output as labeled on the board
enums['MOTOR_TEST_ORDER'][2] = EnumEntry('MOTOR_TEST_ORDER_BOARD', '''motor numbers are specified as the output as labeled on the board''')
MOTOR_TEST_ORDER_ENUM_END = 3 #
enums['MOTOR_TEST_ORDER'][3] = EnumEntry('MOTOR_TEST_ORDER_ENUM_END', '''''')
# MOTOR_TEST_THROTTLE_TYPE
enums['MOTOR_TEST_THROTTLE_TYPE'] = {}
MOTOR_TEST_THROTTLE_PERCENT = 0 # throttle as a percentage from 0 ~ 100
enums['MOTOR_TEST_THROTTLE_TYPE'][0] = EnumEntry('MOTOR_TEST_THROTTLE_PERCENT', '''throttle as a percentage from 0 ~ 100''')
MOTOR_TEST_THROTTLE_PWM = 1 # throttle as an absolute PWM value (normally in range of 1000~2000)
enums['MOTOR_TEST_THROTTLE_TYPE'][1] = EnumEntry('MOTOR_TEST_THROTTLE_PWM', '''throttle as an absolute PWM value (normally in range of 1000~2000)''')
MOTOR_TEST_THROTTLE_PILOT = 2 # throttle pass-through from pilot's transmitter
enums['MOTOR_TEST_THROTTLE_TYPE'][2] = EnumEntry('MOTOR_TEST_THROTTLE_PILOT', '''throttle pass-through from pilot's transmitter''')
MOTOR_TEST_COMPASS_CAL = 3 # per-motor compass calibration test
enums['MOTOR_TEST_THROTTLE_TYPE'][3] = EnumEntry('MOTOR_TEST_COMPASS_CAL', '''per-motor compass calibration test''')
MOTOR_TEST_THROTTLE_TYPE_ENUM_END = 4 #
enums['MOTOR_TEST_THROTTLE_TYPE'][4] = EnumEntry('MOTOR_TEST_THROTTLE_TYPE_ENUM_END', '''''')
# GPS_INPUT_IGNORE_FLAGS
enums['GPS_INPUT_IGNORE_FLAGS'] = {}
GPS_INPUT_IGNORE_FLAG_ALT = 1 # ignore altitude field
enums['GPS_INPUT_IGNORE_FLAGS'][1] = EnumEntry('GPS_INPUT_IGNORE_FLAG_ALT', '''ignore altitude field''')
GPS_INPUT_IGNORE_FLAG_HDOP = 2 # ignore hdop field
enums['GPS_INPUT_IGNORE_FLAGS'][2] = EnumEntry('GPS_INPUT_IGNORE_FLAG_HDOP', '''ignore hdop field''')
GPS_INPUT_IGNORE_FLAG_VDOP = 4 # ignore vdop field
enums['GPS_INPUT_IGNORE_FLAGS'][4] = EnumEntry('GPS_INPUT_IGNORE_FLAG_VDOP', '''ignore vdop field''')
GPS_INPUT_IGNORE_FLAG_VEL_HORIZ = 8 # ignore horizontal velocity field (vn and ve)
enums['GPS_INPUT_IGNORE_FLAGS'][8] = EnumEntry('GPS_INPUT_IGNORE_FLAG_VEL_HORIZ', '''ignore horizontal velocity field (vn and ve)''')
GPS_INPUT_IGNORE_FLAG_VEL_VERT = 16 # ignore vertical velocity field (vd)
enums['GPS_INPUT_IGNORE_FLAGS'][16] = EnumEntry('GPS_INPUT_IGNORE_FLAG_VEL_VERT', '''ignore vertical velocity field (vd)''')
GPS_INPUT_IGNORE_FLAG_SPEED_ACCURACY = 32 # ignore speed accuracy field
enums['GPS_INPUT_IGNORE_FLAGS'][32] = EnumEntry('GPS_INPUT_IGNORE_FLAG_SPEED_ACCURACY', '''ignore speed accuracy field''')
GPS_INPUT_IGNORE_FLAG_HORIZONTAL_ACCURACY = 64 # ignore horizontal accuracy field
enums['GPS_INPUT_IGNORE_FLAGS'][64] = EnumEntry('GPS_INPUT_IGNORE_FLAG_HORIZONTAL_ACCURACY', '''ignore horizontal accuracy field''')
GPS_INPUT_IGNORE_FLAG_VERTICAL_ACCURACY = 128 # ignore vertical accuracy field
enums['GPS_INPUT_IGNORE_FLAGS'][128] = EnumEntry('GPS_INPUT_IGNORE_FLAG_VERTICAL_ACCURACY', '''ignore vertical accuracy field''')
GPS_INPUT_IGNORE_FLAGS_ENUM_END = 129 #
enums['GPS_INPUT_IGNORE_FLAGS'][129] = EnumEntry('GPS_INPUT_IGNORE_FLAGS_ENUM_END', '''''')
# MAV_COLLISION_ACTION
enums['MAV_COLLISION_ACTION'] = {}
MAV_COLLISION_ACTION_NONE = 0 # Ignore any potential collisions
enums['MAV_COLLISION_ACTION'][0] = EnumEntry('MAV_COLLISION_ACTION_NONE', '''Ignore any potential collisions''')
MAV_COLLISION_ACTION_REPORT = 1 # Report potential collision
enums['MAV_COLLISION_ACTION'][1] = EnumEntry('MAV_COLLISION_ACTION_REPORT', '''Report potential collision''')
MAV_COLLISION_ACTION_ASCEND_OR_DESCEND = 2 # Ascend or Descend to avoid threat
enums['MAV_COLLISION_ACTION'][2] = EnumEntry('MAV_COLLISION_ACTION_ASCEND_OR_DESCEND', '''Ascend or Descend to avoid threat''')
MAV_COLLISION_ACTION_MOVE_HORIZONTALLY = 3 # Move horizontally to avoid threat
enums['MAV_COLLISION_ACTION'][3] = EnumEntry('MAV_COLLISION_ACTION_MOVE_HORIZONTALLY', '''Move horizontally to avoid threat''')
MAV_COLLISION_ACTION_MOVE_PERPENDICULAR = 4 # Aircraft to move perpendicular to the collision's velocity vector
enums['MAV_COLLISION_ACTION'][4] = EnumEntry('MAV_COLLISION_ACTION_MOVE_PERPENDICULAR', '''Aircraft to move perpendicular to the collision's velocity vector''')
MAV_COLLISION_ACTION_RTL = 5 # Aircraft to fly directly back to its launch point
enums['MAV_COLLISION_ACTION'][5] = EnumEntry('MAV_COLLISION_ACTION_RTL', '''Aircraft to fly directly back to its launch point''')
MAV_COLLISION_ACTION_HOVER = 6 # Aircraft to stop in place
enums['MAV_COLLISION_ACTION'][6] = EnumEntry('MAV_COLLISION_ACTION_HOVER', '''Aircraft to stop in place''')
MAV_COLLISION_ACTION_ENUM_END = 7 #
enums['MAV_COLLISION_ACTION'][7] = EnumEntry('MAV_COLLISION_ACTION_ENUM_END', '''''')
# MAV_COLLISION_THREAT_LEVEL
enums['MAV_COLLISION_THREAT_LEVEL'] = {}
MAV_COLLISION_THREAT_LEVEL_NONE = 0 # Not a threat
enums['MAV_COLLISION_THREAT_LEVEL'][0] = EnumEntry('MAV_COLLISION_THREAT_LEVEL_NONE', '''Not a threat''')
MAV_COLLISION_THREAT_LEVEL_LOW = 1 # Craft is mildly concerned about this threat
enums['MAV_COLLISION_THREAT_LEVEL'][1] = EnumEntry('MAV_COLLISION_THREAT_LEVEL_LOW', '''Craft is mildly concerned about this threat''')
MAV_COLLISION_THREAT_LEVEL_HIGH = 2 # Craft is panicking, and may take actions to avoid threat
enums['MAV_COLLISION_THREAT_LEVEL'][2] = EnumEntry('MAV_COLLISION_THREAT_LEVEL_HIGH', '''Craft is panicking, and may take actions to avoid threat''')
MAV_COLLISION_THREAT_LEVEL_ENUM_END = 3 #
enums['MAV_COLLISION_THREAT_LEVEL'][3] = EnumEntry('MAV_COLLISION_THREAT_LEVEL_ENUM_END', '''''')
# MAV_COLLISION_SRC
enums['MAV_COLLISION_SRC'] = {}
MAV_COLLISION_SRC_ADSB = 0 # ID field references ADSB_VEHICLE packets
enums['MAV_COLLISION_SRC'][0] = EnumEntry('MAV_COLLISION_SRC_ADSB', '''ID field references ADSB_VEHICLE packets''')
MAV_COLLISION_SRC_MAVLINK_GPS_GLOBAL_INT = 1 # ID field references MAVLink SRC ID
enums['MAV_COLLISION_SRC'][1] = EnumEntry('MAV_COLLISION_SRC_MAVLINK_GPS_GLOBAL_INT', '''ID field references MAVLink SRC ID''')
MAV_COLLISION_SRC_ENUM_END = 2 #
enums['MAV_COLLISION_SRC'][2] = EnumEntry('MAV_COLLISION_SRC_ENUM_END', '''''')
# GPS_FIX_TYPE
enums['GPS_FIX_TYPE'] = {}
GPS_FIX_TYPE_NO_GPS = 0 # No GPS connected
enums['GPS_FIX_TYPE'][0] = EnumEntry('GPS_FIX_TYPE_NO_GPS', '''No GPS connected''')
GPS_FIX_TYPE_NO_FIX = 1 # No position information, GPS is connected
enums['GPS_FIX_TYPE'][1] = EnumEntry('GPS_FIX_TYPE_NO_FIX', '''No position information, GPS is connected''')
GPS_FIX_TYPE_2D_FIX = 2 # 2D position
enums['GPS_FIX_TYPE'][2] = EnumEntry('GPS_FIX_TYPE_2D_FIX', '''2D position''')
GPS_FIX_TYPE_3D_FIX = 3 # 3D position
enums['GPS_FIX_TYPE'][3] = EnumEntry('GPS_FIX_TYPE_3D_FIX', '''3D position''')
GPS_FIX_TYPE_DGPS = 4 # DGPS/SBAS aided 3D position
enums['GPS_FIX_TYPE'][4] = EnumEntry('GPS_FIX_TYPE_DGPS', '''DGPS/SBAS aided 3D position''')
GPS_FIX_TYPE_RTK_FLOAT = 5 # RTK float, 3D position
enums['GPS_FIX_TYPE'][5] = EnumEntry('GPS_FIX_TYPE_RTK_FLOAT', '''RTK float, 3D position''')
GPS_FIX_TYPE_RTK_FIXED = 6 # RTK Fixed, 3D position
enums['GPS_FIX_TYPE'][6] = EnumEntry('GPS_FIX_TYPE_RTK_FIXED', '''RTK Fixed, 3D position''')
GPS_FIX_TYPE_STATIC = 7 # Static fixed, typically used for base stations
enums['GPS_FIX_TYPE'][7] = EnumEntry('GPS_FIX_TYPE_STATIC', '''Static fixed, typically used for base stations''')
GPS_FIX_TYPE_PPP = 8 # PPP, 3D position.
enums['GPS_FIX_TYPE'][8] = EnumEntry('GPS_FIX_TYPE_PPP', '''PPP, 3D position.''')
GPS_FIX_TYPE_ENUM_END = 9 #
enums['GPS_FIX_TYPE'][9] = EnumEntry('GPS_FIX_TYPE_ENUM_END', '''''')
# RTK_BASELINE_COORDINATE_SYSTEM
enums['RTK_BASELINE_COORDINATE_SYSTEM'] = {}
RTK_BASELINE_COORDINATE_SYSTEM_ECEF = 0 # Earth-centered, Earth-fixed
enums['RTK_BASELINE_COORDINATE_SYSTEM'][0] = EnumEntry('RTK_BASELINE_COORDINATE_SYSTEM_ECEF', '''Earth-centered, Earth-fixed''')
RTK_BASELINE_COORDINATE_SYSTEM_NED = 1 # RTK basestation centered, north, east, down
enums['RTK_BASELINE_COORDINATE_SYSTEM'][1] = EnumEntry('RTK_BASELINE_COORDINATE_SYSTEM_NED', '''RTK basestation centered, north, east, down''')
RTK_BASELINE_COORDINATE_SYSTEM_ENUM_END = 2 #
enums['RTK_BASELINE_COORDINATE_SYSTEM'][2] = EnumEntry('RTK_BASELINE_COORDINATE_SYSTEM_ENUM_END', '''''')
# LANDING_TARGET_TYPE
enums['LANDING_TARGET_TYPE'] = {}
LANDING_TARGET_TYPE_LIGHT_BEACON = 0 # Landing target signaled by light beacon (ex: IR-LOCK)
enums['LANDING_TARGET_TYPE'][0] = EnumEntry('LANDING_TARGET_TYPE_LIGHT_BEACON', '''Landing target signaled by light beacon (ex: IR-LOCK)''')
LANDING_TARGET_TYPE_RADIO_BEACON = 1 # Landing target signaled by radio beacon (ex: ILS, NDB)
enums['LANDING_TARGET_TYPE'][1] = EnumEntry('LANDING_TARGET_TYPE_RADIO_BEACON', '''Landing target signaled by radio beacon (ex: ILS, NDB)''')
LANDING_TARGET_TYPE_VISION_FIDUCIAL = 2 # Landing target represented by a fiducial marker (ex: ARTag)
enums['LANDING_TARGET_TYPE'][2] = EnumEntry('LANDING_TARGET_TYPE_VISION_FIDUCIAL', '''Landing target represented by a fiducial marker (ex: ARTag)''')
LANDING_TARGET_TYPE_VISION_OTHER = 3 # Landing target represented by a pre-defined visual shape/feature (ex:
# X-marker, H-marker, square)
enums['LANDING_TARGET_TYPE'][3] = EnumEntry('LANDING_TARGET_TYPE_VISION_OTHER', '''Landing target represented by a pre-defined visual shape/feature (ex: X-marker, H-marker, square)''')
LANDING_TARGET_TYPE_ENUM_END = 4 #
enums['LANDING_TARGET_TYPE'][4] = EnumEntry('LANDING_TARGET_TYPE_ENUM_END', '''''')
# VTOL_TRANSITION_HEADING
enums['VTOL_TRANSITION_HEADING'] = {}
VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT = 0 # Respect the heading configuration of the vehicle.
enums['VTOL_TRANSITION_HEADING'][0] = EnumEntry('VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT', '''Respect the heading configuration of the vehicle.''')
VTOL_TRANSITION_HEADING_NEXT_WAYPOINT = 1 # Use the heading pointing towards the next waypoint.
enums['VTOL_TRANSITION_HEADING'][1] = EnumEntry('VTOL_TRANSITION_HEADING_NEXT_WAYPOINT', '''Use the heading pointing towards the next waypoint.''')
VTOL_TRANSITION_HEADING_TAKEOFF = 2 # Use the heading on takeoff (while sitting on the ground).
enums['VTOL_TRANSITION_HEADING'][2] = EnumEntry('VTOL_TRANSITION_HEADING_TAKEOFF', '''Use the heading on takeoff (while sitting on the ground).''')
VTOL_TRANSITION_HEADING_SPECIFIED = 3 # Use the specified heading in parameter 4.
enums['VTOL_TRANSITION_HEADING'][3] = EnumEntry('VTOL_TRANSITION_HEADING_SPECIFIED', '''Use the specified heading in parameter 4.''')
VTOL_TRANSITION_HEADING_ANY = 4 # Use the current heading when reaching takeoff altitude (potentially
# facing the wind when weather-vaning is
# active).
enums['VTOL_TRANSITION_HEADING'][4] = EnumEntry('VTOL_TRANSITION_HEADING_ANY', '''Use the current heading when reaching takeoff altitude (potentially facing the wind when weather-vaning is active).''')
VTOL_TRANSITION_HEADING_ENUM_END = 5 #
enums['VTOL_TRANSITION_HEADING'][5] = EnumEntry('VTOL_TRANSITION_HEADING_ENUM_END', '''''')
# CAMERA_CAP_FLAGS
enums['CAMERA_CAP_FLAGS'] = {}
CAMERA_CAP_FLAGS_CAPTURE_VIDEO = 1 # Camera is able to record video
enums['CAMERA_CAP_FLAGS'][1] = EnumEntry('CAMERA_CAP_FLAGS_CAPTURE_VIDEO', '''Camera is able to record video''')
CAMERA_CAP_FLAGS_CAPTURE_IMAGE = 2 # Camera is able to capture images
enums['CAMERA_CAP_FLAGS'][2] = EnumEntry('CAMERA_CAP_FLAGS_CAPTURE_IMAGE', '''Camera is able to capture images''')
CAMERA_CAP_FLAGS_HAS_MODES = 4 # Camera has separate Video and Image/Photo modes
# (MAV_CMD_SET_CAMERA_MODE)
enums['CAMERA_CAP_FLAGS'][4] = EnumEntry('CAMERA_CAP_FLAGS_HAS_MODES', '''Camera has separate Video and Image/Photo modes (MAV_CMD_SET_CAMERA_MODE)''')
CAMERA_CAP_FLAGS_CAN_CAPTURE_IMAGE_IN_VIDEO_MODE = 8 # Camera can capture images while in video mode
enums['CAMERA_CAP_FLAGS'][8] = EnumEntry('CAMERA_CAP_FLAGS_CAN_CAPTURE_IMAGE_IN_VIDEO_MODE', '''Camera can capture images while in video mode''')
CAMERA_CAP_FLAGS_CAN_CAPTURE_VIDEO_IN_IMAGE_MODE = 16 # Camera can capture videos while in Photo/Image mode
enums['CAMERA_CAP_FLAGS'][16] = EnumEntry('CAMERA_CAP_FLAGS_CAN_CAPTURE_VIDEO_IN_IMAGE_MODE', '''Camera can capture videos while in Photo/Image mode''')
CAMERA_CAP_FLAGS_HAS_IMAGE_SURVEY_MODE = 32 # Camera has image survey mode (MAV_CMD_SET_CAMERA_MODE)
enums['CAMERA_CAP_FLAGS'][32] = EnumEntry('CAMERA_CAP_FLAGS_HAS_IMAGE_SURVEY_MODE', '''Camera has image survey mode (MAV_CMD_SET_CAMERA_MODE)''')
CAMERA_CAP_FLAGS_HAS_BASIC_ZOOM = 64 # Camera has basic zoom control (MAV_CMD_SET_CAMERA_ZOOM)
enums['CAMERA_CAP_FLAGS'][64] = EnumEntry('CAMERA_CAP_FLAGS_HAS_BASIC_ZOOM', '''Camera has basic zoom control (MAV_CMD_SET_CAMERA_ZOOM)''')
CAMERA_CAP_FLAGS_HAS_BASIC_FOCUS = 128 # Camera has basic focus control (MAV_CMD_SET_CAMERA_FOCUS)
enums['CAMERA_CAP_FLAGS'][128] = EnumEntry('CAMERA_CAP_FLAGS_HAS_BASIC_FOCUS', '''Camera has basic focus control (MAV_CMD_SET_CAMERA_FOCUS)''')
CAMERA_CAP_FLAGS_HAS_VIDEO_STREAM = 256 # Camera has video streaming capabilities (use
# MAV_CMD_REQUEST_VIDEO_STREAM_INFORMATION for
# video streaming info)
enums['CAMERA_CAP_FLAGS'][256] = EnumEntry('CAMERA_CAP_FLAGS_HAS_VIDEO_STREAM', '''Camera has video streaming capabilities (use MAV_CMD_REQUEST_VIDEO_STREAM_INFORMATION for video streaming info)''')
CAMERA_CAP_FLAGS_ENUM_END = 257 #
enums['CAMERA_CAP_FLAGS'][257] = EnumEntry('CAMERA_CAP_FLAGS_ENUM_END', '''''')
# CAMERA_MODE
enums['CAMERA_MODE'] = {}
CAMERA_MODE_IMAGE = 0 # Camera is in image/photo capture mode.
enums['CAMERA_MODE'][0] = EnumEntry('CAMERA_MODE_IMAGE', '''Camera is in image/photo capture mode.''')
CAMERA_MODE_VIDEO = 1 # Camera is in video capture mode.
enums['CAMERA_MODE'][1] = EnumEntry('CAMERA_MODE_VIDEO', '''Camera is in video capture mode.''')
CAMERA_MODE_IMAGE_SURVEY = 2 # Camera is in image survey capture mode. It allows for camera
# controller to do specific settings for
# surveys.
enums['CAMERA_MODE'][2] = EnumEntry('CAMERA_MODE_IMAGE_SURVEY', '''Camera is in image survey capture mode. It allows for camera controller to do specific settings for surveys.''')
CAMERA_MODE_ENUM_END = 3 #
enums['CAMERA_MODE'][3] = EnumEntry('CAMERA_MODE_ENUM_END', '''''')
# MAV_ARM_AUTH_DENIED_REASON
enums['MAV_ARM_AUTH_DENIED_REASON'] = {}
MAV_ARM_AUTH_DENIED_REASON_GENERIC = 0 # Not a specific reason
enums['MAV_ARM_AUTH_DENIED_REASON'][0] = EnumEntry('MAV_ARM_AUTH_DENIED_REASON_GENERIC', '''Not a specific reason''')
MAV_ARM_AUTH_DENIED_REASON_NONE = 1 # Authorizer will send the error as string to GCS
enums['MAV_ARM_AUTH_DENIED_REASON'][1] = EnumEntry('MAV_ARM_AUTH_DENIED_REASON_NONE', '''Authorizer will send the error as string to GCS''')
MAV_ARM_AUTH_DENIED_REASON_INVALID_WAYPOINT = 2 # At least one waypoint have a invalid value
enums['MAV_ARM_AUTH_DENIED_REASON'][2] = EnumEntry('MAV_ARM_AUTH_DENIED_REASON_INVALID_WAYPOINT', '''At least one waypoint have a invalid value''')
MAV_ARM_AUTH_DENIED_REASON_TIMEOUT = 3 # Timeout in the authorizer process(in case it depends on network)
enums['MAV_ARM_AUTH_DENIED_REASON'][3] = EnumEntry('MAV_ARM_AUTH_DENIED_REASON_TIMEOUT', '''Timeout in the authorizer process(in case it depends on network)''')
MAV_ARM_AUTH_DENIED_REASON_AIRSPACE_IN_USE = 4 # Airspace of the mission in use by another vehicle, second result
# parameter can have the waypoint id that
# caused it to be denied.
enums['MAV_ARM_AUTH_DENIED_REASON'][4] = EnumEntry('MAV_ARM_AUTH_DENIED_REASON_AIRSPACE_IN_USE', '''Airspace of the mission in use by another vehicle, second result parameter can have the waypoint id that caused it to be denied.''')
MAV_ARM_AUTH_DENIED_REASON_BAD_WEATHER = 5 # Weather is not good to fly
enums['MAV_ARM_AUTH_DENIED_REASON'][5] = EnumEntry('MAV_ARM_AUTH_DENIED_REASON_BAD_WEATHER', '''Weather is not good to fly''')
MAV_ARM_AUTH_DENIED_REASON_ENUM_END = 6 #
enums['MAV_ARM_AUTH_DENIED_REASON'][6] = EnumEntry('MAV_ARM_AUTH_DENIED_REASON_ENUM_END', '''''')
# RC_TYPE
enums['RC_TYPE'] = {}
RC_TYPE_SPEKTRUM_DSM2 = 0 # Spektrum DSM2
enums['RC_TYPE'][0] = EnumEntry('RC_TYPE_SPEKTRUM_DSM2', '''Spektrum DSM2''')
RC_TYPE_SPEKTRUM_DSMX = 1 # Spektrum DSMX
enums['RC_TYPE'][1] = EnumEntry('RC_TYPE_SPEKTRUM_DSMX', '''Spektrum DSMX''')
RC_TYPE_ENUM_END = 2 #
enums['RC_TYPE'][2] = EnumEntry('RC_TYPE_ENUM_END', '''''')
# POSITION_TARGET_TYPEMASK
enums['POSITION_TARGET_TYPEMASK'] = {}
POSITION_TARGET_TYPEMASK_X_IGNORE = 1 # Ignore position x
enums['POSITION_TARGET_TYPEMASK'][1] = EnumEntry('POSITION_TARGET_TYPEMASK_X_IGNORE', '''Ignore position x''')
POSITION_TARGET_TYPEMASK_Y_IGNORE = 2 # Ignore position y
enums['POSITION_TARGET_TYPEMASK'][2] = EnumEntry('POSITION_TARGET_TYPEMASK_Y_IGNORE', '''Ignore position y''')
POSITION_TARGET_TYPEMASK_Z_IGNORE = 4 # Ignore position z
enums['POSITION_TARGET_TYPEMASK'][4] = EnumEntry('POSITION_TARGET_TYPEMASK_Z_IGNORE', '''Ignore position z''')
POSITION_TARGET_TYPEMASK_VX_IGNORE = 8 # Ignore velocity x
enums['POSITION_TARGET_TYPEMASK'][8] = EnumEntry('POSITION_TARGET_TYPEMASK_VX_IGNORE', '''Ignore velocity x''')
POSITION_TARGET_TYPEMASK_VY_IGNORE = 16 # Ignore velocity y
enums['POSITION_TARGET_TYPEMASK'][16] = EnumEntry('POSITION_TARGET_TYPEMASK_VY_IGNORE', '''Ignore velocity y''')
POSITION_TARGET_TYPEMASK_VZ_IGNORE = 32 # Ignore velocity z
enums['POSITION_TARGET_TYPEMASK'][32] = EnumEntry('POSITION_TARGET_TYPEMASK_VZ_IGNORE', '''Ignore velocity z''')
POSITION_TARGET_TYPEMASK_AX_IGNORE = 64 # Ignore acceleration x
enums['POSITION_TARGET_TYPEMASK'][64] = EnumEntry('POSITION_TARGET_TYPEMASK_AX_IGNORE', '''Ignore acceleration x''')
POSITION_TARGET_TYPEMASK_AY_IGNORE = 128 # Ignore acceleration y
enums['POSITION_TARGET_TYPEMASK'][128] = EnumEntry('POSITION_TARGET_TYPEMASK_AY_IGNORE', '''Ignore acceleration y''')
POSITION_TARGET_TYPEMASK_AZ_IGNORE = 256 # Ignore acceleration z
enums['POSITION_TARGET_TYPEMASK'][256] = EnumEntry('POSITION_TARGET_TYPEMASK_AZ_IGNORE', '''Ignore acceleration z''')
POSITION_TARGET_TYPEMASK_FORCE_SET = 512 # Use force instead of acceleration
enums['POSITION_TARGET_TYPEMASK'][512] = EnumEntry('POSITION_TARGET_TYPEMASK_FORCE_SET', '''Use force instead of acceleration''')
POSITION_TARGET_TYPEMASK_YAW_IGNORE = 1024 # Ignore yaw
enums['POSITION_TARGET_TYPEMASK'][1024] = EnumEntry('POSITION_TARGET_TYPEMASK_YAW_IGNORE', '''Ignore yaw''')
POSITION_TARGET_TYPEMASK_YAW_RATE_IGNORE = 2048 # Ignore yaw rate
enums['POSITION_TARGET_TYPEMASK'][2048] = EnumEntry('POSITION_TARGET_TYPEMASK_YAW_RATE_IGNORE', '''Ignore yaw rate''')
POSITION_TARGET_TYPEMASK_ENUM_END = 2049 #
enums['POSITION_TARGET_TYPEMASK'][2049] = EnumEntry('POSITION_TARGET_TYPEMASK_ENUM_END', '''''')
# PRECISION_LAND_MODE
enums['PRECISION_LAND_MODE'] = {}
PRECISION_LAND_MODE_DISABLED = 0 # Normal (non-precision) landing.
enums['PRECISION_LAND_MODE'][0] = EnumEntry('PRECISION_LAND_MODE_DISABLED', '''Normal (non-precision) landing.''')
PRECISION_LAND_MODE_OPPORTUNISTIC = 1 # Use precision landing if beacon detected when land command accepted,
# otherwise land normally.
enums['PRECISION_LAND_MODE'][1] = EnumEntry('PRECISION_LAND_MODE_OPPORTUNISTIC', '''Use precision landing if beacon detected when land command accepted, otherwise land normally.''')
PRECISION_LAND_MODE_REQUIRED = 2 # Use precision landing, searching for beacon if not found when land
# command accepted (land normally if beacon
# cannot be found).
enums['PRECISION_LAND_MODE'][2] = EnumEntry('PRECISION_LAND_MODE_REQUIRED', '''Use precision landing, searching for beacon if not found when land command accepted (land normally if beacon cannot be found).''')
PRECISION_LAND_MODE_ENUM_END = 3 #
enums['PRECISION_LAND_MODE'][3] = EnumEntry('PRECISION_LAND_MODE_ENUM_END', '''''')
# PARACHUTE_ACTION
enums['PARACHUTE_ACTION'] = {}
PARACHUTE_DISABLE = 0 # Disable parachute release.
enums['PARACHUTE_ACTION'][0] = EnumEntry('PARACHUTE_DISABLE', '''Disable parachute release.''')
PARACHUTE_ENABLE = 1 # Enable parachute release.
enums['PARACHUTE_ACTION'][1] = EnumEntry('PARACHUTE_ENABLE', '''Enable parachute release.''')
PARACHUTE_RELEASE = 2 # Release parachute.
enums['PARACHUTE_ACTION'][2] = EnumEntry('PARACHUTE_RELEASE', '''Release parachute.''')
PARACHUTE_ACTION_ENUM_END = 3 #
enums['PARACHUTE_ACTION'][3] = EnumEntry('PARACHUTE_ACTION_ENUM_END', '''''')
# AIS_TYPE
enums['AIS_TYPE'] = {}
AIS_TYPE_UNKNOWN = 0 # Not available (default).
enums['AIS_TYPE'][0] = EnumEntry('AIS_TYPE_UNKNOWN', '''Not available (default).''')
AIS_TYPE_RESERVED_1 = 1 #
enums['AIS_TYPE'][1] = EnumEntry('AIS_TYPE_RESERVED_1', '''''')
AIS_TYPE_RESERVED_2 = 2 #
enums['AIS_TYPE'][2] = EnumEntry('AIS_TYPE_RESERVED_2', '''''')
AIS_TYPE_RESERVED_3 = 3 #
enums['AIS_TYPE'][3] = EnumEntry('AIS_TYPE_RESERVED_3', '''''')
AIS_TYPE_RESERVED_4 = 4 #
enums['AIS_TYPE'][4] = EnumEntry('AIS_TYPE_RESERVED_4', '''''')
AIS_TYPE_RESERVED_5 = 5 #
enums['AIS_TYPE'][5] = EnumEntry('AIS_TYPE_RESERVED_5', '''''')
AIS_TYPE_RESERVED_6 = 6 #
enums['AIS_TYPE'][6] = EnumEntry('AIS_TYPE_RESERVED_6', '''''')
AIS_TYPE_RESERVED_7 = 7 #
enums['AIS_TYPE'][7] = EnumEntry('AIS_TYPE_RESERVED_7', '''''')
AIS_TYPE_RESERVED_8 = 8 #
enums['AIS_TYPE'][8] = EnumEntry('AIS_TYPE_RESERVED_8', '''''')
AIS_TYPE_RESERVED_9 = 9 #
enums['AIS_TYPE'][9] = EnumEntry('AIS_TYPE_RESERVED_9', '''''')
AIS_TYPE_RESERVED_10 = 10 #
enums['AIS_TYPE'][10] = EnumEntry('AIS_TYPE_RESERVED_10', '''''')
AIS_TYPE_RESERVED_11 = 11 #
enums['AIS_TYPE'][11] = EnumEntry('AIS_TYPE_RESERVED_11', '''''')
AIS_TYPE_RESERVED_12 = 12 #
enums['AIS_TYPE'][12] = EnumEntry('AIS_TYPE_RESERVED_12', '''''')
AIS_TYPE_RESERVED_13 = 13 #
enums['AIS_TYPE'][13] = EnumEntry('AIS_TYPE_RESERVED_13', '''''')
AIS_TYPE_RESERVED_14 = 14 #
enums['AIS_TYPE'][14] = EnumEntry('AIS_TYPE_RESERVED_14', '''''')
AIS_TYPE_RESERVED_15 = 15 #
enums['AIS_TYPE'][15] = EnumEntry('AIS_TYPE_RESERVED_15', '''''')
AIS_TYPE_RESERVED_16 = 16 #
enums['AIS_TYPE'][16] = EnumEntry('AIS_TYPE_RESERVED_16', '''''')
AIS_TYPE_RESERVED_17 = 17 #
enums['AIS_TYPE'][17] = EnumEntry('AIS_TYPE_RESERVED_17', '''''')
AIS_TYPE_RESERVED_18 = 18 #
enums['AIS_TYPE'][18] = EnumEntry('AIS_TYPE_RESERVED_18', '''''')
AIS_TYPE_RESERVED_19 = 19 #
enums['AIS_TYPE'][19] = EnumEntry('AIS_TYPE_RESERVED_19', '''''')
AIS_TYPE_WIG = 20 # Wing In Ground effect.
enums['AIS_TYPE'][20] = EnumEntry('AIS_TYPE_WIG', '''Wing In Ground effect.''')
AIS_TYPE_WIG_HAZARDOUS_A = 21 #
enums['AIS_TYPE'][21] = EnumEntry('AIS_TYPE_WIG_HAZARDOUS_A', '''''')
AIS_TYPE_WIG_HAZARDOUS_B = 22 #
enums['AIS_TYPE'][22] = EnumEntry('AIS_TYPE_WIG_HAZARDOUS_B', '''''')
AIS_TYPE_WIG_HAZARDOUS_C = 23 #
enums['AIS_TYPE'][23] = EnumEntry('AIS_TYPE_WIG_HAZARDOUS_C', '''''')
AIS_TYPE_WIG_HAZARDOUS_D = 24 #
enums['AIS_TYPE'][24] = EnumEntry('AIS_TYPE_WIG_HAZARDOUS_D', '''''')
AIS_TYPE_WIG_RESERVED_1 = 25 #
enums['AIS_TYPE'][25] = EnumEntry('AIS_TYPE_WIG_RESERVED_1', '''''')
AIS_TYPE_WIG_RESERVED_2 = 26 #
enums['AIS_TYPE'][26] = EnumEntry('AIS_TYPE_WIG_RESERVED_2', '''''')
AIS_TYPE_WIG_RESERVED_3 = 27 #
enums['AIS_TYPE'][27] = EnumEntry('AIS_TYPE_WIG_RESERVED_3', '''''')
AIS_TYPE_WIG_RESERVED_4 = 28 #
enums['AIS_TYPE'][28] = EnumEntry('AIS_TYPE_WIG_RESERVED_4', '''''')
AIS_TYPE_WIG_RESERVED_5 = 29 #
enums['AIS_TYPE'][29] = EnumEntry('AIS_TYPE_WIG_RESERVED_5', '''''')
AIS_TYPE_FISHING = 30 #
enums['AIS_TYPE'][30] = EnumEntry('AIS_TYPE_FISHING', '''''')
AIS_TYPE_TOWING = 31 #
enums['AIS_TYPE'][31] = EnumEntry('AIS_TYPE_TOWING', '''''')
AIS_TYPE_TOWING_LARGE = 32 # Towing: length exceeds 200m or breadth exceeds 25m.
enums['AIS_TYPE'][32] = EnumEntry('AIS_TYPE_TOWING_LARGE', '''Towing: length exceeds 200m or breadth exceeds 25m.''')
AIS_TYPE_DREDGING = 33 # Dredging or other underwater ops.
enums['AIS_TYPE'][33] = EnumEntry('AIS_TYPE_DREDGING', '''Dredging or other underwater ops.''')
AIS_TYPE_DIVING = 34 #
enums['AIS_TYPE'][34] = EnumEntry('AIS_TYPE_DIVING', '''''')
AIS_TYPE_MILITARY = 35 #
enums['AIS_TYPE'][35] = EnumEntry('AIS_TYPE_MILITARY', '''''')
AIS_TYPE_SAILING = 36 #
enums['AIS_TYPE'][36] = EnumEntry('AIS_TYPE_SAILING', '''''')
AIS_TYPE_PLEASURE = 37 #
enums['AIS_TYPE'][37] = EnumEntry('AIS_TYPE_PLEASURE', '''''')
AIS_TYPE_RESERVED_20 = 38 #
enums['AIS_TYPE'][38] = EnumEntry('AIS_TYPE_RESERVED_20', '''''')
AIS_TYPE_RESERVED_21 = 39 #
enums['AIS_TYPE'][39] = EnumEntry('AIS_TYPE_RESERVED_21', '''''')
AIS_TYPE_HSC = 40 # High Speed Craft.
enums['AIS_TYPE'][40] = EnumEntry('AIS_TYPE_HSC', '''High Speed Craft.''')
AIS_TYPE_HSC_HAZARDOUS_A = 41 #
enums['AIS_TYPE'][41] = EnumEntry('AIS_TYPE_HSC_HAZARDOUS_A', '''''')
AIS_TYPE_HSC_HAZARDOUS_B = 42 #
enums['AIS_TYPE'][42] = EnumEntry('AIS_TYPE_HSC_HAZARDOUS_B', '''''')
AIS_TYPE_HSC_HAZARDOUS_C = 43 #
enums['AIS_TYPE'][43] = EnumEntry('AIS_TYPE_HSC_HAZARDOUS_C', '''''')
AIS_TYPE_HSC_HAZARDOUS_D = 44 #
enums['AIS_TYPE'][44] = EnumEntry('AIS_TYPE_HSC_HAZARDOUS_D', '''''')
AIS_TYPE_HSC_RESERVED_1 = 45 #
enums['AIS_TYPE'][45] = EnumEntry('AIS_TYPE_HSC_RESERVED_1', '''''')
AIS_TYPE_HSC_RESERVED_2 = 46 #
enums['AIS_TYPE'][46] = EnumEntry('AIS_TYPE_HSC_RESERVED_2', '''''')
AIS_TYPE_HSC_RESERVED_3 = 47 #
enums['AIS_TYPE'][47] = EnumEntry('AIS_TYPE_HSC_RESERVED_3', '''''')
AIS_TYPE_HSC_RESERVED_4 = 48 #
enums['AIS_TYPE'][48] = EnumEntry('AIS_TYPE_HSC_RESERVED_4', '''''')
AIS_TYPE_HSC_UNKNOWN = 49 #
enums['AIS_TYPE'][49] = EnumEntry('AIS_TYPE_HSC_UNKNOWN', '''''')
AIS_TYPE_PILOT = 50 #
enums['AIS_TYPE'][50] = EnumEntry('AIS_TYPE_PILOT', '''''')
AIS_TYPE_SAR = 51 # Search And Rescue vessel.
enums['AIS_TYPE'][51] = EnumEntry('AIS_TYPE_SAR', '''Search And Rescue vessel.''')
AIS_TYPE_TUG = 52 #
enums['AIS_TYPE'][52] = EnumEntry('AIS_TYPE_TUG', '''''')
AIS_TYPE_PORT_TENDER = 53 #
enums['AIS_TYPE'][53] = EnumEntry('AIS_TYPE_PORT_TENDER', '''''')
AIS_TYPE_ANTI_POLLUTION = 54 # Anti-pollution equipment.
enums['AIS_TYPE'][54] = EnumEntry('AIS_TYPE_ANTI_POLLUTION', '''Anti-pollution equipment.''')
AIS_TYPE_LAW_ENFORCEMENT = 55 #
enums['AIS_TYPE'][55] = EnumEntry('AIS_TYPE_LAW_ENFORCEMENT', '''''')
AIS_TYPE_SPARE_LOCAL_1 = 56 #
enums['AIS_TYPE'][56] = EnumEntry('AIS_TYPE_SPARE_LOCAL_1', '''''')
AIS_TYPE_SPARE_LOCAL_2 = 57 #
enums['AIS_TYPE'][57] = EnumEntry('AIS_TYPE_SPARE_LOCAL_2', '''''')
AIS_TYPE_MEDICAL_TRANSPORT = 58 #
enums['AIS_TYPE'][58] = EnumEntry('AIS_TYPE_MEDICAL_TRANSPORT', '''''')
AIS_TYPE_NONECOMBATANT = 59 # Noncombatant ship according to RR Resolution No. 18.
enums['AIS_TYPE'][59] = EnumEntry('AIS_TYPE_NONECOMBATANT', '''Noncombatant ship according to RR Resolution No. 18.''')
AIS_TYPE_PASSENGER = 60 #
enums['AIS_TYPE'][60] = EnumEntry('AIS_TYPE_PASSENGER', '''''')
AIS_TYPE_PASSENGER_HAZARDOUS_A = 61 #
enums['AIS_TYPE'][61] = EnumEntry('AIS_TYPE_PASSENGER_HAZARDOUS_A', '''''')
AIS_TYPE_PASSENGER_HAZARDOUS_B = 62 #
enums['AIS_TYPE'][62] = EnumEntry('AIS_TYPE_PASSENGER_HAZARDOUS_B', '''''')
AIS_TYPE_AIS_TYPE_PASSENGER_HAZARDOUS_C = 63 #
enums['AIS_TYPE'][63] = EnumEntry('AIS_TYPE_AIS_TYPE_PASSENGER_HAZARDOUS_C', '''''')
AIS_TYPE_PASSENGER_HAZARDOUS_D = 64 #
enums['AIS_TYPE'][64] = EnumEntry('AIS_TYPE_PASSENGER_HAZARDOUS_D', '''''')
AIS_TYPE_PASSENGER_RESERVED_1 = 65 #
enums['AIS_TYPE'][65] = EnumEntry('AIS_TYPE_PASSENGER_RESERVED_1', '''''')
AIS_TYPE_PASSENGER_RESERVED_2 = 66 #
enums['AIS_TYPE'][66] = EnumEntry('AIS_TYPE_PASSENGER_RESERVED_2', '''''')
AIS_TYPE_PASSENGER_RESERVED_3 = 67 #
enums['AIS_TYPE'][67] = EnumEntry('AIS_TYPE_PASSENGER_RESERVED_3', '''''')
AIS_TYPE_AIS_TYPE_PASSENGER_RESERVED_4 = 68 #
enums['AIS_TYPE'][68] = EnumEntry('AIS_TYPE_AIS_TYPE_PASSENGER_RESERVED_4', '''''')
AIS_TYPE_PASSENGER_UNKNOWN = 69 #
enums['AIS_TYPE'][69] = EnumEntry('AIS_TYPE_PASSENGER_UNKNOWN', '''''')
AIS_TYPE_CARGO = 70 #
enums['AIS_TYPE'][70] = EnumEntry('AIS_TYPE_CARGO', '''''')
AIS_TYPE_CARGO_HAZARDOUS_A = 71 #
enums['AIS_TYPE'][71] = EnumEntry('AIS_TYPE_CARGO_HAZARDOUS_A', '''''')
AIS_TYPE_CARGO_HAZARDOUS_B = 72 #
enums['AIS_TYPE'][72] = EnumEntry('AIS_TYPE_CARGO_HAZARDOUS_B', '''''')
AIS_TYPE_CARGO_HAZARDOUS_C = 73 #
enums['AIS_TYPE'][73] = EnumEntry('AIS_TYPE_CARGO_HAZARDOUS_C', '''''')
AIS_TYPE_CARGO_HAZARDOUS_D = 74 #
enums['AIS_TYPE'][74] = EnumEntry('AIS_TYPE_CARGO_HAZARDOUS_D', '''''')
AIS_TYPE_CARGO_RESERVED_1 = 75 #
enums['AIS_TYPE'][75] = EnumEntry('AIS_TYPE_CARGO_RESERVED_1', '''''')
AIS_TYPE_CARGO_RESERVED_2 = 76 #
enums['AIS_TYPE'][76] = EnumEntry('AIS_TYPE_CARGO_RESERVED_2', '''''')
AIS_TYPE_CARGO_RESERVED_3 = 77 #
enums['AIS_TYPE'][77] = EnumEntry('AIS_TYPE_CARGO_RESERVED_3', '''''')
AIS_TYPE_CARGO_RESERVED_4 = 78 #
enums['AIS_TYPE'][78] = EnumEntry('AIS_TYPE_CARGO_RESERVED_4', '''''')
AIS_TYPE_CARGO_UNKNOWN = 79 #
enums['AIS_TYPE'][79] = EnumEntry('AIS_TYPE_CARGO_UNKNOWN', '''''')
AIS_TYPE_TANKER = 80 #
enums['AIS_TYPE'][80] = EnumEntry('AIS_TYPE_TANKER', '''''')
AIS_TYPE_TANKER_HAZARDOUS_A = 81 #
enums['AIS_TYPE'][81] = EnumEntry('AIS_TYPE_TANKER_HAZARDOUS_A', '''''')
AIS_TYPE_TANKER_HAZARDOUS_B = 82 #
enums['AIS_TYPE'][82] = EnumEntry('AIS_TYPE_TANKER_HAZARDOUS_B', '''''')
AIS_TYPE_TANKER_HAZARDOUS_C = 83 #
enums['AIS_TYPE'][83] = EnumEntry('AIS_TYPE_TANKER_HAZARDOUS_C', '''''')
AIS_TYPE_TANKER_HAZARDOUS_D = 84 #
enums['AIS_TYPE'][84] = EnumEntry('AIS_TYPE_TANKER_HAZARDOUS_D', '''''')
AIS_TYPE_TANKER_RESERVED_1 = 85 #
enums['AIS_TYPE'][85] = EnumEntry('AIS_TYPE_TANKER_RESERVED_1', '''''')
AIS_TYPE_TANKER_RESERVED_2 = 86 #
enums['AIS_TYPE'][86] = EnumEntry('AIS_TYPE_TANKER_RESERVED_2', '''''')
AIS_TYPE_TANKER_RESERVED_3 = 87 #
enums['AIS_TYPE'][87] = EnumEntry('AIS_TYPE_TANKER_RESERVED_3', '''''')
AIS_TYPE_TANKER_RESERVED_4 = 88 #
enums['AIS_TYPE'][88] = EnumEntry('AIS_TYPE_TANKER_RESERVED_4', '''''')
AIS_TYPE_TANKER_UNKNOWN = 89 #
enums['AIS_TYPE'][89] = EnumEntry('AIS_TYPE_TANKER_UNKNOWN', '''''')
AIS_TYPE_OTHER = 90 #
enums['AIS_TYPE'][90] = EnumEntry('AIS_TYPE_OTHER', '''''')
AIS_TYPE_OTHER_HAZARDOUS_A = 91 #
enums['AIS_TYPE'][91] = EnumEntry('AIS_TYPE_OTHER_HAZARDOUS_A', '''''')
AIS_TYPE_OTHER_HAZARDOUS_B = 92 #
enums['AIS_TYPE'][92] = EnumEntry('AIS_TYPE_OTHER_HAZARDOUS_B', '''''')
AIS_TYPE_OTHER_HAZARDOUS_C = 93 #
enums['AIS_TYPE'][93] = EnumEntry('AIS_TYPE_OTHER_HAZARDOUS_C', '''''')
AIS_TYPE_OTHER_HAZARDOUS_D = 94 #
enums['AIS_TYPE'][94] = EnumEntry('AIS_TYPE_OTHER_HAZARDOUS_D', '''''')
AIS_TYPE_OTHER_RESERVED_1 = 95 #
enums['AIS_TYPE'][95] = EnumEntry('AIS_TYPE_OTHER_RESERVED_1', '''''')
AIS_TYPE_OTHER_RESERVED_2 = 96 #
enums['AIS_TYPE'][96] = EnumEntry('AIS_TYPE_OTHER_RESERVED_2', '''''')
AIS_TYPE_OTHER_RESERVED_3 = 97 #
enums['AIS_TYPE'][97] = EnumEntry('AIS_TYPE_OTHER_RESERVED_3', '''''')
AIS_TYPE_OTHER_RESERVED_4 = 98 #
enums['AIS_TYPE'][98] = EnumEntry('AIS_TYPE_OTHER_RESERVED_4', '''''')
AIS_TYPE_OTHER_UNKNOWN = 99 #
enums['AIS_TYPE'][99] = EnumEntry('AIS_TYPE_OTHER_UNKNOWN', '''''')
AIS_TYPE_ENUM_END = 100 #
enums['AIS_TYPE'][100] = EnumEntry('AIS_TYPE_ENUM_END', '''''')
# AIS_NAV_STATUS
enums['AIS_NAV_STATUS'] = {}
UNDER_WAY = 0 # Under way using engine.
enums['AIS_NAV_STATUS'][0] = EnumEntry('UNDER_WAY', '''Under way using engine.''')
AIS_NAV_ANCHORED = 1 #
enums['AIS_NAV_STATUS'][1] = EnumEntry('AIS_NAV_ANCHORED', '''''')
AIS_NAV_UN_COMMANDED = 2 #
enums['AIS_NAV_STATUS'][2] = EnumEntry('AIS_NAV_UN_COMMANDED', '''''')
AIS_NAV_RESTRICTED_MANOEUVERABILITY = 3 #
enums['AIS_NAV_STATUS'][3] = EnumEntry('AIS_NAV_RESTRICTED_MANOEUVERABILITY', '''''')
AIS_NAV_DRAUGHT_CONSTRAINED = 4 #
enums['AIS_NAV_STATUS'][4] = EnumEntry('AIS_NAV_DRAUGHT_CONSTRAINED', '''''')
AIS_NAV_MOORED = 5 #
enums['AIS_NAV_STATUS'][5] = EnumEntry('AIS_NAV_MOORED', '''''')
AIS_NAV_AGROUND = 6 #
enums['AIS_NAV_STATUS'][6] = EnumEntry('AIS_NAV_AGROUND', '''''')
AIS_NAV_FISHING = 7 #
enums['AIS_NAV_STATUS'][7] = EnumEntry('AIS_NAV_FISHING', '''''')
AIS_NAV_SAILING = 8 #
enums['AIS_NAV_STATUS'][8] = EnumEntry('AIS_NAV_SAILING', '''''')
AIS_NAV_RESERVED_HSC = 9 #
enums['AIS_NAV_STATUS'][9] = EnumEntry('AIS_NAV_RESERVED_HSC', '''''')
AIS_NAV_RESERVED_WIG = 10 #
enums['AIS_NAV_STATUS'][10] = EnumEntry('AIS_NAV_RESERVED_WIG', '''''')
AIS_NAV_RESERVED_1 = 11 #
enums['AIS_NAV_STATUS'][11] = EnumEntry('AIS_NAV_RESERVED_1', '''''')
AIS_NAV_RESERVED_2 = 12 #
enums['AIS_NAV_STATUS'][12] = EnumEntry('AIS_NAV_RESERVED_2', '''''')
AIS_NAV_RESERVED_3 = 13 #
enums['AIS_NAV_STATUS'][13] = EnumEntry('AIS_NAV_RESERVED_3', '''''')
AIS_NAV_AIS_SART = 14 # Search And Rescue Transponder.
enums['AIS_NAV_STATUS'][14] = EnumEntry('AIS_NAV_AIS_SART', '''Search And Rescue Transponder.''')
AIS_NAV_UNKNOWN = 15 # Not available (default).
enums['AIS_NAV_STATUS'][15] = EnumEntry('AIS_NAV_UNKNOWN', '''Not available (default).''')
AIS_NAV_STATUS_ENUM_END = 16 #
enums['AIS_NAV_STATUS'][16] = EnumEntry('AIS_NAV_STATUS_ENUM_END', '''''')
# AIS_FLAGS
enums['AIS_FLAGS'] = {}
AIS_FLAGS_POSITION_ACCURACY = 1 # 1 = Position accuracy less than 10m, 0 = position accuracy greater
# than 10m.
enums['AIS_FLAGS'][1] = EnumEntry('AIS_FLAGS_POSITION_ACCURACY', '''1 = Position accuracy less than 10m, 0 = position accuracy greater than 10m.''')
AIS_FLAGS_VALID_COG = 2 #
enums['AIS_FLAGS'][2] = EnumEntry('AIS_FLAGS_VALID_COG', '''''')
AIS_FLAGS_VALID_VELOCITY = 4 #
enums['AIS_FLAGS'][4] = EnumEntry('AIS_FLAGS_VALID_VELOCITY', '''''')
AIS_FLAGS_HIGH_VELOCITY = 8 # 1 = Velocity over 52.5765m/s (102.2 knots)
enums['AIS_FLAGS'][8] = EnumEntry('AIS_FLAGS_HIGH_VELOCITY', '''1 = Velocity over 52.5765m/s (102.2 knots)''')
AIS_FLAGS_VALID_TURN_RATE = 16 #
enums['AIS_FLAGS'][16] = EnumEntry('AIS_FLAGS_VALID_TURN_RATE', '''''')
AIS_FLAGS_TURN_RATE_SIGN_ONLY = 32 # Only the sign of the returned turn rate value is valid, either greater
# than 5deg/30s or less than -5deg/30s
enums['AIS_FLAGS'][32] = EnumEntry('AIS_FLAGS_TURN_RATE_SIGN_ONLY', '''Only the sign of the returned turn rate value is valid, either greater than 5deg/30s or less than -5deg/30s''')
AIS_FLAGS_VALID_DIMENSIONS = 64 #
enums['AIS_FLAGS'][64] = EnumEntry('AIS_FLAGS_VALID_DIMENSIONS', '''''')
AIS_FLAGS_LARGE_BOW_DIMENSION = 128 # Distance to bow is larger than 511m
enums['AIS_FLAGS'][128] = EnumEntry('AIS_FLAGS_LARGE_BOW_DIMENSION', '''Distance to bow is larger than 511m''')
AIS_FLAGS_LARGE_STERN_DIMENSION = 256 # Distance to stern is larger than 511m
enums['AIS_FLAGS'][256] = EnumEntry('AIS_FLAGS_LARGE_STERN_DIMENSION', '''Distance to stern is larger than 511m''')
AIS_FLAGS_LARGE_PORT_DIMENSION = 512 # Distance to port side is larger than 63m
enums['AIS_FLAGS'][512] = EnumEntry('AIS_FLAGS_LARGE_PORT_DIMENSION', '''Distance to port side is larger than 63m''')
AIS_FLAGS_LARGE_STARBOARD_DIMENSION = 1024 # Distance to starboard side is larger than 63m
enums['AIS_FLAGS'][1024] = EnumEntry('AIS_FLAGS_LARGE_STARBOARD_DIMENSION', '''Distance to starboard side is larger than 63m''')
AIS_FLAGS_VALID_CALLSIGN = 2048 #
enums['AIS_FLAGS'][2048] = EnumEntry('AIS_FLAGS_VALID_CALLSIGN', '''''')
AIS_FLAGS_VALID_NAME = 4096 #
enums['AIS_FLAGS'][4096] = EnumEntry('AIS_FLAGS_VALID_NAME', '''''')
AIS_FLAGS_ENUM_END = 4097 #
enums['AIS_FLAGS'][4097] = EnumEntry('AIS_FLAGS_ENUM_END', '''''')
# MAV_WINCH_STATUS_FLAG
enums['MAV_WINCH_STATUS_FLAG'] = {}
MAV_WINCH_STATUS_HEALTHY = 1 # Winch is healthy
enums['MAV_WINCH_STATUS_FLAG'][1] = EnumEntry('MAV_WINCH_STATUS_HEALTHY', '''Winch is healthy''')
MAV_WINCH_STATUS_FULLY_RETRACTED = 2 # Winch thread is fully retracted
enums['MAV_WINCH_STATUS_FLAG'][2] = EnumEntry('MAV_WINCH_STATUS_FULLY_RETRACTED', '''Winch thread is fully retracted''')
MAV_WINCH_STATUS_MOVING = 4 # Winch motor is moving
enums['MAV_WINCH_STATUS_FLAG'][4] = EnumEntry('MAV_WINCH_STATUS_MOVING', '''Winch motor is moving''')
MAV_WINCH_STATUS_CLUTCH_ENGAGED = 8 # Winch clutch is engaged allowing motor to move freely
enums['MAV_WINCH_STATUS_FLAG'][8] = EnumEntry('MAV_WINCH_STATUS_CLUTCH_ENGAGED', '''Winch clutch is engaged allowing motor to move freely''')
MAV_WINCH_STATUS_FLAG_ENUM_END = 9 #
enums['MAV_WINCH_STATUS_FLAG'][9] = EnumEntry('MAV_WINCH_STATUS_FLAG_ENUM_END', '''''')
# UAVIONIX_ADSB_OUT_DYNAMIC_STATE
enums['UAVIONIX_ADSB_OUT_DYNAMIC_STATE'] = {}
UAVIONIX_ADSB_OUT_DYNAMIC_STATE_INTENT_CHANGE = 1 #
enums['UAVIONIX_ADSB_OUT_DYNAMIC_STATE'][1] = EnumEntry('UAVIONIX_ADSB_OUT_DYNAMIC_STATE_INTENT_CHANGE', '''''')
UAVIONIX_ADSB_OUT_DYNAMIC_STATE_AUTOPILOT_ENABLED = 2 #
enums['UAVIONIX_ADSB_OUT_DYNAMIC_STATE'][2] = EnumEntry('UAVIONIX_ADSB_OUT_DYNAMIC_STATE_AUTOPILOT_ENABLED', '''''')
UAVIONIX_ADSB_OUT_DYNAMIC_STATE_NICBARO_CROSSCHECKED = 4 #
enums['UAVIONIX_ADSB_OUT_DYNAMIC_STATE'][4] = EnumEntry('UAVIONIX_ADSB_OUT_DYNAMIC_STATE_NICBARO_CROSSCHECKED', '''''')
UAVIONIX_ADSB_OUT_DYNAMIC_STATE_ON_GROUND = 8 #
enums['UAVIONIX_ADSB_OUT_DYNAMIC_STATE'][8] = EnumEntry('UAVIONIX_ADSB_OUT_DYNAMIC_STATE_ON_GROUND', '''''')
UAVIONIX_ADSB_OUT_DYNAMIC_STATE_IDENT = 16 #
enums['UAVIONIX_ADSB_OUT_DYNAMIC_STATE'][16] = EnumEntry('UAVIONIX_ADSB_OUT_DYNAMIC_STATE_IDENT', '''''')
UAVIONIX_ADSB_OUT_DYNAMIC_STATE_ENUM_END = 17 #
enums['UAVIONIX_ADSB_OUT_DYNAMIC_STATE'][17] = EnumEntry('UAVIONIX_ADSB_OUT_DYNAMIC_STATE_ENUM_END', '''''')
# UAVIONIX_ADSB_OUT_RF_SELECT
enums['UAVIONIX_ADSB_OUT_RF_SELECT'] = {}
UAVIONIX_ADSB_OUT_RF_SELECT_STANDBY = 0 #
enums['UAVIONIX_ADSB_OUT_RF_SELECT'][0] = EnumEntry('UAVIONIX_ADSB_OUT_RF_SELECT_STANDBY', '''''')
UAVIONIX_ADSB_OUT_RF_SELECT_RX_ENABLED = 1 #
enums['UAVIONIX_ADSB_OUT_RF_SELECT'][1] = EnumEntry('UAVIONIX_ADSB_OUT_RF_SELECT_RX_ENABLED', '''''')
UAVIONIX_ADSB_OUT_RF_SELECT_TX_ENABLED = 2 #
enums['UAVIONIX_ADSB_OUT_RF_SELECT'][2] = EnumEntry('UAVIONIX_ADSB_OUT_RF_SELECT_TX_ENABLED', '''''')
UAVIONIX_ADSB_OUT_RF_SELECT_ENUM_END = 3 #
enums['UAVIONIX_ADSB_OUT_RF_SELECT'][3] = EnumEntry('UAVIONIX_ADSB_OUT_RF_SELECT_ENUM_END', '''''')
# UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX
enums['UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX'] = {}
UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX_NONE_0 = 0 #
enums['UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX'][0] = EnumEntry('UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX_NONE_0', '''''')
UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX_NONE_1 = 1 #
enums['UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX'][1] = EnumEntry('UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX_NONE_1', '''''')
UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX_2D = 2 #
enums['UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX'][2] = EnumEntry('UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX_2D', '''''')
UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX_3D = 3 #
enums['UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX'][3] = EnumEntry('UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX_3D', '''''')
UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX_DGPS = 4 #
enums['UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX'][4] = EnumEntry('UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX_DGPS', '''''')
UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX_RTK = 5 #
enums['UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX'][5] = EnumEntry('UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX_RTK', '''''')
UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX_ENUM_END = 6 #
enums['UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX'][6] = EnumEntry('UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX_ENUM_END', '''''')
# UAVIONIX_ADSB_RF_HEALTH
enums['UAVIONIX_ADSB_RF_HEALTH'] = {}
UAVIONIX_ADSB_RF_HEALTH_INITIALIZING = 0 #
enums['UAVIONIX_ADSB_RF_HEALTH'][0] = EnumEntry('UAVIONIX_ADSB_RF_HEALTH_INITIALIZING', '''''')
UAVIONIX_ADSB_RF_HEALTH_OK = 1 #
enums['UAVIONIX_ADSB_RF_HEALTH'][1] = EnumEntry('UAVIONIX_ADSB_RF_HEALTH_OK', '''''')
UAVIONIX_ADSB_RF_HEALTH_FAIL_TX = 2 #
enums['UAVIONIX_ADSB_RF_HEALTH'][2] = EnumEntry('UAVIONIX_ADSB_RF_HEALTH_FAIL_TX', '''''')
UAVIONIX_ADSB_RF_HEALTH_FAIL_RX = 16 #
enums['UAVIONIX_ADSB_RF_HEALTH'][16] = EnumEntry('UAVIONIX_ADSB_RF_HEALTH_FAIL_RX', '''''')
UAVIONIX_ADSB_RF_HEALTH_ENUM_END = 17 #
enums['UAVIONIX_ADSB_RF_HEALTH'][17] = EnumEntry('UAVIONIX_ADSB_RF_HEALTH_ENUM_END', '''''')
# UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE
enums['UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE'] = {}
UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_NO_DATA = 0 #
enums['UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE'][0] = EnumEntry('UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_NO_DATA', '''''')
UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L15M_W23M = 1 #
enums['UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE'][1] = EnumEntry('UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L15M_W23M', '''''')
UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L25M_W28P5M = 2 #
enums['UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE'][2] = EnumEntry('UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L25M_W28P5M', '''''')
UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L25_34M = 3 #
enums['UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE'][3] = EnumEntry('UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L25_34M', '''''')
UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L35_33M = 4 #
enums['UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE'][4] = EnumEntry('UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L35_33M', '''''')
UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L35_38M = 5 #
enums['UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE'][5] = EnumEntry('UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L35_38M', '''''')
UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L45_39P5M = 6 #
enums['UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE'][6] = EnumEntry('UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L45_39P5M', '''''')
UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L45_45M = 7 #
enums['UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE'][7] = EnumEntry('UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L45_45M', '''''')
UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L55_45M = 8 #
enums['UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE'][8] = EnumEntry('UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L55_45M', '''''')
UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L55_52M = 9 #
enums['UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE'][9] = EnumEntry('UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L55_52M', '''''')
UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L65_59P5M = 10 #
enums['UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE'][10] = EnumEntry('UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L65_59P5M', '''''')
UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L65_67M = 11 #
enums['UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE'][11] = EnumEntry('UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L65_67M', '''''')
UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L75_W72P5M = 12 #
enums['UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE'][12] = EnumEntry('UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L75_W72P5M', '''''')
UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L75_W80M = 13 #
enums['UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE'][13] = EnumEntry('UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L75_W80M', '''''')
UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L85_W80M = 14 #
enums['UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE'][14] = EnumEntry('UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L85_W80M', '''''')
UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L85_W90M = 15 #
enums['UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE'][15] = EnumEntry('UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L85_W90M', '''''')
UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_ENUM_END = 16 #
enums['UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE'][16] = EnumEntry('UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_ENUM_END', '''''')
# UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT
enums['UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT'] = {}
UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_NO_DATA = 0 #
enums['UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT'][0] = EnumEntry('UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_NO_DATA', '''''')
UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_LEFT_2M = 1 #
enums['UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT'][1] = EnumEntry('UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_LEFT_2M', '''''')
UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_LEFT_4M = 2 #
enums['UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT'][2] = EnumEntry('UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_LEFT_4M', '''''')
UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_LEFT_6M = 3 #
enums['UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT'][3] = EnumEntry('UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_LEFT_6M', '''''')
UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_RIGHT_0M = 4 #
enums['UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT'][4] = EnumEntry('UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_RIGHT_0M', '''''')
UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_RIGHT_2M = 5 #
enums['UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT'][5] = EnumEntry('UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_RIGHT_2M', '''''')
UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_RIGHT_4M = 6 #
enums['UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT'][6] = EnumEntry('UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_RIGHT_4M', '''''')
UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_RIGHT_6M = 7 #
enums['UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT'][7] = EnumEntry('UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_RIGHT_6M', '''''')
UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_ENUM_END = 8 #
enums['UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT'][8] = EnumEntry('UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_ENUM_END', '''''')
# UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LON
enums['UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LON'] = {}
UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LON_NO_DATA = 0 #
enums['UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LON'][0] = EnumEntry('UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LON_NO_DATA', '''''')
UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LON_APPLIED_BY_SENSOR = 1 #
enums['UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LON'][1] = EnumEntry('UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LON_APPLIED_BY_SENSOR', '''''')
UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LON_ENUM_END = 2 #
enums['UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LON'][2] = EnumEntry('UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LON_ENUM_END', '''''')
# UAVIONIX_ADSB_EMERGENCY_STATUS
enums['UAVIONIX_ADSB_EMERGENCY_STATUS'] = {}
UAVIONIX_ADSB_OUT_NO_EMERGENCY = 0 #
enums['UAVIONIX_ADSB_EMERGENCY_STATUS'][0] = EnumEntry('UAVIONIX_ADSB_OUT_NO_EMERGENCY', '''''')
UAVIONIX_ADSB_OUT_GENERAL_EMERGENCY = 1 #
enums['UAVIONIX_ADSB_EMERGENCY_STATUS'][1] = EnumEntry('UAVIONIX_ADSB_OUT_GENERAL_EMERGENCY', '''''')
UAVIONIX_ADSB_OUT_LIFEGUARD_EMERGENCY = 2 #
enums['UAVIONIX_ADSB_EMERGENCY_STATUS'][2] = EnumEntry('UAVIONIX_ADSB_OUT_LIFEGUARD_EMERGENCY', '''''')
UAVIONIX_ADSB_OUT_MINIMUM_FUEL_EMERGENCY = 3 #
enums['UAVIONIX_ADSB_EMERGENCY_STATUS'][3] = EnumEntry('UAVIONIX_ADSB_OUT_MINIMUM_FUEL_EMERGENCY', '''''')
UAVIONIX_ADSB_OUT_NO_COMM_EMERGENCY = 4 #
enums['UAVIONIX_ADSB_EMERGENCY_STATUS'][4] = EnumEntry('UAVIONIX_ADSB_OUT_NO_COMM_EMERGENCY', '''''')
UAVIONIX_ADSB_OUT_UNLAWFUL_INTERFERANCE_EMERGENCY = 5 #
enums['UAVIONIX_ADSB_EMERGENCY_STATUS'][5] = EnumEntry('UAVIONIX_ADSB_OUT_UNLAWFUL_INTERFERANCE_EMERGENCY', '''''')
UAVIONIX_ADSB_OUT_DOWNED_AIRCRAFT_EMERGENCY = 6 #
enums['UAVIONIX_ADSB_EMERGENCY_STATUS'][6] = EnumEntry('UAVIONIX_ADSB_OUT_DOWNED_AIRCRAFT_EMERGENCY', '''''')
UAVIONIX_ADSB_OUT_RESERVED = 7 #
enums['UAVIONIX_ADSB_EMERGENCY_STATUS'][7] = EnumEntry('UAVIONIX_ADSB_OUT_RESERVED', '''''')
UAVIONIX_ADSB_EMERGENCY_STATUS_ENUM_END = 8 #
enums['UAVIONIX_ADSB_EMERGENCY_STATUS'][8] = EnumEntry('UAVIONIX_ADSB_EMERGENCY_STATUS_ENUM_END', '''''')
# ICAROUS_TRACK_BAND_TYPES
enums['ICAROUS_TRACK_BAND_TYPES'] = {}
ICAROUS_TRACK_BAND_TYPE_NONE = 0 #
enums['ICAROUS_TRACK_BAND_TYPES'][0] = EnumEntry('ICAROUS_TRACK_BAND_TYPE_NONE', '''''')
ICAROUS_TRACK_BAND_TYPE_NEAR = 1 #
enums['ICAROUS_TRACK_BAND_TYPES'][1] = EnumEntry('ICAROUS_TRACK_BAND_TYPE_NEAR', '''''')
ICAROUS_TRACK_BAND_TYPE_RECOVERY = 2 #
enums['ICAROUS_TRACK_BAND_TYPES'][2] = EnumEntry('ICAROUS_TRACK_BAND_TYPE_RECOVERY', '''''')
ICAROUS_TRACK_BAND_TYPES_ENUM_END = 3 #
enums['ICAROUS_TRACK_BAND_TYPES'][3] = EnumEntry('ICAROUS_TRACK_BAND_TYPES_ENUM_END', '''''')
# ICAROUS_FMS_STATE
enums['ICAROUS_FMS_STATE'] = {}
ICAROUS_FMS_STATE_IDLE = 0 #
enums['ICAROUS_FMS_STATE'][0] = EnumEntry('ICAROUS_FMS_STATE_IDLE', '''''')
ICAROUS_FMS_STATE_TAKEOFF = 1 #
enums['ICAROUS_FMS_STATE'][1] = EnumEntry('ICAROUS_FMS_STATE_TAKEOFF', '''''')
ICAROUS_FMS_STATE_CLIMB = 2 #
enums['ICAROUS_FMS_STATE'][2] = EnumEntry('ICAROUS_FMS_STATE_CLIMB', '''''')
ICAROUS_FMS_STATE_CRUISE = 3 #
enums['ICAROUS_FMS_STATE'][3] = EnumEntry('ICAROUS_FMS_STATE_CRUISE', '''''')
ICAROUS_FMS_STATE_APPROACH = 4 #
enums['ICAROUS_FMS_STATE'][4] = EnumEntry('ICAROUS_FMS_STATE_APPROACH', '''''')
ICAROUS_FMS_STATE_LAND = 5 #
enums['ICAROUS_FMS_STATE'][5] = EnumEntry('ICAROUS_FMS_STATE_LAND', '''''')
ICAROUS_FMS_STATE_ENUM_END = 6 #
enums['ICAROUS_FMS_STATE'][6] = EnumEntry('ICAROUS_FMS_STATE_ENUM_END', '''''')
# message IDs
MAVLINK_MSG_ID_BAD_DATA = -1
MAVLINK_MSG_ID_SENSOR_OFFSETS = 150
MAVLINK_MSG_ID_SET_MAG_OFFSETS = 151
MAVLINK_MSG_ID_MEMINFO = 152
MAVLINK_MSG_ID_AP_ADC = 153
MAVLINK_MSG_ID_DIGICAM_CONFIGURE = 154
MAVLINK_MSG_ID_DIGICAM_CONTROL = 155
MAVLINK_MSG_ID_MOUNT_CONFIGURE = 156
MAVLINK_MSG_ID_MOUNT_CONTROL = 157
MAVLINK_MSG_ID_MOUNT_STATUS = 158
MAVLINK_MSG_ID_FENCE_POINT = 160
MAVLINK_MSG_ID_FENCE_FETCH_POINT = 161
MAVLINK_MSG_ID_AHRS = 163
MAVLINK_MSG_ID_SIMSTATE = 164
MAVLINK_MSG_ID_HWSTATUS = 165
MAVLINK_MSG_ID_RADIO = 166
MAVLINK_MSG_ID_LIMITS_STATUS = 167
MAVLINK_MSG_ID_WIND = 168
MAVLINK_MSG_ID_DATA16 = 169
MAVLINK_MSG_ID_DATA32 = 170
MAVLINK_MSG_ID_DATA64 = 171
MAVLINK_MSG_ID_DATA96 = 172
MAVLINK_MSG_ID_RANGEFINDER = 173
MAVLINK_MSG_ID_AIRSPEED_AUTOCAL = 174
MAVLINK_MSG_ID_RALLY_POINT = 175
MAVLINK_MSG_ID_RALLY_FETCH_POINT = 176
MAVLINK_MSG_ID_COMPASSMOT_STATUS = 177
MAVLINK_MSG_ID_AHRS2 = 178
MAVLINK_MSG_ID_CAMERA_STATUS = 179
MAVLINK_MSG_ID_CAMERA_FEEDBACK = 180
MAVLINK_MSG_ID_BATTERY2 = 181
MAVLINK_MSG_ID_AHRS3 = 182
MAVLINK_MSG_ID_AUTOPILOT_VERSION_REQUEST = 183
MAVLINK_MSG_ID_REMOTE_LOG_DATA_BLOCK = 184
MAVLINK_MSG_ID_REMOTE_LOG_BLOCK_STATUS = 185
MAVLINK_MSG_ID_LED_CONTROL = 186
MAVLINK_MSG_ID_MAG_CAL_PROGRESS = 191
MAVLINK_MSG_ID_MAG_CAL_REPORT = 192
MAVLINK_MSG_ID_EKF_STATUS_REPORT = 193
MAVLINK_MSG_ID_PID_TUNING = 194
MAVLINK_MSG_ID_DEEPSTALL = 195
MAVLINK_MSG_ID_GIMBAL_REPORT = 200
MAVLINK_MSG_ID_GIMBAL_CONTROL = 201
MAVLINK_MSG_ID_GIMBAL_TORQUE_CMD_REPORT = 214
MAVLINK_MSG_ID_GOPRO_HEARTBEAT = 215
MAVLINK_MSG_ID_GOPRO_GET_REQUEST = 216
MAVLINK_MSG_ID_GOPRO_GET_RESPONSE = 217
MAVLINK_MSG_ID_GOPRO_SET_REQUEST = 218
MAVLINK_MSG_ID_GOPRO_SET_RESPONSE = 219
MAVLINK_MSG_ID_EFI_STATUS = 225
MAVLINK_MSG_ID_RPM = 226
MAVLINK_MSG_ID_HEARTBEAT = 0
MAVLINK_MSG_ID_SYS_STATUS = 1
MAVLINK_MSG_ID_SYSTEM_TIME = 2
MAVLINK_MSG_ID_PING = 4
MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL = 5
MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK = 6
MAVLINK_MSG_ID_AUTH_KEY = 7
MAVLINK_MSG_ID_SET_MODE = 11
MAVLINK_MSG_ID_PARAM_REQUEST_READ = 20
MAVLINK_MSG_ID_PARAM_REQUEST_LIST = 21
MAVLINK_MSG_ID_PARAM_VALUE = 22
MAVLINK_MSG_ID_PARAM_SET = 23
MAVLINK_MSG_ID_GPS_RAW_INT = 24
MAVLINK_MSG_ID_GPS_STATUS = 25
MAVLINK_MSG_ID_SCALED_IMU = 26
MAVLINK_MSG_ID_RAW_IMU = 27
MAVLINK_MSG_ID_RAW_PRESSURE = 28
MAVLINK_MSG_ID_SCALED_PRESSURE = 29
MAVLINK_MSG_ID_ATTITUDE = 30
MAVLINK_MSG_ID_ATTITUDE_QUATERNION = 31
MAVLINK_MSG_ID_LOCAL_POSITION_NED = 32
MAVLINK_MSG_ID_GLOBAL_POSITION_INT = 33
MAVLINK_MSG_ID_RC_CHANNELS_SCALED = 34
MAVLINK_MSG_ID_RC_CHANNELS_RAW = 35
MAVLINK_MSG_ID_SERVO_OUTPUT_RAW = 36
MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST = 37
MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST = 38
MAVLINK_MSG_ID_MISSION_ITEM = 39
MAVLINK_MSG_ID_MISSION_REQUEST = 40
MAVLINK_MSG_ID_MISSION_SET_CURRENT = 41
MAVLINK_MSG_ID_MISSION_CURRENT = 42
MAVLINK_MSG_ID_MISSION_REQUEST_LIST = 43
MAVLINK_MSG_ID_MISSION_COUNT = 44
MAVLINK_MSG_ID_MISSION_CLEAR_ALL = 45
MAVLINK_MSG_ID_MISSION_ITEM_REACHED = 46
MAVLINK_MSG_ID_MISSION_ACK = 47
MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN = 48
MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN = 49
MAVLINK_MSG_ID_PARAM_MAP_RC = 50
MAVLINK_MSG_ID_MISSION_REQUEST_INT = 51
MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA = 54
MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA = 55
MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV = 61
MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT = 62
MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV = 63
MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV = 64
MAVLINK_MSG_ID_RC_CHANNELS = 65
MAVLINK_MSG_ID_REQUEST_DATA_STREAM = 66
MAVLINK_MSG_ID_DATA_STREAM = 67
MAVLINK_MSG_ID_MANUAL_CONTROL = 69
MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE = 70
MAVLINK_MSG_ID_MISSION_ITEM_INT = 73
MAVLINK_MSG_ID_VFR_HUD = 74
MAVLINK_MSG_ID_COMMAND_INT = 75
MAVLINK_MSG_ID_COMMAND_LONG = 76
MAVLINK_MSG_ID_COMMAND_ACK = 77
MAVLINK_MSG_ID_MANUAL_SETPOINT = 81
MAVLINK_MSG_ID_SET_ATTITUDE_TARGET = 82
MAVLINK_MSG_ID_ATTITUDE_TARGET = 83
MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED = 84
MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED = 85
MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT = 86
MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT = 87
MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET = 89
MAVLINK_MSG_ID_HIL_STATE = 90
MAVLINK_MSG_ID_HIL_CONTROLS = 91
MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW = 92
MAVLINK_MSG_ID_HIL_ACTUATOR_CONTROLS = 93
MAVLINK_MSG_ID_OPTICAL_FLOW = 100
MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE = 101
MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE = 102
MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE = 103
MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE = 104
MAVLINK_MSG_ID_HIGHRES_IMU = 105
MAVLINK_MSG_ID_OPTICAL_FLOW_RAD = 106
MAVLINK_MSG_ID_HIL_SENSOR = 107
MAVLINK_MSG_ID_SIM_STATE = 108
MAVLINK_MSG_ID_RADIO_STATUS = 109
MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL = 110
MAVLINK_MSG_ID_TIMESYNC = 111
MAVLINK_MSG_ID_CAMERA_TRIGGER = 112
MAVLINK_MSG_ID_HIL_GPS = 113
MAVLINK_MSG_ID_HIL_OPTICAL_FLOW = 114
MAVLINK_MSG_ID_HIL_STATE_QUATERNION = 115
MAVLINK_MSG_ID_SCALED_IMU2 = 116
MAVLINK_MSG_ID_LOG_REQUEST_LIST = 117
MAVLINK_MSG_ID_LOG_ENTRY = 118
MAVLINK_MSG_ID_LOG_REQUEST_DATA = 119
MAVLINK_MSG_ID_LOG_DATA = 120
MAVLINK_MSG_ID_LOG_ERASE = 121
MAVLINK_MSG_ID_LOG_REQUEST_END = 122
MAVLINK_MSG_ID_GPS_INJECT_DATA = 123
MAVLINK_MSG_ID_GPS2_RAW = 124
MAVLINK_MSG_ID_POWER_STATUS = 125
MAVLINK_MSG_ID_SERIAL_CONTROL = 126
MAVLINK_MSG_ID_GPS_RTK = 127
MAVLINK_MSG_ID_GPS2_RTK = 128
MAVLINK_MSG_ID_SCALED_IMU3 = 129
MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE = 130
MAVLINK_MSG_ID_ENCAPSULATED_DATA = 131
MAVLINK_MSG_ID_DISTANCE_SENSOR = 132
MAVLINK_MSG_ID_TERRAIN_REQUEST = 133
MAVLINK_MSG_ID_TERRAIN_DATA = 134
MAVLINK_MSG_ID_TERRAIN_CHECK = 135
MAVLINK_MSG_ID_TERRAIN_REPORT = 136
MAVLINK_MSG_ID_SCALED_PRESSURE2 = 137
MAVLINK_MSG_ID_ATT_POS_MOCAP = 138
MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET = 139
MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET = 140
MAVLINK_MSG_ID_ALTITUDE = 141
MAVLINK_MSG_ID_RESOURCE_REQUEST = 142
MAVLINK_MSG_ID_SCALED_PRESSURE3 = 143
MAVLINK_MSG_ID_FOLLOW_TARGET = 144
MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE = 146
MAVLINK_MSG_ID_BATTERY_STATUS = 147
MAVLINK_MSG_ID_AUTOPILOT_VERSION = 148
MAVLINK_MSG_ID_LANDING_TARGET = 149
MAVLINK_MSG_ID_FENCE_STATUS = 162
MAVLINK_MSG_ID_ESTIMATOR_STATUS = 230
MAVLINK_MSG_ID_WIND_COV = 231
MAVLINK_MSG_ID_GPS_INPUT = 232
MAVLINK_MSG_ID_GPS_RTCM_DATA = 233
MAVLINK_MSG_ID_HIGH_LATENCY = 234
MAVLINK_MSG_ID_VIBRATION = 241
MAVLINK_MSG_ID_HOME_POSITION = 242
MAVLINK_MSG_ID_SET_HOME_POSITION = 243
MAVLINK_MSG_ID_MESSAGE_INTERVAL = 244
MAVLINK_MSG_ID_EXTENDED_SYS_STATE = 245
MAVLINK_MSG_ID_ADSB_VEHICLE = 246
MAVLINK_MSG_ID_COLLISION = 247
MAVLINK_MSG_ID_V2_EXTENSION = 248
MAVLINK_MSG_ID_MEMORY_VECT = 249
MAVLINK_MSG_ID_DEBUG_VECT = 250
MAVLINK_MSG_ID_NAMED_VALUE_FLOAT = 251
MAVLINK_MSG_ID_NAMED_VALUE_INT = 252
MAVLINK_MSG_ID_STATUSTEXT = 253
MAVLINK_MSG_ID_DEBUG = 254
class MAVLink_sensor_offsets_message(MAVLink_message):
'''
Offsets and calibrations values for hardware sensors. This
makes it easier to debug the calibration process.
'''
id = MAVLINK_MSG_ID_SENSOR_OFFSETS
name = 'SENSOR_OFFSETS'
fieldnames = ['mag_ofs_x', 'mag_ofs_y', 'mag_ofs_z', 'mag_declination', 'raw_press', 'raw_temp', 'gyro_cal_x', 'gyro_cal_y', 'gyro_cal_z', 'accel_cal_x', 'accel_cal_y', 'accel_cal_z']
ordered_fieldnames = ['mag_declination', 'raw_press', 'raw_temp', 'gyro_cal_x', 'gyro_cal_y', 'gyro_cal_z', 'accel_cal_x', 'accel_cal_y', 'accel_cal_z', 'mag_ofs_x', 'mag_ofs_y', 'mag_ofs_z']
fieldtypes = ['int16_t', 'int16_t', 'int16_t', 'float', 'int32_t', 'int32_t', 'float', 'float', 'float', 'float', 'float', 'float']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"mag_declination": "rad"}
format = '<fiiffffffhhh'
native_format = bytearray('<fiiffffffhhh', 'ascii')
orders = [9, 10, 11, 0, 1, 2, 3, 4, 5, 6, 7, 8]
lengths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
crc_extra = 134
unpacker = struct.Struct('<fiiffffffhhh')
instance_field = None
instance_offset = -1
def __init__(self, mag_ofs_x, mag_ofs_y, mag_ofs_z, mag_declination, raw_press, raw_temp, gyro_cal_x, gyro_cal_y, gyro_cal_z, accel_cal_x, accel_cal_y, accel_cal_z):
MAVLink_message.__init__(self, MAVLink_sensor_offsets_message.id, MAVLink_sensor_offsets_message.name)
self._fieldnames = MAVLink_sensor_offsets_message.fieldnames
self._instance_field = MAVLink_sensor_offsets_message.instance_field
self._instance_offset = MAVLink_sensor_offsets_message.instance_offset
self.mag_ofs_x = mag_ofs_x
self.mag_ofs_y = mag_ofs_y
self.mag_ofs_z = mag_ofs_z
self.mag_declination = mag_declination
self.raw_press = raw_press
self.raw_temp = raw_temp
self.gyro_cal_x = gyro_cal_x
self.gyro_cal_y = gyro_cal_y
self.gyro_cal_z = gyro_cal_z
self.accel_cal_x = accel_cal_x
self.accel_cal_y = accel_cal_y
self.accel_cal_z = accel_cal_z
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 134, struct.pack('<fiiffffffhhh', self.mag_declination, self.raw_press, self.raw_temp, self.gyro_cal_x, self.gyro_cal_y, self.gyro_cal_z, self.accel_cal_x, self.accel_cal_y, self.accel_cal_z, self.mag_ofs_x, self.mag_ofs_y, self.mag_ofs_z), force_mavlink1=force_mavlink1)
class MAVLink_set_mag_offsets_message(MAVLink_message):
'''
Set the magnetometer offsets
'''
id = MAVLINK_MSG_ID_SET_MAG_OFFSETS
name = 'SET_MAG_OFFSETS'
fieldnames = ['target_system', 'target_component', 'mag_ofs_x', 'mag_ofs_y', 'mag_ofs_z']
ordered_fieldnames = ['mag_ofs_x', 'mag_ofs_y', 'mag_ofs_z', 'target_system', 'target_component']
fieldtypes = ['uint8_t', 'uint8_t', 'int16_t', 'int16_t', 'int16_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {}
format = '<hhhBB'
native_format = bytearray('<hhhBB', 'ascii')
orders = [3, 4, 0, 1, 2]
lengths = [1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0]
crc_extra = 219
unpacker = struct.Struct('<hhhBB')
instance_field = None
instance_offset = -1
def __init__(self, target_system, target_component, mag_ofs_x, mag_ofs_y, mag_ofs_z):
MAVLink_message.__init__(self, MAVLink_set_mag_offsets_message.id, MAVLink_set_mag_offsets_message.name)
self._fieldnames = MAVLink_set_mag_offsets_message.fieldnames
self._instance_field = MAVLink_set_mag_offsets_message.instance_field
self._instance_offset = MAVLink_set_mag_offsets_message.instance_offset
self.target_system = target_system
self.target_component = target_component
self.mag_ofs_x = mag_ofs_x
self.mag_ofs_y = mag_ofs_y
self.mag_ofs_z = mag_ofs_z
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 219, struct.pack('<hhhBB', self.mag_ofs_x, self.mag_ofs_y, self.mag_ofs_z, self.target_system, self.target_component), force_mavlink1=force_mavlink1)
class MAVLink_meminfo_message(MAVLink_message):
'''
State of APM memory.
'''
id = MAVLINK_MSG_ID_MEMINFO
name = 'MEMINFO'
fieldnames = ['brkval', 'freemem']
ordered_fieldnames = ['brkval', 'freemem']
fieldtypes = ['uint16_t', 'uint16_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"freemem": "bytes"}
format = '<HH'
native_format = bytearray('<HH', 'ascii')
orders = [0, 1]
lengths = [1, 1]
array_lengths = [0, 0]
crc_extra = 208
unpacker = struct.Struct('<HH')
instance_field = None
instance_offset = -1
def __init__(self, brkval, freemem):
MAVLink_message.__init__(self, MAVLink_meminfo_message.id, MAVLink_meminfo_message.name)
self._fieldnames = MAVLink_meminfo_message.fieldnames
self._instance_field = MAVLink_meminfo_message.instance_field
self._instance_offset = MAVLink_meminfo_message.instance_offset
self.brkval = brkval
self.freemem = freemem
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 208, struct.pack('<HH', self.brkval, self.freemem), force_mavlink1=force_mavlink1)
class MAVLink_ap_adc_message(MAVLink_message):
'''
Raw ADC output.
'''
id = MAVLINK_MSG_ID_AP_ADC
name = 'AP_ADC'
fieldnames = ['adc1', 'adc2', 'adc3', 'adc4', 'adc5', 'adc6']
ordered_fieldnames = ['adc1', 'adc2', 'adc3', 'adc4', 'adc5', 'adc6']
fieldtypes = ['uint16_t', 'uint16_t', 'uint16_t', 'uint16_t', 'uint16_t', 'uint16_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {}
format = '<HHHHHH'
native_format = bytearray('<HHHHHH', 'ascii')
orders = [0, 1, 2, 3, 4, 5]
lengths = [1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0]
crc_extra = 188
unpacker = struct.Struct('<HHHHHH')
instance_field = None
instance_offset = -1
def __init__(self, adc1, adc2, adc3, adc4, adc5, adc6):
MAVLink_message.__init__(self, MAVLink_ap_adc_message.id, MAVLink_ap_adc_message.name)
self._fieldnames = MAVLink_ap_adc_message.fieldnames
self._instance_field = MAVLink_ap_adc_message.instance_field
self._instance_offset = MAVLink_ap_adc_message.instance_offset
self.adc1 = adc1
self.adc2 = adc2
self.adc3 = adc3
self.adc4 = adc4
self.adc5 = adc5
self.adc6 = adc6
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 188, struct.pack('<HHHHHH', self.adc1, self.adc2, self.adc3, self.adc4, self.adc5, self.adc6), force_mavlink1=force_mavlink1)
class MAVLink_digicam_configure_message(MAVLink_message):
'''
Configure on-board Camera Control System.
'''
id = MAVLINK_MSG_ID_DIGICAM_CONFIGURE
name = 'DIGICAM_CONFIGURE'
fieldnames = ['target_system', 'target_component', 'mode', 'shutter_speed', 'aperture', 'iso', 'exposure_type', 'command_id', 'engine_cut_off', 'extra_param', 'extra_value']
ordered_fieldnames = ['extra_value', 'shutter_speed', 'target_system', 'target_component', 'mode', 'aperture', 'iso', 'exposure_type', 'command_id', 'engine_cut_off', 'extra_param']
fieldtypes = ['uint8_t', 'uint8_t', 'uint8_t', 'uint16_t', 'uint8_t', 'uint8_t', 'uint8_t', 'uint8_t', 'uint8_t', 'uint8_t', 'float']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"engine_cut_off": "ds"}
format = '<fHBBBBBBBBB'
native_format = bytearray('<fHBBBBBBBBB', 'ascii')
orders = [2, 3, 4, 1, 5, 6, 7, 8, 9, 10, 0]
lengths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
crc_extra = 84
unpacker = struct.Struct('<fHBBBBBBBBB')
instance_field = None
instance_offset = -1
def __init__(self, target_system, target_component, mode, shutter_speed, aperture, iso, exposure_type, command_id, engine_cut_off, extra_param, extra_value):
MAVLink_message.__init__(self, MAVLink_digicam_configure_message.id, MAVLink_digicam_configure_message.name)
self._fieldnames = MAVLink_digicam_configure_message.fieldnames
self._instance_field = MAVLink_digicam_configure_message.instance_field
self._instance_offset = MAVLink_digicam_configure_message.instance_offset
self.target_system = target_system
self.target_component = target_component
self.mode = mode
self.shutter_speed = shutter_speed
self.aperture = aperture
self.iso = iso
self.exposure_type = exposure_type
self.command_id = command_id
self.engine_cut_off = engine_cut_off
self.extra_param = extra_param
self.extra_value = extra_value
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 84, struct.pack('<fHBBBBBBBBB', self.extra_value, self.shutter_speed, self.target_system, self.target_component, self.mode, self.aperture, self.iso, self.exposure_type, self.command_id, self.engine_cut_off, self.extra_param), force_mavlink1=force_mavlink1)
class MAVLink_digicam_control_message(MAVLink_message):
'''
Control on-board Camera Control System to take shots.
'''
id = MAVLINK_MSG_ID_DIGICAM_CONTROL
name = 'DIGICAM_CONTROL'
fieldnames = ['target_system', 'target_component', 'session', 'zoom_pos', 'zoom_step', 'focus_lock', 'shot', 'command_id', 'extra_param', 'extra_value']
ordered_fieldnames = ['extra_value', 'target_system', 'target_component', 'session', 'zoom_pos', 'zoom_step', 'focus_lock', 'shot', 'command_id', 'extra_param']
fieldtypes = ['uint8_t', 'uint8_t', 'uint8_t', 'uint8_t', 'int8_t', 'uint8_t', 'uint8_t', 'uint8_t', 'uint8_t', 'float']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {}
format = '<fBBBBbBBBB'
native_format = bytearray('<fBBBBbBBBB', 'ascii')
orders = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0]
lengths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
crc_extra = 22
unpacker = struct.Struct('<fBBBBbBBBB')
instance_field = None
instance_offset = -1
def __init__(self, target_system, target_component, session, zoom_pos, zoom_step, focus_lock, shot, command_id, extra_param, extra_value):
MAVLink_message.__init__(self, MAVLink_digicam_control_message.id, MAVLink_digicam_control_message.name)
self._fieldnames = MAVLink_digicam_control_message.fieldnames
self._instance_field = MAVLink_digicam_control_message.instance_field
self._instance_offset = MAVLink_digicam_control_message.instance_offset
self.target_system = target_system
self.target_component = target_component
self.session = session
self.zoom_pos = zoom_pos
self.zoom_step = zoom_step
self.focus_lock = focus_lock
self.shot = shot
self.command_id = command_id
self.extra_param = extra_param
self.extra_value = extra_value
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 22, struct.pack('<fBBBBbBBBB', self.extra_value, self.target_system, self.target_component, self.session, self.zoom_pos, self.zoom_step, self.focus_lock, self.shot, self.command_id, self.extra_param), force_mavlink1=force_mavlink1)
class MAVLink_mount_configure_message(MAVLink_message):
'''
Message to configure a camera mount, directional antenna, etc.
'''
id = MAVLINK_MSG_ID_MOUNT_CONFIGURE
name = 'MOUNT_CONFIGURE'
fieldnames = ['target_system', 'target_component', 'mount_mode', 'stab_roll', 'stab_pitch', 'stab_yaw']
ordered_fieldnames = ['target_system', 'target_component', 'mount_mode', 'stab_roll', 'stab_pitch', 'stab_yaw']
fieldtypes = ['uint8_t', 'uint8_t', 'uint8_t', 'uint8_t', 'uint8_t', 'uint8_t']
fielddisplays_by_name = {}
fieldenums_by_name = {"mount_mode": "MAV_MOUNT_MODE"}
fieldunits_by_name = {}
format = '<BBBBBB'
native_format = bytearray('<BBBBBB', 'ascii')
orders = [0, 1, 2, 3, 4, 5]
lengths = [1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0]
crc_extra = 19
unpacker = struct.Struct('<BBBBBB')
instance_field = None
instance_offset = -1
def __init__(self, target_system, target_component, mount_mode, stab_roll, stab_pitch, stab_yaw):
MAVLink_message.__init__(self, MAVLink_mount_configure_message.id, MAVLink_mount_configure_message.name)
self._fieldnames = MAVLink_mount_configure_message.fieldnames
self._instance_field = MAVLink_mount_configure_message.instance_field
self._instance_offset = MAVLink_mount_configure_message.instance_offset
self.target_system = target_system
self.target_component = target_component
self.mount_mode = mount_mode
self.stab_roll = stab_roll
self.stab_pitch = stab_pitch
self.stab_yaw = stab_yaw
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 19, struct.pack('<BBBBBB', self.target_system, self.target_component, self.mount_mode, self.stab_roll, self.stab_pitch, self.stab_yaw), force_mavlink1=force_mavlink1)
class MAVLink_mount_control_message(MAVLink_message):
'''
Message to control a camera mount, directional antenna, etc.
'''
id = MAVLINK_MSG_ID_MOUNT_CONTROL
name = 'MOUNT_CONTROL'
fieldnames = ['target_system', 'target_component', 'input_a', 'input_b', 'input_c', 'save_position']
ordered_fieldnames = ['input_a', 'input_b', 'input_c', 'target_system', 'target_component', 'save_position']
fieldtypes = ['uint8_t', 'uint8_t', 'int32_t', 'int32_t', 'int32_t', 'uint8_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {}
format = '<iiiBBB'
native_format = bytearray('<iiiBBB', 'ascii')
orders = [3, 4, 0, 1, 2, 5]
lengths = [1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0]
crc_extra = 21
unpacker = struct.Struct('<iiiBBB')
instance_field = None
instance_offset = -1
def __init__(self, target_system, target_component, input_a, input_b, input_c, save_position):
MAVLink_message.__init__(self, MAVLink_mount_control_message.id, MAVLink_mount_control_message.name)
self._fieldnames = MAVLink_mount_control_message.fieldnames
self._instance_field = MAVLink_mount_control_message.instance_field
self._instance_offset = MAVLink_mount_control_message.instance_offset
self.target_system = target_system
self.target_component = target_component
self.input_a = input_a
self.input_b = input_b
self.input_c = input_c
self.save_position = save_position
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 21, struct.pack('<iiiBBB', self.input_a, self.input_b, self.input_c, self.target_system, self.target_component, self.save_position), force_mavlink1=force_mavlink1)
class MAVLink_mount_status_message(MAVLink_message):
'''
Message with some status from APM to GCS about camera or
antenna mount.
'''
id = MAVLINK_MSG_ID_MOUNT_STATUS
name = 'MOUNT_STATUS'
fieldnames = ['target_system', 'target_component', 'pointing_a', 'pointing_b', 'pointing_c']
ordered_fieldnames = ['pointing_a', 'pointing_b', 'pointing_c', 'target_system', 'target_component']
fieldtypes = ['uint8_t', 'uint8_t', 'int32_t', 'int32_t', 'int32_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"pointing_a": "cdeg", "pointing_b": "cdeg", "pointing_c": "cdeg"}
format = '<iiiBB'
native_format = bytearray('<iiiBB', 'ascii')
orders = [3, 4, 0, 1, 2]
lengths = [1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0]
crc_extra = 134
unpacker = struct.Struct('<iiiBB')
instance_field = None
instance_offset = -1
def __init__(self, target_system, target_component, pointing_a, pointing_b, pointing_c):
MAVLink_message.__init__(self, MAVLink_mount_status_message.id, MAVLink_mount_status_message.name)
self._fieldnames = MAVLink_mount_status_message.fieldnames
self._instance_field = MAVLink_mount_status_message.instance_field
self._instance_offset = MAVLink_mount_status_message.instance_offset
self.target_system = target_system
self.target_component = target_component
self.pointing_a = pointing_a
self.pointing_b = pointing_b
self.pointing_c = pointing_c
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 134, struct.pack('<iiiBB', self.pointing_a, self.pointing_b, self.pointing_c, self.target_system, self.target_component), force_mavlink1=force_mavlink1)
class MAVLink_fence_point_message(MAVLink_message):
'''
A fence point. Used to set a point when from GCS -> MAV. Also
used to return a point from MAV -> GCS.
'''
id = MAVLINK_MSG_ID_FENCE_POINT
name = 'FENCE_POINT'
fieldnames = ['target_system', 'target_component', 'idx', 'count', 'lat', 'lng']
ordered_fieldnames = ['lat', 'lng', 'target_system', 'target_component', 'idx', 'count']
fieldtypes = ['uint8_t', 'uint8_t', 'uint8_t', 'uint8_t', 'float', 'float']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"lat": "deg", "lng": "deg"}
format = '<ffBBBB'
native_format = bytearray('<ffBBBB', 'ascii')
orders = [2, 3, 4, 5, 0, 1]
lengths = [1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0]
crc_extra = 78
unpacker = struct.Struct('<ffBBBB')
instance_field = None
instance_offset = -1
def __init__(self, target_system, target_component, idx, count, lat, lng):
MAVLink_message.__init__(self, MAVLink_fence_point_message.id, MAVLink_fence_point_message.name)
self._fieldnames = MAVLink_fence_point_message.fieldnames
self._instance_field = MAVLink_fence_point_message.instance_field
self._instance_offset = MAVLink_fence_point_message.instance_offset
self.target_system = target_system
self.target_component = target_component
self.idx = idx
self.count = count
self.lat = lat
self.lng = lng
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 78, struct.pack('<ffBBBB', self.lat, self.lng, self.target_system, self.target_component, self.idx, self.count), force_mavlink1=force_mavlink1)
class MAVLink_fence_fetch_point_message(MAVLink_message):
'''
Request a current fence point from MAV.
'''
id = MAVLINK_MSG_ID_FENCE_FETCH_POINT
name = 'FENCE_FETCH_POINT'
fieldnames = ['target_system', 'target_component', 'idx']
ordered_fieldnames = ['target_system', 'target_component', 'idx']
fieldtypes = ['uint8_t', 'uint8_t', 'uint8_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {}
format = '<BBB'
native_format = bytearray('<BBB', 'ascii')
orders = [0, 1, 2]
lengths = [1, 1, 1]
array_lengths = [0, 0, 0]
crc_extra = 68
unpacker = struct.Struct('<BBB')
instance_field = None
instance_offset = -1
def __init__(self, target_system, target_component, idx):
MAVLink_message.__init__(self, MAVLink_fence_fetch_point_message.id, MAVLink_fence_fetch_point_message.name)
self._fieldnames = MAVLink_fence_fetch_point_message.fieldnames
self._instance_field = MAVLink_fence_fetch_point_message.instance_field
self._instance_offset = MAVLink_fence_fetch_point_message.instance_offset
self.target_system = target_system
self.target_component = target_component
self.idx = idx
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 68, struct.pack('<BBB', self.target_system, self.target_component, self.idx), force_mavlink1=force_mavlink1)
class MAVLink_ahrs_message(MAVLink_message):
'''
Status of DCM attitude estimator.
'''
id = MAVLINK_MSG_ID_AHRS
name = 'AHRS'
fieldnames = ['omegaIx', 'omegaIy', 'omegaIz', 'accel_weight', 'renorm_val', 'error_rp', 'error_yaw']
ordered_fieldnames = ['omegaIx', 'omegaIy', 'omegaIz', 'accel_weight', 'renorm_val', 'error_rp', 'error_yaw']
fieldtypes = ['float', 'float', 'float', 'float', 'float', 'float', 'float']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"omegaIx": "rad/s", "omegaIy": "rad/s", "omegaIz": "rad/s"}
format = '<fffffff'
native_format = bytearray('<fffffff', 'ascii')
orders = [0, 1, 2, 3, 4, 5, 6]
lengths = [1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0]
crc_extra = 127
unpacker = struct.Struct('<fffffff')
instance_field = None
instance_offset = -1
def __init__(self, omegaIx, omegaIy, omegaIz, accel_weight, renorm_val, error_rp, error_yaw):
MAVLink_message.__init__(self, MAVLink_ahrs_message.id, MAVLink_ahrs_message.name)
self._fieldnames = MAVLink_ahrs_message.fieldnames
self._instance_field = MAVLink_ahrs_message.instance_field
self._instance_offset = MAVLink_ahrs_message.instance_offset
self.omegaIx = omegaIx
self.omegaIy = omegaIy
self.omegaIz = omegaIz
self.accel_weight = accel_weight
self.renorm_val = renorm_val
self.error_rp = error_rp
self.error_yaw = error_yaw
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 127, struct.pack('<fffffff', self.omegaIx, self.omegaIy, self.omegaIz, self.accel_weight, self.renorm_val, self.error_rp, self.error_yaw), force_mavlink1=force_mavlink1)
class MAVLink_simstate_message(MAVLink_message):
'''
Status of simulation environment, if used.
'''
id = MAVLINK_MSG_ID_SIMSTATE
name = 'SIMSTATE'
fieldnames = ['roll', 'pitch', 'yaw', 'xacc', 'yacc', 'zacc', 'xgyro', 'ygyro', 'zgyro', 'lat', 'lng']
ordered_fieldnames = ['roll', 'pitch', 'yaw', 'xacc', 'yacc', 'zacc', 'xgyro', 'ygyro', 'zgyro', 'lat', 'lng']
fieldtypes = ['float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'int32_t', 'int32_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"roll": "rad", "pitch": "rad", "yaw": "rad", "xacc": "m/s/s", "yacc": "m/s/s", "zacc": "m/s/s", "xgyro": "rad/s", "ygyro": "rad/s", "zgyro": "rad/s", "lat": "degE7", "lng": "degE7"}
format = '<fffffffffii'
native_format = bytearray('<fffffffffii', 'ascii')
orders = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
lengths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
crc_extra = 154
unpacker = struct.Struct('<fffffffffii')
instance_field = None
instance_offset = -1
def __init__(self, roll, pitch, yaw, xacc, yacc, zacc, xgyro, ygyro, zgyro, lat, lng):
MAVLink_message.__init__(self, MAVLink_simstate_message.id, MAVLink_simstate_message.name)
self._fieldnames = MAVLink_simstate_message.fieldnames
self._instance_field = MAVLink_simstate_message.instance_field
self._instance_offset = MAVLink_simstate_message.instance_offset
self.roll = roll
self.pitch = pitch
self.yaw = yaw
self.xacc = xacc
self.yacc = yacc
self.zacc = zacc
self.xgyro = xgyro
self.ygyro = ygyro
self.zgyro = zgyro
self.lat = lat
self.lng = lng
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 154, struct.pack('<fffffffffii', self.roll, self.pitch, self.yaw, self.xacc, self.yacc, self.zacc, self.xgyro, self.ygyro, self.zgyro, self.lat, self.lng), force_mavlink1=force_mavlink1)
class MAVLink_hwstatus_message(MAVLink_message):
'''
Status of key hardware.
'''
id = MAVLINK_MSG_ID_HWSTATUS
name = 'HWSTATUS'
fieldnames = ['Vcc', 'I2Cerr']
ordered_fieldnames = ['Vcc', 'I2Cerr']
fieldtypes = ['uint16_t', 'uint8_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"Vcc": "mV"}
format = '<HB'
native_format = bytearray('<HB', 'ascii')
orders = [0, 1]
lengths = [1, 1]
array_lengths = [0, 0]
crc_extra = 21
unpacker = struct.Struct('<HB')
instance_field = None
instance_offset = -1
def __init__(self, Vcc, I2Cerr):
MAVLink_message.__init__(self, MAVLink_hwstatus_message.id, MAVLink_hwstatus_message.name)
self._fieldnames = MAVLink_hwstatus_message.fieldnames
self._instance_field = MAVLink_hwstatus_message.instance_field
self._instance_offset = MAVLink_hwstatus_message.instance_offset
self.Vcc = Vcc
self.I2Cerr = I2Cerr
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 21, struct.pack('<HB', self.Vcc, self.I2Cerr), force_mavlink1=force_mavlink1)
class MAVLink_radio_message(MAVLink_message):
'''
Status generated by radio.
'''
id = MAVLINK_MSG_ID_RADIO
name = 'RADIO'
fieldnames = ['rssi', 'remrssi', 'txbuf', 'noise', 'remnoise', 'rxerrors', 'fixed']
ordered_fieldnames = ['rxerrors', 'fixed', 'rssi', 'remrssi', 'txbuf', 'noise', 'remnoise']
fieldtypes = ['uint8_t', 'uint8_t', 'uint8_t', 'uint8_t', 'uint8_t', 'uint16_t', 'uint16_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"txbuf": "%"}
format = '<HHBBBBB'
native_format = bytearray('<HHBBBBB', 'ascii')
orders = [2, 3, 4, 5, 6, 0, 1]
lengths = [1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0]
crc_extra = 21
unpacker = struct.Struct('<HHBBBBB')
instance_field = None
instance_offset = -1
def __init__(self, rssi, remrssi, txbuf, noise, remnoise, rxerrors, fixed):
MAVLink_message.__init__(self, MAVLink_radio_message.id, MAVLink_radio_message.name)
self._fieldnames = MAVLink_radio_message.fieldnames
self._instance_field = MAVLink_radio_message.instance_field
self._instance_offset = MAVLink_radio_message.instance_offset
self.rssi = rssi
self.remrssi = remrssi
self.txbuf = txbuf
self.noise = noise
self.remnoise = remnoise
self.rxerrors = rxerrors
self.fixed = fixed
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 21, struct.pack('<HHBBBBB', self.rxerrors, self.fixed, self.rssi, self.remrssi, self.txbuf, self.noise, self.remnoise), force_mavlink1=force_mavlink1)
class MAVLink_limits_status_message(MAVLink_message):
'''
Status of AP_Limits. Sent in extended status stream when
AP_Limits is enabled.
'''
id = MAVLINK_MSG_ID_LIMITS_STATUS
name = 'LIMITS_STATUS'
fieldnames = ['limits_state', 'last_trigger', 'last_action', 'last_recovery', 'last_clear', 'breach_count', 'mods_enabled', 'mods_required', 'mods_triggered']
ordered_fieldnames = ['last_trigger', 'last_action', 'last_recovery', 'last_clear', 'breach_count', 'limits_state', 'mods_enabled', 'mods_required', 'mods_triggered']
fieldtypes = ['uint8_t', 'uint32_t', 'uint32_t', 'uint32_t', 'uint32_t', 'uint16_t', 'uint8_t', 'uint8_t', 'uint8_t']
fielddisplays_by_name = {"mods_enabled": "bitmask", "mods_required": "bitmask", "mods_triggered": "bitmask"}
fieldenums_by_name = {"limits_state": "LIMITS_STATE", "mods_enabled": "LIMIT_MODULE", "mods_required": "LIMIT_MODULE", "mods_triggered": "LIMIT_MODULE"}
fieldunits_by_name = {"last_trigger": "ms", "last_action": "ms", "last_recovery": "ms", "last_clear": "ms"}
format = '<IIIIHBBBB'
native_format = bytearray('<IIIIHBBBB', 'ascii')
orders = [5, 0, 1, 2, 3, 4, 6, 7, 8]
lengths = [1, 1, 1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0, 0, 0]
crc_extra = 144
unpacker = struct.Struct('<IIIIHBBBB')
instance_field = None
instance_offset = -1
def __init__(self, limits_state, last_trigger, last_action, last_recovery, last_clear, breach_count, mods_enabled, mods_required, mods_triggered):
MAVLink_message.__init__(self, MAVLink_limits_status_message.id, MAVLink_limits_status_message.name)
self._fieldnames = MAVLink_limits_status_message.fieldnames
self._instance_field = MAVLink_limits_status_message.instance_field
self._instance_offset = MAVLink_limits_status_message.instance_offset
self.limits_state = limits_state
self.last_trigger = last_trigger
self.last_action = last_action
self.last_recovery = last_recovery
self.last_clear = last_clear
self.breach_count = breach_count
self.mods_enabled = mods_enabled
self.mods_required = mods_required
self.mods_triggered = mods_triggered
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 144, struct.pack('<IIIIHBBBB', self.last_trigger, self.last_action, self.last_recovery, self.last_clear, self.breach_count, self.limits_state, self.mods_enabled, self.mods_required, self.mods_triggered), force_mavlink1=force_mavlink1)
class MAVLink_wind_message(MAVLink_message):
'''
Wind estimation.
'''
id = MAVLINK_MSG_ID_WIND
name = 'WIND'
fieldnames = ['direction', 'speed', 'speed_z']
ordered_fieldnames = ['direction', 'speed', 'speed_z']
fieldtypes = ['float', 'float', 'float']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"direction": "deg", "speed": "m/s", "speed_z": "m/s"}
format = '<fff'
native_format = bytearray('<fff', 'ascii')
orders = [0, 1, 2]
lengths = [1, 1, 1]
array_lengths = [0, 0, 0]
crc_extra = 1
unpacker = struct.Struct('<fff')
instance_field = None
instance_offset = -1
def __init__(self, direction, speed, speed_z):
MAVLink_message.__init__(self, MAVLink_wind_message.id, MAVLink_wind_message.name)
self._fieldnames = MAVLink_wind_message.fieldnames
self._instance_field = MAVLink_wind_message.instance_field
self._instance_offset = MAVLink_wind_message.instance_offset
self.direction = direction
self.speed = speed
self.speed_z = speed_z
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 1, struct.pack('<fff', self.direction, self.speed, self.speed_z), force_mavlink1=force_mavlink1)
class MAVLink_data16_message(MAVLink_message):
'''
Data packet, size 16.
'''
id = MAVLINK_MSG_ID_DATA16
name = 'DATA16'
fieldnames = ['type', 'len', 'data']
ordered_fieldnames = ['type', 'len', 'data']
fieldtypes = ['uint8_t', 'uint8_t', 'uint8_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"len": "bytes"}
format = '<BB16B'
native_format = bytearray('<BBB', 'ascii')
orders = [0, 1, 2]
lengths = [1, 1, 16]
array_lengths = [0, 0, 16]
crc_extra = 234
unpacker = struct.Struct('<BB16B')
instance_field = None
instance_offset = -1
def __init__(self, type, len, data):
MAVLink_message.__init__(self, MAVLink_data16_message.id, MAVLink_data16_message.name)
self._fieldnames = MAVLink_data16_message.fieldnames
self._instance_field = MAVLink_data16_message.instance_field
self._instance_offset = MAVLink_data16_message.instance_offset
self.type = type
self.len = len
self.data = data
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 234, struct.pack('<BB16B', self.type, self.len, self.data[0], self.data[1], self.data[2], self.data[3], self.data[4], self.data[5], self.data[6], self.data[7], self.data[8], self.data[9], self.data[10], self.data[11], self.data[12], self.data[13], self.data[14], self.data[15]), force_mavlink1=force_mavlink1)
class MAVLink_data32_message(MAVLink_message):
'''
Data packet, size 32.
'''
id = MAVLINK_MSG_ID_DATA32
name = 'DATA32'
fieldnames = ['type', 'len', 'data']
ordered_fieldnames = ['type', 'len', 'data']
fieldtypes = ['uint8_t', 'uint8_t', 'uint8_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"len": "bytes"}
format = '<BB32B'
native_format = bytearray('<BBB', 'ascii')
orders = [0, 1, 2]
lengths = [1, 1, 32]
array_lengths = [0, 0, 32]
crc_extra = 73
unpacker = struct.Struct('<BB32B')
instance_field = None
instance_offset = -1
def __init__(self, type, len, data):
MAVLink_message.__init__(self, MAVLink_data32_message.id, MAVLink_data32_message.name)
self._fieldnames = MAVLink_data32_message.fieldnames
self._instance_field = MAVLink_data32_message.instance_field
self._instance_offset = MAVLink_data32_message.instance_offset
self.type = type
self.len = len
self.data = data
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 73, struct.pack('<BB32B', self.type, self.len, self.data[0], self.data[1], self.data[2], self.data[3], self.data[4], self.data[5], self.data[6], self.data[7], self.data[8], self.data[9], self.data[10], self.data[11], self.data[12], self.data[13], self.data[14], self.data[15], self.data[16], self.data[17], self.data[18], self.data[19], self.data[20], self.data[21], self.data[22], self.data[23], self.data[24], self.data[25], self.data[26], self.data[27], self.data[28], self.data[29], self.data[30], self.data[31]), force_mavlink1=force_mavlink1)
class MAVLink_data64_message(MAVLink_message):
'''
Data packet, size 64.
'''
id = MAVLINK_MSG_ID_DATA64
name = 'DATA64'
fieldnames = ['type', 'len', 'data']
ordered_fieldnames = ['type', 'len', 'data']
fieldtypes = ['uint8_t', 'uint8_t', 'uint8_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"len": "bytes"}
format = '<BB64B'
native_format = bytearray('<BBB', 'ascii')
orders = [0, 1, 2]
lengths = [1, 1, 64]
array_lengths = [0, 0, 64]
crc_extra = 181
unpacker = struct.Struct('<BB64B')
instance_field = None
instance_offset = -1
def __init__(self, type, len, data):
MAVLink_message.__init__(self, MAVLink_data64_message.id, MAVLink_data64_message.name)
self._fieldnames = MAVLink_data64_message.fieldnames
self._instance_field = MAVLink_data64_message.instance_field
self._instance_offset = MAVLink_data64_message.instance_offset
self.type = type
self.len = len
self.data = data
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 181, struct.pack('<BB64B', self.type, self.len, self.data[0], self.data[1], self.data[2], self.data[3], self.data[4], self.data[5], self.data[6], self.data[7], self.data[8], self.data[9], self.data[10], self.data[11], self.data[12], self.data[13], self.data[14], self.data[15], self.data[16], self.data[17], self.data[18], self.data[19], self.data[20], self.data[21], self.data[22], self.data[23], self.data[24], self.data[25], self.data[26], self.data[27], self.data[28], self.data[29], self.data[30], self.data[31], self.data[32], self.data[33], self.data[34], self.data[35], self.data[36], self.data[37], self.data[38], self.data[39], self.data[40], self.data[41], self.data[42], self.data[43], self.data[44], self.data[45], self.data[46], self.data[47], self.data[48], self.data[49], self.data[50], self.data[51], self.data[52], self.data[53], self.data[54], self.data[55], self.data[56], self.data[57], self.data[58], self.data[59], self.data[60], self.data[61], self.data[62], self.data[63]), force_mavlink1=force_mavlink1)
class MAVLink_data96_message(MAVLink_message):
'''
Data packet, size 96.
'''
id = MAVLINK_MSG_ID_DATA96
name = 'DATA96'
fieldnames = ['type', 'len', 'data']
ordered_fieldnames = ['type', 'len', 'data']
fieldtypes = ['uint8_t', 'uint8_t', 'uint8_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"len": "bytes"}
format = '<BB96B'
native_format = bytearray('<BBB', 'ascii')
orders = [0, 1, 2]
lengths = [1, 1, 96]
array_lengths = [0, 0, 96]
crc_extra = 22
unpacker = struct.Struct('<BB96B')
instance_field = None
instance_offset = -1
def __init__(self, type, len, data):
MAVLink_message.__init__(self, MAVLink_data96_message.id, MAVLink_data96_message.name)
self._fieldnames = MAVLink_data96_message.fieldnames
self._instance_field = MAVLink_data96_message.instance_field
self._instance_offset = MAVLink_data96_message.instance_offset
self.type = type
self.len = len
self.data = data
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 22, struct.pack('<BB96B', self.type, self.len, self.data[0], self.data[1], self.data[2], self.data[3], self.data[4], self.data[5], self.data[6], self.data[7], self.data[8], self.data[9], self.data[10], self.data[11], self.data[12], self.data[13], self.data[14], self.data[15], self.data[16], self.data[17], self.data[18], self.data[19], self.data[20], self.data[21], self.data[22], self.data[23], self.data[24], self.data[25], self.data[26], self.data[27], self.data[28], self.data[29], self.data[30], self.data[31], self.data[32], self.data[33], self.data[34], self.data[35], self.data[36], self.data[37], self.data[38], self.data[39], self.data[40], self.data[41], self.data[42], self.data[43], self.data[44], self.data[45], self.data[46], self.data[47], self.data[48], self.data[49], self.data[50], self.data[51], self.data[52], self.data[53], self.data[54], self.data[55], self.data[56], self.data[57], self.data[58], self.data[59], self.data[60], self.data[61], self.data[62], self.data[63], self.data[64], self.data[65], self.data[66], self.data[67], self.data[68], self.data[69], self.data[70], self.data[71], self.data[72], self.data[73], self.data[74], self.data[75], self.data[76], self.data[77], self.data[78], self.data[79], self.data[80], self.data[81], self.data[82], self.data[83], self.data[84], self.data[85], self.data[86], self.data[87], self.data[88], self.data[89], self.data[90], self.data[91], self.data[92], self.data[93], self.data[94], self.data[95]), force_mavlink1=force_mavlink1)
class MAVLink_rangefinder_message(MAVLink_message):
'''
Rangefinder reporting.
'''
id = MAVLINK_MSG_ID_RANGEFINDER
name = 'RANGEFINDER'
fieldnames = ['distance', 'voltage']
ordered_fieldnames = ['distance', 'voltage']
fieldtypes = ['float', 'float']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"distance": "m", "voltage": "V"}
format = '<ff'
native_format = bytearray('<ff', 'ascii')
orders = [0, 1]
lengths = [1, 1]
array_lengths = [0, 0]
crc_extra = 83
unpacker = struct.Struct('<ff')
instance_field = None
instance_offset = -1
def __init__(self, distance, voltage):
MAVLink_message.__init__(self, MAVLink_rangefinder_message.id, MAVLink_rangefinder_message.name)
self._fieldnames = MAVLink_rangefinder_message.fieldnames
self._instance_field = MAVLink_rangefinder_message.instance_field
self._instance_offset = MAVLink_rangefinder_message.instance_offset
self.distance = distance
self.voltage = voltage
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 83, struct.pack('<ff', self.distance, self.voltage), force_mavlink1=force_mavlink1)
class MAVLink_airspeed_autocal_message(MAVLink_message):
'''
Airspeed auto-calibration.
'''
id = MAVLINK_MSG_ID_AIRSPEED_AUTOCAL
name = 'AIRSPEED_AUTOCAL'
fieldnames = ['vx', 'vy', 'vz', 'diff_pressure', 'EAS2TAS', 'ratio', 'state_x', 'state_y', 'state_z', 'Pax', 'Pby', 'Pcz']
ordered_fieldnames = ['vx', 'vy', 'vz', 'diff_pressure', 'EAS2TAS', 'ratio', 'state_x', 'state_y', 'state_z', 'Pax', 'Pby', 'Pcz']
fieldtypes = ['float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"vx": "m/s", "vy": "m/s", "vz": "m/s", "diff_pressure": "Pa"}
format = '<ffffffffffff'
native_format = bytearray('<ffffffffffff', 'ascii')
orders = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
lengths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
crc_extra = 167
unpacker = struct.Struct('<ffffffffffff')
instance_field = None
instance_offset = -1
def __init__(self, vx, vy, vz, diff_pressure, EAS2TAS, ratio, state_x, state_y, state_z, Pax, Pby, Pcz):
MAVLink_message.__init__(self, MAVLink_airspeed_autocal_message.id, MAVLink_airspeed_autocal_message.name)
self._fieldnames = MAVLink_airspeed_autocal_message.fieldnames
self._instance_field = MAVLink_airspeed_autocal_message.instance_field
self._instance_offset = MAVLink_airspeed_autocal_message.instance_offset
self.vx = vx
self.vy = vy
self.vz = vz
self.diff_pressure = diff_pressure
self.EAS2TAS = EAS2TAS
self.ratio = ratio
self.state_x = state_x
self.state_y = state_y
self.state_z = state_z
self.Pax = Pax
self.Pby = Pby
self.Pcz = Pcz
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 167, struct.pack('<ffffffffffff', self.vx, self.vy, self.vz, self.diff_pressure, self.EAS2TAS, self.ratio, self.state_x, self.state_y, self.state_z, self.Pax, self.Pby, self.Pcz), force_mavlink1=force_mavlink1)
class MAVLink_rally_point_message(MAVLink_message):
'''
A rally point. Used to set a point when from GCS -> MAV. Also
used to return a point from MAV -> GCS.
'''
id = MAVLINK_MSG_ID_RALLY_POINT
name = 'RALLY_POINT'
fieldnames = ['target_system', 'target_component', 'idx', 'count', 'lat', 'lng', 'alt', 'break_alt', 'land_dir', 'flags']
ordered_fieldnames = ['lat', 'lng', 'alt', 'break_alt', 'land_dir', 'target_system', 'target_component', 'idx', 'count', 'flags']
fieldtypes = ['uint8_t', 'uint8_t', 'uint8_t', 'uint8_t', 'int32_t', 'int32_t', 'int16_t', 'int16_t', 'uint16_t', 'uint8_t']
fielddisplays_by_name = {"flags": "bitmask"}
fieldenums_by_name = {"flags": "RALLY_FLAGS"}
fieldunits_by_name = {"lat": "degE7", "lng": "degE7", "alt": "m", "break_alt": "m", "land_dir": "cdeg"}
format = '<iihhHBBBBB'
native_format = bytearray('<iihhHBBBBB', 'ascii')
orders = [5, 6, 7, 8, 0, 1, 2, 3, 4, 9]
lengths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
crc_extra = 138
unpacker = struct.Struct('<iihhHBBBBB')
instance_field = None
instance_offset = -1
def __init__(self, target_system, target_component, idx, count, lat, lng, alt, break_alt, land_dir, flags):
MAVLink_message.__init__(self, MAVLink_rally_point_message.id, MAVLink_rally_point_message.name)
self._fieldnames = MAVLink_rally_point_message.fieldnames
self._instance_field = MAVLink_rally_point_message.instance_field
self._instance_offset = MAVLink_rally_point_message.instance_offset
self.target_system = target_system
self.target_component = target_component
self.idx = idx
self.count = count
self.lat = lat
self.lng = lng
self.alt = alt
self.break_alt = break_alt
self.land_dir = land_dir
self.flags = flags
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 138, struct.pack('<iihhHBBBBB', self.lat, self.lng, self.alt, self.break_alt, self.land_dir, self.target_system, self.target_component, self.idx, self.count, self.flags), force_mavlink1=force_mavlink1)
class MAVLink_rally_fetch_point_message(MAVLink_message):
'''
Request a current rally point from MAV. MAV should respond
with a RALLY_POINT message. MAV should not respond if the
request is invalid.
'''
id = MAVLINK_MSG_ID_RALLY_FETCH_POINT
name = 'RALLY_FETCH_POINT'
fieldnames = ['target_system', 'target_component', 'idx']
ordered_fieldnames = ['target_system', 'target_component', 'idx']
fieldtypes = ['uint8_t', 'uint8_t', 'uint8_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {}
format = '<BBB'
native_format = bytearray('<BBB', 'ascii')
orders = [0, 1, 2]
lengths = [1, 1, 1]
array_lengths = [0, 0, 0]
crc_extra = 234
unpacker = struct.Struct('<BBB')
instance_field = None
instance_offset = -1
def __init__(self, target_system, target_component, idx):
MAVLink_message.__init__(self, MAVLink_rally_fetch_point_message.id, MAVLink_rally_fetch_point_message.name)
self._fieldnames = MAVLink_rally_fetch_point_message.fieldnames
self._instance_field = MAVLink_rally_fetch_point_message.instance_field
self._instance_offset = MAVLink_rally_fetch_point_message.instance_offset
self.target_system = target_system
self.target_component = target_component
self.idx = idx
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 234, struct.pack('<BBB', self.target_system, self.target_component, self.idx), force_mavlink1=force_mavlink1)
class MAVLink_compassmot_status_message(MAVLink_message):
'''
Status of compassmot calibration.
'''
id = MAVLINK_MSG_ID_COMPASSMOT_STATUS
name = 'COMPASSMOT_STATUS'
fieldnames = ['throttle', 'current', 'interference', 'CompensationX', 'CompensationY', 'CompensationZ']
ordered_fieldnames = ['current', 'CompensationX', 'CompensationY', 'CompensationZ', 'throttle', 'interference']
fieldtypes = ['uint16_t', 'float', 'uint16_t', 'float', 'float', 'float']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"throttle": "d%", "current": "A", "interference": "%"}
format = '<ffffHH'
native_format = bytearray('<ffffHH', 'ascii')
orders = [4, 0, 5, 1, 2, 3]
lengths = [1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0]
crc_extra = 240
unpacker = struct.Struct('<ffffHH')
instance_field = None
instance_offset = -1
def __init__(self, throttle, current, interference, CompensationX, CompensationY, CompensationZ):
MAVLink_message.__init__(self, MAVLink_compassmot_status_message.id, MAVLink_compassmot_status_message.name)
self._fieldnames = MAVLink_compassmot_status_message.fieldnames
self._instance_field = MAVLink_compassmot_status_message.instance_field
self._instance_offset = MAVLink_compassmot_status_message.instance_offset
self.throttle = throttle
self.current = current
self.interference = interference
self.CompensationX = CompensationX
self.CompensationY = CompensationY
self.CompensationZ = CompensationZ
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 240, struct.pack('<ffffHH', self.current, self.CompensationX, self.CompensationY, self.CompensationZ, self.throttle, self.interference), force_mavlink1=force_mavlink1)
class MAVLink_ahrs2_message(MAVLink_message):
'''
Status of secondary AHRS filter if available.
'''
id = MAVLINK_MSG_ID_AHRS2
name = 'AHRS2'
fieldnames = ['roll', 'pitch', 'yaw', 'altitude', 'lat', 'lng']
ordered_fieldnames = ['roll', 'pitch', 'yaw', 'altitude', 'lat', 'lng']
fieldtypes = ['float', 'float', 'float', 'float', 'int32_t', 'int32_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"roll": "rad", "pitch": "rad", "yaw": "rad", "altitude": "m", "lat": "degE7", "lng": "degE7"}
format = '<ffffii'
native_format = bytearray('<ffffii', 'ascii')
orders = [0, 1, 2, 3, 4, 5]
lengths = [1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0]
crc_extra = 47
unpacker = struct.Struct('<ffffii')
instance_field = None
instance_offset = -1
def __init__(self, roll, pitch, yaw, altitude, lat, lng):
MAVLink_message.__init__(self, MAVLink_ahrs2_message.id, MAVLink_ahrs2_message.name)
self._fieldnames = MAVLink_ahrs2_message.fieldnames
self._instance_field = MAVLink_ahrs2_message.instance_field
self._instance_offset = MAVLink_ahrs2_message.instance_offset
self.roll = roll
self.pitch = pitch
self.yaw = yaw
self.altitude = altitude
self.lat = lat
self.lng = lng
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 47, struct.pack('<ffffii', self.roll, self.pitch, self.yaw, self.altitude, self.lat, self.lng), force_mavlink1=force_mavlink1)
class MAVLink_camera_status_message(MAVLink_message):
'''
Camera Event.
'''
id = MAVLINK_MSG_ID_CAMERA_STATUS
name = 'CAMERA_STATUS'
fieldnames = ['time_usec', 'target_system', 'cam_idx', 'img_idx', 'event_id', 'p1', 'p2', 'p3', 'p4']
ordered_fieldnames = ['time_usec', 'p1', 'p2', 'p3', 'p4', 'img_idx', 'target_system', 'cam_idx', 'event_id']
fieldtypes = ['uint64_t', 'uint8_t', 'uint8_t', 'uint16_t', 'uint8_t', 'float', 'float', 'float', 'float']
fielddisplays_by_name = {}
fieldenums_by_name = {"event_id": "CAMERA_STATUS_TYPES"}
fieldunits_by_name = {"time_usec": "us"}
format = '<QffffHBBB'
native_format = bytearray('<QffffHBBB', 'ascii')
orders = [0, 6, 7, 5, 8, 1, 2, 3, 4]
lengths = [1, 1, 1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0, 0, 0]
crc_extra = 189
unpacker = struct.Struct('<QffffHBBB')
instance_field = None
instance_offset = -1
def __init__(self, time_usec, target_system, cam_idx, img_idx, event_id, p1, p2, p3, p4):
MAVLink_message.__init__(self, MAVLink_camera_status_message.id, MAVLink_camera_status_message.name)
self._fieldnames = MAVLink_camera_status_message.fieldnames
self._instance_field = MAVLink_camera_status_message.instance_field
self._instance_offset = MAVLink_camera_status_message.instance_offset
self.time_usec = time_usec
self.target_system = target_system
self.cam_idx = cam_idx
self.img_idx = img_idx
self.event_id = event_id
self.p1 = p1
self.p2 = p2
self.p3 = p3
self.p4 = p4
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 189, struct.pack('<QffffHBBB', self.time_usec, self.p1, self.p2, self.p3, self.p4, self.img_idx, self.target_system, self.cam_idx, self.event_id), force_mavlink1=force_mavlink1)
class MAVLink_camera_feedback_message(MAVLink_message):
'''
Camera Capture Feedback.
'''
id = MAVLINK_MSG_ID_CAMERA_FEEDBACK
name = 'CAMERA_FEEDBACK'
fieldnames = ['time_usec', 'target_system', 'cam_idx', 'img_idx', 'lat', 'lng', 'alt_msl', 'alt_rel', 'roll', 'pitch', 'yaw', 'foc_len', 'flags']
ordered_fieldnames = ['time_usec', 'lat', 'lng', 'alt_msl', 'alt_rel', 'roll', 'pitch', 'yaw', 'foc_len', 'img_idx', 'target_system', 'cam_idx', 'flags']
fieldtypes = ['uint64_t', 'uint8_t', 'uint8_t', 'uint16_t', 'int32_t', 'int32_t', 'float', 'float', 'float', 'float', 'float', 'float', 'uint8_t']
fielddisplays_by_name = {}
fieldenums_by_name = {"flags": "CAMERA_FEEDBACK_FLAGS"}
fieldunits_by_name = {"time_usec": "us", "lat": "degE7", "lng": "degE7", "alt_msl": "m", "alt_rel": "m", "roll": "deg", "pitch": "deg", "yaw": "deg", "foc_len": "mm"}
format = '<QiiffffffHBBB'
native_format = bytearray('<QiiffffffHBBB', 'ascii')
orders = [0, 10, 11, 9, 1, 2, 3, 4, 5, 6, 7, 8, 12]
lengths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
crc_extra = 52
unpacker = struct.Struct('<QiiffffffHBBB')
instance_field = None
instance_offset = -1
def __init__(self, time_usec, target_system, cam_idx, img_idx, lat, lng, alt_msl, alt_rel, roll, pitch, yaw, foc_len, flags):
MAVLink_message.__init__(self, MAVLink_camera_feedback_message.id, MAVLink_camera_feedback_message.name)
self._fieldnames = MAVLink_camera_feedback_message.fieldnames
self._instance_field = MAVLink_camera_feedback_message.instance_field
self._instance_offset = MAVLink_camera_feedback_message.instance_offset
self.time_usec = time_usec
self.target_system = target_system
self.cam_idx = cam_idx
self.img_idx = img_idx
self.lat = lat
self.lng = lng
self.alt_msl = alt_msl
self.alt_rel = alt_rel
self.roll = roll
self.pitch = pitch
self.yaw = yaw
self.foc_len = foc_len
self.flags = flags
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 52, struct.pack('<QiiffffffHBBB', self.time_usec, self.lat, self.lng, self.alt_msl, self.alt_rel, self.roll, self.pitch, self.yaw, self.foc_len, self.img_idx, self.target_system, self.cam_idx, self.flags), force_mavlink1=force_mavlink1)
class MAVLink_battery2_message(MAVLink_message):
'''
2nd Battery status
'''
id = MAVLINK_MSG_ID_BATTERY2
name = 'BATTERY2'
fieldnames = ['voltage', 'current_battery']
ordered_fieldnames = ['voltage', 'current_battery']
fieldtypes = ['uint16_t', 'int16_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"voltage": "mV", "current_battery": "cA"}
format = '<Hh'
native_format = bytearray('<Hh', 'ascii')
orders = [0, 1]
lengths = [1, 1]
array_lengths = [0, 0]
crc_extra = 174
unpacker = struct.Struct('<Hh')
instance_field = None
instance_offset = -1
def __init__(self, voltage, current_battery):
MAVLink_message.__init__(self, MAVLink_battery2_message.id, MAVLink_battery2_message.name)
self._fieldnames = MAVLink_battery2_message.fieldnames
self._instance_field = MAVLink_battery2_message.instance_field
self._instance_offset = MAVLink_battery2_message.instance_offset
self.voltage = voltage
self.current_battery = current_battery
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 174, struct.pack('<Hh', self.voltage, self.current_battery), force_mavlink1=force_mavlink1)
class MAVLink_ahrs3_message(MAVLink_message):
'''
Status of third AHRS filter if available. This is for ANU
research group (Ali and Sean).
'''
id = MAVLINK_MSG_ID_AHRS3
name = 'AHRS3'
fieldnames = ['roll', 'pitch', 'yaw', 'altitude', 'lat', 'lng', 'v1', 'v2', 'v3', 'v4']
ordered_fieldnames = ['roll', 'pitch', 'yaw', 'altitude', 'lat', 'lng', 'v1', 'v2', 'v3', 'v4']
fieldtypes = ['float', 'float', 'float', 'float', 'int32_t', 'int32_t', 'float', 'float', 'float', 'float']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"roll": "rad", "pitch": "rad", "yaw": "rad", "altitude": "m", "lat": "degE7", "lng": "degE7"}
format = '<ffffiiffff'
native_format = bytearray('<ffffiiffff', 'ascii')
orders = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
lengths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
crc_extra = 229
unpacker = struct.Struct('<ffffiiffff')
instance_field = None
instance_offset = -1
def __init__(self, roll, pitch, yaw, altitude, lat, lng, v1, v2, v3, v4):
MAVLink_message.__init__(self, MAVLink_ahrs3_message.id, MAVLink_ahrs3_message.name)
self._fieldnames = MAVLink_ahrs3_message.fieldnames
self._instance_field = MAVLink_ahrs3_message.instance_field
self._instance_offset = MAVLink_ahrs3_message.instance_offset
self.roll = roll
self.pitch = pitch
self.yaw = yaw
self.altitude = altitude
self.lat = lat
self.lng = lng
self.v1 = v1
self.v2 = v2
self.v3 = v3
self.v4 = v4
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 229, struct.pack('<ffffiiffff', self.roll, self.pitch, self.yaw, self.altitude, self.lat, self.lng, self.v1, self.v2, self.v3, self.v4), force_mavlink1=force_mavlink1)
class MAVLink_autopilot_version_request_message(MAVLink_message):
'''
Request the autopilot version from the system/component.
'''
id = MAVLINK_MSG_ID_AUTOPILOT_VERSION_REQUEST
name = 'AUTOPILOT_VERSION_REQUEST'
fieldnames = ['target_system', 'target_component']
ordered_fieldnames = ['target_system', 'target_component']
fieldtypes = ['uint8_t', 'uint8_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {}
format = '<BB'
native_format = bytearray('<BB', 'ascii')
orders = [0, 1]
lengths = [1, 1]
array_lengths = [0, 0]
crc_extra = 85
unpacker = struct.Struct('<BB')
instance_field = None
instance_offset = -1
def __init__(self, target_system, target_component):
MAVLink_message.__init__(self, MAVLink_autopilot_version_request_message.id, MAVLink_autopilot_version_request_message.name)
self._fieldnames = MAVLink_autopilot_version_request_message.fieldnames
self._instance_field = MAVLink_autopilot_version_request_message.instance_field
self._instance_offset = MAVLink_autopilot_version_request_message.instance_offset
self.target_system = target_system
self.target_component = target_component
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 85, struct.pack('<BB', self.target_system, self.target_component), force_mavlink1=force_mavlink1)
class MAVLink_remote_log_data_block_message(MAVLink_message):
'''
Send a block of log data to remote location.
'''
id = MAVLINK_MSG_ID_REMOTE_LOG_DATA_BLOCK
name = 'REMOTE_LOG_DATA_BLOCK'
fieldnames = ['target_system', 'target_component', 'seqno', 'data']
ordered_fieldnames = ['seqno', 'target_system', 'target_component', 'data']
fieldtypes = ['uint8_t', 'uint8_t', 'uint32_t', 'uint8_t']
fielddisplays_by_name = {}
fieldenums_by_name = {"seqno": "MAV_REMOTE_LOG_DATA_BLOCK_COMMANDS"}
fieldunits_by_name = {}
format = '<IBB200B'
native_format = bytearray('<IBBB', 'ascii')
orders = [1, 2, 0, 3]
lengths = [1, 1, 1, 200]
array_lengths = [0, 0, 0, 200]
crc_extra = 159
unpacker = struct.Struct('<IBB200B')
instance_field = None
instance_offset = -1
def __init__(self, target_system, target_component, seqno, data):
MAVLink_message.__init__(self, MAVLink_remote_log_data_block_message.id, MAVLink_remote_log_data_block_message.name)
self._fieldnames = MAVLink_remote_log_data_block_message.fieldnames
self._instance_field = MAVLink_remote_log_data_block_message.instance_field
self._instance_offset = MAVLink_remote_log_data_block_message.instance_offset
self.target_system = target_system
self.target_component = target_component
self.seqno = seqno
self.data = data
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 159, struct.pack('<IBB200B', self.seqno, self.target_system, self.target_component, self.data[0], self.data[1], self.data[2], self.data[3], self.data[4], self.data[5], self.data[6], self.data[7], self.data[8], self.data[9], self.data[10], self.data[11], self.data[12], self.data[13], self.data[14], self.data[15], self.data[16], self.data[17], self.data[18], self.data[19], self.data[20], self.data[21], self.data[22], self.data[23], self.data[24], self.data[25], self.data[26], self.data[27], self.data[28], self.data[29], self.data[30], self.data[31], self.data[32], self.data[33], self.data[34], self.data[35], self.data[36], self.data[37], self.data[38], self.data[39], self.data[40], self.data[41], self.data[42], self.data[43], self.data[44], self.data[45], self.data[46], self.data[47], self.data[48], self.data[49], self.data[50], self.data[51], self.data[52], self.data[53], self.data[54], self.data[55], self.data[56], self.data[57], self.data[58], self.data[59], self.data[60], self.data[61], self.data[62], self.data[63], self.data[64], self.data[65], self.data[66], self.data[67], self.data[68], self.data[69], self.data[70], self.data[71], self.data[72], self.data[73], self.data[74], self.data[75], self.data[76], self.data[77], self.data[78], self.data[79], self.data[80], self.data[81], self.data[82], self.data[83], self.data[84], self.data[85], self.data[86], self.data[87], self.data[88], self.data[89], self.data[90], self.data[91], self.data[92], self.data[93], self.data[94], self.data[95], self.data[96], self.data[97], self.data[98], self.data[99], self.data[100], self.data[101], self.data[102], self.data[103], self.data[104], self.data[105], self.data[106], self.data[107], self.data[108], self.data[109], self.data[110], self.data[111], self.data[112], self.data[113], self.data[114], self.data[115], self.data[116], self.data[117], self.data[118], self.data[119], self.data[120], self.data[121], self.data[122], self.data[123], self.data[124], self.data[125], self.data[126], self.data[127], self.data[128], self.data[129], self.data[130], self.data[131], self.data[132], self.data[133], self.data[134], self.data[135], self.data[136], self.data[137], self.data[138], self.data[139], self.data[140], self.data[141], self.data[142], self.data[143], self.data[144], self.data[145], self.data[146], self.data[147], self.data[148], self.data[149], self.data[150], self.data[151], self.data[152], self.data[153], self.data[154], self.data[155], self.data[156], self.data[157], self.data[158], self.data[159], self.data[160], self.data[161], self.data[162], self.data[163], self.data[164], self.data[165], self.data[166], self.data[167], self.data[168], self.data[169], self.data[170], self.data[171], self.data[172], self.data[173], self.data[174], self.data[175], self.data[176], self.data[177], self.data[178], self.data[179], self.data[180], self.data[181], self.data[182], self.data[183], self.data[184], self.data[185], self.data[186], self.data[187], self.data[188], self.data[189], self.data[190], self.data[191], self.data[192], self.data[193], self.data[194], self.data[195], self.data[196], self.data[197], self.data[198], self.data[199]), force_mavlink1=force_mavlink1)
class MAVLink_remote_log_block_status_message(MAVLink_message):
'''
Send Status of each log block that autopilot board might have
sent.
'''
id = MAVLINK_MSG_ID_REMOTE_LOG_BLOCK_STATUS
name = 'REMOTE_LOG_BLOCK_STATUS'
fieldnames = ['target_system', 'target_component', 'seqno', 'status']
ordered_fieldnames = ['seqno', 'target_system', 'target_component', 'status']
fieldtypes = ['uint8_t', 'uint8_t', 'uint32_t', 'uint8_t']
fielddisplays_by_name = {}
fieldenums_by_name = {"status": "MAV_REMOTE_LOG_DATA_BLOCK_STATUSES"}
fieldunits_by_name = {}
format = '<IBBB'
native_format = bytearray('<IBBB', 'ascii')
orders = [1, 2, 0, 3]
lengths = [1, 1, 1, 1]
array_lengths = [0, 0, 0, 0]
crc_extra = 186
unpacker = struct.Struct('<IBBB')
instance_field = None
instance_offset = -1
def __init__(self, target_system, target_component, seqno, status):
MAVLink_message.__init__(self, MAVLink_remote_log_block_status_message.id, MAVLink_remote_log_block_status_message.name)
self._fieldnames = MAVLink_remote_log_block_status_message.fieldnames
self._instance_field = MAVLink_remote_log_block_status_message.instance_field
self._instance_offset = MAVLink_remote_log_block_status_message.instance_offset
self.target_system = target_system
self.target_component = target_component
self.seqno = seqno
self.status = status
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 186, struct.pack('<IBBB', self.seqno, self.target_system, self.target_component, self.status), force_mavlink1=force_mavlink1)
class MAVLink_led_control_message(MAVLink_message):
'''
Control vehicle LEDs.
'''
id = MAVLINK_MSG_ID_LED_CONTROL
name = 'LED_CONTROL'
fieldnames = ['target_system', 'target_component', 'instance', 'pattern', 'custom_len', 'custom_bytes']
ordered_fieldnames = ['target_system', 'target_component', 'instance', 'pattern', 'custom_len', 'custom_bytes']
fieldtypes = ['uint8_t', 'uint8_t', 'uint8_t', 'uint8_t', 'uint8_t', 'uint8_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {}
format = '<BBBBB24B'
native_format = bytearray('<BBBBBB', 'ascii')
orders = [0, 1, 2, 3, 4, 5]
lengths = [1, 1, 1, 1, 1, 24]
array_lengths = [0, 0, 0, 0, 0, 24]
crc_extra = 72
unpacker = struct.Struct('<BBBBB24B')
instance_field = None
instance_offset = -1
def __init__(self, target_system, target_component, instance, pattern, custom_len, custom_bytes):
MAVLink_message.__init__(self, MAVLink_led_control_message.id, MAVLink_led_control_message.name)
self._fieldnames = MAVLink_led_control_message.fieldnames
self._instance_field = MAVLink_led_control_message.instance_field
self._instance_offset = MAVLink_led_control_message.instance_offset
self.target_system = target_system
self.target_component = target_component
self.instance = instance
self.pattern = pattern
self.custom_len = custom_len
self.custom_bytes = custom_bytes
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 72, struct.pack('<BBBBB24B', self.target_system, self.target_component, self.instance, self.pattern, self.custom_len, self.custom_bytes[0], self.custom_bytes[1], self.custom_bytes[2], self.custom_bytes[3], self.custom_bytes[4], self.custom_bytes[5], self.custom_bytes[6], self.custom_bytes[7], self.custom_bytes[8], self.custom_bytes[9], self.custom_bytes[10], self.custom_bytes[11], self.custom_bytes[12], self.custom_bytes[13], self.custom_bytes[14], self.custom_bytes[15], self.custom_bytes[16], self.custom_bytes[17], self.custom_bytes[18], self.custom_bytes[19], self.custom_bytes[20], self.custom_bytes[21], self.custom_bytes[22], self.custom_bytes[23]), force_mavlink1=force_mavlink1)
class MAVLink_mag_cal_progress_message(MAVLink_message):
'''
Reports progress of compass calibration.
'''
id = MAVLINK_MSG_ID_MAG_CAL_PROGRESS
name = 'MAG_CAL_PROGRESS'
fieldnames = ['compass_id', 'cal_mask', 'cal_status', 'attempt', 'completion_pct', 'completion_mask', 'direction_x', 'direction_y', 'direction_z']
ordered_fieldnames = ['direction_x', 'direction_y', 'direction_z', 'compass_id', 'cal_mask', 'cal_status', 'attempt', 'completion_pct', 'completion_mask']
fieldtypes = ['uint8_t', 'uint8_t', 'uint8_t', 'uint8_t', 'uint8_t', 'uint8_t', 'float', 'float', 'float']
fielddisplays_by_name = {"cal_mask": "bitmask"}
fieldenums_by_name = {"cal_status": "MAG_CAL_STATUS"}
fieldunits_by_name = {"completion_pct": "%"}
format = '<fffBBBBB10B'
native_format = bytearray('<fffBBBBBB', 'ascii')
orders = [3, 4, 5, 6, 7, 8, 0, 1, 2]
lengths = [1, 1, 1, 1, 1, 1, 1, 1, 10]
array_lengths = [0, 0, 0, 0, 0, 0, 0, 0, 10]
crc_extra = 92
unpacker = struct.Struct('<fffBBBBB10B')
instance_field = 'compass_id'
instance_offset = 12
def __init__(self, compass_id, cal_mask, cal_status, attempt, completion_pct, completion_mask, direction_x, direction_y, direction_z):
MAVLink_message.__init__(self, MAVLink_mag_cal_progress_message.id, MAVLink_mag_cal_progress_message.name)
self._fieldnames = MAVLink_mag_cal_progress_message.fieldnames
self._instance_field = MAVLink_mag_cal_progress_message.instance_field
self._instance_offset = MAVLink_mag_cal_progress_message.instance_offset
self.compass_id = compass_id
self.cal_mask = cal_mask
self.cal_status = cal_status
self.attempt = attempt
self.completion_pct = completion_pct
self.completion_mask = completion_mask
self.direction_x = direction_x
self.direction_y = direction_y
self.direction_z = direction_z
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 92, struct.pack('<fffBBBBB10B', self.direction_x, self.direction_y, self.direction_z, self.compass_id, self.cal_mask, self.cal_status, self.attempt, self.completion_pct, self.completion_mask[0], self.completion_mask[1], self.completion_mask[2], self.completion_mask[3], self.completion_mask[4], self.completion_mask[5], self.completion_mask[6], self.completion_mask[7], self.completion_mask[8], self.completion_mask[9]), force_mavlink1=force_mavlink1)
class MAVLink_mag_cal_report_message(MAVLink_message):
'''
Reports results of completed compass calibration. Sent until
MAG_CAL_ACK received.
'''
id = MAVLINK_MSG_ID_MAG_CAL_REPORT
name = 'MAG_CAL_REPORT'
fieldnames = ['compass_id', 'cal_mask', 'cal_status', 'autosaved', 'fitness', 'ofs_x', 'ofs_y', 'ofs_z', 'diag_x', 'diag_y', 'diag_z', 'offdiag_x', 'offdiag_y', 'offdiag_z']
ordered_fieldnames = ['fitness', 'ofs_x', 'ofs_y', 'ofs_z', 'diag_x', 'diag_y', 'diag_z', 'offdiag_x', 'offdiag_y', 'offdiag_z', 'compass_id', 'cal_mask', 'cal_status', 'autosaved']
fieldtypes = ['uint8_t', 'uint8_t', 'uint8_t', 'uint8_t', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float']
fielddisplays_by_name = {"cal_mask": "bitmask"}
fieldenums_by_name = {"cal_status": "MAG_CAL_STATUS"}
fieldunits_by_name = {"fitness": "mgauss"}
format = '<ffffffffffBBBB'
native_format = bytearray('<ffffffffffBBBB', 'ascii')
orders = [10, 11, 12, 13, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
lengths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
crc_extra = 36
unpacker = struct.Struct('<ffffffffffBBBB')
instance_field = 'compass_id'
instance_offset = 40
def __init__(self, compass_id, cal_mask, cal_status, autosaved, fitness, ofs_x, ofs_y, ofs_z, diag_x, diag_y, diag_z, offdiag_x, offdiag_y, offdiag_z):
MAVLink_message.__init__(self, MAVLink_mag_cal_report_message.id, MAVLink_mag_cal_report_message.name)
self._fieldnames = MAVLink_mag_cal_report_message.fieldnames
self._instance_field = MAVLink_mag_cal_report_message.instance_field
self._instance_offset = MAVLink_mag_cal_report_message.instance_offset
self.compass_id = compass_id
self.cal_mask = cal_mask
self.cal_status = cal_status
self.autosaved = autosaved
self.fitness = fitness
self.ofs_x = ofs_x
self.ofs_y = ofs_y
self.ofs_z = ofs_z
self.diag_x = diag_x
self.diag_y = diag_y
self.diag_z = diag_z
self.offdiag_x = offdiag_x
self.offdiag_y = offdiag_y
self.offdiag_z = offdiag_z
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 36, struct.pack('<ffffffffffBBBB', self.fitness, self.ofs_x, self.ofs_y, self.ofs_z, self.diag_x, self.diag_y, self.diag_z, self.offdiag_x, self.offdiag_y, self.offdiag_z, self.compass_id, self.cal_mask, self.cal_status, self.autosaved), force_mavlink1=force_mavlink1)
class MAVLink_ekf_status_report_message(MAVLink_message):
'''
EKF Status message including flags and variances.
'''
id = MAVLINK_MSG_ID_EKF_STATUS_REPORT
name = 'EKF_STATUS_REPORT'
fieldnames = ['flags', 'velocity_variance', 'pos_horiz_variance', 'pos_vert_variance', 'compass_variance', 'terrain_alt_variance']
ordered_fieldnames = ['velocity_variance', 'pos_horiz_variance', 'pos_vert_variance', 'compass_variance', 'terrain_alt_variance', 'flags']
fieldtypes = ['uint16_t', 'float', 'float', 'float', 'float', 'float']
fielddisplays_by_name = {"flags": "bitmask"}
fieldenums_by_name = {"flags": "EKF_STATUS_FLAGS"}
fieldunits_by_name = {}
format = '<fffffH'
native_format = bytearray('<fffffH', 'ascii')
orders = [5, 0, 1, 2, 3, 4]
lengths = [1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0]
crc_extra = 71
unpacker = struct.Struct('<fffffH')
instance_field = None
instance_offset = -1
def __init__(self, flags, velocity_variance, pos_horiz_variance, pos_vert_variance, compass_variance, terrain_alt_variance):
MAVLink_message.__init__(self, MAVLink_ekf_status_report_message.id, MAVLink_ekf_status_report_message.name)
self._fieldnames = MAVLink_ekf_status_report_message.fieldnames
self._instance_field = MAVLink_ekf_status_report_message.instance_field
self._instance_offset = MAVLink_ekf_status_report_message.instance_offset
self.flags = flags
self.velocity_variance = velocity_variance
self.pos_horiz_variance = pos_horiz_variance
self.pos_vert_variance = pos_vert_variance
self.compass_variance = compass_variance
self.terrain_alt_variance = terrain_alt_variance
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 71, struct.pack('<fffffH', self.velocity_variance, self.pos_horiz_variance, self.pos_vert_variance, self.compass_variance, self.terrain_alt_variance, self.flags), force_mavlink1=force_mavlink1)
class MAVLink_pid_tuning_message(MAVLink_message):
'''
PID tuning information.
'''
id = MAVLINK_MSG_ID_PID_TUNING
name = 'PID_TUNING'
fieldnames = ['axis', 'desired', 'achieved', 'FF', 'P', 'I', 'D']
ordered_fieldnames = ['desired', 'achieved', 'FF', 'P', 'I', 'D', 'axis']
fieldtypes = ['uint8_t', 'float', 'float', 'float', 'float', 'float', 'float']
fielddisplays_by_name = {}
fieldenums_by_name = {"axis": "PID_TUNING_AXIS"}
fieldunits_by_name = {}
format = '<ffffffB'
native_format = bytearray('<ffffffB', 'ascii')
orders = [6, 0, 1, 2, 3, 4, 5]
lengths = [1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0]
crc_extra = 98
unpacker = struct.Struct('<ffffffB')
instance_field = 'axis'
instance_offset = 24
def __init__(self, axis, desired, achieved, FF, P, I, D):
MAVLink_message.__init__(self, MAVLink_pid_tuning_message.id, MAVLink_pid_tuning_message.name)
self._fieldnames = MAVLink_pid_tuning_message.fieldnames
self._instance_field = MAVLink_pid_tuning_message.instance_field
self._instance_offset = MAVLink_pid_tuning_message.instance_offset
self.axis = axis
self.desired = desired
self.achieved = achieved
self.FF = FF
self.P = P
self.I = I
self.D = D
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 98, struct.pack('<ffffffB', self.desired, self.achieved, self.FF, self.P, self.I, self.D, self.axis), force_mavlink1=force_mavlink1)
class MAVLink_deepstall_message(MAVLink_message):
'''
Deepstall path planning.
'''
id = MAVLINK_MSG_ID_DEEPSTALL
name = 'DEEPSTALL'
fieldnames = ['landing_lat', 'landing_lon', 'path_lat', 'path_lon', 'arc_entry_lat', 'arc_entry_lon', 'altitude', 'expected_travel_distance', 'cross_track_error', 'stage']
ordered_fieldnames = ['landing_lat', 'landing_lon', 'path_lat', 'path_lon', 'arc_entry_lat', 'arc_entry_lon', 'altitude', 'expected_travel_distance', 'cross_track_error', 'stage']
fieldtypes = ['int32_t', 'int32_t', 'int32_t', 'int32_t', 'int32_t', 'int32_t', 'float', 'float', 'float', 'uint8_t']
fielddisplays_by_name = {}
fieldenums_by_name = {"stage": "DEEPSTALL_STAGE"}
fieldunits_by_name = {"landing_lat": "degE7", "landing_lon": "degE7", "path_lat": "degE7", "path_lon": "degE7", "arc_entry_lat": "degE7", "arc_entry_lon": "degE7", "altitude": "m", "expected_travel_distance": "m", "cross_track_error": "m"}
format = '<iiiiiifffB'
native_format = bytearray('<iiiiiifffB', 'ascii')
orders = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
lengths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
crc_extra = 120
unpacker = struct.Struct('<iiiiiifffB')
instance_field = None
instance_offset = -1
def __init__(self, landing_lat, landing_lon, path_lat, path_lon, arc_entry_lat, arc_entry_lon, altitude, expected_travel_distance, cross_track_error, stage):
MAVLink_message.__init__(self, MAVLink_deepstall_message.id, MAVLink_deepstall_message.name)
self._fieldnames = MAVLink_deepstall_message.fieldnames
self._instance_field = MAVLink_deepstall_message.instance_field
self._instance_offset = MAVLink_deepstall_message.instance_offset
self.landing_lat = landing_lat
self.landing_lon = landing_lon
self.path_lat = path_lat
self.path_lon = path_lon
self.arc_entry_lat = arc_entry_lat
self.arc_entry_lon = arc_entry_lon
self.altitude = altitude
self.expected_travel_distance = expected_travel_distance
self.cross_track_error = cross_track_error
self.stage = stage
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 120, struct.pack('<iiiiiifffB', self.landing_lat, self.landing_lon, self.path_lat, self.path_lon, self.arc_entry_lat, self.arc_entry_lon, self.altitude, self.expected_travel_distance, self.cross_track_error, self.stage), force_mavlink1=force_mavlink1)
class MAVLink_gimbal_report_message(MAVLink_message):
'''
3 axis gimbal measurements.
'''
id = MAVLINK_MSG_ID_GIMBAL_REPORT
name = 'GIMBAL_REPORT'
fieldnames = ['target_system', 'target_component', 'delta_time', 'delta_angle_x', 'delta_angle_y', 'delta_angle_z', 'delta_velocity_x', 'delta_velocity_y', 'delta_velocity_z', 'joint_roll', 'joint_el', 'joint_az']
ordered_fieldnames = ['delta_time', 'delta_angle_x', 'delta_angle_y', 'delta_angle_z', 'delta_velocity_x', 'delta_velocity_y', 'delta_velocity_z', 'joint_roll', 'joint_el', 'joint_az', 'target_system', 'target_component']
fieldtypes = ['uint8_t', 'uint8_t', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"delta_time": "s", "delta_angle_x": "rad", "delta_angle_y": "rad", "delta_angle_z": "rad", "delta_velocity_x": "m/s", "delta_velocity_y": "m/s", "delta_velocity_z": "m/s", "joint_roll": "rad", "joint_el": "rad", "joint_az": "rad"}
format = '<ffffffffffBB'
native_format = bytearray('<ffffffffffBB', 'ascii')
orders = [10, 11, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
lengths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
crc_extra = 134
unpacker = struct.Struct('<ffffffffffBB')
instance_field = None
instance_offset = -1
def __init__(self, target_system, target_component, delta_time, delta_angle_x, delta_angle_y, delta_angle_z, delta_velocity_x, delta_velocity_y, delta_velocity_z, joint_roll, joint_el, joint_az):
MAVLink_message.__init__(self, MAVLink_gimbal_report_message.id, MAVLink_gimbal_report_message.name)
self._fieldnames = MAVLink_gimbal_report_message.fieldnames
self._instance_field = MAVLink_gimbal_report_message.instance_field
self._instance_offset = MAVLink_gimbal_report_message.instance_offset
self.target_system = target_system
self.target_component = target_component
self.delta_time = delta_time
self.delta_angle_x = delta_angle_x
self.delta_angle_y = delta_angle_y
self.delta_angle_z = delta_angle_z
self.delta_velocity_x = delta_velocity_x
self.delta_velocity_y = delta_velocity_y
self.delta_velocity_z = delta_velocity_z
self.joint_roll = joint_roll
self.joint_el = joint_el
self.joint_az = joint_az
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 134, struct.pack('<ffffffffffBB', self.delta_time, self.delta_angle_x, self.delta_angle_y, self.delta_angle_z, self.delta_velocity_x, self.delta_velocity_y, self.delta_velocity_z, self.joint_roll, self.joint_el, self.joint_az, self.target_system, self.target_component), force_mavlink1=force_mavlink1)
class MAVLink_gimbal_control_message(MAVLink_message):
'''
Control message for rate gimbal.
'''
id = MAVLINK_MSG_ID_GIMBAL_CONTROL
name = 'GIMBAL_CONTROL'
fieldnames = ['target_system', 'target_component', 'demanded_rate_x', 'demanded_rate_y', 'demanded_rate_z']
ordered_fieldnames = ['demanded_rate_x', 'demanded_rate_y', 'demanded_rate_z', 'target_system', 'target_component']
fieldtypes = ['uint8_t', 'uint8_t', 'float', 'float', 'float']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"demanded_rate_x": "rad/s", "demanded_rate_y": "rad/s", "demanded_rate_z": "rad/s"}
format = '<fffBB'
native_format = bytearray('<fffBB', 'ascii')
orders = [3, 4, 0, 1, 2]
lengths = [1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0]
crc_extra = 205
unpacker = struct.Struct('<fffBB')
instance_field = None
instance_offset = -1
def __init__(self, target_system, target_component, demanded_rate_x, demanded_rate_y, demanded_rate_z):
MAVLink_message.__init__(self, MAVLink_gimbal_control_message.id, MAVLink_gimbal_control_message.name)
self._fieldnames = MAVLink_gimbal_control_message.fieldnames
self._instance_field = MAVLink_gimbal_control_message.instance_field
self._instance_offset = MAVLink_gimbal_control_message.instance_offset
self.target_system = target_system
self.target_component = target_component
self.demanded_rate_x = demanded_rate_x
self.demanded_rate_y = demanded_rate_y
self.demanded_rate_z = demanded_rate_z
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 205, struct.pack('<fffBB', self.demanded_rate_x, self.demanded_rate_y, self.demanded_rate_z, self.target_system, self.target_component), force_mavlink1=force_mavlink1)
class MAVLink_gimbal_torque_cmd_report_message(MAVLink_message):
'''
100 Hz gimbal torque command telemetry.
'''
id = MAVLINK_MSG_ID_GIMBAL_TORQUE_CMD_REPORT
name = 'GIMBAL_TORQUE_CMD_REPORT'
fieldnames = ['target_system', 'target_component', 'rl_torque_cmd', 'el_torque_cmd', 'az_torque_cmd']
ordered_fieldnames = ['rl_torque_cmd', 'el_torque_cmd', 'az_torque_cmd', 'target_system', 'target_component']
fieldtypes = ['uint8_t', 'uint8_t', 'int16_t', 'int16_t', 'int16_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {}
format = '<hhhBB'
native_format = bytearray('<hhhBB', 'ascii')
orders = [3, 4, 0, 1, 2]
lengths = [1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0]
crc_extra = 69
unpacker = struct.Struct('<hhhBB')
instance_field = None
instance_offset = -1
def __init__(self, target_system, target_component, rl_torque_cmd, el_torque_cmd, az_torque_cmd):
MAVLink_message.__init__(self, MAVLink_gimbal_torque_cmd_report_message.id, MAVLink_gimbal_torque_cmd_report_message.name)
self._fieldnames = MAVLink_gimbal_torque_cmd_report_message.fieldnames
self._instance_field = MAVLink_gimbal_torque_cmd_report_message.instance_field
self._instance_offset = MAVLink_gimbal_torque_cmd_report_message.instance_offset
self.target_system = target_system
self.target_component = target_component
self.rl_torque_cmd = rl_torque_cmd
self.el_torque_cmd = el_torque_cmd
self.az_torque_cmd = az_torque_cmd
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 69, struct.pack('<hhhBB', self.rl_torque_cmd, self.el_torque_cmd, self.az_torque_cmd, self.target_system, self.target_component), force_mavlink1=force_mavlink1)
class MAVLink_gopro_heartbeat_message(MAVLink_message):
'''
Heartbeat from a HeroBus attached GoPro.
'''
id = MAVLINK_MSG_ID_GOPRO_HEARTBEAT
name = 'GOPRO_HEARTBEAT'
fieldnames = ['status', 'capture_mode', 'flags']
ordered_fieldnames = ['status', 'capture_mode', 'flags']
fieldtypes = ['uint8_t', 'uint8_t', 'uint8_t']
fielddisplays_by_name = {"flags": "bitmask"}
fieldenums_by_name = {"status": "GOPRO_HEARTBEAT_STATUS", "capture_mode": "GOPRO_CAPTURE_MODE", "flags": "GOPRO_HEARTBEAT_FLAGS"}
fieldunits_by_name = {}
format = '<BBB'
native_format = bytearray('<BBB', 'ascii')
orders = [0, 1, 2]
lengths = [1, 1, 1]
array_lengths = [0, 0, 0]
crc_extra = 101
unpacker = struct.Struct('<BBB')
instance_field = None
instance_offset = -1
def __init__(self, status, capture_mode, flags):
MAVLink_message.__init__(self, MAVLink_gopro_heartbeat_message.id, MAVLink_gopro_heartbeat_message.name)
self._fieldnames = MAVLink_gopro_heartbeat_message.fieldnames
self._instance_field = MAVLink_gopro_heartbeat_message.instance_field
self._instance_offset = MAVLink_gopro_heartbeat_message.instance_offset
self.status = status
self.capture_mode = capture_mode
self.flags = flags
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 101, struct.pack('<BBB', self.status, self.capture_mode, self.flags), force_mavlink1=force_mavlink1)
class MAVLink_gopro_get_request_message(MAVLink_message):
'''
Request a GOPRO_COMMAND response from the GoPro.
'''
id = MAVLINK_MSG_ID_GOPRO_GET_REQUEST
name = 'GOPRO_GET_REQUEST'
fieldnames = ['target_system', 'target_component', 'cmd_id']
ordered_fieldnames = ['target_system', 'target_component', 'cmd_id']
fieldtypes = ['uint8_t', 'uint8_t', 'uint8_t']
fielddisplays_by_name = {}
fieldenums_by_name = {"cmd_id": "GOPRO_COMMAND"}
fieldunits_by_name = {}
format = '<BBB'
native_format = bytearray('<BBB', 'ascii')
orders = [0, 1, 2]
lengths = [1, 1, 1]
array_lengths = [0, 0, 0]
crc_extra = 50
unpacker = struct.Struct('<BBB')
instance_field = None
instance_offset = -1
def __init__(self, target_system, target_component, cmd_id):
MAVLink_message.__init__(self, MAVLink_gopro_get_request_message.id, MAVLink_gopro_get_request_message.name)
self._fieldnames = MAVLink_gopro_get_request_message.fieldnames
self._instance_field = MAVLink_gopro_get_request_message.instance_field
self._instance_offset = MAVLink_gopro_get_request_message.instance_offset
self.target_system = target_system
self.target_component = target_component
self.cmd_id = cmd_id
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 50, struct.pack('<BBB', self.target_system, self.target_component, self.cmd_id), force_mavlink1=force_mavlink1)
class MAVLink_gopro_get_response_message(MAVLink_message):
'''
Response from a GOPRO_COMMAND get request.
'''
id = MAVLINK_MSG_ID_GOPRO_GET_RESPONSE
name = 'GOPRO_GET_RESPONSE'
fieldnames = ['cmd_id', 'status', 'value']
ordered_fieldnames = ['cmd_id', 'status', 'value']
fieldtypes = ['uint8_t', 'uint8_t', 'uint8_t']
fielddisplays_by_name = {}
fieldenums_by_name = {"cmd_id": "GOPRO_COMMAND", "status": "GOPRO_REQUEST_STATUS"}
fieldunits_by_name = {}
format = '<BB4B'
native_format = bytearray('<BBB', 'ascii')
orders = [0, 1, 2]
lengths = [1, 1, 4]
array_lengths = [0, 0, 4]
crc_extra = 202
unpacker = struct.Struct('<BB4B')
instance_field = None
instance_offset = -1
def __init__(self, cmd_id, status, value):
MAVLink_message.__init__(self, MAVLink_gopro_get_response_message.id, MAVLink_gopro_get_response_message.name)
self._fieldnames = MAVLink_gopro_get_response_message.fieldnames
self._instance_field = MAVLink_gopro_get_response_message.instance_field
self._instance_offset = MAVLink_gopro_get_response_message.instance_offset
self.cmd_id = cmd_id
self.status = status
self.value = value
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 202, struct.pack('<BB4B', self.cmd_id, self.status, self.value[0], self.value[1], self.value[2], self.value[3]), force_mavlink1=force_mavlink1)
class MAVLink_gopro_set_request_message(MAVLink_message):
'''
Request to set a GOPRO_COMMAND with a desired.
'''
id = MAVLINK_MSG_ID_GOPRO_SET_REQUEST
name = 'GOPRO_SET_REQUEST'
fieldnames = ['target_system', 'target_component', 'cmd_id', 'value']
ordered_fieldnames = ['target_system', 'target_component', 'cmd_id', 'value']
fieldtypes = ['uint8_t', 'uint8_t', 'uint8_t', 'uint8_t']
fielddisplays_by_name = {}
fieldenums_by_name = {"cmd_id": "GOPRO_COMMAND"}
fieldunits_by_name = {}
format = '<BBB4B'
native_format = bytearray('<BBBB', 'ascii')
orders = [0, 1, 2, 3]
lengths = [1, 1, 1, 4]
array_lengths = [0, 0, 0, 4]
crc_extra = 17
unpacker = struct.Struct('<BBB4B')
instance_field = None
instance_offset = -1
def __init__(self, target_system, target_component, cmd_id, value):
MAVLink_message.__init__(self, MAVLink_gopro_set_request_message.id, MAVLink_gopro_set_request_message.name)
self._fieldnames = MAVLink_gopro_set_request_message.fieldnames
self._instance_field = MAVLink_gopro_set_request_message.instance_field
self._instance_offset = MAVLink_gopro_set_request_message.instance_offset
self.target_system = target_system
self.target_component = target_component
self.cmd_id = cmd_id
self.value = value
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 17, struct.pack('<BBB4B', self.target_system, self.target_component, self.cmd_id, self.value[0], self.value[1], self.value[2], self.value[3]), force_mavlink1=force_mavlink1)
class MAVLink_gopro_set_response_message(MAVLink_message):
'''
Response from a GOPRO_COMMAND set request.
'''
id = MAVLINK_MSG_ID_GOPRO_SET_RESPONSE
name = 'GOPRO_SET_RESPONSE'
fieldnames = ['cmd_id', 'status']
ordered_fieldnames = ['cmd_id', 'status']
fieldtypes = ['uint8_t', 'uint8_t']
fielddisplays_by_name = {}
fieldenums_by_name = {"cmd_id": "GOPRO_COMMAND", "status": "GOPRO_REQUEST_STATUS"}
fieldunits_by_name = {}
format = '<BB'
native_format = bytearray('<BB', 'ascii')
orders = [0, 1]
lengths = [1, 1]
array_lengths = [0, 0]
crc_extra = 162
unpacker = struct.Struct('<BB')
instance_field = None
instance_offset = -1
def __init__(self, cmd_id, status):
MAVLink_message.__init__(self, MAVLink_gopro_set_response_message.id, MAVLink_gopro_set_response_message.name)
self._fieldnames = MAVLink_gopro_set_response_message.fieldnames
self._instance_field = MAVLink_gopro_set_response_message.instance_field
self._instance_offset = MAVLink_gopro_set_response_message.instance_offset
self.cmd_id = cmd_id
self.status = status
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 162, struct.pack('<BB', self.cmd_id, self.status), force_mavlink1=force_mavlink1)
class MAVLink_efi_status_message(MAVLink_message):
'''
EFI status output
'''
id = MAVLINK_MSG_ID_EFI_STATUS
name = 'EFI_STATUS'
fieldnames = ['health', 'ecu_index', 'rpm', 'fuel_consumed', 'fuel_flow', 'engine_load', 'throttle_position', 'spark_dwell_time', 'barometric_pressure', 'intake_manifold_pressure', 'intake_manifold_temperature', 'cylinder_head_temperature', 'ignition_timing', 'injection_time', 'exhaust_gas_temperature', 'throttle_out', 'pt_compensation']
ordered_fieldnames = ['ecu_index', 'rpm', 'fuel_consumed', 'fuel_flow', 'engine_load', 'throttle_position', 'spark_dwell_time', 'barometric_pressure', 'intake_manifold_pressure', 'intake_manifold_temperature', 'cylinder_head_temperature', 'ignition_timing', 'injection_time', 'exhaust_gas_temperature', 'throttle_out', 'pt_compensation', 'health']
fieldtypes = ['uint8_t', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"fuel_consumed": "g", "fuel_flow": "g/min", "engine_load": "%", "throttle_position": "%", "spark_dwell_time": "ms", "barometric_pressure": "kPa", "intake_manifold_pressure": "kPa", "intake_manifold_temperature": "degC", "cylinder_head_temperature": "degC", "ignition_timing": "deg", "injection_time": "ms", "exhaust_gas_temperature": "degC", "throttle_out": "%"}
format = '<ffffffffffffffffB'
native_format = bytearray('<ffffffffffffffffB', 'ascii')
orders = [16, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
lengths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
crc_extra = 208
unpacker = struct.Struct('<ffffffffffffffffB')
instance_field = None
instance_offset = -1
def __init__(self, health, ecu_index, rpm, fuel_consumed, fuel_flow, engine_load, throttle_position, spark_dwell_time, barometric_pressure, intake_manifold_pressure, intake_manifold_temperature, cylinder_head_temperature, ignition_timing, injection_time, exhaust_gas_temperature, throttle_out, pt_compensation):
MAVLink_message.__init__(self, MAVLink_efi_status_message.id, MAVLink_efi_status_message.name)
self._fieldnames = MAVLink_efi_status_message.fieldnames
self._instance_field = MAVLink_efi_status_message.instance_field
self._instance_offset = MAVLink_efi_status_message.instance_offset
self.health = health
self.ecu_index = ecu_index
self.rpm = rpm
self.fuel_consumed = fuel_consumed
self.fuel_flow = fuel_flow
self.engine_load = engine_load
self.throttle_position = throttle_position
self.spark_dwell_time = spark_dwell_time
self.barometric_pressure = barometric_pressure
self.intake_manifold_pressure = intake_manifold_pressure
self.intake_manifold_temperature = intake_manifold_temperature
self.cylinder_head_temperature = cylinder_head_temperature
self.ignition_timing = ignition_timing
self.injection_time = injection_time
self.exhaust_gas_temperature = exhaust_gas_temperature
self.throttle_out = throttle_out
self.pt_compensation = pt_compensation
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 208, struct.pack('<ffffffffffffffffB', self.ecu_index, self.rpm, self.fuel_consumed, self.fuel_flow, self.engine_load, self.throttle_position, self.spark_dwell_time, self.barometric_pressure, self.intake_manifold_pressure, self.intake_manifold_temperature, self.cylinder_head_temperature, self.ignition_timing, self.injection_time, self.exhaust_gas_temperature, self.throttle_out, self.pt_compensation, self.health), force_mavlink1=force_mavlink1)
class MAVLink_rpm_message(MAVLink_message):
'''
RPM sensor output.
'''
id = MAVLINK_MSG_ID_RPM
name = 'RPM'
fieldnames = ['rpm1', 'rpm2']
ordered_fieldnames = ['rpm1', 'rpm2']
fieldtypes = ['float', 'float']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {}
format = '<ff'
native_format = bytearray('<ff', 'ascii')
orders = [0, 1]
lengths = [1, 1]
array_lengths = [0, 0]
crc_extra = 207
unpacker = struct.Struct('<ff')
instance_field = None
instance_offset = -1
def __init__(self, rpm1, rpm2):
MAVLink_message.__init__(self, MAVLink_rpm_message.id, MAVLink_rpm_message.name)
self._fieldnames = MAVLink_rpm_message.fieldnames
self._instance_field = MAVLink_rpm_message.instance_field
self._instance_offset = MAVLink_rpm_message.instance_offset
self.rpm1 = rpm1
self.rpm2 = rpm2
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 207, struct.pack('<ff', self.rpm1, self.rpm2), force_mavlink1=force_mavlink1)
class MAVLink_heartbeat_message(MAVLink_message):
'''
The heartbeat message shows that a system or component is
present and responding. The type and autopilot fields (along
with the message component id), allow the receiving system to
treat further messages from this system appropriately (e.g. by
laying out the user interface based on the autopilot). This
microservice is documented at
https://mavlink.io/en/services/heartbeat.html
'''
id = MAVLINK_MSG_ID_HEARTBEAT
name = 'HEARTBEAT'
fieldnames = ['type', 'autopilot', 'base_mode', 'custom_mode', 'system_status', 'mavlink_version']
ordered_fieldnames = ['custom_mode', 'type', 'autopilot', 'base_mode', 'system_status', 'mavlink_version']
fieldtypes = ['uint8_t', 'uint8_t', 'uint8_t', 'uint32_t', 'uint8_t', 'uint8_t']
fielddisplays_by_name = {"base_mode": "bitmask"}
fieldenums_by_name = {"type": "MAV_TYPE", "autopilot": "MAV_AUTOPILOT", "base_mode": "MAV_MODE_FLAG", "system_status": "MAV_STATE"}
fieldunits_by_name = {}
format = '<IBBBBB'
native_format = bytearray('<IBBBBB', 'ascii')
orders = [1, 2, 3, 0, 4, 5]
lengths = [1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0]
crc_extra = 50
unpacker = struct.Struct('<IBBBBB')
instance_field = None
instance_offset = -1
def __init__(self, type, autopilot, base_mode, custom_mode, system_status, mavlink_version):
MAVLink_message.__init__(self, MAVLink_heartbeat_message.id, MAVLink_heartbeat_message.name)
self._fieldnames = MAVLink_heartbeat_message.fieldnames
self._instance_field = MAVLink_heartbeat_message.instance_field
self._instance_offset = MAVLink_heartbeat_message.instance_offset
self.type = type
self.autopilot = autopilot
self.base_mode = base_mode
self.custom_mode = custom_mode
self.system_status = system_status
self.mavlink_version = mavlink_version
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 50, struct.pack('<IBBBBB', self.custom_mode, self.type, self.autopilot, self.base_mode, self.system_status, self.mavlink_version), force_mavlink1=force_mavlink1)
class MAVLink_sys_status_message(MAVLink_message):
'''
The general system state. If the system is following the
MAVLink standard, the system state is mainly defined by three
orthogonal states/modes: The system mode, which is either
LOCKED (motors shut down and locked), MANUAL (system under RC
control), GUIDED (system with autonomous position control,
position setpoint controlled manually) or AUTO (system guided
by path/waypoint planner). The NAV_MODE defined the current
flight state: LIFTOFF (often an open-loop maneuver), LANDING,
WAYPOINTS or VECTOR. This represents the internal navigation
state machine. The system status shows whether the system is
currently active or not and if an emergency occurred. During
the CRITICAL and EMERGENCY states the MAV is still considered
to be active, but should start emergency procedures
autonomously. After a failure occurred it should first move
from active to critical to allow manual intervention and then
move to emergency after a certain timeout.
'''
id = MAVLINK_MSG_ID_SYS_STATUS
name = 'SYS_STATUS'
fieldnames = ['onboard_control_sensors_present', 'onboard_control_sensors_enabled', 'onboard_control_sensors_health', 'load', 'voltage_battery', 'current_battery', 'battery_remaining', 'drop_rate_comm', 'errors_comm', 'errors_count1', 'errors_count2', 'errors_count3', 'errors_count4']
ordered_fieldnames = ['onboard_control_sensors_present', 'onboard_control_sensors_enabled', 'onboard_control_sensors_health', 'load', 'voltage_battery', 'current_battery', 'drop_rate_comm', 'errors_comm', 'errors_count1', 'errors_count2', 'errors_count3', 'errors_count4', 'battery_remaining']
fieldtypes = ['uint32_t', 'uint32_t', 'uint32_t', 'uint16_t', 'uint16_t', 'int16_t', 'int8_t', 'uint16_t', 'uint16_t', 'uint16_t', 'uint16_t', 'uint16_t', 'uint16_t']
fielddisplays_by_name = {"onboard_control_sensors_present": "bitmask", "onboard_control_sensors_enabled": "bitmask", "onboard_control_sensors_health": "bitmask"}
fieldenums_by_name = {"onboard_control_sensors_present": "MAV_SYS_STATUS_SENSOR", "onboard_control_sensors_enabled": "MAV_SYS_STATUS_SENSOR", "onboard_control_sensors_health": "MAV_SYS_STATUS_SENSOR"}
fieldunits_by_name = {"load": "d%", "voltage_battery": "mV", "current_battery": "cA", "battery_remaining": "%", "drop_rate_comm": "c%"}
format = '<IIIHHhHHHHHHb'
native_format = bytearray('<IIIHHhHHHHHHb', 'ascii')
orders = [0, 1, 2, 3, 4, 5, 12, 6, 7, 8, 9, 10, 11]
lengths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
crc_extra = 124
unpacker = struct.Struct('<IIIHHhHHHHHHb')
instance_field = None
instance_offset = -1
def __init__(self, onboard_control_sensors_present, onboard_control_sensors_enabled, onboard_control_sensors_health, load, voltage_battery, current_battery, battery_remaining, drop_rate_comm, errors_comm, errors_count1, errors_count2, errors_count3, errors_count4):
MAVLink_message.__init__(self, MAVLink_sys_status_message.id, MAVLink_sys_status_message.name)
self._fieldnames = MAVLink_sys_status_message.fieldnames
self._instance_field = MAVLink_sys_status_message.instance_field
self._instance_offset = MAVLink_sys_status_message.instance_offset
self.onboard_control_sensors_present = onboard_control_sensors_present
self.onboard_control_sensors_enabled = onboard_control_sensors_enabled
self.onboard_control_sensors_health = onboard_control_sensors_health
self.load = load
self.voltage_battery = voltage_battery
self.current_battery = current_battery
self.battery_remaining = battery_remaining
self.drop_rate_comm = drop_rate_comm
self.errors_comm = errors_comm
self.errors_count1 = errors_count1
self.errors_count2 = errors_count2
self.errors_count3 = errors_count3
self.errors_count4 = errors_count4
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 124, struct.pack('<IIIHHhHHHHHHb', self.onboard_control_sensors_present, self.onboard_control_sensors_enabled, self.onboard_control_sensors_health, self.load, self.voltage_battery, self.current_battery, self.drop_rate_comm, self.errors_comm, self.errors_count1, self.errors_count2, self.errors_count3, self.errors_count4, self.battery_remaining), force_mavlink1=force_mavlink1)
class MAVLink_system_time_message(MAVLink_message):
'''
The system time is the time of the master clock, typically the
computer clock of the main onboard computer.
'''
id = MAVLINK_MSG_ID_SYSTEM_TIME
name = 'SYSTEM_TIME'
fieldnames = ['time_unix_usec', 'time_boot_ms']
ordered_fieldnames = ['time_unix_usec', 'time_boot_ms']
fieldtypes = ['uint64_t', 'uint32_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"time_unix_usec": "us", "time_boot_ms": "ms"}
format = '<QI'
native_format = bytearray('<QI', 'ascii')
orders = [0, 1]
lengths = [1, 1]
array_lengths = [0, 0]
crc_extra = 137
unpacker = struct.Struct('<QI')
instance_field = None
instance_offset = -1
def __init__(self, time_unix_usec, time_boot_ms):
MAVLink_message.__init__(self, MAVLink_system_time_message.id, MAVLink_system_time_message.name)
self._fieldnames = MAVLink_system_time_message.fieldnames
self._instance_field = MAVLink_system_time_message.instance_field
self._instance_offset = MAVLink_system_time_message.instance_offset
self.time_unix_usec = time_unix_usec
self.time_boot_ms = time_boot_ms
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 137, struct.pack('<QI', self.time_unix_usec, self.time_boot_ms), force_mavlink1=force_mavlink1)
class MAVLink_ping_message(MAVLink_message):
'''
A ping message either requesting or responding to a ping. This
allows to measure the system latencies, including serial port,
radio modem and UDP connections. The ping microservice is
documented at https://mavlink.io/en/services/ping.html
'''
id = MAVLINK_MSG_ID_PING
name = 'PING'
fieldnames = ['time_usec', 'seq', 'target_system', 'target_component']
ordered_fieldnames = ['time_usec', 'seq', 'target_system', 'target_component']
fieldtypes = ['uint64_t', 'uint32_t', 'uint8_t', 'uint8_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"time_usec": "us"}
format = '<QIBB'
native_format = bytearray('<QIBB', 'ascii')
orders = [0, 1, 2, 3]
lengths = [1, 1, 1, 1]
array_lengths = [0, 0, 0, 0]
crc_extra = 237
unpacker = struct.Struct('<QIBB')
instance_field = None
instance_offset = -1
def __init__(self, time_usec, seq, target_system, target_component):
MAVLink_message.__init__(self, MAVLink_ping_message.id, MAVLink_ping_message.name)
self._fieldnames = MAVLink_ping_message.fieldnames
self._instance_field = MAVLink_ping_message.instance_field
self._instance_offset = MAVLink_ping_message.instance_offset
self.time_usec = time_usec
self.seq = seq
self.target_system = target_system
self.target_component = target_component
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 237, struct.pack('<QIBB', self.time_usec, self.seq, self.target_system, self.target_component), force_mavlink1=force_mavlink1)
class MAVLink_change_operator_control_message(MAVLink_message):
'''
Request to control this MAV
'''
id = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL
name = 'CHANGE_OPERATOR_CONTROL'
fieldnames = ['target_system', 'control_request', 'version', 'passkey']
ordered_fieldnames = ['target_system', 'control_request', 'version', 'passkey']
fieldtypes = ['uint8_t', 'uint8_t', 'uint8_t', 'char']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"version": "rad"}
format = '<BBB25s'
native_format = bytearray('<BBBc', 'ascii')
orders = [0, 1, 2, 3]
lengths = [1, 1, 1, 1]
array_lengths = [0, 0, 0, 25]
crc_extra = 217
unpacker = struct.Struct('<BBB25s')
instance_field = None
instance_offset = -1
def __init__(self, target_system, control_request, version, passkey):
MAVLink_message.__init__(self, MAVLink_change_operator_control_message.id, MAVLink_change_operator_control_message.name)
self._fieldnames = MAVLink_change_operator_control_message.fieldnames
self._instance_field = MAVLink_change_operator_control_message.instance_field
self._instance_offset = MAVLink_change_operator_control_message.instance_offset
self.target_system = target_system
self.control_request = control_request
self.version = version
self.passkey = passkey
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 217, struct.pack('<BBB25s', self.target_system, self.control_request, self.version, self.passkey), force_mavlink1=force_mavlink1)
class MAVLink_change_operator_control_ack_message(MAVLink_message):
'''
Accept / deny control of this MAV
'''
id = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK
name = 'CHANGE_OPERATOR_CONTROL_ACK'
fieldnames = ['gcs_system_id', 'control_request', 'ack']
ordered_fieldnames = ['gcs_system_id', 'control_request', 'ack']
fieldtypes = ['uint8_t', 'uint8_t', 'uint8_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {}
format = '<BBB'
native_format = bytearray('<BBB', 'ascii')
orders = [0, 1, 2]
lengths = [1, 1, 1]
array_lengths = [0, 0, 0]
crc_extra = 104
unpacker = struct.Struct('<BBB')
instance_field = None
instance_offset = -1
def __init__(self, gcs_system_id, control_request, ack):
MAVLink_message.__init__(self, MAVLink_change_operator_control_ack_message.id, MAVLink_change_operator_control_ack_message.name)
self._fieldnames = MAVLink_change_operator_control_ack_message.fieldnames
self._instance_field = MAVLink_change_operator_control_ack_message.instance_field
self._instance_offset = MAVLink_change_operator_control_ack_message.instance_offset
self.gcs_system_id = gcs_system_id
self.control_request = control_request
self.ack = ack
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 104, struct.pack('<BBB', self.gcs_system_id, self.control_request, self.ack), force_mavlink1=force_mavlink1)
class MAVLink_auth_key_message(MAVLink_message):
'''
Emit an encrypted signature / key identifying this system.
PLEASE NOTE: This protocol has been kept simple, so
transmitting the key requires an encrypted channel for true
safety.
'''
id = MAVLINK_MSG_ID_AUTH_KEY
name = 'AUTH_KEY'
fieldnames = ['key']
ordered_fieldnames = ['key']
fieldtypes = ['char']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {}
format = '<32s'
native_format = bytearray('<c', 'ascii')
orders = [0]
lengths = [1]
array_lengths = [32]
crc_extra = 119
unpacker = struct.Struct('<32s')
instance_field = None
instance_offset = -1
def __init__(self, key):
MAVLink_message.__init__(self, MAVLink_auth_key_message.id, MAVLink_auth_key_message.name)
self._fieldnames = MAVLink_auth_key_message.fieldnames
self._instance_field = MAVLink_auth_key_message.instance_field
self._instance_offset = MAVLink_auth_key_message.instance_offset
self.key = key
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 119, struct.pack('<32s', self.key), force_mavlink1=force_mavlink1)
class MAVLink_set_mode_message(MAVLink_message):
'''
Set the system mode, as defined by enum MAV_MODE. There is no
target component id as the mode is by definition for the
overall aircraft, not only for one component.
'''
id = MAVLINK_MSG_ID_SET_MODE
name = 'SET_MODE'
fieldnames = ['target_system', 'base_mode', 'custom_mode']
ordered_fieldnames = ['custom_mode', 'target_system', 'base_mode']
fieldtypes = ['uint8_t', 'uint8_t', 'uint32_t']
fielddisplays_by_name = {}
fieldenums_by_name = {"base_mode": "MAV_MODE"}
fieldunits_by_name = {}
format = '<IBB'
native_format = bytearray('<IBB', 'ascii')
orders = [1, 2, 0]
lengths = [1, 1, 1]
array_lengths = [0, 0, 0]
crc_extra = 89
unpacker = struct.Struct('<IBB')
instance_field = None
instance_offset = -1
def __init__(self, target_system, base_mode, custom_mode):
MAVLink_message.__init__(self, MAVLink_set_mode_message.id, MAVLink_set_mode_message.name)
self._fieldnames = MAVLink_set_mode_message.fieldnames
self._instance_field = MAVLink_set_mode_message.instance_field
self._instance_offset = MAVLink_set_mode_message.instance_offset
self.target_system = target_system
self.base_mode = base_mode
self.custom_mode = custom_mode
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 89, struct.pack('<IBB', self.custom_mode, self.target_system, self.base_mode), force_mavlink1=force_mavlink1)
class MAVLink_param_request_read_message(MAVLink_message):
'''
Request to read the onboard parameter with the param_id string
id. Onboard parameters are stored as key[const char*] ->
value[float]. This allows to send a parameter to any other
component (such as the GCS) without the need of previous
knowledge of possible parameter names. Thus the same GCS can
store different parameters for different autopilots. See also
https://mavlink.io/en/services/parameter.html for a full
documentation of QGroundControl and IMU code.
'''
id = MAVLINK_MSG_ID_PARAM_REQUEST_READ
name = 'PARAM_REQUEST_READ'
fieldnames = ['target_system', 'target_component', 'param_id', 'param_index']
ordered_fieldnames = ['param_index', 'target_system', 'target_component', 'param_id']
fieldtypes = ['uint8_t', 'uint8_t', 'char', 'int16_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {}
format = '<hBB16s'
native_format = bytearray('<hBBc', 'ascii')
orders = [1, 2, 3, 0]
lengths = [1, 1, 1, 1]
array_lengths = [0, 0, 0, 16]
crc_extra = 214
unpacker = struct.Struct('<hBB16s')
instance_field = None
instance_offset = -1
def __init__(self, target_system, target_component, param_id, param_index):
MAVLink_message.__init__(self, MAVLink_param_request_read_message.id, MAVLink_param_request_read_message.name)
self._fieldnames = MAVLink_param_request_read_message.fieldnames
self._instance_field = MAVLink_param_request_read_message.instance_field
self._instance_offset = MAVLink_param_request_read_message.instance_offset
self.target_system = target_system
self.target_component = target_component
self.param_id = param_id
self.param_index = param_index
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 214, struct.pack('<hBB16s', self.param_index, self.target_system, self.target_component, self.param_id), force_mavlink1=force_mavlink1)
class MAVLink_param_request_list_message(MAVLink_message):
'''
Request all parameters of this component. After this request,
all parameters are emitted. The parameter microservice is
documented at https://mavlink.io/en/services/parameter.html
'''
id = MAVLINK_MSG_ID_PARAM_REQUEST_LIST
name = 'PARAM_REQUEST_LIST'
fieldnames = ['target_system', 'target_component']
ordered_fieldnames = ['target_system', 'target_component']
fieldtypes = ['uint8_t', 'uint8_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {}
format = '<BB'
native_format = bytearray('<BB', 'ascii')
orders = [0, 1]
lengths = [1, 1]
array_lengths = [0, 0]
crc_extra = 159
unpacker = struct.Struct('<BB')
instance_field = None
instance_offset = -1
def __init__(self, target_system, target_component):
MAVLink_message.__init__(self, MAVLink_param_request_list_message.id, MAVLink_param_request_list_message.name)
self._fieldnames = MAVLink_param_request_list_message.fieldnames
self._instance_field = MAVLink_param_request_list_message.instance_field
self._instance_offset = MAVLink_param_request_list_message.instance_offset
self.target_system = target_system
self.target_component = target_component
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 159, struct.pack('<BB', self.target_system, self.target_component), force_mavlink1=force_mavlink1)
class MAVLink_param_value_message(MAVLink_message):
'''
Emit the value of a onboard parameter. The inclusion of
param_count and param_index in the message allows the
recipient to keep track of received parameters and allows him
to re-request missing parameters after a loss or timeout. The
parameter microservice is documented at
https://mavlink.io/en/services/parameter.html
'''
id = MAVLINK_MSG_ID_PARAM_VALUE
name = 'PARAM_VALUE'
fieldnames = ['param_id', 'param_value', 'param_type', 'param_count', 'param_index']
ordered_fieldnames = ['param_value', 'param_count', 'param_index', 'param_id', 'param_type']
fieldtypes = ['char', 'float', 'uint8_t', 'uint16_t', 'uint16_t']
fielddisplays_by_name = {}
fieldenums_by_name = {"param_type": "MAV_PARAM_TYPE"}
fieldunits_by_name = {}
format = '<fHH16sB'
native_format = bytearray('<fHHcB', 'ascii')
orders = [3, 0, 4, 1, 2]
lengths = [1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 16, 0]
crc_extra = 220
unpacker = struct.Struct('<fHH16sB')
instance_field = None
instance_offset = -1
def __init__(self, param_id, param_value, param_type, param_count, param_index):
MAVLink_message.__init__(self, MAVLink_param_value_message.id, MAVLink_param_value_message.name)
self._fieldnames = MAVLink_param_value_message.fieldnames
self._instance_field = MAVLink_param_value_message.instance_field
self._instance_offset = MAVLink_param_value_message.instance_offset
self.param_id = param_id
self.param_value = param_value
self.param_type = param_type
self.param_count = param_count
self.param_index = param_index
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 220, struct.pack('<fHH16sB', self.param_value, self.param_count, self.param_index, self.param_id, self.param_type), force_mavlink1=force_mavlink1)
class MAVLink_param_set_message(MAVLink_message):
'''
Set a parameter value (write new value to permanent storage).
IMPORTANT: The receiving component should acknowledge the new
parameter value by sending a PARAM_VALUE message to all
communication partners. This will also ensure that multiple
GCS all have an up-to-date list of all parameters. If the
sending GCS did not receive a PARAM_VALUE message within its
timeout time, it should re-send the PARAM_SET message. The
parameter microservice is documented at
https://mavlink.io/en/services/parameter.html
'''
id = MAVLINK_MSG_ID_PARAM_SET
name = 'PARAM_SET'
fieldnames = ['target_system', 'target_component', 'param_id', 'param_value', 'param_type']
ordered_fieldnames = ['param_value', 'target_system', 'target_component', 'param_id', 'param_type']
fieldtypes = ['uint8_t', 'uint8_t', 'char', 'float', 'uint8_t']
fielddisplays_by_name = {}
fieldenums_by_name = {"param_type": "MAV_PARAM_TYPE"}
fieldunits_by_name = {}
format = '<fBB16sB'
native_format = bytearray('<fBBcB', 'ascii')
orders = [1, 2, 3, 0, 4]
lengths = [1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 16, 0]
crc_extra = 168
unpacker = struct.Struct('<fBB16sB')
instance_field = None
instance_offset = -1
def __init__(self, target_system, target_component, param_id, param_value, param_type):
MAVLink_message.__init__(self, MAVLink_param_set_message.id, MAVLink_param_set_message.name)
self._fieldnames = MAVLink_param_set_message.fieldnames
self._instance_field = MAVLink_param_set_message.instance_field
self._instance_offset = MAVLink_param_set_message.instance_offset
self.target_system = target_system
self.target_component = target_component
self.param_id = param_id
self.param_value = param_value
self.param_type = param_type
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 168, struct.pack('<fBB16sB', self.param_value, self.target_system, self.target_component, self.param_id, self.param_type), force_mavlink1=force_mavlink1)
class MAVLink_gps_raw_int_message(MAVLink_message):
'''
The global position, as returned by the Global Positioning
System (GPS). This is NOT the global position
estimate of the system, but rather a RAW sensor value. See
message GLOBAL_POSITION for the global position estimate.
'''
id = MAVLINK_MSG_ID_GPS_RAW_INT
name = 'GPS_RAW_INT'
fieldnames = ['time_usec', 'fix_type', 'lat', 'lon', 'alt', 'eph', 'epv', 'vel', 'cog', 'satellites_visible']
ordered_fieldnames = ['time_usec', 'lat', 'lon', 'alt', 'eph', 'epv', 'vel', 'cog', 'fix_type', 'satellites_visible']
fieldtypes = ['uint64_t', 'uint8_t', 'int32_t', 'int32_t', 'int32_t', 'uint16_t', 'uint16_t', 'uint16_t', 'uint16_t', 'uint8_t']
fielddisplays_by_name = {}
fieldenums_by_name = {"fix_type": "GPS_FIX_TYPE"}
fieldunits_by_name = {"time_usec": "us", "lat": "degE7", "lon": "degE7", "alt": "mm", "vel": "cm/s", "cog": "cdeg"}
format = '<QiiiHHHHBB'
native_format = bytearray('<QiiiHHHHBB', 'ascii')
orders = [0, 8, 1, 2, 3, 4, 5, 6, 7, 9]
lengths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
crc_extra = 24
unpacker = struct.Struct('<QiiiHHHHBB')
instance_field = None
instance_offset = -1
def __init__(self, time_usec, fix_type, lat, lon, alt, eph, epv, vel, cog, satellites_visible):
MAVLink_message.__init__(self, MAVLink_gps_raw_int_message.id, MAVLink_gps_raw_int_message.name)
self._fieldnames = MAVLink_gps_raw_int_message.fieldnames
self._instance_field = MAVLink_gps_raw_int_message.instance_field
self._instance_offset = MAVLink_gps_raw_int_message.instance_offset
self.time_usec = time_usec
self.fix_type = fix_type
self.lat = lat
self.lon = lon
self.alt = alt
self.eph = eph
self.epv = epv
self.vel = vel
self.cog = cog
self.satellites_visible = satellites_visible
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 24, struct.pack('<QiiiHHHHBB', self.time_usec, self.lat, self.lon, self.alt, self.eph, self.epv, self.vel, self.cog, self.fix_type, self.satellites_visible), force_mavlink1=force_mavlink1)
class MAVLink_gps_status_message(MAVLink_message):
'''
The positioning status, as reported by GPS. This message is
intended to display status information about each satellite
visible to the receiver. See message GLOBAL_POSITION for the
global position estimate. This message can contain information
for up to 20 satellites.
'''
id = MAVLINK_MSG_ID_GPS_STATUS
name = 'GPS_STATUS'
fieldnames = ['satellites_visible', 'satellite_prn', 'satellite_used', 'satellite_elevation', 'satellite_azimuth', 'satellite_snr']
ordered_fieldnames = ['satellites_visible', 'satellite_prn', 'satellite_used', 'satellite_elevation', 'satellite_azimuth', 'satellite_snr']
fieldtypes = ['uint8_t', 'uint8_t', 'uint8_t', 'uint8_t', 'uint8_t', 'uint8_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"satellite_elevation": "deg", "satellite_azimuth": "deg", "satellite_snr": "dB"}
format = '<B20B20B20B20B20B'
native_format = bytearray('<BBBBBB', 'ascii')
orders = [0, 1, 2, 3, 4, 5]
lengths = [1, 20, 20, 20, 20, 20]
array_lengths = [0, 20, 20, 20, 20, 20]
crc_extra = 23
unpacker = struct.Struct('<B20B20B20B20B20B')
instance_field = None
instance_offset = -1
def __init__(self, satellites_visible, satellite_prn, satellite_used, satellite_elevation, satellite_azimuth, satellite_snr):
MAVLink_message.__init__(self, MAVLink_gps_status_message.id, MAVLink_gps_status_message.name)
self._fieldnames = MAVLink_gps_status_message.fieldnames
self._instance_field = MAVLink_gps_status_message.instance_field
self._instance_offset = MAVLink_gps_status_message.instance_offset
self.satellites_visible = satellites_visible
self.satellite_prn = satellite_prn
self.satellite_used = satellite_used
self.satellite_elevation = satellite_elevation
self.satellite_azimuth = satellite_azimuth
self.satellite_snr = satellite_snr
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 23, struct.pack('<B20B20B20B20B20B', self.satellites_visible, self.satellite_prn[0], self.satellite_prn[1], self.satellite_prn[2], self.satellite_prn[3], self.satellite_prn[4], self.satellite_prn[5], self.satellite_prn[6], self.satellite_prn[7], self.satellite_prn[8], self.satellite_prn[9], self.satellite_prn[10], self.satellite_prn[11], self.satellite_prn[12], self.satellite_prn[13], self.satellite_prn[14], self.satellite_prn[15], self.satellite_prn[16], self.satellite_prn[17], self.satellite_prn[18], self.satellite_prn[19], self.satellite_used[0], self.satellite_used[1], self.satellite_used[2], self.satellite_used[3], self.satellite_used[4], self.satellite_used[5], self.satellite_used[6], self.satellite_used[7], self.satellite_used[8], self.satellite_used[9], self.satellite_used[10], self.satellite_used[11], self.satellite_used[12], self.satellite_used[13], self.satellite_used[14], self.satellite_used[15], self.satellite_used[16], self.satellite_used[17], self.satellite_used[18], self.satellite_used[19], self.satellite_elevation[0], self.satellite_elevation[1], self.satellite_elevation[2], self.satellite_elevation[3], self.satellite_elevation[4], self.satellite_elevation[5], self.satellite_elevation[6], self.satellite_elevation[7], self.satellite_elevation[8], self.satellite_elevation[9], self.satellite_elevation[10], self.satellite_elevation[11], self.satellite_elevation[12], self.satellite_elevation[13], self.satellite_elevation[14], self.satellite_elevation[15], self.satellite_elevation[16], self.satellite_elevation[17], self.satellite_elevation[18], self.satellite_elevation[19], self.satellite_azimuth[0], self.satellite_azimuth[1], self.satellite_azimuth[2], self.satellite_azimuth[3], self.satellite_azimuth[4], self.satellite_azimuth[5], self.satellite_azimuth[6], self.satellite_azimuth[7], self.satellite_azimuth[8], self.satellite_azimuth[9], self.satellite_azimuth[10], self.satellite_azimuth[11], self.satellite_azimuth[12], self.satellite_azimuth[13], self.satellite_azimuth[14], self.satellite_azimuth[15], self.satellite_azimuth[16], self.satellite_azimuth[17], self.satellite_azimuth[18], self.satellite_azimuth[19], self.satellite_snr[0], self.satellite_snr[1], self.satellite_snr[2], self.satellite_snr[3], self.satellite_snr[4], self.satellite_snr[5], self.satellite_snr[6], self.satellite_snr[7], self.satellite_snr[8], self.satellite_snr[9], self.satellite_snr[10], self.satellite_snr[11], self.satellite_snr[12], self.satellite_snr[13], self.satellite_snr[14], self.satellite_snr[15], self.satellite_snr[16], self.satellite_snr[17], self.satellite_snr[18], self.satellite_snr[19]), force_mavlink1=force_mavlink1)
class MAVLink_scaled_imu_message(MAVLink_message):
'''
The RAW IMU readings for the usual 9DOF sensor setup. This
message should contain the scaled values to the described
units
'''
id = MAVLINK_MSG_ID_SCALED_IMU
name = 'SCALED_IMU'
fieldnames = ['time_boot_ms', 'xacc', 'yacc', 'zacc', 'xgyro', 'ygyro', 'zgyro', 'xmag', 'ymag', 'zmag']
ordered_fieldnames = ['time_boot_ms', 'xacc', 'yacc', 'zacc', 'xgyro', 'ygyro', 'zgyro', 'xmag', 'ymag', 'zmag']
fieldtypes = ['uint32_t', 'int16_t', 'int16_t', 'int16_t', 'int16_t', 'int16_t', 'int16_t', 'int16_t', 'int16_t', 'int16_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"time_boot_ms": "ms", "xacc": "mG", "yacc": "mG", "zacc": "mG", "xgyro": "mrad/s", "ygyro": "mrad/s", "zgyro": "mrad/s", "xmag": "mgauss", "ymag": "mgauss", "zmag": "mgauss"}
format = '<Ihhhhhhhhh'
native_format = bytearray('<Ihhhhhhhhh', 'ascii')
orders = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
lengths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
crc_extra = 170
unpacker = struct.Struct('<Ihhhhhhhhh')
instance_field = None
instance_offset = -1
def __init__(self, time_boot_ms, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag):
MAVLink_message.__init__(self, MAVLink_scaled_imu_message.id, MAVLink_scaled_imu_message.name)
self._fieldnames = MAVLink_scaled_imu_message.fieldnames
self._instance_field = MAVLink_scaled_imu_message.instance_field
self._instance_offset = MAVLink_scaled_imu_message.instance_offset
self.time_boot_ms = time_boot_ms
self.xacc = xacc
self.yacc = yacc
self.zacc = zacc
self.xgyro = xgyro
self.ygyro = ygyro
self.zgyro = zgyro
self.xmag = xmag
self.ymag = ymag
self.zmag = zmag
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 170, struct.pack('<Ihhhhhhhhh', self.time_boot_ms, self.xacc, self.yacc, self.zacc, self.xgyro, self.ygyro, self.zgyro, self.xmag, self.ymag, self.zmag), force_mavlink1=force_mavlink1)
class MAVLink_raw_imu_message(MAVLink_message):
'''
The RAW IMU readings for a 9DOF sensor, which is identified by
the id (default IMU1). This message should always contain the
true raw values without any scaling to allow data capture and
system debugging.
'''
id = MAVLINK_MSG_ID_RAW_IMU
name = 'RAW_IMU'
fieldnames = ['time_usec', 'xacc', 'yacc', 'zacc', 'xgyro', 'ygyro', 'zgyro', 'xmag', 'ymag', 'zmag']
ordered_fieldnames = ['time_usec', 'xacc', 'yacc', 'zacc', 'xgyro', 'ygyro', 'zgyro', 'xmag', 'ymag', 'zmag']
fieldtypes = ['uint64_t', 'int16_t', 'int16_t', 'int16_t', 'int16_t', 'int16_t', 'int16_t', 'int16_t', 'int16_t', 'int16_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"time_usec": "us"}
format = '<Qhhhhhhhhh'
native_format = bytearray('<Qhhhhhhhhh', 'ascii')
orders = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
lengths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
crc_extra = 144
unpacker = struct.Struct('<Qhhhhhhhhh')
instance_field = None
instance_offset = -1
def __init__(self, time_usec, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag):
MAVLink_message.__init__(self, MAVLink_raw_imu_message.id, MAVLink_raw_imu_message.name)
self._fieldnames = MAVLink_raw_imu_message.fieldnames
self._instance_field = MAVLink_raw_imu_message.instance_field
self._instance_offset = MAVLink_raw_imu_message.instance_offset
self.time_usec = time_usec
self.xacc = xacc
self.yacc = yacc
self.zacc = zacc
self.xgyro = xgyro
self.ygyro = ygyro
self.zgyro = zgyro
self.xmag = xmag
self.ymag = ymag
self.zmag = zmag
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 144, struct.pack('<Qhhhhhhhhh', self.time_usec, self.xacc, self.yacc, self.zacc, self.xgyro, self.ygyro, self.zgyro, self.xmag, self.ymag, self.zmag), force_mavlink1=force_mavlink1)
class MAVLink_raw_pressure_message(MAVLink_message):
'''
The RAW pressure readings for the typical setup of one
absolute pressure and one differential pressure sensor. The
sensor values should be the raw, UNSCALED ADC values.
'''
id = MAVLINK_MSG_ID_RAW_PRESSURE
name = 'RAW_PRESSURE'
fieldnames = ['time_usec', 'press_abs', 'press_diff1', 'press_diff2', 'temperature']
ordered_fieldnames = ['time_usec', 'press_abs', 'press_diff1', 'press_diff2', 'temperature']
fieldtypes = ['uint64_t', 'int16_t', 'int16_t', 'int16_t', 'int16_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"time_usec": "us"}
format = '<Qhhhh'
native_format = bytearray('<Qhhhh', 'ascii')
orders = [0, 1, 2, 3, 4]
lengths = [1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0]
crc_extra = 67
unpacker = struct.Struct('<Qhhhh')
instance_field = None
instance_offset = -1
def __init__(self, time_usec, press_abs, press_diff1, press_diff2, temperature):
MAVLink_message.__init__(self, MAVLink_raw_pressure_message.id, MAVLink_raw_pressure_message.name)
self._fieldnames = MAVLink_raw_pressure_message.fieldnames
self._instance_field = MAVLink_raw_pressure_message.instance_field
self._instance_offset = MAVLink_raw_pressure_message.instance_offset
self.time_usec = time_usec
self.press_abs = press_abs
self.press_diff1 = press_diff1
self.press_diff2 = press_diff2
self.temperature = temperature
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 67, struct.pack('<Qhhhh', self.time_usec, self.press_abs, self.press_diff1, self.press_diff2, self.temperature), force_mavlink1=force_mavlink1)
class MAVLink_scaled_pressure_message(MAVLink_message):
'''
The pressure readings for the typical setup of one absolute
and differential pressure sensor. The units are as specified
in each field.
'''
id = MAVLINK_MSG_ID_SCALED_PRESSURE
name = 'SCALED_PRESSURE'
fieldnames = ['time_boot_ms', 'press_abs', 'press_diff', 'temperature']
ordered_fieldnames = ['time_boot_ms', 'press_abs', 'press_diff', 'temperature']
fieldtypes = ['uint32_t', 'float', 'float', 'int16_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"time_boot_ms": "ms", "press_abs": "hPa", "press_diff": "hPa", "temperature": "cdegC"}
format = '<Iffh'
native_format = bytearray('<Iffh', 'ascii')
orders = [0, 1, 2, 3]
lengths = [1, 1, 1, 1]
array_lengths = [0, 0, 0, 0]
crc_extra = 115
unpacker = struct.Struct('<Iffh')
instance_field = None
instance_offset = -1
def __init__(self, time_boot_ms, press_abs, press_diff, temperature):
MAVLink_message.__init__(self, MAVLink_scaled_pressure_message.id, MAVLink_scaled_pressure_message.name)
self._fieldnames = MAVLink_scaled_pressure_message.fieldnames
self._instance_field = MAVLink_scaled_pressure_message.instance_field
self._instance_offset = MAVLink_scaled_pressure_message.instance_offset
self.time_boot_ms = time_boot_ms
self.press_abs = press_abs
self.press_diff = press_diff
self.temperature = temperature
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 115, struct.pack('<Iffh', self.time_boot_ms, self.press_abs, self.press_diff, self.temperature), force_mavlink1=force_mavlink1)
class MAVLink_attitude_message(MAVLink_message):
'''
The attitude in the aeronautical frame (right-handed, Z-down,
X-front, Y-right).
'''
id = MAVLINK_MSG_ID_ATTITUDE
name = 'ATTITUDE'
fieldnames = ['time_boot_ms', 'roll', 'pitch', 'yaw', 'rollspeed', 'pitchspeed', 'yawspeed']
ordered_fieldnames = ['time_boot_ms', 'roll', 'pitch', 'yaw', 'rollspeed', 'pitchspeed', 'yawspeed']
fieldtypes = ['uint32_t', 'float', 'float', 'float', 'float', 'float', 'float']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"time_boot_ms": "ms", "roll": "rad", "pitch": "rad", "yaw": "rad", "rollspeed": "rad/s", "pitchspeed": "rad/s", "yawspeed": "rad/s"}
format = '<Iffffff'
native_format = bytearray('<Iffffff', 'ascii')
orders = [0, 1, 2, 3, 4, 5, 6]
lengths = [1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0]
crc_extra = 39
unpacker = struct.Struct('<Iffffff')
instance_field = None
instance_offset = -1
def __init__(self, time_boot_ms, roll, pitch, yaw, rollspeed, pitchspeed, yawspeed):
MAVLink_message.__init__(self, MAVLink_attitude_message.id, MAVLink_attitude_message.name)
self._fieldnames = MAVLink_attitude_message.fieldnames
self._instance_field = MAVLink_attitude_message.instance_field
self._instance_offset = MAVLink_attitude_message.instance_offset
self.time_boot_ms = time_boot_ms
self.roll = roll
self.pitch = pitch
self.yaw = yaw
self.rollspeed = rollspeed
self.pitchspeed = pitchspeed
self.yawspeed = yawspeed
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 39, struct.pack('<Iffffff', self.time_boot_ms, self.roll, self.pitch, self.yaw, self.rollspeed, self.pitchspeed, self.yawspeed), force_mavlink1=force_mavlink1)
class MAVLink_attitude_quaternion_message(MAVLink_message):
'''
The attitude in the aeronautical frame (right-handed, Z-down,
X-front, Y-right), expressed as quaternion. Quaternion order
is w, x, y, z and a zero rotation would be expressed as (1 0 0
0).
'''
id = MAVLINK_MSG_ID_ATTITUDE_QUATERNION
name = 'ATTITUDE_QUATERNION'
fieldnames = ['time_boot_ms', 'q1', 'q2', 'q3', 'q4', 'rollspeed', 'pitchspeed', 'yawspeed']
ordered_fieldnames = ['time_boot_ms', 'q1', 'q2', 'q3', 'q4', 'rollspeed', 'pitchspeed', 'yawspeed']
fieldtypes = ['uint32_t', 'float', 'float', 'float', 'float', 'float', 'float', 'float']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"time_boot_ms": "ms", "rollspeed": "rad/s", "pitchspeed": "rad/s", "yawspeed": "rad/s"}
format = '<Ifffffff'
native_format = bytearray('<Ifffffff', 'ascii')
orders = [0, 1, 2, 3, 4, 5, 6, 7]
lengths = [1, 1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0, 0]
crc_extra = 246
unpacker = struct.Struct('<Ifffffff')
instance_field = None
instance_offset = -1
def __init__(self, time_boot_ms, q1, q2, q3, q4, rollspeed, pitchspeed, yawspeed):
MAVLink_message.__init__(self, MAVLink_attitude_quaternion_message.id, MAVLink_attitude_quaternion_message.name)
self._fieldnames = MAVLink_attitude_quaternion_message.fieldnames
self._instance_field = MAVLink_attitude_quaternion_message.instance_field
self._instance_offset = MAVLink_attitude_quaternion_message.instance_offset
self.time_boot_ms = time_boot_ms
self.q1 = q1
self.q2 = q2
self.q3 = q3
self.q4 = q4
self.rollspeed = rollspeed
self.pitchspeed = pitchspeed
self.yawspeed = yawspeed
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 246, struct.pack('<Ifffffff', self.time_boot_ms, self.q1, self.q2, self.q3, self.q4, self.rollspeed, self.pitchspeed, self.yawspeed), force_mavlink1=force_mavlink1)
class MAVLink_local_position_ned_message(MAVLink_message):
'''
The filtered local position (e.g. fused computer vision and
accelerometers). Coordinate frame is right-handed, Z-axis down
(aeronautical frame, NED / north-east-down convention)
'''
id = MAVLINK_MSG_ID_LOCAL_POSITION_NED
name = 'LOCAL_POSITION_NED'
fieldnames = ['time_boot_ms', 'x', 'y', 'z', 'vx', 'vy', 'vz']
ordered_fieldnames = ['time_boot_ms', 'x', 'y', 'z', 'vx', 'vy', 'vz']
fieldtypes = ['uint32_t', 'float', 'float', 'float', 'float', 'float', 'float']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"time_boot_ms": "ms", "x": "m", "y": "m", "z": "m", "vx": "m/s", "vy": "m/s", "vz": "m/s"}
format = '<Iffffff'
native_format = bytearray('<Iffffff', 'ascii')
orders = [0, 1, 2, 3, 4, 5, 6]
lengths = [1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0]
crc_extra = 185
unpacker = struct.Struct('<Iffffff')
instance_field = None
instance_offset = -1
def __init__(self, time_boot_ms, x, y, z, vx, vy, vz):
MAVLink_message.__init__(self, MAVLink_local_position_ned_message.id, MAVLink_local_position_ned_message.name)
self._fieldnames = MAVLink_local_position_ned_message.fieldnames
self._instance_field = MAVLink_local_position_ned_message.instance_field
self._instance_offset = MAVLink_local_position_ned_message.instance_offset
self.time_boot_ms = time_boot_ms
self.x = x
self.y = y
self.z = z
self.vx = vx
self.vy = vy
self.vz = vz
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 185, struct.pack('<Iffffff', self.time_boot_ms, self.x, self.y, self.z, self.vx, self.vy, self.vz), force_mavlink1=force_mavlink1)
class MAVLink_global_position_int_message(MAVLink_message):
'''
The filtered global position (e.g. fused GPS and
accelerometers). The position is in GPS-frame (right-handed,
Z-up). It is designed as scaled integer message
since the resolution of float is not sufficient.
'''
id = MAVLINK_MSG_ID_GLOBAL_POSITION_INT
name = 'GLOBAL_POSITION_INT'
fieldnames = ['time_boot_ms', 'lat', 'lon', 'alt', 'relative_alt', 'vx', 'vy', 'vz', 'hdg']
ordered_fieldnames = ['time_boot_ms', 'lat', 'lon', 'alt', 'relative_alt', 'vx', 'vy', 'vz', 'hdg']
fieldtypes = ['uint32_t', 'int32_t', 'int32_t', 'int32_t', 'int32_t', 'int16_t', 'int16_t', 'int16_t', 'uint16_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"time_boot_ms": "ms", "lat": "degE7", "lon": "degE7", "alt": "mm", "relative_alt": "mm", "vx": "cm/s", "vy": "cm/s", "vz": "cm/s", "hdg": "cdeg"}
format = '<IiiiihhhH'
native_format = bytearray('<IiiiihhhH', 'ascii')
orders = [0, 1, 2, 3, 4, 5, 6, 7, 8]
lengths = [1, 1, 1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0, 0, 0]
crc_extra = 104
unpacker = struct.Struct('<IiiiihhhH')
instance_field = None
instance_offset = -1
def __init__(self, time_boot_ms, lat, lon, alt, relative_alt, vx, vy, vz, hdg):
MAVLink_message.__init__(self, MAVLink_global_position_int_message.id, MAVLink_global_position_int_message.name)
self._fieldnames = MAVLink_global_position_int_message.fieldnames
self._instance_field = MAVLink_global_position_int_message.instance_field
self._instance_offset = MAVLink_global_position_int_message.instance_offset
self.time_boot_ms = time_boot_ms
self.lat = lat
self.lon = lon
self.alt = alt
self.relative_alt = relative_alt
self.vx = vx
self.vy = vy
self.vz = vz
self.hdg = hdg
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 104, struct.pack('<IiiiihhhH', self.time_boot_ms, self.lat, self.lon, self.alt, self.relative_alt, self.vx, self.vy, self.vz, self.hdg), force_mavlink1=force_mavlink1)
class MAVLink_rc_channels_scaled_message(MAVLink_message):
'''
The scaled values of the RC channels received: (-100%) -10000,
(0%) 0, (100%) 10000. Channels that are inactive should be set
to UINT16_MAX.
'''
id = MAVLINK_MSG_ID_RC_CHANNELS_SCALED
name = 'RC_CHANNELS_SCALED'
fieldnames = ['time_boot_ms', 'port', 'chan1_scaled', 'chan2_scaled', 'chan3_scaled', 'chan4_scaled', 'chan5_scaled', 'chan6_scaled', 'chan7_scaled', 'chan8_scaled', 'rssi']
ordered_fieldnames = ['time_boot_ms', 'chan1_scaled', 'chan2_scaled', 'chan3_scaled', 'chan4_scaled', 'chan5_scaled', 'chan6_scaled', 'chan7_scaled', 'chan8_scaled', 'port', 'rssi']
fieldtypes = ['uint32_t', 'uint8_t', 'int16_t', 'int16_t', 'int16_t', 'int16_t', 'int16_t', 'int16_t', 'int16_t', 'int16_t', 'uint8_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"time_boot_ms": "ms"}
format = '<IhhhhhhhhBB'
native_format = bytearray('<IhhhhhhhhBB', 'ascii')
orders = [0, 9, 1, 2, 3, 4, 5, 6, 7, 8, 10]
lengths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
crc_extra = 237
unpacker = struct.Struct('<IhhhhhhhhBB')
instance_field = None
instance_offset = -1
def __init__(self, time_boot_ms, port, chan1_scaled, chan2_scaled, chan3_scaled, chan4_scaled, chan5_scaled, chan6_scaled, chan7_scaled, chan8_scaled, rssi):
MAVLink_message.__init__(self, MAVLink_rc_channels_scaled_message.id, MAVLink_rc_channels_scaled_message.name)
self._fieldnames = MAVLink_rc_channels_scaled_message.fieldnames
self._instance_field = MAVLink_rc_channels_scaled_message.instance_field
self._instance_offset = MAVLink_rc_channels_scaled_message.instance_offset
self.time_boot_ms = time_boot_ms
self.port = port
self.chan1_scaled = chan1_scaled
self.chan2_scaled = chan2_scaled
self.chan3_scaled = chan3_scaled
self.chan4_scaled = chan4_scaled
self.chan5_scaled = chan5_scaled
self.chan6_scaled = chan6_scaled
self.chan7_scaled = chan7_scaled
self.chan8_scaled = chan8_scaled
self.rssi = rssi
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 237, struct.pack('<IhhhhhhhhBB', self.time_boot_ms, self.chan1_scaled, self.chan2_scaled, self.chan3_scaled, self.chan4_scaled, self.chan5_scaled, self.chan6_scaled, self.chan7_scaled, self.chan8_scaled, self.port, self.rssi), force_mavlink1=force_mavlink1)
class MAVLink_rc_channels_raw_message(MAVLink_message):
'''
The RAW values of the RC channels received. The standard PPM
modulation is as follows: 1000 microseconds: 0%, 2000
microseconds: 100%. A value of UINT16_MAX implies the channel
is unused. Individual receivers/transmitters might violate
this specification.
'''
id = MAVLINK_MSG_ID_RC_CHANNELS_RAW
name = 'RC_CHANNELS_RAW'
fieldnames = ['time_boot_ms', 'port', 'chan1_raw', 'chan2_raw', 'chan3_raw', 'chan4_raw', 'chan5_raw', 'chan6_raw', 'chan7_raw', 'chan8_raw', 'rssi']
ordered_fieldnames = ['time_boot_ms', 'chan1_raw', 'chan2_raw', 'chan3_raw', 'chan4_raw', 'chan5_raw', 'chan6_raw', 'chan7_raw', 'chan8_raw', 'port', 'rssi']
fieldtypes = ['uint32_t', 'uint8_t', 'uint16_t', 'uint16_t', 'uint16_t', 'uint16_t', 'uint16_t', 'uint16_t', 'uint16_t', 'uint16_t', 'uint8_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"time_boot_ms": "ms", "chan1_raw": "us", "chan2_raw": "us", "chan3_raw": "us", "chan4_raw": "us", "chan5_raw": "us", "chan6_raw": "us", "chan7_raw": "us", "chan8_raw": "us"}
format = '<IHHHHHHHHBB'
native_format = bytearray('<IHHHHHHHHBB', 'ascii')
orders = [0, 9, 1, 2, 3, 4, 5, 6, 7, 8, 10]
lengths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
crc_extra = 244
unpacker = struct.Struct('<IHHHHHHHHBB')
instance_field = None
instance_offset = -1
def __init__(self, time_boot_ms, port, chan1_raw, chan2_raw, chan3_raw, chan4_raw, chan5_raw, chan6_raw, chan7_raw, chan8_raw, rssi):
MAVLink_message.__init__(self, MAVLink_rc_channels_raw_message.id, MAVLink_rc_channels_raw_message.name)
self._fieldnames = MAVLink_rc_channels_raw_message.fieldnames
self._instance_field = MAVLink_rc_channels_raw_message.instance_field
self._instance_offset = MAVLink_rc_channels_raw_message.instance_offset
self.time_boot_ms = time_boot_ms
self.port = port
self.chan1_raw = chan1_raw
self.chan2_raw = chan2_raw
self.chan3_raw = chan3_raw
self.chan4_raw = chan4_raw
self.chan5_raw = chan5_raw
self.chan6_raw = chan6_raw
self.chan7_raw = chan7_raw
self.chan8_raw = chan8_raw
self.rssi = rssi
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 244, struct.pack('<IHHHHHHHHBB', self.time_boot_ms, self.chan1_raw, self.chan2_raw, self.chan3_raw, self.chan4_raw, self.chan5_raw, self.chan6_raw, self.chan7_raw, self.chan8_raw, self.port, self.rssi), force_mavlink1=force_mavlink1)
class MAVLink_servo_output_raw_message(MAVLink_message):
'''
Superseded by ACTUATOR_OUTPUT_STATUS. The RAW values of the
servo outputs (for RC input from the remote, use the
RC_CHANNELS messages). The standard PPM modulation is as
follows: 1000 microseconds: 0%, 2000 microseconds: 100%.
'''
id = MAVLINK_MSG_ID_SERVO_OUTPUT_RAW
name = 'SERVO_OUTPUT_RAW'
fieldnames = ['time_usec', 'port', 'servo1_raw', 'servo2_raw', 'servo3_raw', 'servo4_raw', 'servo5_raw', 'servo6_raw', 'servo7_raw', 'servo8_raw']
ordered_fieldnames = ['time_usec', 'servo1_raw', 'servo2_raw', 'servo3_raw', 'servo4_raw', 'servo5_raw', 'servo6_raw', 'servo7_raw', 'servo8_raw', 'port']
fieldtypes = ['uint32_t', 'uint8_t', 'uint16_t', 'uint16_t', 'uint16_t', 'uint16_t', 'uint16_t', 'uint16_t', 'uint16_t', 'uint16_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"time_usec": "us", "servo1_raw": "us", "servo2_raw": "us", "servo3_raw": "us", "servo4_raw": "us", "servo5_raw": "us", "servo6_raw": "us", "servo7_raw": "us", "servo8_raw": "us"}
format = '<IHHHHHHHHB'
native_format = bytearray('<IHHHHHHHHB', 'ascii')
orders = [0, 9, 1, 2, 3, 4, 5, 6, 7, 8]
lengths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
crc_extra = 222
unpacker = struct.Struct('<IHHHHHHHHB')
instance_field = None
instance_offset = -1
def __init__(self, time_usec, port, servo1_raw, servo2_raw, servo3_raw, servo4_raw, servo5_raw, servo6_raw, servo7_raw, servo8_raw):
MAVLink_message.__init__(self, MAVLink_servo_output_raw_message.id, MAVLink_servo_output_raw_message.name)
self._fieldnames = MAVLink_servo_output_raw_message.fieldnames
self._instance_field = MAVLink_servo_output_raw_message.instance_field
self._instance_offset = MAVLink_servo_output_raw_message.instance_offset
self.time_usec = time_usec
self.port = port
self.servo1_raw = servo1_raw
self.servo2_raw = servo2_raw
self.servo3_raw = servo3_raw
self.servo4_raw = servo4_raw
self.servo5_raw = servo5_raw
self.servo6_raw = servo6_raw
self.servo7_raw = servo7_raw
self.servo8_raw = servo8_raw
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 222, struct.pack('<IHHHHHHHHB', self.time_usec, self.servo1_raw, self.servo2_raw, self.servo3_raw, self.servo4_raw, self.servo5_raw, self.servo6_raw, self.servo7_raw, self.servo8_raw, self.port), force_mavlink1=force_mavlink1)
class MAVLink_mission_request_partial_list_message(MAVLink_message):
'''
Request a partial list of mission items from the
system/component. https://mavlink.io/en/services/mission.html.
If start and end index are the same, just send one waypoint.
'''
id = MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST
name = 'MISSION_REQUEST_PARTIAL_LIST'
fieldnames = ['target_system', 'target_component', 'start_index', 'end_index']
ordered_fieldnames = ['start_index', 'end_index', 'target_system', 'target_component']
fieldtypes = ['uint8_t', 'uint8_t', 'int16_t', 'int16_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {}
format = '<hhBB'
native_format = bytearray('<hhBB', 'ascii')
orders = [2, 3, 0, 1]
lengths = [1, 1, 1, 1]
array_lengths = [0, 0, 0, 0]
crc_extra = 212
unpacker = struct.Struct('<hhBB')
instance_field = None
instance_offset = -1
def __init__(self, target_system, target_component, start_index, end_index):
MAVLink_message.__init__(self, MAVLink_mission_request_partial_list_message.id, MAVLink_mission_request_partial_list_message.name)
self._fieldnames = MAVLink_mission_request_partial_list_message.fieldnames
self._instance_field = MAVLink_mission_request_partial_list_message.instance_field
self._instance_offset = MAVLink_mission_request_partial_list_message.instance_offset
self.target_system = target_system
self.target_component = target_component
self.start_index = start_index
self.end_index = end_index
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 212, struct.pack('<hhBB', self.start_index, self.end_index, self.target_system, self.target_component), force_mavlink1=force_mavlink1)
class MAVLink_mission_write_partial_list_message(MAVLink_message):
'''
This message is sent to the MAV to write a partial list. If
start index == end index, only one item will be transmitted /
updated. If the start index is NOT 0 and above the current
list size, this request should be REJECTED!
'''
id = MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST
name = 'MISSION_WRITE_PARTIAL_LIST'
fieldnames = ['target_system', 'target_component', 'start_index', 'end_index']
ordered_fieldnames = ['start_index', 'end_index', 'target_system', 'target_component']
fieldtypes = ['uint8_t', 'uint8_t', 'int16_t', 'int16_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {}
format = '<hhBB'
native_format = bytearray('<hhBB', 'ascii')
orders = [2, 3, 0, 1]
lengths = [1, 1, 1, 1]
array_lengths = [0, 0, 0, 0]
crc_extra = 9
unpacker = struct.Struct('<hhBB')
instance_field = None
instance_offset = -1
def __init__(self, target_system, target_component, start_index, end_index):
MAVLink_message.__init__(self, MAVLink_mission_write_partial_list_message.id, MAVLink_mission_write_partial_list_message.name)
self._fieldnames = MAVLink_mission_write_partial_list_message.fieldnames
self._instance_field = MAVLink_mission_write_partial_list_message.instance_field
self._instance_offset = MAVLink_mission_write_partial_list_message.instance_offset
self.target_system = target_system
self.target_component = target_component
self.start_index = start_index
self.end_index = end_index
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 9, struct.pack('<hhBB', self.start_index, self.end_index, self.target_system, self.target_component), force_mavlink1=force_mavlink1)
class MAVLink_mission_item_message(MAVLink_message):
'''
Message encoding a mission item. This message is emitted to
announce the presence of a mission item and to
set a mission item on the system. The mission item can be
either in x, y, z meters (type: LOCAL) or x:lat, y:lon,
z:altitude. Local frame is Z-down, right handed (NED), global
frame is Z-up, right handed (ENU). NaN may be used to indicate
an optional/default value (e.g. to use the system's current
latitude or yaw rather than a specific value). See also
https://mavlink.io/en/services/mission.html.
'''
id = MAVLINK_MSG_ID_MISSION_ITEM
name = 'MISSION_ITEM'
fieldnames = ['target_system', 'target_component', 'seq', 'frame', 'command', 'current', 'autocontinue', 'param1', 'param2', 'param3', 'param4', 'x', 'y', 'z']
ordered_fieldnames = ['param1', 'param2', 'param3', 'param4', 'x', 'y', 'z', 'seq', 'command', 'target_system', 'target_component', 'frame', 'current', 'autocontinue']
fieldtypes = ['uint8_t', 'uint8_t', 'uint16_t', 'uint8_t', 'uint16_t', 'uint8_t', 'uint8_t', 'float', 'float', 'float', 'float', 'float', 'float', 'float']
fielddisplays_by_name = {}
fieldenums_by_name = {"frame": "MAV_FRAME", "command": "MAV_CMD"}
fieldunits_by_name = {}
format = '<fffffffHHBBBBB'
native_format = bytearray('<fffffffHHBBBBB', 'ascii')
orders = [9, 10, 7, 11, 8, 12, 13, 0, 1, 2, 3, 4, 5, 6]
lengths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
crc_extra = 254
unpacker = struct.Struct('<fffffffHHBBBBB')
instance_field = None
instance_offset = -1
def __init__(self, target_system, target_component, seq, frame, command, current, autocontinue, param1, param2, param3, param4, x, y, z):
MAVLink_message.__init__(self, MAVLink_mission_item_message.id, MAVLink_mission_item_message.name)
self._fieldnames = MAVLink_mission_item_message.fieldnames
self._instance_field = MAVLink_mission_item_message.instance_field
self._instance_offset = MAVLink_mission_item_message.instance_offset
self.target_system = target_system
self.target_component = target_component
self.seq = seq
self.frame = frame
self.command = command
self.current = current
self.autocontinue = autocontinue
self.param1 = param1
self.param2 = param2
self.param3 = param3
self.param4 = param4
self.x = x
self.y = y
self.z = z
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 254, struct.pack('<fffffffHHBBBBB', self.param1, self.param2, self.param3, self.param4, self.x, self.y, self.z, self.seq, self.command, self.target_system, self.target_component, self.frame, self.current, self.autocontinue), force_mavlink1=force_mavlink1)
class MAVLink_mission_request_message(MAVLink_message):
'''
Request the information of the mission item with the sequence
number seq. The response of the system to this message should
be a MISSION_ITEM message.
https://mavlink.io/en/services/mission.html
'''
id = MAVLINK_MSG_ID_MISSION_REQUEST
name = 'MISSION_REQUEST'
fieldnames = ['target_system', 'target_component', 'seq']
ordered_fieldnames = ['seq', 'target_system', 'target_component']
fieldtypes = ['uint8_t', 'uint8_t', 'uint16_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {}
format = '<HBB'
native_format = bytearray('<HBB', 'ascii')
orders = [1, 2, 0]
lengths = [1, 1, 1]
array_lengths = [0, 0, 0]
crc_extra = 230
unpacker = struct.Struct('<HBB')
instance_field = None
instance_offset = -1
def __init__(self, target_system, target_component, seq):
MAVLink_message.__init__(self, MAVLink_mission_request_message.id, MAVLink_mission_request_message.name)
self._fieldnames = MAVLink_mission_request_message.fieldnames
self._instance_field = MAVLink_mission_request_message.instance_field
self._instance_offset = MAVLink_mission_request_message.instance_offset
self.target_system = target_system
self.target_component = target_component
self.seq = seq
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 230, struct.pack('<HBB', self.seq, self.target_system, self.target_component), force_mavlink1=force_mavlink1)
class MAVLink_mission_set_current_message(MAVLink_message):
'''
Set the mission item with sequence number seq as current item.
This means that the MAV will continue to this mission item on
the shortest path (not following the mission items in-
between).
'''
id = MAVLINK_MSG_ID_MISSION_SET_CURRENT
name = 'MISSION_SET_CURRENT'
fieldnames = ['target_system', 'target_component', 'seq']
ordered_fieldnames = ['seq', 'target_system', 'target_component']
fieldtypes = ['uint8_t', 'uint8_t', 'uint16_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {}
format = '<HBB'
native_format = bytearray('<HBB', 'ascii')
orders = [1, 2, 0]
lengths = [1, 1, 1]
array_lengths = [0, 0, 0]
crc_extra = 28
unpacker = struct.Struct('<HBB')
instance_field = None
instance_offset = -1
def __init__(self, target_system, target_component, seq):
MAVLink_message.__init__(self, MAVLink_mission_set_current_message.id, MAVLink_mission_set_current_message.name)
self._fieldnames = MAVLink_mission_set_current_message.fieldnames
self._instance_field = MAVLink_mission_set_current_message.instance_field
self._instance_offset = MAVLink_mission_set_current_message.instance_offset
self.target_system = target_system
self.target_component = target_component
self.seq = seq
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 28, struct.pack('<HBB', self.seq, self.target_system, self.target_component), force_mavlink1=force_mavlink1)
class MAVLink_mission_current_message(MAVLink_message):
'''
Message that announces the sequence number of the current
active mission item. The MAV will fly towards this mission
item.
'''
id = MAVLINK_MSG_ID_MISSION_CURRENT
name = 'MISSION_CURRENT'
fieldnames = ['seq']
ordered_fieldnames = ['seq']
fieldtypes = ['uint16_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {}
format = '<H'
native_format = bytearray('<H', 'ascii')
orders = [0]
lengths = [1]
array_lengths = [0]
crc_extra = 28
unpacker = struct.Struct('<H')
instance_field = None
instance_offset = -1
def __init__(self, seq):
MAVLink_message.__init__(self, MAVLink_mission_current_message.id, MAVLink_mission_current_message.name)
self._fieldnames = MAVLink_mission_current_message.fieldnames
self._instance_field = MAVLink_mission_current_message.instance_field
self._instance_offset = MAVLink_mission_current_message.instance_offset
self.seq = seq
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 28, struct.pack('<H', self.seq), force_mavlink1=force_mavlink1)
class MAVLink_mission_request_list_message(MAVLink_message):
'''
Request the overall list of mission items from the
system/component.
'''
id = MAVLINK_MSG_ID_MISSION_REQUEST_LIST
name = 'MISSION_REQUEST_LIST'
fieldnames = ['target_system', 'target_component']
ordered_fieldnames = ['target_system', 'target_component']
fieldtypes = ['uint8_t', 'uint8_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {}
format = '<BB'
native_format = bytearray('<BB', 'ascii')
orders = [0, 1]
lengths = [1, 1]
array_lengths = [0, 0]
crc_extra = 132
unpacker = struct.Struct('<BB')
instance_field = None
instance_offset = -1
def __init__(self, target_system, target_component):
MAVLink_message.__init__(self, MAVLink_mission_request_list_message.id, MAVLink_mission_request_list_message.name)
self._fieldnames = MAVLink_mission_request_list_message.fieldnames
self._instance_field = MAVLink_mission_request_list_message.instance_field
self._instance_offset = MAVLink_mission_request_list_message.instance_offset
self.target_system = target_system
self.target_component = target_component
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 132, struct.pack('<BB', self.target_system, self.target_component), force_mavlink1=force_mavlink1)
class MAVLink_mission_count_message(MAVLink_message):
'''
This message is emitted as response to MISSION_REQUEST_LIST by
the MAV and to initiate a write transaction. The GCS can then
request the individual mission item based on the knowledge of
the total number of waypoints.
'''
id = MAVLINK_MSG_ID_MISSION_COUNT
name = 'MISSION_COUNT'
fieldnames = ['target_system', 'target_component', 'count']
ordered_fieldnames = ['count', 'target_system', 'target_component']
fieldtypes = ['uint8_t', 'uint8_t', 'uint16_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {}
format = '<HBB'
native_format = bytearray('<HBB', 'ascii')
orders = [1, 2, 0]
lengths = [1, 1, 1]
array_lengths = [0, 0, 0]
crc_extra = 221
unpacker = struct.Struct('<HBB')
instance_field = None
instance_offset = -1
def __init__(self, target_system, target_component, count):
MAVLink_message.__init__(self, MAVLink_mission_count_message.id, MAVLink_mission_count_message.name)
self._fieldnames = MAVLink_mission_count_message.fieldnames
self._instance_field = MAVLink_mission_count_message.instance_field
self._instance_offset = MAVLink_mission_count_message.instance_offset
self.target_system = target_system
self.target_component = target_component
self.count = count
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 221, struct.pack('<HBB', self.count, self.target_system, self.target_component), force_mavlink1=force_mavlink1)
class MAVLink_mission_clear_all_message(MAVLink_message):
'''
Delete all mission items at once.
'''
id = MAVLINK_MSG_ID_MISSION_CLEAR_ALL
name = 'MISSION_CLEAR_ALL'
fieldnames = ['target_system', 'target_component']
ordered_fieldnames = ['target_system', 'target_component']
fieldtypes = ['uint8_t', 'uint8_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {}
format = '<BB'
native_format = bytearray('<BB', 'ascii')
orders = [0, 1]
lengths = [1, 1]
array_lengths = [0, 0]
crc_extra = 232
unpacker = struct.Struct('<BB')
instance_field = None
instance_offset = -1
def __init__(self, target_system, target_component):
MAVLink_message.__init__(self, MAVLink_mission_clear_all_message.id, MAVLink_mission_clear_all_message.name)
self._fieldnames = MAVLink_mission_clear_all_message.fieldnames
self._instance_field = MAVLink_mission_clear_all_message.instance_field
self._instance_offset = MAVLink_mission_clear_all_message.instance_offset
self.target_system = target_system
self.target_component = target_component
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 232, struct.pack('<BB', self.target_system, self.target_component), force_mavlink1=force_mavlink1)
class MAVLink_mission_item_reached_message(MAVLink_message):
'''
A certain mission item has been reached. The system will
either hold this position (or circle on the orbit) or (if the
autocontinue on the WP was set) continue to the next waypoint.
'''
id = MAVLINK_MSG_ID_MISSION_ITEM_REACHED
name = 'MISSION_ITEM_REACHED'
fieldnames = ['seq']
ordered_fieldnames = ['seq']
fieldtypes = ['uint16_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {}
format = '<H'
native_format = bytearray('<H', 'ascii')
orders = [0]
lengths = [1]
array_lengths = [0]
crc_extra = 11
unpacker = struct.Struct('<H')
instance_field = None
instance_offset = -1
def __init__(self, seq):
MAVLink_message.__init__(self, MAVLink_mission_item_reached_message.id, MAVLink_mission_item_reached_message.name)
self._fieldnames = MAVLink_mission_item_reached_message.fieldnames
self._instance_field = MAVLink_mission_item_reached_message.instance_field
self._instance_offset = MAVLink_mission_item_reached_message.instance_offset
self.seq = seq
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 11, struct.pack('<H', self.seq), force_mavlink1=force_mavlink1)
class MAVLink_mission_ack_message(MAVLink_message):
'''
Acknowledgment message during waypoint handling. The type
field states if this message is a positive ack (type=0) or if
an error happened (type=non-zero).
'''
id = MAVLINK_MSG_ID_MISSION_ACK
name = 'MISSION_ACK'
fieldnames = ['target_system', 'target_component', 'type']
ordered_fieldnames = ['target_system', 'target_component', 'type']
fieldtypes = ['uint8_t', 'uint8_t', 'uint8_t']
fielddisplays_by_name = {}
fieldenums_by_name = {"type": "MAV_MISSION_RESULT"}
fieldunits_by_name = {}
format = '<BBB'
native_format = bytearray('<BBB', 'ascii')
orders = [0, 1, 2]
lengths = [1, 1, 1]
array_lengths = [0, 0, 0]
crc_extra = 153
unpacker = struct.Struct('<BBB')
instance_field = None
instance_offset = -1
def __init__(self, target_system, target_component, type):
MAVLink_message.__init__(self, MAVLink_mission_ack_message.id, MAVLink_mission_ack_message.name)
self._fieldnames = MAVLink_mission_ack_message.fieldnames
self._instance_field = MAVLink_mission_ack_message.instance_field
self._instance_offset = MAVLink_mission_ack_message.instance_offset
self.target_system = target_system
self.target_component = target_component
self.type = type
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 153, struct.pack('<BBB', self.target_system, self.target_component, self.type), force_mavlink1=force_mavlink1)
class MAVLink_set_gps_global_origin_message(MAVLink_message):
'''
Sets the GPS co-ordinates of the vehicle local origin (0,0,0)
position. Vehicle should emit GPS_GLOBAL_ORIGIN irrespective
of whether the origin is changed. This enables transform
between the local coordinate frame and the global (GPS)
coordinate frame, which may be necessary when (for example)
indoor and outdoor settings are connected and the MAV should
move from in- to outdoor.
'''
id = MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN
name = 'SET_GPS_GLOBAL_ORIGIN'
fieldnames = ['target_system', 'latitude', 'longitude', 'altitude']
ordered_fieldnames = ['latitude', 'longitude', 'altitude', 'target_system']
fieldtypes = ['uint8_t', 'int32_t', 'int32_t', 'int32_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"latitude": "degE7", "longitude": "degE7", "altitude": "mm"}
format = '<iiiB'
native_format = bytearray('<iiiB', 'ascii')
orders = [3, 0, 1, 2]
lengths = [1, 1, 1, 1]
array_lengths = [0, 0, 0, 0]
crc_extra = 41
unpacker = struct.Struct('<iiiB')
instance_field = None
instance_offset = -1
def __init__(self, target_system, latitude, longitude, altitude):
MAVLink_message.__init__(self, MAVLink_set_gps_global_origin_message.id, MAVLink_set_gps_global_origin_message.name)
self._fieldnames = MAVLink_set_gps_global_origin_message.fieldnames
self._instance_field = MAVLink_set_gps_global_origin_message.instance_field
self._instance_offset = MAVLink_set_gps_global_origin_message.instance_offset
self.target_system = target_system
self.latitude = latitude
self.longitude = longitude
self.altitude = altitude
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 41, struct.pack('<iiiB', self.latitude, self.longitude, self.altitude, self.target_system), force_mavlink1=force_mavlink1)
class MAVLink_gps_global_origin_message(MAVLink_message):
'''
Publishes the GPS co-ordinates of the vehicle local origin
(0,0,0) position. Emitted whenever a new GPS-Local position
mapping is requested or set - e.g. following
SET_GPS_GLOBAL_ORIGIN message.
'''
id = MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN
name = 'GPS_GLOBAL_ORIGIN'
fieldnames = ['latitude', 'longitude', 'altitude']
ordered_fieldnames = ['latitude', 'longitude', 'altitude']
fieldtypes = ['int32_t', 'int32_t', 'int32_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"latitude": "degE7", "longitude": "degE7", "altitude": "mm"}
format = '<iii'
native_format = bytearray('<iii', 'ascii')
orders = [0, 1, 2]
lengths = [1, 1, 1]
array_lengths = [0, 0, 0]
crc_extra = 39
unpacker = struct.Struct('<iii')
instance_field = None
instance_offset = -1
def __init__(self, latitude, longitude, altitude):
MAVLink_message.__init__(self, MAVLink_gps_global_origin_message.id, MAVLink_gps_global_origin_message.name)
self._fieldnames = MAVLink_gps_global_origin_message.fieldnames
self._instance_field = MAVLink_gps_global_origin_message.instance_field
self._instance_offset = MAVLink_gps_global_origin_message.instance_offset
self.latitude = latitude
self.longitude = longitude
self.altitude = altitude
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 39, struct.pack('<iii', self.latitude, self.longitude, self.altitude), force_mavlink1=force_mavlink1)
class MAVLink_param_map_rc_message(MAVLink_message):
'''
Bind a RC channel to a parameter. The parameter should change
according to the RC channel value.
'''
id = MAVLINK_MSG_ID_PARAM_MAP_RC
name = 'PARAM_MAP_RC'
fieldnames = ['target_system', 'target_component', 'param_id', 'param_index', 'parameter_rc_channel_index', 'param_value0', 'scale', 'param_value_min', 'param_value_max']
ordered_fieldnames = ['param_value0', 'scale', 'param_value_min', 'param_value_max', 'param_index', 'target_system', 'target_component', 'param_id', 'parameter_rc_channel_index']
fieldtypes = ['uint8_t', 'uint8_t', 'char', 'int16_t', 'uint8_t', 'float', 'float', 'float', 'float']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {}
format = '<ffffhBB16sB'
native_format = bytearray('<ffffhBBcB', 'ascii')
orders = [5, 6, 7, 4, 8, 0, 1, 2, 3]
lengths = [1, 1, 1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0, 16, 0]
crc_extra = 78
unpacker = struct.Struct('<ffffhBB16sB')
instance_field = None
instance_offset = -1
def __init__(self, target_system, target_component, param_id, param_index, parameter_rc_channel_index, param_value0, scale, param_value_min, param_value_max):
MAVLink_message.__init__(self, MAVLink_param_map_rc_message.id, MAVLink_param_map_rc_message.name)
self._fieldnames = MAVLink_param_map_rc_message.fieldnames
self._instance_field = MAVLink_param_map_rc_message.instance_field
self._instance_offset = MAVLink_param_map_rc_message.instance_offset
self.target_system = target_system
self.target_component = target_component
self.param_id = param_id
self.param_index = param_index
self.parameter_rc_channel_index = parameter_rc_channel_index
self.param_value0 = param_value0
self.scale = scale
self.param_value_min = param_value_min
self.param_value_max = param_value_max
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 78, struct.pack('<ffffhBB16sB', self.param_value0, self.scale, self.param_value_min, self.param_value_max, self.param_index, self.target_system, self.target_component, self.param_id, self.parameter_rc_channel_index), force_mavlink1=force_mavlink1)
class MAVLink_mission_request_int_message(MAVLink_message):
'''
Request the information of the mission item with the sequence
number seq. The response of the system to this message should
be a MISSION_ITEM_INT message.
https://mavlink.io/en/services/mission.html
'''
id = MAVLINK_MSG_ID_MISSION_REQUEST_INT
name = 'MISSION_REQUEST_INT'
fieldnames = ['target_system', 'target_component', 'seq']
ordered_fieldnames = ['seq', 'target_system', 'target_component']
fieldtypes = ['uint8_t', 'uint8_t', 'uint16_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {}
format = '<HBB'
native_format = bytearray('<HBB', 'ascii')
orders = [1, 2, 0]
lengths = [1, 1, 1]
array_lengths = [0, 0, 0]
crc_extra = 196
unpacker = struct.Struct('<HBB')
instance_field = None
instance_offset = -1
def __init__(self, target_system, target_component, seq):
MAVLink_message.__init__(self, MAVLink_mission_request_int_message.id, MAVLink_mission_request_int_message.name)
self._fieldnames = MAVLink_mission_request_int_message.fieldnames
self._instance_field = MAVLink_mission_request_int_message.instance_field
self._instance_offset = MAVLink_mission_request_int_message.instance_offset
self.target_system = target_system
self.target_component = target_component
self.seq = seq
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 196, struct.pack('<HBB', self.seq, self.target_system, self.target_component), force_mavlink1=force_mavlink1)
class MAVLink_safety_set_allowed_area_message(MAVLink_message):
'''
Set a safety zone (volume), which is defined by two corners of
a cube. This message can be used to tell the MAV which
setpoints/waypoints to accept and which to reject. Safety
areas are often enforced by national or competition
regulations.
'''
id = MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA
name = 'SAFETY_SET_ALLOWED_AREA'
fieldnames = ['target_system', 'target_component', 'frame', 'p1x', 'p1y', 'p1z', 'p2x', 'p2y', 'p2z']
ordered_fieldnames = ['p1x', 'p1y', 'p1z', 'p2x', 'p2y', 'p2z', 'target_system', 'target_component', 'frame']
fieldtypes = ['uint8_t', 'uint8_t', 'uint8_t', 'float', 'float', 'float', 'float', 'float', 'float']
fielddisplays_by_name = {}
fieldenums_by_name = {"frame": "MAV_FRAME"}
fieldunits_by_name = {"p1x": "m", "p1y": "m", "p1z": "m", "p2x": "m", "p2y": "m", "p2z": "m"}
format = '<ffffffBBB'
native_format = bytearray('<ffffffBBB', 'ascii')
orders = [6, 7, 8, 0, 1, 2, 3, 4, 5]
lengths = [1, 1, 1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0, 0, 0]
crc_extra = 15
unpacker = struct.Struct('<ffffffBBB')
instance_field = None
instance_offset = -1
def __init__(self, target_system, target_component, frame, p1x, p1y, p1z, p2x, p2y, p2z):
MAVLink_message.__init__(self, MAVLink_safety_set_allowed_area_message.id, MAVLink_safety_set_allowed_area_message.name)
self._fieldnames = MAVLink_safety_set_allowed_area_message.fieldnames
self._instance_field = MAVLink_safety_set_allowed_area_message.instance_field
self._instance_offset = MAVLink_safety_set_allowed_area_message.instance_offset
self.target_system = target_system
self.target_component = target_component
self.frame = frame
self.p1x = p1x
self.p1y = p1y
self.p1z = p1z
self.p2x = p2x
self.p2y = p2y
self.p2z = p2z
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 15, struct.pack('<ffffffBBB', self.p1x, self.p1y, self.p1z, self.p2x, self.p2y, self.p2z, self.target_system, self.target_component, self.frame), force_mavlink1=force_mavlink1)
class MAVLink_safety_allowed_area_message(MAVLink_message):
'''
Read out the safety zone the MAV currently assumes.
'''
id = MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA
name = 'SAFETY_ALLOWED_AREA'
fieldnames = ['frame', 'p1x', 'p1y', 'p1z', 'p2x', 'p2y', 'p2z']
ordered_fieldnames = ['p1x', 'p1y', 'p1z', 'p2x', 'p2y', 'p2z', 'frame']
fieldtypes = ['uint8_t', 'float', 'float', 'float', 'float', 'float', 'float']
fielddisplays_by_name = {}
fieldenums_by_name = {"frame": "MAV_FRAME"}
fieldunits_by_name = {"p1x": "m", "p1y": "m", "p1z": "m", "p2x": "m", "p2y": "m", "p2z": "m"}
format = '<ffffffB'
native_format = bytearray('<ffffffB', 'ascii')
orders = [6, 0, 1, 2, 3, 4, 5]
lengths = [1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0]
crc_extra = 3
unpacker = struct.Struct('<ffffffB')
instance_field = None
instance_offset = -1
def __init__(self, frame, p1x, p1y, p1z, p2x, p2y, p2z):
MAVLink_message.__init__(self, MAVLink_safety_allowed_area_message.id, MAVLink_safety_allowed_area_message.name)
self._fieldnames = MAVLink_safety_allowed_area_message.fieldnames
self._instance_field = MAVLink_safety_allowed_area_message.instance_field
self._instance_offset = MAVLink_safety_allowed_area_message.instance_offset
self.frame = frame
self.p1x = p1x
self.p1y = p1y
self.p1z = p1z
self.p2x = p2x
self.p2y = p2y
self.p2z = p2z
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 3, struct.pack('<ffffffB', self.p1x, self.p1y, self.p1z, self.p2x, self.p2y, self.p2z, self.frame), force_mavlink1=force_mavlink1)
class MAVLink_attitude_quaternion_cov_message(MAVLink_message):
'''
The attitude in the aeronautical frame (right-handed, Z-down,
X-front, Y-right), expressed as quaternion. Quaternion order
is w, x, y, z and a zero rotation would be expressed as (1 0 0
0).
'''
id = MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV
name = 'ATTITUDE_QUATERNION_COV'
fieldnames = ['time_usec', 'q', 'rollspeed', 'pitchspeed', 'yawspeed', 'covariance']
ordered_fieldnames = ['time_usec', 'q', 'rollspeed', 'pitchspeed', 'yawspeed', 'covariance']
fieldtypes = ['uint64_t', 'float', 'float', 'float', 'float', 'float']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"time_usec": "us", "rollspeed": "rad/s", "pitchspeed": "rad/s", "yawspeed": "rad/s"}
format = '<Q4ffff9f'
native_format = bytearray('<Qfffff', 'ascii')
orders = [0, 1, 2, 3, 4, 5]
lengths = [1, 4, 1, 1, 1, 9]
array_lengths = [0, 4, 0, 0, 0, 9]
crc_extra = 167
unpacker = struct.Struct('<Q4ffff9f')
instance_field = None
instance_offset = -1
def __init__(self, time_usec, q, rollspeed, pitchspeed, yawspeed, covariance):
MAVLink_message.__init__(self, MAVLink_attitude_quaternion_cov_message.id, MAVLink_attitude_quaternion_cov_message.name)
self._fieldnames = MAVLink_attitude_quaternion_cov_message.fieldnames
self._instance_field = MAVLink_attitude_quaternion_cov_message.instance_field
self._instance_offset = MAVLink_attitude_quaternion_cov_message.instance_offset
self.time_usec = time_usec
self.q = q
self.rollspeed = rollspeed
self.pitchspeed = pitchspeed
self.yawspeed = yawspeed
self.covariance = covariance
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 167, struct.pack('<Q4ffff9f', self.time_usec, self.q[0], self.q[1], self.q[2], self.q[3], self.rollspeed, self.pitchspeed, self.yawspeed, self.covariance[0], self.covariance[1], self.covariance[2], self.covariance[3], self.covariance[4], self.covariance[5], self.covariance[6], self.covariance[7], self.covariance[8]), force_mavlink1=force_mavlink1)
class MAVLink_nav_controller_output_message(MAVLink_message):
'''
The state of the fixed wing navigation and position
controller.
'''
id = MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT
name = 'NAV_CONTROLLER_OUTPUT'
fieldnames = ['nav_roll', 'nav_pitch', 'nav_bearing', 'target_bearing', 'wp_dist', 'alt_error', 'aspd_error', 'xtrack_error']
ordered_fieldnames = ['nav_roll', 'nav_pitch', 'alt_error', 'aspd_error', 'xtrack_error', 'nav_bearing', 'target_bearing', 'wp_dist']
fieldtypes = ['float', 'float', 'int16_t', 'int16_t', 'uint16_t', 'float', 'float', 'float']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"nav_roll": "deg", "nav_pitch": "deg", "nav_bearing": "deg", "target_bearing": "deg", "wp_dist": "m", "alt_error": "m", "aspd_error": "m/s", "xtrack_error": "m"}
format = '<fffffhhH'
native_format = bytearray('<fffffhhH', 'ascii')
orders = [0, 1, 5, 6, 7, 2, 3, 4]
lengths = [1, 1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0, 0]
crc_extra = 183
unpacker = struct.Struct('<fffffhhH')
instance_field = None
instance_offset = -1
def __init__(self, nav_roll, nav_pitch, nav_bearing, target_bearing, wp_dist, alt_error, aspd_error, xtrack_error):
MAVLink_message.__init__(self, MAVLink_nav_controller_output_message.id, MAVLink_nav_controller_output_message.name)
self._fieldnames = MAVLink_nav_controller_output_message.fieldnames
self._instance_field = MAVLink_nav_controller_output_message.instance_field
self._instance_offset = MAVLink_nav_controller_output_message.instance_offset
self.nav_roll = nav_roll
self.nav_pitch = nav_pitch
self.nav_bearing = nav_bearing
self.target_bearing = target_bearing
self.wp_dist = wp_dist
self.alt_error = alt_error
self.aspd_error = aspd_error
self.xtrack_error = xtrack_error
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 183, struct.pack('<fffffhhH', self.nav_roll, self.nav_pitch, self.alt_error, self.aspd_error, self.xtrack_error, self.nav_bearing, self.target_bearing, self.wp_dist), force_mavlink1=force_mavlink1)
class MAVLink_global_position_int_cov_message(MAVLink_message):
'''
The filtered global position (e.g. fused GPS and
accelerometers). The position is in GPS-frame (right-handed,
Z-up). It is designed as scaled integer message since the
resolution of float is not sufficient. NOTE: This message is
intended for onboard networks / companion computers and
higher-bandwidth links and optimized for accuracy and
completeness. Please use the GLOBAL_POSITION_INT message for a
minimal subset.
'''
id = MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV
name = 'GLOBAL_POSITION_INT_COV'
fieldnames = ['time_usec', 'estimator_type', 'lat', 'lon', 'alt', 'relative_alt', 'vx', 'vy', 'vz', 'covariance']
ordered_fieldnames = ['time_usec', 'lat', 'lon', 'alt', 'relative_alt', 'vx', 'vy', 'vz', 'covariance', 'estimator_type']
fieldtypes = ['uint64_t', 'uint8_t', 'int32_t', 'int32_t', 'int32_t', 'int32_t', 'float', 'float', 'float', 'float']
fielddisplays_by_name = {}
fieldenums_by_name = {"estimator_type": "MAV_ESTIMATOR_TYPE"}
fieldunits_by_name = {"time_usec": "us", "lat": "degE7", "lon": "degE7", "alt": "mm", "relative_alt": "mm", "vx": "m/s", "vy": "m/s", "vz": "m/s"}
format = '<Qiiiifff36fB'
native_format = bytearray('<QiiiiffffB', 'ascii')
orders = [0, 9, 1, 2, 3, 4, 5, 6, 7, 8]
lengths = [1, 1, 1, 1, 1, 1, 1, 1, 36, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0, 0, 36, 0]
crc_extra = 119
unpacker = struct.Struct('<Qiiiifff36fB')
instance_field = None
instance_offset = -1
def __init__(self, time_usec, estimator_type, lat, lon, alt, relative_alt, vx, vy, vz, covariance):
MAVLink_message.__init__(self, MAVLink_global_position_int_cov_message.id, MAVLink_global_position_int_cov_message.name)
self._fieldnames = MAVLink_global_position_int_cov_message.fieldnames
self._instance_field = MAVLink_global_position_int_cov_message.instance_field
self._instance_offset = MAVLink_global_position_int_cov_message.instance_offset
self.time_usec = time_usec
self.estimator_type = estimator_type
self.lat = lat
self.lon = lon
self.alt = alt
self.relative_alt = relative_alt
self.vx = vx
self.vy = vy
self.vz = vz
self.covariance = covariance
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 119, struct.pack('<Qiiiifff36fB', self.time_usec, self.lat, self.lon, self.alt, self.relative_alt, self.vx, self.vy, self.vz, self.covariance[0], self.covariance[1], self.covariance[2], self.covariance[3], self.covariance[4], self.covariance[5], self.covariance[6], self.covariance[7], self.covariance[8], self.covariance[9], self.covariance[10], self.covariance[11], self.covariance[12], self.covariance[13], self.covariance[14], self.covariance[15], self.covariance[16], self.covariance[17], self.covariance[18], self.covariance[19], self.covariance[20], self.covariance[21], self.covariance[22], self.covariance[23], self.covariance[24], self.covariance[25], self.covariance[26], self.covariance[27], self.covariance[28], self.covariance[29], self.covariance[30], self.covariance[31], self.covariance[32], self.covariance[33], self.covariance[34], self.covariance[35], self.estimator_type), force_mavlink1=force_mavlink1)
class MAVLink_local_position_ned_cov_message(MAVLink_message):
'''
The filtered local position (e.g. fused computer vision and
accelerometers). Coordinate frame is right-handed, Z-axis down
(aeronautical frame, NED / north-east-down convention)
'''
id = MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV
name = 'LOCAL_POSITION_NED_COV'
fieldnames = ['time_usec', 'estimator_type', 'x', 'y', 'z', 'vx', 'vy', 'vz', 'ax', 'ay', 'az', 'covariance']
ordered_fieldnames = ['time_usec', 'x', 'y', 'z', 'vx', 'vy', 'vz', 'ax', 'ay', 'az', 'covariance', 'estimator_type']
fieldtypes = ['uint64_t', 'uint8_t', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float']
fielddisplays_by_name = {}
fieldenums_by_name = {"estimator_type": "MAV_ESTIMATOR_TYPE"}
fieldunits_by_name = {"time_usec": "us", "x": "m", "y": "m", "z": "m", "vx": "m/s", "vy": "m/s", "vz": "m/s", "ax": "m/s/s", "ay": "m/s/s", "az": "m/s/s"}
format = '<Qfffffffff45fB'
native_format = bytearray('<QffffffffffB', 'ascii')
orders = [0, 11, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
lengths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 45, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 45, 0]
crc_extra = 191
unpacker = struct.Struct('<Qfffffffff45fB')
instance_field = None
instance_offset = -1
def __init__(self, time_usec, estimator_type, x, y, z, vx, vy, vz, ax, ay, az, covariance):
MAVLink_message.__init__(self, MAVLink_local_position_ned_cov_message.id, MAVLink_local_position_ned_cov_message.name)
self._fieldnames = MAVLink_local_position_ned_cov_message.fieldnames
self._instance_field = MAVLink_local_position_ned_cov_message.instance_field
self._instance_offset = MAVLink_local_position_ned_cov_message.instance_offset
self.time_usec = time_usec
self.estimator_type = estimator_type
self.x = x
self.y = y
self.z = z
self.vx = vx
self.vy = vy
self.vz = vz
self.ax = ax
self.ay = ay
self.az = az
self.covariance = covariance
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 191, struct.pack('<Qfffffffff45fB', self.time_usec, self.x, self.y, self.z, self.vx, self.vy, self.vz, self.ax, self.ay, self.az, self.covariance[0], self.covariance[1], self.covariance[2], self.covariance[3], self.covariance[4], self.covariance[5], self.covariance[6], self.covariance[7], self.covariance[8], self.covariance[9], self.covariance[10], self.covariance[11], self.covariance[12], self.covariance[13], self.covariance[14], self.covariance[15], self.covariance[16], self.covariance[17], self.covariance[18], self.covariance[19], self.covariance[20], self.covariance[21], self.covariance[22], self.covariance[23], self.covariance[24], self.covariance[25], self.covariance[26], self.covariance[27], self.covariance[28], self.covariance[29], self.covariance[30], self.covariance[31], self.covariance[32], self.covariance[33], self.covariance[34], self.covariance[35], self.covariance[36], self.covariance[37], self.covariance[38], self.covariance[39], self.covariance[40], self.covariance[41], self.covariance[42], self.covariance[43], self.covariance[44], self.estimator_type), force_mavlink1=force_mavlink1)
class MAVLink_rc_channels_message(MAVLink_message):
'''
The PPM values of the RC channels received. The standard PPM
modulation is as follows: 1000 microseconds: 0%, 2000
microseconds: 100%. A value of UINT16_MAX implies the channel
is unused. Individual receivers/transmitters might violate
this specification.
'''
id = MAVLINK_MSG_ID_RC_CHANNELS
name = 'RC_CHANNELS'
fieldnames = ['time_boot_ms', 'chancount', 'chan1_raw', 'chan2_raw', 'chan3_raw', 'chan4_raw', 'chan5_raw', 'chan6_raw', 'chan7_raw', 'chan8_raw', 'chan9_raw', 'chan10_raw', 'chan11_raw', 'chan12_raw', 'chan13_raw', 'chan14_raw', 'chan15_raw', 'chan16_raw', 'chan17_raw', 'chan18_raw', 'rssi']
ordered_fieldnames = ['time_boot_ms', 'chan1_raw', 'chan2_raw', 'chan3_raw', 'chan4_raw', 'chan5_raw', 'chan6_raw', 'chan7_raw', 'chan8_raw', 'chan9_raw', 'chan10_raw', 'chan11_raw', 'chan12_raw', 'chan13_raw', 'chan14_raw', 'chan15_raw', 'chan16_raw', 'chan17_raw', 'chan18_raw', 'chancount', 'rssi']
fieldtypes = ['uint32_t', 'uint8_t', 'uint16_t', 'uint16_t', 'uint16_t', 'uint16_t', 'uint16_t', 'uint16_t', 'uint16_t', 'uint16_t', 'uint16_t', 'uint16_t', 'uint16_t', 'uint16_t', 'uint16_t', 'uint16_t', 'uint16_t', 'uint16_t', 'uint16_t', 'uint16_t', 'uint8_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"time_boot_ms": "ms", "chan1_raw": "us", "chan2_raw": "us", "chan3_raw": "us", "chan4_raw": "us", "chan5_raw": "us", "chan6_raw": "us", "chan7_raw": "us", "chan8_raw": "us", "chan9_raw": "us", "chan10_raw": "us", "chan11_raw": "us", "chan12_raw": "us", "chan13_raw": "us", "chan14_raw": "us", "chan15_raw": "us", "chan16_raw": "us", "chan17_raw": "us", "chan18_raw": "us"}
format = '<IHHHHHHHHHHHHHHHHHHBB'
native_format = bytearray('<IHHHHHHHHHHHHHHHHHHBB', 'ascii')
orders = [0, 19, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 20]
lengths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
crc_extra = 118
unpacker = struct.Struct('<IHHHHHHHHHHHHHHHHHHBB')
instance_field = None
instance_offset = -1
def __init__(self, time_boot_ms, chancount, chan1_raw, chan2_raw, chan3_raw, chan4_raw, chan5_raw, chan6_raw, chan7_raw, chan8_raw, chan9_raw, chan10_raw, chan11_raw, chan12_raw, chan13_raw, chan14_raw, chan15_raw, chan16_raw, chan17_raw, chan18_raw, rssi):
MAVLink_message.__init__(self, MAVLink_rc_channels_message.id, MAVLink_rc_channels_message.name)
self._fieldnames = MAVLink_rc_channels_message.fieldnames
self._instance_field = MAVLink_rc_channels_message.instance_field
self._instance_offset = MAVLink_rc_channels_message.instance_offset
self.time_boot_ms = time_boot_ms
self.chancount = chancount
self.chan1_raw = chan1_raw
self.chan2_raw = chan2_raw
self.chan3_raw = chan3_raw
self.chan4_raw = chan4_raw
self.chan5_raw = chan5_raw
self.chan6_raw = chan6_raw
self.chan7_raw = chan7_raw
self.chan8_raw = chan8_raw
self.chan9_raw = chan9_raw
self.chan10_raw = chan10_raw
self.chan11_raw = chan11_raw
self.chan12_raw = chan12_raw
self.chan13_raw = chan13_raw
self.chan14_raw = chan14_raw
self.chan15_raw = chan15_raw
self.chan16_raw = chan16_raw
self.chan17_raw = chan17_raw
self.chan18_raw = chan18_raw
self.rssi = rssi
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 118, struct.pack('<IHHHHHHHHHHHHHHHHHHBB', self.time_boot_ms, self.chan1_raw, self.chan2_raw, self.chan3_raw, self.chan4_raw, self.chan5_raw, self.chan6_raw, self.chan7_raw, self.chan8_raw, self.chan9_raw, self.chan10_raw, self.chan11_raw, self.chan12_raw, self.chan13_raw, self.chan14_raw, self.chan15_raw, self.chan16_raw, self.chan17_raw, self.chan18_raw, self.chancount, self.rssi), force_mavlink1=force_mavlink1)
class MAVLink_request_data_stream_message(MAVLink_message):
'''
Request a data stream.
'''
id = MAVLINK_MSG_ID_REQUEST_DATA_STREAM
name = 'REQUEST_DATA_STREAM'
fieldnames = ['target_system', 'target_component', 'req_stream_id', 'req_message_rate', 'start_stop']
ordered_fieldnames = ['req_message_rate', 'target_system', 'target_component', 'req_stream_id', 'start_stop']
fieldtypes = ['uint8_t', 'uint8_t', 'uint8_t', 'uint16_t', 'uint8_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"req_message_rate": "Hz"}
format = '<HBBBB'
native_format = bytearray('<HBBBB', 'ascii')
orders = [1, 2, 3, 0, 4]
lengths = [1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0]
crc_extra = 148
unpacker = struct.Struct('<HBBBB')
instance_field = None
instance_offset = -1
def __init__(self, target_system, target_component, req_stream_id, req_message_rate, start_stop):
MAVLink_message.__init__(self, MAVLink_request_data_stream_message.id, MAVLink_request_data_stream_message.name)
self._fieldnames = MAVLink_request_data_stream_message.fieldnames
self._instance_field = MAVLink_request_data_stream_message.instance_field
self._instance_offset = MAVLink_request_data_stream_message.instance_offset
self.target_system = target_system
self.target_component = target_component
self.req_stream_id = req_stream_id
self.req_message_rate = req_message_rate
self.start_stop = start_stop
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 148, struct.pack('<HBBBB', self.req_message_rate, self.target_system, self.target_component, self.req_stream_id, self.start_stop), force_mavlink1=force_mavlink1)
class MAVLink_data_stream_message(MAVLink_message):
'''
Data stream status information.
'''
id = MAVLINK_MSG_ID_DATA_STREAM
name = 'DATA_STREAM'
fieldnames = ['stream_id', 'message_rate', 'on_off']
ordered_fieldnames = ['message_rate', 'stream_id', 'on_off']
fieldtypes = ['uint8_t', 'uint16_t', 'uint8_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"message_rate": "Hz"}
format = '<HBB'
native_format = bytearray('<HBB', 'ascii')
orders = [1, 0, 2]
lengths = [1, 1, 1]
array_lengths = [0, 0, 0]
crc_extra = 21
unpacker = struct.Struct('<HBB')
instance_field = None
instance_offset = -1
def __init__(self, stream_id, message_rate, on_off):
MAVLink_message.__init__(self, MAVLink_data_stream_message.id, MAVLink_data_stream_message.name)
self._fieldnames = MAVLink_data_stream_message.fieldnames
self._instance_field = MAVLink_data_stream_message.instance_field
self._instance_offset = MAVLink_data_stream_message.instance_offset
self.stream_id = stream_id
self.message_rate = message_rate
self.on_off = on_off
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 21, struct.pack('<HBB', self.message_rate, self.stream_id, self.on_off), force_mavlink1=force_mavlink1)
class MAVLink_manual_control_message(MAVLink_message):
'''
This message provides an API for manually controlling the
vehicle using standard joystick axes nomenclature, along with
a joystick-like input device. Unused axes can be disabled an
buttons are also transmit as boolean values of their
'''
id = MAVLINK_MSG_ID_MANUAL_CONTROL
name = 'MANUAL_CONTROL'
fieldnames = ['target', 'x', 'y', 'z', 'r', 'buttons']
ordered_fieldnames = ['x', 'y', 'z', 'r', 'buttons', 'target']
fieldtypes = ['uint8_t', 'int16_t', 'int16_t', 'int16_t', 'int16_t', 'uint16_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {}
format = '<hhhhHB'
native_format = bytearray('<hhhhHB', 'ascii')
orders = [5, 0, 1, 2, 3, 4]
lengths = [1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0]
crc_extra = 243
unpacker = struct.Struct('<hhhhHB')
instance_field = None
instance_offset = -1
def __init__(self, target, x, y, z, r, buttons):
MAVLink_message.__init__(self, MAVLink_manual_control_message.id, MAVLink_manual_control_message.name)
self._fieldnames = MAVLink_manual_control_message.fieldnames
self._instance_field = MAVLink_manual_control_message.instance_field
self._instance_offset = MAVLink_manual_control_message.instance_offset
self.target = target
self.x = x
self.y = y
self.z = z
self.r = r
self.buttons = buttons
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 243, struct.pack('<hhhhHB', self.x, self.y, self.z, self.r, self.buttons, self.target), force_mavlink1=force_mavlink1)
class MAVLink_rc_channels_override_message(MAVLink_message):
'''
The RAW values of the RC channels sent to the MAV to override
info received from the RC radio. A value of UINT16_MAX means
no change to that channel. A value of 0 means control of that
channel should be released back to the RC radio. The standard
PPM modulation is as follows: 1000 microseconds: 0%, 2000
microseconds: 100%. Individual receivers/transmitters might
violate this specification.
'''
id = MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE
name = 'RC_CHANNELS_OVERRIDE'
fieldnames = ['target_system', 'target_component', 'chan1_raw', 'chan2_raw', 'chan3_raw', 'chan4_raw', 'chan5_raw', 'chan6_raw', 'chan7_raw', 'chan8_raw']
ordered_fieldnames = ['chan1_raw', 'chan2_raw', 'chan3_raw', 'chan4_raw', 'chan5_raw', 'chan6_raw', 'chan7_raw', 'chan8_raw', 'target_system', 'target_component']
fieldtypes = ['uint8_t', 'uint8_t', 'uint16_t', 'uint16_t', 'uint16_t', 'uint16_t', 'uint16_t', 'uint16_t', 'uint16_t', 'uint16_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"chan1_raw": "us", "chan2_raw": "us", "chan3_raw": "us", "chan4_raw": "us", "chan5_raw": "us", "chan6_raw": "us", "chan7_raw": "us", "chan8_raw": "us"}
format = '<HHHHHHHHBB'
native_format = bytearray('<HHHHHHHHBB', 'ascii')
orders = [8, 9, 0, 1, 2, 3, 4, 5, 6, 7]
lengths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
crc_extra = 124
unpacker = struct.Struct('<HHHHHHHHBB')
instance_field = None
instance_offset = -1
def __init__(self, target_system, target_component, chan1_raw, chan2_raw, chan3_raw, chan4_raw, chan5_raw, chan6_raw, chan7_raw, chan8_raw):
MAVLink_message.__init__(self, MAVLink_rc_channels_override_message.id, MAVLink_rc_channels_override_message.name)
self._fieldnames = MAVLink_rc_channels_override_message.fieldnames
self._instance_field = MAVLink_rc_channels_override_message.instance_field
self._instance_offset = MAVLink_rc_channels_override_message.instance_offset
self.target_system = target_system
self.target_component = target_component
self.chan1_raw = chan1_raw
self.chan2_raw = chan2_raw
self.chan3_raw = chan3_raw
self.chan4_raw = chan4_raw
self.chan5_raw = chan5_raw
self.chan6_raw = chan6_raw
self.chan7_raw = chan7_raw
self.chan8_raw = chan8_raw
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 124, struct.pack('<HHHHHHHHBB', self.chan1_raw, self.chan2_raw, self.chan3_raw, self.chan4_raw, self.chan5_raw, self.chan6_raw, self.chan7_raw, self.chan8_raw, self.target_system, self.target_component), force_mavlink1=force_mavlink1)
class MAVLink_mission_item_int_message(MAVLink_message):
'''
Message encoding a mission item. This message is emitted to
announce the presence of a mission item and to
set a mission item on the system. The mission item can be
either in x, y, z meters (type: LOCAL) or x:lat, y:lon,
z:altitude. Local frame is Z-down, right handed (NED), global
frame is Z-up, right handed (ENU). NaN or INT32_MAX may be
used in float/integer params (respectively) to indicate
optional/default values (e.g. to use the component's current
latitude, yaw rather than a specific value). See also
https://mavlink.io/en/services/mission.html.
'''
id = MAVLINK_MSG_ID_MISSION_ITEM_INT
name = 'MISSION_ITEM_INT'
fieldnames = ['target_system', 'target_component', 'seq', 'frame', 'command', 'current', 'autocontinue', 'param1', 'param2', 'param3', 'param4', 'x', 'y', 'z']
ordered_fieldnames = ['param1', 'param2', 'param3', 'param4', 'x', 'y', 'z', 'seq', 'command', 'target_system', 'target_component', 'frame', 'current', 'autocontinue']
fieldtypes = ['uint8_t', 'uint8_t', 'uint16_t', 'uint8_t', 'uint16_t', 'uint8_t', 'uint8_t', 'float', 'float', 'float', 'float', 'int32_t', 'int32_t', 'float']
fielddisplays_by_name = {}
fieldenums_by_name = {"frame": "MAV_FRAME", "command": "MAV_CMD"}
fieldunits_by_name = {}
format = '<ffffiifHHBBBBB'
native_format = bytearray('<ffffiifHHBBBBB', 'ascii')
orders = [9, 10, 7, 11, 8, 12, 13, 0, 1, 2, 3, 4, 5, 6]
lengths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
crc_extra = 38
unpacker = struct.Struct('<ffffiifHHBBBBB')
instance_field = None
instance_offset = -1
def __init__(self, target_system, target_component, seq, frame, command, current, autocontinue, param1, param2, param3, param4, x, y, z):
MAVLink_message.__init__(self, MAVLink_mission_item_int_message.id, MAVLink_mission_item_int_message.name)
self._fieldnames = MAVLink_mission_item_int_message.fieldnames
self._instance_field = MAVLink_mission_item_int_message.instance_field
self._instance_offset = MAVLink_mission_item_int_message.instance_offset
self.target_system = target_system
self.target_component = target_component
self.seq = seq
self.frame = frame
self.command = command
self.current = current
self.autocontinue = autocontinue
self.param1 = param1
self.param2 = param2
self.param3 = param3
self.param4 = param4
self.x = x
self.y = y
self.z = z
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 38, struct.pack('<ffffiifHHBBBBB', self.param1, self.param2, self.param3, self.param4, self.x, self.y, self.z, self.seq, self.command, self.target_system, self.target_component, self.frame, self.current, self.autocontinue), force_mavlink1=force_mavlink1)
class MAVLink_vfr_hud_message(MAVLink_message):
'''
Metrics typically displayed on a HUD for fixed wing aircraft.
'''
id = MAVLINK_MSG_ID_VFR_HUD
name = 'VFR_HUD'
fieldnames = ['airspeed', 'groundspeed', 'heading', 'throttle', 'alt', 'climb']
ordered_fieldnames = ['airspeed', 'groundspeed', 'alt', 'climb', 'heading', 'throttle']
fieldtypes = ['float', 'float', 'int16_t', 'uint16_t', 'float', 'float']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"airspeed": "m/s", "groundspeed": "m/s", "heading": "deg", "throttle": "%", "alt": "m", "climb": "m/s"}
format = '<ffffhH'
native_format = bytearray('<ffffhH', 'ascii')
orders = [0, 1, 4, 5, 2, 3]
lengths = [1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0]
crc_extra = 20
unpacker = struct.Struct('<ffffhH')
instance_field = None
instance_offset = -1
def __init__(self, airspeed, groundspeed, heading, throttle, alt, climb):
MAVLink_message.__init__(self, MAVLink_vfr_hud_message.id, MAVLink_vfr_hud_message.name)
self._fieldnames = MAVLink_vfr_hud_message.fieldnames
self._instance_field = MAVLink_vfr_hud_message.instance_field
self._instance_offset = MAVLink_vfr_hud_message.instance_offset
self.airspeed = airspeed
self.groundspeed = groundspeed
self.heading = heading
self.throttle = throttle
self.alt = alt
self.climb = climb
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 20, struct.pack('<ffffhH', self.airspeed, self.groundspeed, self.alt, self.climb, self.heading, self.throttle), force_mavlink1=force_mavlink1)
class MAVLink_command_int_message(MAVLink_message):
'''
Message encoding a command with parameters as scaled integers.
Scaling depends on the actual command value. The command
microservice is documented at
https://mavlink.io/en/services/command.html
'''
id = MAVLINK_MSG_ID_COMMAND_INT
name = 'COMMAND_INT'
fieldnames = ['target_system', 'target_component', 'frame', 'command', 'current', 'autocontinue', 'param1', 'param2', 'param3', 'param4', 'x', 'y', 'z']
ordered_fieldnames = ['param1', 'param2', 'param3', 'param4', 'x', 'y', 'z', 'command', 'target_system', 'target_component', 'frame', 'current', 'autocontinue']
fieldtypes = ['uint8_t', 'uint8_t', 'uint8_t', 'uint16_t', 'uint8_t', 'uint8_t', 'float', 'float', 'float', 'float', 'int32_t', 'int32_t', 'float']
fielddisplays_by_name = {}
fieldenums_by_name = {"frame": "MAV_FRAME", "command": "MAV_CMD"}
fieldunits_by_name = {}
format = '<ffffiifHBBBBB'
native_format = bytearray('<ffffiifHBBBBB', 'ascii')
orders = [8, 9, 10, 7, 11, 12, 0, 1, 2, 3, 4, 5, 6]
lengths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
crc_extra = 158
unpacker = struct.Struct('<ffffiifHBBBBB')
instance_field = None
instance_offset = -1
def __init__(self, target_system, target_component, frame, command, current, autocontinue, param1, param2, param3, param4, x, y, z):
MAVLink_message.__init__(self, MAVLink_command_int_message.id, MAVLink_command_int_message.name)
self._fieldnames = MAVLink_command_int_message.fieldnames
self._instance_field = MAVLink_command_int_message.instance_field
self._instance_offset = MAVLink_command_int_message.instance_offset
self.target_system = target_system
self.target_component = target_component
self.frame = frame
self.command = command
self.current = current
self.autocontinue = autocontinue
self.param1 = param1
self.param2 = param2
self.param3 = param3
self.param4 = param4
self.x = x
self.y = y
self.z = z
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 158, struct.pack('<ffffiifHBBBBB', self.param1, self.param2, self.param3, self.param4, self.x, self.y, self.z, self.command, self.target_system, self.target_component, self.frame, self.current, self.autocontinue), force_mavlink1=force_mavlink1)
class MAVLink_command_long_message(MAVLink_message):
'''
Send a command with up to seven parameters to the MAV. The
command microservice is documented at
https://mavlink.io/en/services/command.html
'''
id = MAVLINK_MSG_ID_COMMAND_LONG
name = 'COMMAND_LONG'
fieldnames = ['target_system', 'target_component', 'command', 'confirmation', 'param1', 'param2', 'param3', 'param4', 'param5', 'param6', 'param7']
ordered_fieldnames = ['param1', 'param2', 'param3', 'param4', 'param5', 'param6', 'param7', 'command', 'target_system', 'target_component', 'confirmation']
fieldtypes = ['uint8_t', 'uint8_t', 'uint16_t', 'uint8_t', 'float', 'float', 'float', 'float', 'float', 'float', 'float']
fielddisplays_by_name = {}
fieldenums_by_name = {"command": "MAV_CMD"}
fieldunits_by_name = {}
format = '<fffffffHBBB'
native_format = bytearray('<fffffffHBBB', 'ascii')
orders = [8, 9, 7, 10, 0, 1, 2, 3, 4, 5, 6]
lengths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
crc_extra = 152
unpacker = struct.Struct('<fffffffHBBB')
instance_field = None
instance_offset = -1
def __init__(self, target_system, target_component, command, confirmation, param1, param2, param3, param4, param5, param6, param7):
MAVLink_message.__init__(self, MAVLink_command_long_message.id, MAVLink_command_long_message.name)
self._fieldnames = MAVLink_command_long_message.fieldnames
self._instance_field = MAVLink_command_long_message.instance_field
self._instance_offset = MAVLink_command_long_message.instance_offset
self.target_system = target_system
self.target_component = target_component
self.command = command
self.confirmation = confirmation
self.param1 = param1
self.param2 = param2
self.param3 = param3
self.param4 = param4
self.param5 = param5
self.param6 = param6
self.param7 = param7
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 152, struct.pack('<fffffffHBBB', self.param1, self.param2, self.param3, self.param4, self.param5, self.param6, self.param7, self.command, self.target_system, self.target_component, self.confirmation), force_mavlink1=force_mavlink1)
class MAVLink_command_ack_message(MAVLink_message):
'''
Report status of a command. Includes feedback whether the
command was executed. The command microservice is documented
at https://mavlink.io/en/services/command.html
'''
id = MAVLINK_MSG_ID_COMMAND_ACK
name = 'COMMAND_ACK'
fieldnames = ['command', 'result']
ordered_fieldnames = ['command', 'result']
fieldtypes = ['uint16_t', 'uint8_t']
fielddisplays_by_name = {}
fieldenums_by_name = {"command": "MAV_CMD", "result": "MAV_RESULT"}
fieldunits_by_name = {}
format = '<HB'
native_format = bytearray('<HB', 'ascii')
orders = [0, 1]
lengths = [1, 1]
array_lengths = [0, 0]
crc_extra = 143
unpacker = struct.Struct('<HB')
instance_field = None
instance_offset = -1
def __init__(self, command, result):
MAVLink_message.__init__(self, MAVLink_command_ack_message.id, MAVLink_command_ack_message.name)
self._fieldnames = MAVLink_command_ack_message.fieldnames
self._instance_field = MAVLink_command_ack_message.instance_field
self._instance_offset = MAVLink_command_ack_message.instance_offset
self.command = command
self.result = result
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 143, struct.pack('<HB', self.command, self.result), force_mavlink1=force_mavlink1)
class MAVLink_manual_setpoint_message(MAVLink_message):
'''
Setpoint in roll, pitch, yaw and thrust from the operator
'''
id = MAVLINK_MSG_ID_MANUAL_SETPOINT
name = 'MANUAL_SETPOINT'
fieldnames = ['time_boot_ms', 'roll', 'pitch', 'yaw', 'thrust', 'mode_switch', 'manual_override_switch']
ordered_fieldnames = ['time_boot_ms', 'roll', 'pitch', 'yaw', 'thrust', 'mode_switch', 'manual_override_switch']
fieldtypes = ['uint32_t', 'float', 'float', 'float', 'float', 'uint8_t', 'uint8_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"time_boot_ms": "ms", "roll": "rad/s", "pitch": "rad/s", "yaw": "rad/s"}
format = '<IffffBB'
native_format = bytearray('<IffffBB', 'ascii')
orders = [0, 1, 2, 3, 4, 5, 6]
lengths = [1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0]
crc_extra = 106
unpacker = struct.Struct('<IffffBB')
instance_field = None
instance_offset = -1
def __init__(self, time_boot_ms, roll, pitch, yaw, thrust, mode_switch, manual_override_switch):
MAVLink_message.__init__(self, MAVLink_manual_setpoint_message.id, MAVLink_manual_setpoint_message.name)
self._fieldnames = MAVLink_manual_setpoint_message.fieldnames
self._instance_field = MAVLink_manual_setpoint_message.instance_field
self._instance_offset = MAVLink_manual_setpoint_message.instance_offset
self.time_boot_ms = time_boot_ms
self.roll = roll
self.pitch = pitch
self.yaw = yaw
self.thrust = thrust
self.mode_switch = mode_switch
self.manual_override_switch = manual_override_switch
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 106, struct.pack('<IffffBB', self.time_boot_ms, self.roll, self.pitch, self.yaw, self.thrust, self.mode_switch, self.manual_override_switch), force_mavlink1=force_mavlink1)
class MAVLink_set_attitude_target_message(MAVLink_message):
'''
Sets a desired vehicle attitude. Used by an external
controller to command the vehicle (manual controller or other
system).
'''
id = MAVLINK_MSG_ID_SET_ATTITUDE_TARGET
name = 'SET_ATTITUDE_TARGET'
fieldnames = ['time_boot_ms', 'target_system', 'target_component', 'type_mask', 'q', 'body_roll_rate', 'body_pitch_rate', 'body_yaw_rate', 'thrust']
ordered_fieldnames = ['time_boot_ms', 'q', 'body_roll_rate', 'body_pitch_rate', 'body_yaw_rate', 'thrust', 'target_system', 'target_component', 'type_mask']
fieldtypes = ['uint32_t', 'uint8_t', 'uint8_t', 'uint8_t', 'float', 'float', 'float', 'float', 'float']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"time_boot_ms": "ms", "body_roll_rate": "rad/s", "body_pitch_rate": "rad/s", "body_yaw_rate": "rad/s"}
format = '<I4fffffBBB'
native_format = bytearray('<IfffffBBB', 'ascii')
orders = [0, 6, 7, 8, 1, 2, 3, 4, 5]
lengths = [1, 4, 1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 4, 0, 0, 0, 0, 0, 0, 0]
crc_extra = 49
unpacker = struct.Struct('<I4fffffBBB')
instance_field = None
instance_offset = -1
def __init__(self, time_boot_ms, target_system, target_component, type_mask, q, body_roll_rate, body_pitch_rate, body_yaw_rate, thrust):
MAVLink_message.__init__(self, MAVLink_set_attitude_target_message.id, MAVLink_set_attitude_target_message.name)
self._fieldnames = MAVLink_set_attitude_target_message.fieldnames
self._instance_field = MAVLink_set_attitude_target_message.instance_field
self._instance_offset = MAVLink_set_attitude_target_message.instance_offset
self.time_boot_ms = time_boot_ms
self.target_system = target_system
self.target_component = target_component
self.type_mask = type_mask
self.q = q
self.body_roll_rate = body_roll_rate
self.body_pitch_rate = body_pitch_rate
self.body_yaw_rate = body_yaw_rate
self.thrust = thrust
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 49, struct.pack('<I4fffffBBB', self.time_boot_ms, self.q[0], self.q[1], self.q[2], self.q[3], self.body_roll_rate, self.body_pitch_rate, self.body_yaw_rate, self.thrust, self.target_system, self.target_component, self.type_mask), force_mavlink1=force_mavlink1)
class MAVLink_attitude_target_message(MAVLink_message):
'''
Reports the current commanded attitude of the vehicle as
specified by the autopilot. This should match the commands
sent in a SET_ATTITUDE_TARGET message if the vehicle is being
controlled this way.
'''
id = MAVLINK_MSG_ID_ATTITUDE_TARGET
name = 'ATTITUDE_TARGET'
fieldnames = ['time_boot_ms', 'type_mask', 'q', 'body_roll_rate', 'body_pitch_rate', 'body_yaw_rate', 'thrust']
ordered_fieldnames = ['time_boot_ms', 'q', 'body_roll_rate', 'body_pitch_rate', 'body_yaw_rate', 'thrust', 'type_mask']
fieldtypes = ['uint32_t', 'uint8_t', 'float', 'float', 'float', 'float', 'float']
fielddisplays_by_name = {"type_mask": "bitmask"}
fieldenums_by_name = {}
fieldunits_by_name = {"time_boot_ms": "ms", "body_roll_rate": "rad/s", "body_pitch_rate": "rad/s", "body_yaw_rate": "rad/s"}
format = '<I4fffffB'
native_format = bytearray('<IfffffB', 'ascii')
orders = [0, 6, 1, 2, 3, 4, 5]
lengths = [1, 4, 1, 1, 1, 1, 1]
array_lengths = [0, 4, 0, 0, 0, 0, 0]
crc_extra = 22
unpacker = struct.Struct('<I4fffffB')
instance_field = None
instance_offset = -1
def __init__(self, time_boot_ms, type_mask, q, body_roll_rate, body_pitch_rate, body_yaw_rate, thrust):
MAVLink_message.__init__(self, MAVLink_attitude_target_message.id, MAVLink_attitude_target_message.name)
self._fieldnames = MAVLink_attitude_target_message.fieldnames
self._instance_field = MAVLink_attitude_target_message.instance_field
self._instance_offset = MAVLink_attitude_target_message.instance_offset
self.time_boot_ms = time_boot_ms
self.type_mask = type_mask
self.q = q
self.body_roll_rate = body_roll_rate
self.body_pitch_rate = body_pitch_rate
self.body_yaw_rate = body_yaw_rate
self.thrust = thrust
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 22, struct.pack('<I4fffffB', self.time_boot_ms, self.q[0], self.q[1], self.q[2], self.q[3], self.body_roll_rate, self.body_pitch_rate, self.body_yaw_rate, self.thrust, self.type_mask), force_mavlink1=force_mavlink1)
class MAVLink_set_position_target_local_ned_message(MAVLink_message):
'''
Sets a desired vehicle position in a local north-east-down
coordinate frame. Used by an external controller to command
the vehicle (manual controller or other system).
'''
id = MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED
name = 'SET_POSITION_TARGET_LOCAL_NED'
fieldnames = ['time_boot_ms', 'target_system', 'target_component', 'coordinate_frame', 'type_mask', 'x', 'y', 'z', 'vx', 'vy', 'vz', 'afx', 'afy', 'afz', 'yaw', 'yaw_rate']
ordered_fieldnames = ['time_boot_ms', 'x', 'y', 'z', 'vx', 'vy', 'vz', 'afx', 'afy', 'afz', 'yaw', 'yaw_rate', 'type_mask', 'target_system', 'target_component', 'coordinate_frame']
fieldtypes = ['uint32_t', 'uint8_t', 'uint8_t', 'uint8_t', 'uint16_t', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float']
fielddisplays_by_name = {"type_mask": "bitmask"}
fieldenums_by_name = {"coordinate_frame": "MAV_FRAME", "type_mask": "POSITION_TARGET_TYPEMASK"}
fieldunits_by_name = {"time_boot_ms": "ms", "x": "m", "y": "m", "z": "m", "vx": "m/s", "vy": "m/s", "vz": "m/s", "afx": "m/s/s", "afy": "m/s/s", "afz": "m/s/s", "yaw": "rad", "yaw_rate": "rad/s"}
format = '<IfffffffffffHBBB'
native_format = bytearray('<IfffffffffffHBBB', 'ascii')
orders = [0, 13, 14, 15, 12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
lengths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
crc_extra = 143
unpacker = struct.Struct('<IfffffffffffHBBB')
instance_field = None
instance_offset = -1
def __init__(self, time_boot_ms, target_system, target_component, coordinate_frame, type_mask, x, y, z, vx, vy, vz, afx, afy, afz, yaw, yaw_rate):
MAVLink_message.__init__(self, MAVLink_set_position_target_local_ned_message.id, MAVLink_set_position_target_local_ned_message.name)
self._fieldnames = MAVLink_set_position_target_local_ned_message.fieldnames
self._instance_field = MAVLink_set_position_target_local_ned_message.instance_field
self._instance_offset = MAVLink_set_position_target_local_ned_message.instance_offset
self.time_boot_ms = time_boot_ms
self.target_system = target_system
self.target_component = target_component
self.coordinate_frame = coordinate_frame
self.type_mask = type_mask
self.x = x
self.y = y
self.z = z
self.vx = vx
self.vy = vy
self.vz = vz
self.afx = afx
self.afy = afy
self.afz = afz
self.yaw = yaw
self.yaw_rate = yaw_rate
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 143, struct.pack('<IfffffffffffHBBB', self.time_boot_ms, self.x, self.y, self.z, self.vx, self.vy, self.vz, self.afx, self.afy, self.afz, self.yaw, self.yaw_rate, self.type_mask, self.target_system, self.target_component, self.coordinate_frame), force_mavlink1=force_mavlink1)
class MAVLink_position_target_local_ned_message(MAVLink_message):
'''
Reports the current commanded vehicle position, velocity, and
acceleration as specified by the autopilot. This should match
the commands sent in SET_POSITION_TARGET_LOCAL_NED if the
vehicle is being controlled this way.
'''
id = MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED
name = 'POSITION_TARGET_LOCAL_NED'
fieldnames = ['time_boot_ms', 'coordinate_frame', 'type_mask', 'x', 'y', 'z', 'vx', 'vy', 'vz', 'afx', 'afy', 'afz', 'yaw', 'yaw_rate']
ordered_fieldnames = ['time_boot_ms', 'x', 'y', 'z', 'vx', 'vy', 'vz', 'afx', 'afy', 'afz', 'yaw', 'yaw_rate', 'type_mask', 'coordinate_frame']
fieldtypes = ['uint32_t', 'uint8_t', 'uint16_t', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float']
fielddisplays_by_name = {"type_mask": "bitmask"}
fieldenums_by_name = {"coordinate_frame": "MAV_FRAME", "type_mask": "POSITION_TARGET_TYPEMASK"}
fieldunits_by_name = {"time_boot_ms": "ms", "x": "m", "y": "m", "z": "m", "vx": "m/s", "vy": "m/s", "vz": "m/s", "afx": "m/s/s", "afy": "m/s/s", "afz": "m/s/s", "yaw": "rad", "yaw_rate": "rad/s"}
format = '<IfffffffffffHB'
native_format = bytearray('<IfffffffffffHB', 'ascii')
orders = [0, 13, 12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
lengths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
crc_extra = 140
unpacker = struct.Struct('<IfffffffffffHB')
instance_field = None
instance_offset = -1
def __init__(self, time_boot_ms, coordinate_frame, type_mask, x, y, z, vx, vy, vz, afx, afy, afz, yaw, yaw_rate):
MAVLink_message.__init__(self, MAVLink_position_target_local_ned_message.id, MAVLink_position_target_local_ned_message.name)
self._fieldnames = MAVLink_position_target_local_ned_message.fieldnames
self._instance_field = MAVLink_position_target_local_ned_message.instance_field
self._instance_offset = MAVLink_position_target_local_ned_message.instance_offset
self.time_boot_ms = time_boot_ms
self.coordinate_frame = coordinate_frame
self.type_mask = type_mask
self.x = x
self.y = y
self.z = z
self.vx = vx
self.vy = vy
self.vz = vz
self.afx = afx
self.afy = afy
self.afz = afz
self.yaw = yaw
self.yaw_rate = yaw_rate
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 140, struct.pack('<IfffffffffffHB', self.time_boot_ms, self.x, self.y, self.z, self.vx, self.vy, self.vz, self.afx, self.afy, self.afz, self.yaw, self.yaw_rate, self.type_mask, self.coordinate_frame), force_mavlink1=force_mavlink1)
class MAVLink_set_position_target_global_int_message(MAVLink_message):
'''
Sets a desired vehicle position, velocity, and/or acceleration
in a global coordinate system (WGS84). Used by an external
controller to command the vehicle (manual controller or other
system).
'''
id = MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT
name = 'SET_POSITION_TARGET_GLOBAL_INT'
fieldnames = ['time_boot_ms', 'target_system', 'target_component', 'coordinate_frame', 'type_mask', 'lat_int', 'lon_int', 'alt', 'vx', 'vy', 'vz', 'afx', 'afy', 'afz', 'yaw', 'yaw_rate']
ordered_fieldnames = ['time_boot_ms', 'lat_int', 'lon_int', 'alt', 'vx', 'vy', 'vz', 'afx', 'afy', 'afz', 'yaw', 'yaw_rate', 'type_mask', 'target_system', 'target_component', 'coordinate_frame']
fieldtypes = ['uint32_t', 'uint8_t', 'uint8_t', 'uint8_t', 'uint16_t', 'int32_t', 'int32_t', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float']
fielddisplays_by_name = {"type_mask": "bitmask"}
fieldenums_by_name = {"coordinate_frame": "MAV_FRAME", "type_mask": "POSITION_TARGET_TYPEMASK"}
fieldunits_by_name = {"time_boot_ms": "ms", "lat_int": "degE7", "lon_int": "degE7", "alt": "m", "vx": "m/s", "vy": "m/s", "vz": "m/s", "afx": "m/s/s", "afy": "m/s/s", "afz": "m/s/s", "yaw": "rad", "yaw_rate": "rad/s"}
format = '<IiifffffffffHBBB'
native_format = bytearray('<IiifffffffffHBBB', 'ascii')
orders = [0, 13, 14, 15, 12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
lengths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
crc_extra = 5
unpacker = struct.Struct('<IiifffffffffHBBB')
instance_field = None
instance_offset = -1
def __init__(self, time_boot_ms, target_system, target_component, coordinate_frame, type_mask, lat_int, lon_int, alt, vx, vy, vz, afx, afy, afz, yaw, yaw_rate):
MAVLink_message.__init__(self, MAVLink_set_position_target_global_int_message.id, MAVLink_set_position_target_global_int_message.name)
self._fieldnames = MAVLink_set_position_target_global_int_message.fieldnames
self._instance_field = MAVLink_set_position_target_global_int_message.instance_field
self._instance_offset = MAVLink_set_position_target_global_int_message.instance_offset
self.time_boot_ms = time_boot_ms
self.target_system = target_system
self.target_component = target_component
self.coordinate_frame = coordinate_frame
self.type_mask = type_mask
self.lat_int = lat_int
self.lon_int = lon_int
self.alt = alt
self.vx = vx
self.vy = vy
self.vz = vz
self.afx = afx
self.afy = afy
self.afz = afz
self.yaw = yaw
self.yaw_rate = yaw_rate
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 5, struct.pack('<IiifffffffffHBBB', self.time_boot_ms, self.lat_int, self.lon_int, self.alt, self.vx, self.vy, self.vz, self.afx, self.afy, self.afz, self.yaw, self.yaw_rate, self.type_mask, self.target_system, self.target_component, self.coordinate_frame), force_mavlink1=force_mavlink1)
class MAVLink_position_target_global_int_message(MAVLink_message):
'''
Reports the current commanded vehicle position, velocity, and
acceleration as specified by the autopilot. This should match
the commands sent in SET_POSITION_TARGET_GLOBAL_INT if the
vehicle is being controlled this way.
'''
id = MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT
name = 'POSITION_TARGET_GLOBAL_INT'
fieldnames = ['time_boot_ms', 'coordinate_frame', 'type_mask', 'lat_int', 'lon_int', 'alt', 'vx', 'vy', 'vz', 'afx', 'afy', 'afz', 'yaw', 'yaw_rate']
ordered_fieldnames = ['time_boot_ms', 'lat_int', 'lon_int', 'alt', 'vx', 'vy', 'vz', 'afx', 'afy', 'afz', 'yaw', 'yaw_rate', 'type_mask', 'coordinate_frame']
fieldtypes = ['uint32_t', 'uint8_t', 'uint16_t', 'int32_t', 'int32_t', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float']
fielddisplays_by_name = {"type_mask": "bitmask"}
fieldenums_by_name = {"coordinate_frame": "MAV_FRAME", "type_mask": "POSITION_TARGET_TYPEMASK"}
fieldunits_by_name = {"time_boot_ms": "ms", "lat_int": "degE7", "lon_int": "degE7", "alt": "m", "vx": "m/s", "vy": "m/s", "vz": "m/s", "afx": "m/s/s", "afy": "m/s/s", "afz": "m/s/s", "yaw": "rad", "yaw_rate": "rad/s"}
format = '<IiifffffffffHB'
native_format = bytearray('<IiifffffffffHB', 'ascii')
orders = [0, 13, 12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
lengths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
crc_extra = 150
unpacker = struct.Struct('<IiifffffffffHB')
instance_field = None
instance_offset = -1
def __init__(self, time_boot_ms, coordinate_frame, type_mask, lat_int, lon_int, alt, vx, vy, vz, afx, afy, afz, yaw, yaw_rate):
MAVLink_message.__init__(self, MAVLink_position_target_global_int_message.id, MAVLink_position_target_global_int_message.name)
self._fieldnames = MAVLink_position_target_global_int_message.fieldnames
self._instance_field = MAVLink_position_target_global_int_message.instance_field
self._instance_offset = MAVLink_position_target_global_int_message.instance_offset
self.time_boot_ms = time_boot_ms
self.coordinate_frame = coordinate_frame
self.type_mask = type_mask
self.lat_int = lat_int
self.lon_int = lon_int
self.alt = alt
self.vx = vx
self.vy = vy
self.vz = vz
self.afx = afx
self.afy = afy
self.afz = afz
self.yaw = yaw
self.yaw_rate = yaw_rate
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 150, struct.pack('<IiifffffffffHB', self.time_boot_ms, self.lat_int, self.lon_int, self.alt, self.vx, self.vy, self.vz, self.afx, self.afy, self.afz, self.yaw, self.yaw_rate, self.type_mask, self.coordinate_frame), force_mavlink1=force_mavlink1)
class MAVLink_local_position_ned_system_global_offset_message(MAVLink_message):
'''
The offset in X, Y, Z and yaw between the LOCAL_POSITION_NED
messages of MAV X and the global coordinate frame in NED
coordinates. Coordinate frame is right-handed, Z-axis down
(aeronautical frame, NED / north-east-down convention)
'''
id = MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET
name = 'LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET'
fieldnames = ['time_boot_ms', 'x', 'y', 'z', 'roll', 'pitch', 'yaw']
ordered_fieldnames = ['time_boot_ms', 'x', 'y', 'z', 'roll', 'pitch', 'yaw']
fieldtypes = ['uint32_t', 'float', 'float', 'float', 'float', 'float', 'float']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"time_boot_ms": "ms", "x": "m", "y": "m", "z": "m", "roll": "rad", "pitch": "rad", "yaw": "rad"}
format = '<Iffffff'
native_format = bytearray('<Iffffff', 'ascii')
orders = [0, 1, 2, 3, 4, 5, 6]
lengths = [1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0]
crc_extra = 231
unpacker = struct.Struct('<Iffffff')
instance_field = None
instance_offset = -1
def __init__(self, time_boot_ms, x, y, z, roll, pitch, yaw):
MAVLink_message.__init__(self, MAVLink_local_position_ned_system_global_offset_message.id, MAVLink_local_position_ned_system_global_offset_message.name)
self._fieldnames = MAVLink_local_position_ned_system_global_offset_message.fieldnames
self._instance_field = MAVLink_local_position_ned_system_global_offset_message.instance_field
self._instance_offset = MAVLink_local_position_ned_system_global_offset_message.instance_offset
self.time_boot_ms = time_boot_ms
self.x = x
self.y = y
self.z = z
self.roll = roll
self.pitch = pitch
self.yaw = yaw
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 231, struct.pack('<Iffffff', self.time_boot_ms, self.x, self.y, self.z, self.roll, self.pitch, self.yaw), force_mavlink1=force_mavlink1)
class MAVLink_hil_state_message(MAVLink_message):
'''
Sent from simulation to autopilot. This packet is useful for
high throughput applications such as hardware in the loop
simulations.
'''
id = MAVLINK_MSG_ID_HIL_STATE
name = 'HIL_STATE'
fieldnames = ['time_usec', 'roll', 'pitch', 'yaw', 'rollspeed', 'pitchspeed', 'yawspeed', 'lat', 'lon', 'alt', 'vx', 'vy', 'vz', 'xacc', 'yacc', 'zacc']
ordered_fieldnames = ['time_usec', 'roll', 'pitch', 'yaw', 'rollspeed', 'pitchspeed', 'yawspeed', 'lat', 'lon', 'alt', 'vx', 'vy', 'vz', 'xacc', 'yacc', 'zacc']
fieldtypes = ['uint64_t', 'float', 'float', 'float', 'float', 'float', 'float', 'int32_t', 'int32_t', 'int32_t', 'int16_t', 'int16_t', 'int16_t', 'int16_t', 'int16_t', 'int16_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"time_usec": "us", "roll": "rad", "pitch": "rad", "yaw": "rad", "rollspeed": "rad/s", "pitchspeed": "rad/s", "yawspeed": "rad/s", "lat": "degE7", "lon": "degE7", "alt": "mm", "vx": "cm/s", "vy": "cm/s", "vz": "cm/s", "xacc": "mG", "yacc": "mG", "zacc": "mG"}
format = '<Qffffffiiihhhhhh'
native_format = bytearray('<Qffffffiiihhhhhh', 'ascii')
orders = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
lengths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
crc_extra = 183
unpacker = struct.Struct('<Qffffffiiihhhhhh')
instance_field = None
instance_offset = -1
def __init__(self, time_usec, roll, pitch, yaw, rollspeed, pitchspeed, yawspeed, lat, lon, alt, vx, vy, vz, xacc, yacc, zacc):
MAVLink_message.__init__(self, MAVLink_hil_state_message.id, MAVLink_hil_state_message.name)
self._fieldnames = MAVLink_hil_state_message.fieldnames
self._instance_field = MAVLink_hil_state_message.instance_field
self._instance_offset = MAVLink_hil_state_message.instance_offset
self.time_usec = time_usec
self.roll = roll
self.pitch = pitch
self.yaw = yaw
self.rollspeed = rollspeed
self.pitchspeed = pitchspeed
self.yawspeed = yawspeed
self.lat = lat
self.lon = lon
self.alt = alt
self.vx = vx
self.vy = vy
self.vz = vz
self.xacc = xacc
self.yacc = yacc
self.zacc = zacc
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 183, struct.pack('<Qffffffiiihhhhhh', self.time_usec, self.roll, self.pitch, self.yaw, self.rollspeed, self.pitchspeed, self.yawspeed, self.lat, self.lon, self.alt, self.vx, self.vy, self.vz, self.xacc, self.yacc, self.zacc), force_mavlink1=force_mavlink1)
class MAVLink_hil_controls_message(MAVLink_message):
'''
Sent from autopilot to simulation. Hardware in the loop
control outputs
'''
id = MAVLINK_MSG_ID_HIL_CONTROLS
name = 'HIL_CONTROLS'
fieldnames = ['time_usec', 'roll_ailerons', 'pitch_elevator', 'yaw_rudder', 'throttle', 'aux1', 'aux2', 'aux3', 'aux4', 'mode', 'nav_mode']
ordered_fieldnames = ['time_usec', 'roll_ailerons', 'pitch_elevator', 'yaw_rudder', 'throttle', 'aux1', 'aux2', 'aux3', 'aux4', 'mode', 'nav_mode']
fieldtypes = ['uint64_t', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'uint8_t', 'uint8_t']
fielddisplays_by_name = {}
fieldenums_by_name = {"mode": "MAV_MODE"}
fieldunits_by_name = {"time_usec": "us"}
format = '<QffffffffBB'
native_format = bytearray('<QffffffffBB', 'ascii')
orders = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
lengths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
crc_extra = 63
unpacker = struct.Struct('<QffffffffBB')
instance_field = None
instance_offset = -1
def __init__(self, time_usec, roll_ailerons, pitch_elevator, yaw_rudder, throttle, aux1, aux2, aux3, aux4, mode, nav_mode):
MAVLink_message.__init__(self, MAVLink_hil_controls_message.id, MAVLink_hil_controls_message.name)
self._fieldnames = MAVLink_hil_controls_message.fieldnames
self._instance_field = MAVLink_hil_controls_message.instance_field
self._instance_offset = MAVLink_hil_controls_message.instance_offset
self.time_usec = time_usec
self.roll_ailerons = roll_ailerons
self.pitch_elevator = pitch_elevator
self.yaw_rudder = yaw_rudder
self.throttle = throttle
self.aux1 = aux1
self.aux2 = aux2
self.aux3 = aux3
self.aux4 = aux4
self.mode = mode
self.nav_mode = nav_mode
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 63, struct.pack('<QffffffffBB', self.time_usec, self.roll_ailerons, self.pitch_elevator, self.yaw_rudder, self.throttle, self.aux1, self.aux2, self.aux3, self.aux4, self.mode, self.nav_mode), force_mavlink1=force_mavlink1)
class MAVLink_hil_rc_inputs_raw_message(MAVLink_message):
'''
Sent from simulation to autopilot. The RAW values of the RC
channels received. The standard PPM modulation is as follows:
1000 microseconds: 0%, 2000 microseconds: 100%. Individual
receivers/transmitters might violate this specification.
'''
id = MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW
name = 'HIL_RC_INPUTS_RAW'
fieldnames = ['time_usec', 'chan1_raw', 'chan2_raw', 'chan3_raw', 'chan4_raw', 'chan5_raw', 'chan6_raw', 'chan7_raw', 'chan8_raw', 'chan9_raw', 'chan10_raw', 'chan11_raw', 'chan12_raw', 'rssi']
ordered_fieldnames = ['time_usec', 'chan1_raw', 'chan2_raw', 'chan3_raw', 'chan4_raw', 'chan5_raw', 'chan6_raw', 'chan7_raw', 'chan8_raw', 'chan9_raw', 'chan10_raw', 'chan11_raw', 'chan12_raw', 'rssi']
fieldtypes = ['uint64_t', 'uint16_t', 'uint16_t', 'uint16_t', 'uint16_t', 'uint16_t', 'uint16_t', 'uint16_t', 'uint16_t', 'uint16_t', 'uint16_t', 'uint16_t', 'uint16_t', 'uint8_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"time_usec": "us", "chan1_raw": "us", "chan2_raw": "us", "chan3_raw": "us", "chan4_raw": "us", "chan5_raw": "us", "chan6_raw": "us", "chan7_raw": "us", "chan8_raw": "us", "chan9_raw": "us", "chan10_raw": "us", "chan11_raw": "us", "chan12_raw": "us"}
format = '<QHHHHHHHHHHHHB'
native_format = bytearray('<QHHHHHHHHHHHHB', 'ascii')
orders = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
lengths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
crc_extra = 54
unpacker = struct.Struct('<QHHHHHHHHHHHHB')
instance_field = None
instance_offset = -1
def __init__(self, time_usec, chan1_raw, chan2_raw, chan3_raw, chan4_raw, chan5_raw, chan6_raw, chan7_raw, chan8_raw, chan9_raw, chan10_raw, chan11_raw, chan12_raw, rssi):
MAVLink_message.__init__(self, MAVLink_hil_rc_inputs_raw_message.id, MAVLink_hil_rc_inputs_raw_message.name)
self._fieldnames = MAVLink_hil_rc_inputs_raw_message.fieldnames
self._instance_field = MAVLink_hil_rc_inputs_raw_message.instance_field
self._instance_offset = MAVLink_hil_rc_inputs_raw_message.instance_offset
self.time_usec = time_usec
self.chan1_raw = chan1_raw
self.chan2_raw = chan2_raw
self.chan3_raw = chan3_raw
self.chan4_raw = chan4_raw
self.chan5_raw = chan5_raw
self.chan6_raw = chan6_raw
self.chan7_raw = chan7_raw
self.chan8_raw = chan8_raw
self.chan9_raw = chan9_raw
self.chan10_raw = chan10_raw
self.chan11_raw = chan11_raw
self.chan12_raw = chan12_raw
self.rssi = rssi
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 54, struct.pack('<QHHHHHHHHHHHHB', self.time_usec, self.chan1_raw, self.chan2_raw, self.chan3_raw, self.chan4_raw, self.chan5_raw, self.chan6_raw, self.chan7_raw, self.chan8_raw, self.chan9_raw, self.chan10_raw, self.chan11_raw, self.chan12_raw, self.rssi), force_mavlink1=force_mavlink1)
class MAVLink_hil_actuator_controls_message(MAVLink_message):
'''
Sent from autopilot to simulation. Hardware in the loop
control outputs (replacement for HIL_CONTROLS)
'''
id = MAVLINK_MSG_ID_HIL_ACTUATOR_CONTROLS
name = 'HIL_ACTUATOR_CONTROLS'
fieldnames = ['time_usec', 'controls', 'mode', 'flags']
ordered_fieldnames = ['time_usec', 'flags', 'controls', 'mode']
fieldtypes = ['uint64_t', 'float', 'uint8_t', 'uint64_t']
fielddisplays_by_name = {"mode": "bitmask", "flags": "bitmask"}
fieldenums_by_name = {"mode": "MAV_MODE_FLAG"}
fieldunits_by_name = {"time_usec": "us"}
format = '<QQ16fB'
native_format = bytearray('<QQfB', 'ascii')
orders = [0, 2, 3, 1]
lengths = [1, 1, 16, 1]
array_lengths = [0, 0, 16, 0]
crc_extra = 47
unpacker = struct.Struct('<QQ16fB')
instance_field = None
instance_offset = -1
def __init__(self, time_usec, controls, mode, flags):
MAVLink_message.__init__(self, MAVLink_hil_actuator_controls_message.id, MAVLink_hil_actuator_controls_message.name)
self._fieldnames = MAVLink_hil_actuator_controls_message.fieldnames
self._instance_field = MAVLink_hil_actuator_controls_message.instance_field
self._instance_offset = MAVLink_hil_actuator_controls_message.instance_offset
self.time_usec = time_usec
self.controls = controls
self.mode = mode
self.flags = flags
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 47, struct.pack('<QQ16fB', self.time_usec, self.flags, self.controls[0], self.controls[1], self.controls[2], self.controls[3], self.controls[4], self.controls[5], self.controls[6], self.controls[7], self.controls[8], self.controls[9], self.controls[10], self.controls[11], self.controls[12], self.controls[13], self.controls[14], self.controls[15], self.mode), force_mavlink1=force_mavlink1)
class MAVLink_optical_flow_message(MAVLink_message):
'''
Optical flow from a flow sensor (e.g. optical mouse sensor)
'''
id = MAVLINK_MSG_ID_OPTICAL_FLOW
name = 'OPTICAL_FLOW'
fieldnames = ['time_usec', 'sensor_id', 'flow_x', 'flow_y', 'flow_comp_m_x', 'flow_comp_m_y', 'quality', 'ground_distance']
ordered_fieldnames = ['time_usec', 'flow_comp_m_x', 'flow_comp_m_y', 'ground_distance', 'flow_x', 'flow_y', 'sensor_id', 'quality']
fieldtypes = ['uint64_t', 'uint8_t', 'int16_t', 'int16_t', 'float', 'float', 'uint8_t', 'float']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"time_usec": "us", "flow_x": "dpix", "flow_y": "dpix", "flow_comp_m_x": "m/s", "flow_comp_m_y": "m/s", "ground_distance": "m"}
format = '<QfffhhBB'
native_format = bytearray('<QfffhhBB', 'ascii')
orders = [0, 6, 4, 5, 1, 2, 7, 3]
lengths = [1, 1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0, 0]
crc_extra = 175
unpacker = struct.Struct('<QfffhhBB')
instance_field = None
instance_offset = -1
def __init__(self, time_usec, sensor_id, flow_x, flow_y, flow_comp_m_x, flow_comp_m_y, quality, ground_distance):
MAVLink_message.__init__(self, MAVLink_optical_flow_message.id, MAVLink_optical_flow_message.name)
self._fieldnames = MAVLink_optical_flow_message.fieldnames
self._instance_field = MAVLink_optical_flow_message.instance_field
self._instance_offset = MAVLink_optical_flow_message.instance_offset
self.time_usec = time_usec
self.sensor_id = sensor_id
self.flow_x = flow_x
self.flow_y = flow_y
self.flow_comp_m_x = flow_comp_m_x
self.flow_comp_m_y = flow_comp_m_y
self.quality = quality
self.ground_distance = ground_distance
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 175, struct.pack('<QfffhhBB', self.time_usec, self.flow_comp_m_x, self.flow_comp_m_y, self.ground_distance, self.flow_x, self.flow_y, self.sensor_id, self.quality), force_mavlink1=force_mavlink1)
class MAVLink_global_vision_position_estimate_message(MAVLink_message):
'''
Global position/attitude estimate from a vision source.
'''
id = MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE
name = 'GLOBAL_VISION_POSITION_ESTIMATE'
fieldnames = ['usec', 'x', 'y', 'z', 'roll', 'pitch', 'yaw']
ordered_fieldnames = ['usec', 'x', 'y', 'z', 'roll', 'pitch', 'yaw']
fieldtypes = ['uint64_t', 'float', 'float', 'float', 'float', 'float', 'float']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"usec": "us", "x": "m", "y": "m", "z": "m", "roll": "rad", "pitch": "rad", "yaw": "rad"}
format = '<Qffffff'
native_format = bytearray('<Qffffff', 'ascii')
orders = [0, 1, 2, 3, 4, 5, 6]
lengths = [1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0]
crc_extra = 102
unpacker = struct.Struct('<Qffffff')
instance_field = None
instance_offset = -1
def __init__(self, usec, x, y, z, roll, pitch, yaw):
MAVLink_message.__init__(self, MAVLink_global_vision_position_estimate_message.id, MAVLink_global_vision_position_estimate_message.name)
self._fieldnames = MAVLink_global_vision_position_estimate_message.fieldnames
self._instance_field = MAVLink_global_vision_position_estimate_message.instance_field
self._instance_offset = MAVLink_global_vision_position_estimate_message.instance_offset
self.usec = usec
self.x = x
self.y = y
self.z = z
self.roll = roll
self.pitch = pitch
self.yaw = yaw
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 102, struct.pack('<Qffffff', self.usec, self.x, self.y, self.z, self.roll, self.pitch, self.yaw), force_mavlink1=force_mavlink1)
class MAVLink_vision_position_estimate_message(MAVLink_message):
'''
Local position/attitude estimate from a vision source.
'''
id = MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE
name = 'VISION_POSITION_ESTIMATE'
fieldnames = ['usec', 'x', 'y', 'z', 'roll', 'pitch', 'yaw']
ordered_fieldnames = ['usec', 'x', 'y', 'z', 'roll', 'pitch', 'yaw']
fieldtypes = ['uint64_t', 'float', 'float', 'float', 'float', 'float', 'float']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"usec": "us", "x": "m", "y": "m", "z": "m", "roll": "rad", "pitch": "rad", "yaw": "rad"}
format = '<Qffffff'
native_format = bytearray('<Qffffff', 'ascii')
orders = [0, 1, 2, 3, 4, 5, 6]
lengths = [1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0]
crc_extra = 158
unpacker = struct.Struct('<Qffffff')
instance_field = None
instance_offset = -1
def __init__(self, usec, x, y, z, roll, pitch, yaw):
MAVLink_message.__init__(self, MAVLink_vision_position_estimate_message.id, MAVLink_vision_position_estimate_message.name)
self._fieldnames = MAVLink_vision_position_estimate_message.fieldnames
self._instance_field = MAVLink_vision_position_estimate_message.instance_field
self._instance_offset = MAVLink_vision_position_estimate_message.instance_offset
self.usec = usec
self.x = x
self.y = y
self.z = z
self.roll = roll
self.pitch = pitch
self.yaw = yaw
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 158, struct.pack('<Qffffff', self.usec, self.x, self.y, self.z, self.roll, self.pitch, self.yaw), force_mavlink1=force_mavlink1)
class MAVLink_vision_speed_estimate_message(MAVLink_message):
'''
Speed estimate from a vision source.
'''
id = MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE
name = 'VISION_SPEED_ESTIMATE'
fieldnames = ['usec', 'x', 'y', 'z']
ordered_fieldnames = ['usec', 'x', 'y', 'z']
fieldtypes = ['uint64_t', 'float', 'float', 'float']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"usec": "us", "x": "m/s", "y": "m/s", "z": "m/s"}
format = '<Qfff'
native_format = bytearray('<Qfff', 'ascii')
orders = [0, 1, 2, 3]
lengths = [1, 1, 1, 1]
array_lengths = [0, 0, 0, 0]
crc_extra = 208
unpacker = struct.Struct('<Qfff')
instance_field = None
instance_offset = -1
def __init__(self, usec, x, y, z):
MAVLink_message.__init__(self, MAVLink_vision_speed_estimate_message.id, MAVLink_vision_speed_estimate_message.name)
self._fieldnames = MAVLink_vision_speed_estimate_message.fieldnames
self._instance_field = MAVLink_vision_speed_estimate_message.instance_field
self._instance_offset = MAVLink_vision_speed_estimate_message.instance_offset
self.usec = usec
self.x = x
self.y = y
self.z = z
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 208, struct.pack('<Qfff', self.usec, self.x, self.y, self.z), force_mavlink1=force_mavlink1)
class MAVLink_vicon_position_estimate_message(MAVLink_message):
'''
Global position estimate from a Vicon motion system source.
'''
id = MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE
name = 'VICON_POSITION_ESTIMATE'
fieldnames = ['usec', 'x', 'y', 'z', 'roll', 'pitch', 'yaw']
ordered_fieldnames = ['usec', 'x', 'y', 'z', 'roll', 'pitch', 'yaw']
fieldtypes = ['uint64_t', 'float', 'float', 'float', 'float', 'float', 'float']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"usec": "us", "x": "m", "y": "m", "z": "m", "roll": "rad", "pitch": "rad", "yaw": "rad"}
format = '<Qffffff'
native_format = bytearray('<Qffffff', 'ascii')
orders = [0, 1, 2, 3, 4, 5, 6]
lengths = [1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0]
crc_extra = 56
unpacker = struct.Struct('<Qffffff')
instance_field = None
instance_offset = -1
def __init__(self, usec, x, y, z, roll, pitch, yaw):
MAVLink_message.__init__(self, MAVLink_vicon_position_estimate_message.id, MAVLink_vicon_position_estimate_message.name)
self._fieldnames = MAVLink_vicon_position_estimate_message.fieldnames
self._instance_field = MAVLink_vicon_position_estimate_message.instance_field
self._instance_offset = MAVLink_vicon_position_estimate_message.instance_offset
self.usec = usec
self.x = x
self.y = y
self.z = z
self.roll = roll
self.pitch = pitch
self.yaw = yaw
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 56, struct.pack('<Qffffff', self.usec, self.x, self.y, self.z, self.roll, self.pitch, self.yaw), force_mavlink1=force_mavlink1)
class MAVLink_highres_imu_message(MAVLink_message):
'''
The IMU readings in SI units in NED body frame
'''
id = MAVLINK_MSG_ID_HIGHRES_IMU
name = 'HIGHRES_IMU'
fieldnames = ['time_usec', 'xacc', 'yacc', 'zacc', 'xgyro', 'ygyro', 'zgyro', 'xmag', 'ymag', 'zmag', 'abs_pressure', 'diff_pressure', 'pressure_alt', 'temperature', 'fields_updated']
ordered_fieldnames = ['time_usec', 'xacc', 'yacc', 'zacc', 'xgyro', 'ygyro', 'zgyro', 'xmag', 'ymag', 'zmag', 'abs_pressure', 'diff_pressure', 'pressure_alt', 'temperature', 'fields_updated']
fieldtypes = ['uint64_t', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'uint16_t']
fielddisplays_by_name = {"fields_updated": "bitmask"}
fieldenums_by_name = {}
fieldunits_by_name = {"time_usec": "us", "xacc": "m/s/s", "yacc": "m/s/s", "zacc": "m/s/s", "xgyro": "rad/s", "ygyro": "rad/s", "zgyro": "rad/s", "xmag": "gauss", "ymag": "gauss", "zmag": "gauss", "abs_pressure": "mbar", "diff_pressure": "mbar", "temperature": "degC"}
format = '<QfffffffffffffH'
native_format = bytearray('<QfffffffffffffH', 'ascii')
orders = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
lengths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
crc_extra = 93
unpacker = struct.Struct('<QfffffffffffffH')
instance_field = None
instance_offset = -1
def __init__(self, time_usec, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag, abs_pressure, diff_pressure, pressure_alt, temperature, fields_updated):
MAVLink_message.__init__(self, MAVLink_highres_imu_message.id, MAVLink_highres_imu_message.name)
self._fieldnames = MAVLink_highres_imu_message.fieldnames
self._instance_field = MAVLink_highres_imu_message.instance_field
self._instance_offset = MAVLink_highres_imu_message.instance_offset
self.time_usec = time_usec
self.xacc = xacc
self.yacc = yacc
self.zacc = zacc
self.xgyro = xgyro
self.ygyro = ygyro
self.zgyro = zgyro
self.xmag = xmag
self.ymag = ymag
self.zmag = zmag
self.abs_pressure = abs_pressure
self.diff_pressure = diff_pressure
self.pressure_alt = pressure_alt
self.temperature = temperature
self.fields_updated = fields_updated
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 93, struct.pack('<QfffffffffffffH', self.time_usec, self.xacc, self.yacc, self.zacc, self.xgyro, self.ygyro, self.zgyro, self.xmag, self.ymag, self.zmag, self.abs_pressure, self.diff_pressure, self.pressure_alt, self.temperature, self.fields_updated), force_mavlink1=force_mavlink1)
class MAVLink_optical_flow_rad_message(MAVLink_message):
'''
Optical flow from an angular rate flow sensor (e.g. PX4FLOW or
mouse sensor)
'''
id = MAVLINK_MSG_ID_OPTICAL_FLOW_RAD
name = 'OPTICAL_FLOW_RAD'
fieldnames = ['time_usec', 'sensor_id', 'integration_time_us', 'integrated_x', 'integrated_y', 'integrated_xgyro', 'integrated_ygyro', 'integrated_zgyro', 'temperature', 'quality', 'time_delta_distance_us', 'distance']
ordered_fieldnames = ['time_usec', 'integration_time_us', 'integrated_x', 'integrated_y', 'integrated_xgyro', 'integrated_ygyro', 'integrated_zgyro', 'time_delta_distance_us', 'distance', 'temperature', 'sensor_id', 'quality']
fieldtypes = ['uint64_t', 'uint8_t', 'uint32_t', 'float', 'float', 'float', 'float', 'float', 'int16_t', 'uint8_t', 'uint32_t', 'float']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"time_usec": "us", "integration_time_us": "us", "integrated_x": "rad", "integrated_y": "rad", "integrated_xgyro": "rad", "integrated_ygyro": "rad", "integrated_zgyro": "rad", "temperature": "cdegC", "time_delta_distance_us": "us", "distance": "m"}
format = '<QIfffffIfhBB'
native_format = bytearray('<QIfffffIfhBB', 'ascii')
orders = [0, 10, 1, 2, 3, 4, 5, 6, 9, 11, 7, 8]
lengths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
crc_extra = 138
unpacker = struct.Struct('<QIfffffIfhBB')
instance_field = None
instance_offset = -1
def __init__(self, time_usec, sensor_id, integration_time_us, integrated_x, integrated_y, integrated_xgyro, integrated_ygyro, integrated_zgyro, temperature, quality, time_delta_distance_us, distance):
MAVLink_message.__init__(self, MAVLink_optical_flow_rad_message.id, MAVLink_optical_flow_rad_message.name)
self._fieldnames = MAVLink_optical_flow_rad_message.fieldnames
self._instance_field = MAVLink_optical_flow_rad_message.instance_field
self._instance_offset = MAVLink_optical_flow_rad_message.instance_offset
self.time_usec = time_usec
self.sensor_id = sensor_id
self.integration_time_us = integration_time_us
self.integrated_x = integrated_x
self.integrated_y = integrated_y
self.integrated_xgyro = integrated_xgyro
self.integrated_ygyro = integrated_ygyro
self.integrated_zgyro = integrated_zgyro
self.temperature = temperature
self.quality = quality
self.time_delta_distance_us = time_delta_distance_us
self.distance = distance
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 138, struct.pack('<QIfffffIfhBB', self.time_usec, self.integration_time_us, self.integrated_x, self.integrated_y, self.integrated_xgyro, self.integrated_ygyro, self.integrated_zgyro, self.time_delta_distance_us, self.distance, self.temperature, self.sensor_id, self.quality), force_mavlink1=force_mavlink1)
class MAVLink_hil_sensor_message(MAVLink_message):
'''
The IMU readings in SI units in NED body frame
'''
id = MAVLINK_MSG_ID_HIL_SENSOR
name = 'HIL_SENSOR'
fieldnames = ['time_usec', 'xacc', 'yacc', 'zacc', 'xgyro', 'ygyro', 'zgyro', 'xmag', 'ymag', 'zmag', 'abs_pressure', 'diff_pressure', 'pressure_alt', 'temperature', 'fields_updated']
ordered_fieldnames = ['time_usec', 'xacc', 'yacc', 'zacc', 'xgyro', 'ygyro', 'zgyro', 'xmag', 'ymag', 'zmag', 'abs_pressure', 'diff_pressure', 'pressure_alt', 'temperature', 'fields_updated']
fieldtypes = ['uint64_t', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'uint32_t']
fielddisplays_by_name = {"fields_updated": "bitmask"}
fieldenums_by_name = {}
fieldunits_by_name = {"time_usec": "us", "xacc": "m/s/s", "yacc": "m/s/s", "zacc": "m/s/s", "xgyro": "rad/s", "ygyro": "rad/s", "zgyro": "rad/s", "xmag": "gauss", "ymag": "gauss", "zmag": "gauss", "abs_pressure": "mbar", "diff_pressure": "mbar", "temperature": "degC"}
format = '<QfffffffffffffI'
native_format = bytearray('<QfffffffffffffI', 'ascii')
orders = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
lengths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
crc_extra = 108
unpacker = struct.Struct('<QfffffffffffffI')
instance_field = None
instance_offset = -1
def __init__(self, time_usec, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag, abs_pressure, diff_pressure, pressure_alt, temperature, fields_updated):
MAVLink_message.__init__(self, MAVLink_hil_sensor_message.id, MAVLink_hil_sensor_message.name)
self._fieldnames = MAVLink_hil_sensor_message.fieldnames
self._instance_field = MAVLink_hil_sensor_message.instance_field
self._instance_offset = MAVLink_hil_sensor_message.instance_offset
self.time_usec = time_usec
self.xacc = xacc
self.yacc = yacc
self.zacc = zacc
self.xgyro = xgyro
self.ygyro = ygyro
self.zgyro = zgyro
self.xmag = xmag
self.ymag = ymag
self.zmag = zmag
self.abs_pressure = abs_pressure
self.diff_pressure = diff_pressure
self.pressure_alt = pressure_alt
self.temperature = temperature
self.fields_updated = fields_updated
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 108, struct.pack('<QfffffffffffffI', self.time_usec, self.xacc, self.yacc, self.zacc, self.xgyro, self.ygyro, self.zgyro, self.xmag, self.ymag, self.zmag, self.abs_pressure, self.diff_pressure, self.pressure_alt, self.temperature, self.fields_updated), force_mavlink1=force_mavlink1)
class MAVLink_sim_state_message(MAVLink_message):
'''
Status of simulation environment, if used
'''
id = MAVLINK_MSG_ID_SIM_STATE
name = 'SIM_STATE'
fieldnames = ['q1', 'q2', 'q3', 'q4', 'roll', 'pitch', 'yaw', 'xacc', 'yacc', 'zacc', 'xgyro', 'ygyro', 'zgyro', 'lat', 'lon', 'alt', 'std_dev_horz', 'std_dev_vert', 'vn', 've', 'vd']
ordered_fieldnames = ['q1', 'q2', 'q3', 'q4', 'roll', 'pitch', 'yaw', 'xacc', 'yacc', 'zacc', 'xgyro', 'ygyro', 'zgyro', 'lat', 'lon', 'alt', 'std_dev_horz', 'std_dev_vert', 'vn', 've', 'vd']
fieldtypes = ['float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"xacc": "m/s/s", "yacc": "m/s/s", "zacc": "m/s/s", "xgyro": "rad/s", "ygyro": "rad/s", "zgyro": "rad/s", "lat": "deg", "lon": "deg", "alt": "m", "vn": "m/s", "ve": "m/s", "vd": "m/s"}
format = '<fffffffffffffffffffff'
native_format = bytearray('<fffffffffffffffffffff', 'ascii')
orders = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]
lengths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
crc_extra = 32
unpacker = struct.Struct('<fffffffffffffffffffff')
instance_field = None
instance_offset = -1
def __init__(self, q1, q2, q3, q4, roll, pitch, yaw, xacc, yacc, zacc, xgyro, ygyro, zgyro, lat, lon, alt, std_dev_horz, std_dev_vert, vn, ve, vd):
MAVLink_message.__init__(self, MAVLink_sim_state_message.id, MAVLink_sim_state_message.name)
self._fieldnames = MAVLink_sim_state_message.fieldnames
self._instance_field = MAVLink_sim_state_message.instance_field
self._instance_offset = MAVLink_sim_state_message.instance_offset
self.q1 = q1
self.q2 = q2
self.q3 = q3
self.q4 = q4
self.roll = roll
self.pitch = pitch
self.yaw = yaw
self.xacc = xacc
self.yacc = yacc
self.zacc = zacc
self.xgyro = xgyro
self.ygyro = ygyro
self.zgyro = zgyro
self.lat = lat
self.lon = lon
self.alt = alt
self.std_dev_horz = std_dev_horz
self.std_dev_vert = std_dev_vert
self.vn = vn
self.ve = ve
self.vd = vd
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 32, struct.pack('<fffffffffffffffffffff', self.q1, self.q2, self.q3, self.q4, self.roll, self.pitch, self.yaw, self.xacc, self.yacc, self.zacc, self.xgyro, self.ygyro, self.zgyro, self.lat, self.lon, self.alt, self.std_dev_horz, self.std_dev_vert, self.vn, self.ve, self.vd), force_mavlink1=force_mavlink1)
class MAVLink_radio_status_message(MAVLink_message):
'''
Status generated by radio and injected into MAVLink stream.
'''
id = MAVLINK_MSG_ID_RADIO_STATUS
name = 'RADIO_STATUS'
fieldnames = ['rssi', 'remrssi', 'txbuf', 'noise', 'remnoise', 'rxerrors', 'fixed']
ordered_fieldnames = ['rxerrors', 'fixed', 'rssi', 'remrssi', 'txbuf', 'noise', 'remnoise']
fieldtypes = ['uint8_t', 'uint8_t', 'uint8_t', 'uint8_t', 'uint8_t', 'uint16_t', 'uint16_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"txbuf": "%"}
format = '<HHBBBBB'
native_format = bytearray('<HHBBBBB', 'ascii')
orders = [2, 3, 4, 5, 6, 0, 1]
lengths = [1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0]
crc_extra = 185
unpacker = struct.Struct('<HHBBBBB')
instance_field = None
instance_offset = -1
def __init__(self, rssi, remrssi, txbuf, noise, remnoise, rxerrors, fixed):
MAVLink_message.__init__(self, MAVLink_radio_status_message.id, MAVLink_radio_status_message.name)
self._fieldnames = MAVLink_radio_status_message.fieldnames
self._instance_field = MAVLink_radio_status_message.instance_field
self._instance_offset = MAVLink_radio_status_message.instance_offset
self.rssi = rssi
self.remrssi = remrssi
self.txbuf = txbuf
self.noise = noise
self.remnoise = remnoise
self.rxerrors = rxerrors
self.fixed = fixed
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 185, struct.pack('<HHBBBBB', self.rxerrors, self.fixed, self.rssi, self.remrssi, self.txbuf, self.noise, self.remnoise), force_mavlink1=force_mavlink1)
class MAVLink_file_transfer_protocol_message(MAVLink_message):
'''
File transfer message
'''
id = MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL
name = 'FILE_TRANSFER_PROTOCOL'
fieldnames = ['target_network', 'target_system', 'target_component', 'payload']
ordered_fieldnames = ['target_network', 'target_system', 'target_component', 'payload']
fieldtypes = ['uint8_t', 'uint8_t', 'uint8_t', 'uint8_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {}
format = '<BBB251B'
native_format = bytearray('<BBBB', 'ascii')
orders = [0, 1, 2, 3]
lengths = [1, 1, 1, 251]
array_lengths = [0, 0, 0, 251]
crc_extra = 84
unpacker = struct.Struct('<BBB251B')
instance_field = None
instance_offset = -1
def __init__(self, target_network, target_system, target_component, payload):
MAVLink_message.__init__(self, MAVLink_file_transfer_protocol_message.id, MAVLink_file_transfer_protocol_message.name)
self._fieldnames = MAVLink_file_transfer_protocol_message.fieldnames
self._instance_field = MAVLink_file_transfer_protocol_message.instance_field
self._instance_offset = MAVLink_file_transfer_protocol_message.instance_offset
self.target_network = target_network
self.target_system = target_system
self.target_component = target_component
self.payload = payload
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 84, struct.pack('<BBB251B', self.target_network, self.target_system, self.target_component, self.payload[0], self.payload[1], self.payload[2], self.payload[3], self.payload[4], self.payload[5], self.payload[6], self.payload[7], self.payload[8], self.payload[9], self.payload[10], self.payload[11], self.payload[12], self.payload[13], self.payload[14], self.payload[15], self.payload[16], self.payload[17], self.payload[18], self.payload[19], self.payload[20], self.payload[21], self.payload[22], self.payload[23], self.payload[24], self.payload[25], self.payload[26], self.payload[27], self.payload[28], self.payload[29], self.payload[30], self.payload[31], self.payload[32], self.payload[33], self.payload[34], self.payload[35], self.payload[36], self.payload[37], self.payload[38], self.payload[39], self.payload[40], self.payload[41], self.payload[42], self.payload[43], self.payload[44], self.payload[45], self.payload[46], self.payload[47], self.payload[48], self.payload[49], self.payload[50], self.payload[51], self.payload[52], self.payload[53], self.payload[54], self.payload[55], self.payload[56], self.payload[57], self.payload[58], self.payload[59], self.payload[60], self.payload[61], self.payload[62], self.payload[63], self.payload[64], self.payload[65], self.payload[66], self.payload[67], self.payload[68], self.payload[69], self.payload[70], self.payload[71], self.payload[72], self.payload[73], self.payload[74], self.payload[75], self.payload[76], self.payload[77], self.payload[78], self.payload[79], self.payload[80], self.payload[81], self.payload[82], self.payload[83], self.payload[84], self.payload[85], self.payload[86], self.payload[87], self.payload[88], self.payload[89], self.payload[90], self.payload[91], self.payload[92], self.payload[93], self.payload[94], self.payload[95], self.payload[96], self.payload[97], self.payload[98], self.payload[99], self.payload[100], self.payload[101], self.payload[102], self.payload[103], self.payload[104], self.payload[105], self.payload[106], self.payload[107], self.payload[108], self.payload[109], self.payload[110], self.payload[111], self.payload[112], self.payload[113], self.payload[114], self.payload[115], self.payload[116], self.payload[117], self.payload[118], self.payload[119], self.payload[120], self.payload[121], self.payload[122], self.payload[123], self.payload[124], self.payload[125], self.payload[126], self.payload[127], self.payload[128], self.payload[129], self.payload[130], self.payload[131], self.payload[132], self.payload[133], self.payload[134], self.payload[135], self.payload[136], self.payload[137], self.payload[138], self.payload[139], self.payload[140], self.payload[141], self.payload[142], self.payload[143], self.payload[144], self.payload[145], self.payload[146], self.payload[147], self.payload[148], self.payload[149], self.payload[150], self.payload[151], self.payload[152], self.payload[153], self.payload[154], self.payload[155], self.payload[156], self.payload[157], self.payload[158], self.payload[159], self.payload[160], self.payload[161], self.payload[162], self.payload[163], self.payload[164], self.payload[165], self.payload[166], self.payload[167], self.payload[168], self.payload[169], self.payload[170], self.payload[171], self.payload[172], self.payload[173], self.payload[174], self.payload[175], self.payload[176], self.payload[177], self.payload[178], self.payload[179], self.payload[180], self.payload[181], self.payload[182], self.payload[183], self.payload[184], self.payload[185], self.payload[186], self.payload[187], self.payload[188], self.payload[189], self.payload[190], self.payload[191], self.payload[192], self.payload[193], self.payload[194], self.payload[195], self.payload[196], self.payload[197], self.payload[198], self.payload[199], self.payload[200], self.payload[201], self.payload[202], self.payload[203], self.payload[204], self.payload[205], self.payload[206], self.payload[207], self.payload[208], self.payload[209], self.payload[210], self.payload[211], self.payload[212], self.payload[213], self.payload[214], self.payload[215], self.payload[216], self.payload[217], self.payload[218], self.payload[219], self.payload[220], self.payload[221], self.payload[222], self.payload[223], self.payload[224], self.payload[225], self.payload[226], self.payload[227], self.payload[228], self.payload[229], self.payload[230], self.payload[231], self.payload[232], self.payload[233], self.payload[234], self.payload[235], self.payload[236], self.payload[237], self.payload[238], self.payload[239], self.payload[240], self.payload[241], self.payload[242], self.payload[243], self.payload[244], self.payload[245], self.payload[246], self.payload[247], self.payload[248], self.payload[249], self.payload[250]), force_mavlink1=force_mavlink1)
class MAVLink_timesync_message(MAVLink_message):
'''
Time synchronization message.
'''
id = MAVLINK_MSG_ID_TIMESYNC
name = 'TIMESYNC'
fieldnames = ['tc1', 'ts1']
ordered_fieldnames = ['tc1', 'ts1']
fieldtypes = ['int64_t', 'int64_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {}
format = '<qq'
native_format = bytearray('<qq', 'ascii')
orders = [0, 1]
lengths = [1, 1]
array_lengths = [0, 0]
crc_extra = 34
unpacker = struct.Struct('<qq')
instance_field = None
instance_offset = -1
def __init__(self, tc1, ts1):
MAVLink_message.__init__(self, MAVLink_timesync_message.id, MAVLink_timesync_message.name)
self._fieldnames = MAVLink_timesync_message.fieldnames
self._instance_field = MAVLink_timesync_message.instance_field
self._instance_offset = MAVLink_timesync_message.instance_offset
self.tc1 = tc1
self.ts1 = ts1
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 34, struct.pack('<qq', self.tc1, self.ts1), force_mavlink1=force_mavlink1)
class MAVLink_camera_trigger_message(MAVLink_message):
'''
Camera-IMU triggering and synchronisation message.
'''
id = MAVLINK_MSG_ID_CAMERA_TRIGGER
name = 'CAMERA_TRIGGER'
fieldnames = ['time_usec', 'seq']
ordered_fieldnames = ['time_usec', 'seq']
fieldtypes = ['uint64_t', 'uint32_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"time_usec": "us"}
format = '<QI'
native_format = bytearray('<QI', 'ascii')
orders = [0, 1]
lengths = [1, 1]
array_lengths = [0, 0]
crc_extra = 174
unpacker = struct.Struct('<QI')
instance_field = None
instance_offset = -1
def __init__(self, time_usec, seq):
MAVLink_message.__init__(self, MAVLink_camera_trigger_message.id, MAVLink_camera_trigger_message.name)
self._fieldnames = MAVLink_camera_trigger_message.fieldnames
self._instance_field = MAVLink_camera_trigger_message.instance_field
self._instance_offset = MAVLink_camera_trigger_message.instance_offset
self.time_usec = time_usec
self.seq = seq
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 174, struct.pack('<QI', self.time_usec, self.seq), force_mavlink1=force_mavlink1)
class MAVLink_hil_gps_message(MAVLink_message):
'''
The global position, as returned by the Global Positioning
System (GPS). This is NOT the global position
estimate of the sytem, but rather a RAW sensor value. See
message GLOBAL_POSITION for the global position estimate.
'''
id = MAVLINK_MSG_ID_HIL_GPS
name = 'HIL_GPS'
fieldnames = ['time_usec', 'fix_type', 'lat', 'lon', 'alt', 'eph', 'epv', 'vel', 'vn', 've', 'vd', 'cog', 'satellites_visible']
ordered_fieldnames = ['time_usec', 'lat', 'lon', 'alt', 'eph', 'epv', 'vel', 'vn', 've', 'vd', 'cog', 'fix_type', 'satellites_visible']
fieldtypes = ['uint64_t', 'uint8_t', 'int32_t', 'int32_t', 'int32_t', 'uint16_t', 'uint16_t', 'uint16_t', 'int16_t', 'int16_t', 'int16_t', 'uint16_t', 'uint8_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"time_usec": "us", "lat": "degE7", "lon": "degE7", "alt": "mm", "eph": "cm", "epv": "cm", "vel": "cm/s", "vn": "cm/s", "ve": "cm/s", "vd": "cm/s", "cog": "cdeg"}
format = '<QiiiHHHhhhHBB'
native_format = bytearray('<QiiiHHHhhhHBB', 'ascii')
orders = [0, 11, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12]
lengths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
crc_extra = 124
unpacker = struct.Struct('<QiiiHHHhhhHBB')
instance_field = None
instance_offset = -1
def __init__(self, time_usec, fix_type, lat, lon, alt, eph, epv, vel, vn, ve, vd, cog, satellites_visible):
MAVLink_message.__init__(self, MAVLink_hil_gps_message.id, MAVLink_hil_gps_message.name)
self._fieldnames = MAVLink_hil_gps_message.fieldnames
self._instance_field = MAVLink_hil_gps_message.instance_field
self._instance_offset = MAVLink_hil_gps_message.instance_offset
self.time_usec = time_usec
self.fix_type = fix_type
self.lat = lat
self.lon = lon
self.alt = alt
self.eph = eph
self.epv = epv
self.vel = vel
self.vn = vn
self.ve = ve
self.vd = vd
self.cog = cog
self.satellites_visible = satellites_visible
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 124, struct.pack('<QiiiHHHhhhHBB', self.time_usec, self.lat, self.lon, self.alt, self.eph, self.epv, self.vel, self.vn, self.ve, self.vd, self.cog, self.fix_type, self.satellites_visible), force_mavlink1=force_mavlink1)
class MAVLink_hil_optical_flow_message(MAVLink_message):
'''
Simulated optical flow from a flow sensor (e.g. PX4FLOW or
optical mouse sensor)
'''
id = MAVLINK_MSG_ID_HIL_OPTICAL_FLOW
name = 'HIL_OPTICAL_FLOW'
fieldnames = ['time_usec', 'sensor_id', 'integration_time_us', 'integrated_x', 'integrated_y', 'integrated_xgyro', 'integrated_ygyro', 'integrated_zgyro', 'temperature', 'quality', 'time_delta_distance_us', 'distance']
ordered_fieldnames = ['time_usec', 'integration_time_us', 'integrated_x', 'integrated_y', 'integrated_xgyro', 'integrated_ygyro', 'integrated_zgyro', 'time_delta_distance_us', 'distance', 'temperature', 'sensor_id', 'quality']
fieldtypes = ['uint64_t', 'uint8_t', 'uint32_t', 'float', 'float', 'float', 'float', 'float', 'int16_t', 'uint8_t', 'uint32_t', 'float']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"time_usec": "us", "integration_time_us": "us", "integrated_x": "rad", "integrated_y": "rad", "integrated_xgyro": "rad", "integrated_ygyro": "rad", "integrated_zgyro": "rad", "temperature": "cdegC", "time_delta_distance_us": "us", "distance": "m"}
format = '<QIfffffIfhBB'
native_format = bytearray('<QIfffffIfhBB', 'ascii')
orders = [0, 10, 1, 2, 3, 4, 5, 6, 9, 11, 7, 8]
lengths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
crc_extra = 237
unpacker = struct.Struct('<QIfffffIfhBB')
instance_field = None
instance_offset = -1
def __init__(self, time_usec, sensor_id, integration_time_us, integrated_x, integrated_y, integrated_xgyro, integrated_ygyro, integrated_zgyro, temperature, quality, time_delta_distance_us, distance):
MAVLink_message.__init__(self, MAVLink_hil_optical_flow_message.id, MAVLink_hil_optical_flow_message.name)
self._fieldnames = MAVLink_hil_optical_flow_message.fieldnames
self._instance_field = MAVLink_hil_optical_flow_message.instance_field
self._instance_offset = MAVLink_hil_optical_flow_message.instance_offset
self.time_usec = time_usec
self.sensor_id = sensor_id
self.integration_time_us = integration_time_us
self.integrated_x = integrated_x
self.integrated_y = integrated_y
self.integrated_xgyro = integrated_xgyro
self.integrated_ygyro = integrated_ygyro
self.integrated_zgyro = integrated_zgyro
self.temperature = temperature
self.quality = quality
self.time_delta_distance_us = time_delta_distance_us
self.distance = distance
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 237, struct.pack('<QIfffffIfhBB', self.time_usec, self.integration_time_us, self.integrated_x, self.integrated_y, self.integrated_xgyro, self.integrated_ygyro, self.integrated_zgyro, self.time_delta_distance_us, self.distance, self.temperature, self.sensor_id, self.quality), force_mavlink1=force_mavlink1)
class MAVLink_hil_state_quaternion_message(MAVLink_message):
'''
Sent from simulation to autopilot, avoids in contrast to
HIL_STATE singularities. This packet is useful for high
throughput applications such as hardware in the loop
simulations.
'''
id = MAVLINK_MSG_ID_HIL_STATE_QUATERNION
name = 'HIL_STATE_QUATERNION'
fieldnames = ['time_usec', 'attitude_quaternion', 'rollspeed', 'pitchspeed', 'yawspeed', 'lat', 'lon', 'alt', 'vx', 'vy', 'vz', 'ind_airspeed', 'true_airspeed', 'xacc', 'yacc', 'zacc']
ordered_fieldnames = ['time_usec', 'attitude_quaternion', 'rollspeed', 'pitchspeed', 'yawspeed', 'lat', 'lon', 'alt', 'vx', 'vy', 'vz', 'ind_airspeed', 'true_airspeed', 'xacc', 'yacc', 'zacc']
fieldtypes = ['uint64_t', 'float', 'float', 'float', 'float', 'int32_t', 'int32_t', 'int32_t', 'int16_t', 'int16_t', 'int16_t', 'uint16_t', 'uint16_t', 'int16_t', 'int16_t', 'int16_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"time_usec": "us", "rollspeed": "rad/s", "pitchspeed": "rad/s", "yawspeed": "rad/s", "lat": "degE7", "lon": "degE7", "alt": "mm", "vx": "cm/s", "vy": "cm/s", "vz": "cm/s", "ind_airspeed": "cm/s", "true_airspeed": "cm/s", "xacc": "mG", "yacc": "mG", "zacc": "mG"}
format = '<Q4ffffiiihhhHHhhh'
native_format = bytearray('<QffffiiihhhHHhhh', 'ascii')
orders = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
lengths = [1, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
crc_extra = 4
unpacker = struct.Struct('<Q4ffffiiihhhHHhhh')
instance_field = None
instance_offset = -1
def __init__(self, time_usec, attitude_quaternion, rollspeed, pitchspeed, yawspeed, lat, lon, alt, vx, vy, vz, ind_airspeed, true_airspeed, xacc, yacc, zacc):
MAVLink_message.__init__(self, MAVLink_hil_state_quaternion_message.id, MAVLink_hil_state_quaternion_message.name)
self._fieldnames = MAVLink_hil_state_quaternion_message.fieldnames
self._instance_field = MAVLink_hil_state_quaternion_message.instance_field
self._instance_offset = MAVLink_hil_state_quaternion_message.instance_offset
self.time_usec = time_usec
self.attitude_quaternion = attitude_quaternion
self.rollspeed = rollspeed
self.pitchspeed = pitchspeed
self.yawspeed = yawspeed
self.lat = lat
self.lon = lon
self.alt = alt
self.vx = vx
self.vy = vy
self.vz = vz
self.ind_airspeed = ind_airspeed
self.true_airspeed = true_airspeed
self.xacc = xacc
self.yacc = yacc
self.zacc = zacc
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 4, struct.pack('<Q4ffffiiihhhHHhhh', self.time_usec, self.attitude_quaternion[0], self.attitude_quaternion[1], self.attitude_quaternion[2], self.attitude_quaternion[3], self.rollspeed, self.pitchspeed, self.yawspeed, self.lat, self.lon, self.alt, self.vx, self.vy, self.vz, self.ind_airspeed, self.true_airspeed, self.xacc, self.yacc, self.zacc), force_mavlink1=force_mavlink1)
class MAVLink_scaled_imu2_message(MAVLink_message):
'''
The RAW IMU readings for secondary 9DOF sensor setup. This
message should contain the scaled values to the described
units
'''
id = MAVLINK_MSG_ID_SCALED_IMU2
name = 'SCALED_IMU2'
fieldnames = ['time_boot_ms', 'xacc', 'yacc', 'zacc', 'xgyro', 'ygyro', 'zgyro', 'xmag', 'ymag', 'zmag']
ordered_fieldnames = ['time_boot_ms', 'xacc', 'yacc', 'zacc', 'xgyro', 'ygyro', 'zgyro', 'xmag', 'ymag', 'zmag']
fieldtypes = ['uint32_t', 'int16_t', 'int16_t', 'int16_t', 'int16_t', 'int16_t', 'int16_t', 'int16_t', 'int16_t', 'int16_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"time_boot_ms": "ms", "xacc": "mG", "yacc": "mG", "zacc": "mG", "xgyro": "mrad/s", "ygyro": "mrad/s", "zgyro": "mrad/s", "xmag": "mgauss", "ymag": "mgauss", "zmag": "mgauss"}
format = '<Ihhhhhhhhh'
native_format = bytearray('<Ihhhhhhhhh', 'ascii')
orders = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
lengths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
crc_extra = 76
unpacker = struct.Struct('<Ihhhhhhhhh')
instance_field = None
instance_offset = -1
def __init__(self, time_boot_ms, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag):
MAVLink_message.__init__(self, MAVLink_scaled_imu2_message.id, MAVLink_scaled_imu2_message.name)
self._fieldnames = MAVLink_scaled_imu2_message.fieldnames
self._instance_field = MAVLink_scaled_imu2_message.instance_field
self._instance_offset = MAVLink_scaled_imu2_message.instance_offset
self.time_boot_ms = time_boot_ms
self.xacc = xacc
self.yacc = yacc
self.zacc = zacc
self.xgyro = xgyro
self.ygyro = ygyro
self.zgyro = zgyro
self.xmag = xmag
self.ymag = ymag
self.zmag = zmag
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 76, struct.pack('<Ihhhhhhhhh', self.time_boot_ms, self.xacc, self.yacc, self.zacc, self.xgyro, self.ygyro, self.zgyro, self.xmag, self.ymag, self.zmag), force_mavlink1=force_mavlink1)
class MAVLink_log_request_list_message(MAVLink_message):
'''
Request a list of available logs. On some systems calling this
may stop on-board logging until LOG_REQUEST_END is called.
'''
id = MAVLINK_MSG_ID_LOG_REQUEST_LIST
name = 'LOG_REQUEST_LIST'
fieldnames = ['target_system', 'target_component', 'start', 'end']
ordered_fieldnames = ['start', 'end', 'target_system', 'target_component']
fieldtypes = ['uint8_t', 'uint8_t', 'uint16_t', 'uint16_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {}
format = '<HHBB'
native_format = bytearray('<HHBB', 'ascii')
orders = [2, 3, 0, 1]
lengths = [1, 1, 1, 1]
array_lengths = [0, 0, 0, 0]
crc_extra = 128
unpacker = struct.Struct('<HHBB')
instance_field = None
instance_offset = -1
def __init__(self, target_system, target_component, start, end):
MAVLink_message.__init__(self, MAVLink_log_request_list_message.id, MAVLink_log_request_list_message.name)
self._fieldnames = MAVLink_log_request_list_message.fieldnames
self._instance_field = MAVLink_log_request_list_message.instance_field
self._instance_offset = MAVLink_log_request_list_message.instance_offset
self.target_system = target_system
self.target_component = target_component
self.start = start
self.end = end
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 128, struct.pack('<HHBB', self.start, self.end, self.target_system, self.target_component), force_mavlink1=force_mavlink1)
class MAVLink_log_entry_message(MAVLink_message):
'''
Reply to LOG_REQUEST_LIST
'''
id = MAVLINK_MSG_ID_LOG_ENTRY
name = 'LOG_ENTRY'
fieldnames = ['id', 'num_logs', 'last_log_num', 'time_utc', 'size']
ordered_fieldnames = ['time_utc', 'size', 'id', 'num_logs', 'last_log_num']
fieldtypes = ['uint16_t', 'uint16_t', 'uint16_t', 'uint32_t', 'uint32_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"time_utc": "s", "size": "bytes"}
format = '<IIHHH'
native_format = bytearray('<IIHHH', 'ascii')
orders = [2, 3, 4, 0, 1]
lengths = [1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0]
crc_extra = 56
unpacker = struct.Struct('<IIHHH')
instance_field = None
instance_offset = -1
def __init__(self, id, num_logs, last_log_num, time_utc, size):
MAVLink_message.__init__(self, MAVLink_log_entry_message.id, MAVLink_log_entry_message.name)
self._fieldnames = MAVLink_log_entry_message.fieldnames
self._instance_field = MAVLink_log_entry_message.instance_field
self._instance_offset = MAVLink_log_entry_message.instance_offset
self.id = id
self.num_logs = num_logs
self.last_log_num = last_log_num
self.time_utc = time_utc
self.size = size
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 56, struct.pack('<IIHHH', self.time_utc, self.size, self.id, self.num_logs, self.last_log_num), force_mavlink1=force_mavlink1)
class MAVLink_log_request_data_message(MAVLink_message):
'''
Request a chunk of a log
'''
id = MAVLINK_MSG_ID_LOG_REQUEST_DATA
name = 'LOG_REQUEST_DATA'
fieldnames = ['target_system', 'target_component', 'id', 'ofs', 'count']
ordered_fieldnames = ['ofs', 'count', 'id', 'target_system', 'target_component']
fieldtypes = ['uint8_t', 'uint8_t', 'uint16_t', 'uint32_t', 'uint32_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"count": "bytes"}
format = '<IIHBB'
native_format = bytearray('<IIHBB', 'ascii')
orders = [3, 4, 2, 0, 1]
lengths = [1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0]
crc_extra = 116
unpacker = struct.Struct('<IIHBB')
instance_field = None
instance_offset = -1
def __init__(self, target_system, target_component, id, ofs, count):
MAVLink_message.__init__(self, MAVLink_log_request_data_message.id, MAVLink_log_request_data_message.name)
self._fieldnames = MAVLink_log_request_data_message.fieldnames
self._instance_field = MAVLink_log_request_data_message.instance_field
self._instance_offset = MAVLink_log_request_data_message.instance_offset
self.target_system = target_system
self.target_component = target_component
self.id = id
self.ofs = ofs
self.count = count
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 116, struct.pack('<IIHBB', self.ofs, self.count, self.id, self.target_system, self.target_component), force_mavlink1=force_mavlink1)
class MAVLink_log_data_message(MAVLink_message):
'''
Reply to LOG_REQUEST_DATA
'''
id = MAVLINK_MSG_ID_LOG_DATA
name = 'LOG_DATA'
fieldnames = ['id', 'ofs', 'count', 'data']
ordered_fieldnames = ['ofs', 'id', 'count', 'data']
fieldtypes = ['uint16_t', 'uint32_t', 'uint8_t', 'uint8_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"count": "bytes"}
format = '<IHB90B'
native_format = bytearray('<IHBB', 'ascii')
orders = [1, 0, 2, 3]
lengths = [1, 1, 1, 90]
array_lengths = [0, 0, 0, 90]
crc_extra = 134
unpacker = struct.Struct('<IHB90B')
instance_field = None
instance_offset = -1
def __init__(self, id, ofs, count, data):
MAVLink_message.__init__(self, MAVLink_log_data_message.id, MAVLink_log_data_message.name)
self._fieldnames = MAVLink_log_data_message.fieldnames
self._instance_field = MAVLink_log_data_message.instance_field
self._instance_offset = MAVLink_log_data_message.instance_offset
self.id = id
self.ofs = ofs
self.count = count
self.data = data
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 134, struct.pack('<IHB90B', self.ofs, self.id, self.count, self.data[0], self.data[1], self.data[2], self.data[3], self.data[4], self.data[5], self.data[6], self.data[7], self.data[8], self.data[9], self.data[10], self.data[11], self.data[12], self.data[13], self.data[14], self.data[15], self.data[16], self.data[17], self.data[18], self.data[19], self.data[20], self.data[21], self.data[22], self.data[23], self.data[24], self.data[25], self.data[26], self.data[27], self.data[28], self.data[29], self.data[30], self.data[31], self.data[32], self.data[33], self.data[34], self.data[35], self.data[36], self.data[37], self.data[38], self.data[39], self.data[40], self.data[41], self.data[42], self.data[43], self.data[44], self.data[45], self.data[46], self.data[47], self.data[48], self.data[49], self.data[50], self.data[51], self.data[52], self.data[53], self.data[54], self.data[55], self.data[56], self.data[57], self.data[58], self.data[59], self.data[60], self.data[61], self.data[62], self.data[63], self.data[64], self.data[65], self.data[66], self.data[67], self.data[68], self.data[69], self.data[70], self.data[71], self.data[72], self.data[73], self.data[74], self.data[75], self.data[76], self.data[77], self.data[78], self.data[79], self.data[80], self.data[81], self.data[82], self.data[83], self.data[84], self.data[85], self.data[86], self.data[87], self.data[88], self.data[89]), force_mavlink1=force_mavlink1)
class MAVLink_log_erase_message(MAVLink_message):
'''
Erase all logs
'''
id = MAVLINK_MSG_ID_LOG_ERASE
name = 'LOG_ERASE'
fieldnames = ['target_system', 'target_component']
ordered_fieldnames = ['target_system', 'target_component']
fieldtypes = ['uint8_t', 'uint8_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {}
format = '<BB'
native_format = bytearray('<BB', 'ascii')
orders = [0, 1]
lengths = [1, 1]
array_lengths = [0, 0]
crc_extra = 237
unpacker = struct.Struct('<BB')
instance_field = None
instance_offset = -1
def __init__(self, target_system, target_component):
MAVLink_message.__init__(self, MAVLink_log_erase_message.id, MAVLink_log_erase_message.name)
self._fieldnames = MAVLink_log_erase_message.fieldnames
self._instance_field = MAVLink_log_erase_message.instance_field
self._instance_offset = MAVLink_log_erase_message.instance_offset
self.target_system = target_system
self.target_component = target_component
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 237, struct.pack('<BB', self.target_system, self.target_component), force_mavlink1=force_mavlink1)
class MAVLink_log_request_end_message(MAVLink_message):
'''
Stop log transfer and resume normal logging
'''
id = MAVLINK_MSG_ID_LOG_REQUEST_END
name = 'LOG_REQUEST_END'
fieldnames = ['target_system', 'target_component']
ordered_fieldnames = ['target_system', 'target_component']
fieldtypes = ['uint8_t', 'uint8_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {}
format = '<BB'
native_format = bytearray('<BB', 'ascii')
orders = [0, 1]
lengths = [1, 1]
array_lengths = [0, 0]
crc_extra = 203
unpacker = struct.Struct('<BB')
instance_field = None
instance_offset = -1
def __init__(self, target_system, target_component):
MAVLink_message.__init__(self, MAVLink_log_request_end_message.id, MAVLink_log_request_end_message.name)
self._fieldnames = MAVLink_log_request_end_message.fieldnames
self._instance_field = MAVLink_log_request_end_message.instance_field
self._instance_offset = MAVLink_log_request_end_message.instance_offset
self.target_system = target_system
self.target_component = target_component
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 203, struct.pack('<BB', self.target_system, self.target_component), force_mavlink1=force_mavlink1)
class MAVLink_gps_inject_data_message(MAVLink_message):
'''
Data for injecting into the onboard GPS (used for DGPS)
'''
id = MAVLINK_MSG_ID_GPS_INJECT_DATA
name = 'GPS_INJECT_DATA'
fieldnames = ['target_system', 'target_component', 'len', 'data']
ordered_fieldnames = ['target_system', 'target_component', 'len', 'data']
fieldtypes = ['uint8_t', 'uint8_t', 'uint8_t', 'uint8_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"len": "bytes"}
format = '<BBB110B'
native_format = bytearray('<BBBB', 'ascii')
orders = [0, 1, 2, 3]
lengths = [1, 1, 1, 110]
array_lengths = [0, 0, 0, 110]
crc_extra = 250
unpacker = struct.Struct('<BBB110B')
instance_field = None
instance_offset = -1
def __init__(self, target_system, target_component, len, data):
MAVLink_message.__init__(self, MAVLink_gps_inject_data_message.id, MAVLink_gps_inject_data_message.name)
self._fieldnames = MAVLink_gps_inject_data_message.fieldnames
self._instance_field = MAVLink_gps_inject_data_message.instance_field
self._instance_offset = MAVLink_gps_inject_data_message.instance_offset
self.target_system = target_system
self.target_component = target_component
self.len = len
self.data = data
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 250, struct.pack('<BBB110B', self.target_system, self.target_component, self.len, self.data[0], self.data[1], self.data[2], self.data[3], self.data[4], self.data[5], self.data[6], self.data[7], self.data[8], self.data[9], self.data[10], self.data[11], self.data[12], self.data[13], self.data[14], self.data[15], self.data[16], self.data[17], self.data[18], self.data[19], self.data[20], self.data[21], self.data[22], self.data[23], self.data[24], self.data[25], self.data[26], self.data[27], self.data[28], self.data[29], self.data[30], self.data[31], self.data[32], self.data[33], self.data[34], self.data[35], self.data[36], self.data[37], self.data[38], self.data[39], self.data[40], self.data[41], self.data[42], self.data[43], self.data[44], self.data[45], self.data[46], self.data[47], self.data[48], self.data[49], self.data[50], self.data[51], self.data[52], self.data[53], self.data[54], self.data[55], self.data[56], self.data[57], self.data[58], self.data[59], self.data[60], self.data[61], self.data[62], self.data[63], self.data[64], self.data[65], self.data[66], self.data[67], self.data[68], self.data[69], self.data[70], self.data[71], self.data[72], self.data[73], self.data[74], self.data[75], self.data[76], self.data[77], self.data[78], self.data[79], self.data[80], self.data[81], self.data[82], self.data[83], self.data[84], self.data[85], self.data[86], self.data[87], self.data[88], self.data[89], self.data[90], self.data[91], self.data[92], self.data[93], self.data[94], self.data[95], self.data[96], self.data[97], self.data[98], self.data[99], self.data[100], self.data[101], self.data[102], self.data[103], self.data[104], self.data[105], self.data[106], self.data[107], self.data[108], self.data[109]), force_mavlink1=force_mavlink1)
class MAVLink_gps2_raw_message(MAVLink_message):
'''
Second GPS data.
'''
id = MAVLINK_MSG_ID_GPS2_RAW
name = 'GPS2_RAW'
fieldnames = ['time_usec', 'fix_type', 'lat', 'lon', 'alt', 'eph', 'epv', 'vel', 'cog', 'satellites_visible', 'dgps_numch', 'dgps_age']
ordered_fieldnames = ['time_usec', 'lat', 'lon', 'alt', 'dgps_age', 'eph', 'epv', 'vel', 'cog', 'fix_type', 'satellites_visible', 'dgps_numch']
fieldtypes = ['uint64_t', 'uint8_t', 'int32_t', 'int32_t', 'int32_t', 'uint16_t', 'uint16_t', 'uint16_t', 'uint16_t', 'uint8_t', 'uint8_t', 'uint32_t']
fielddisplays_by_name = {}
fieldenums_by_name = {"fix_type": "GPS_FIX_TYPE"}
fieldunits_by_name = {"time_usec": "us", "lat": "degE7", "lon": "degE7", "alt": "mm", "eph": "cm", "epv": "cm", "vel": "cm/s", "cog": "cdeg", "dgps_age": "ms"}
format = '<QiiiIHHHHBBB'
native_format = bytearray('<QiiiIHHHHBBB', 'ascii')
orders = [0, 9, 1, 2, 3, 5, 6, 7, 8, 10, 11, 4]
lengths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
crc_extra = 87
unpacker = struct.Struct('<QiiiIHHHHBBB')
instance_field = None
instance_offset = -1
def __init__(self, time_usec, fix_type, lat, lon, alt, eph, epv, vel, cog, satellites_visible, dgps_numch, dgps_age):
MAVLink_message.__init__(self, MAVLink_gps2_raw_message.id, MAVLink_gps2_raw_message.name)
self._fieldnames = MAVLink_gps2_raw_message.fieldnames
self._instance_field = MAVLink_gps2_raw_message.instance_field
self._instance_offset = MAVLink_gps2_raw_message.instance_offset
self.time_usec = time_usec
self.fix_type = fix_type
self.lat = lat
self.lon = lon
self.alt = alt
self.eph = eph
self.epv = epv
self.vel = vel
self.cog = cog
self.satellites_visible = satellites_visible
self.dgps_numch = dgps_numch
self.dgps_age = dgps_age
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 87, struct.pack('<QiiiIHHHHBBB', self.time_usec, self.lat, self.lon, self.alt, self.dgps_age, self.eph, self.epv, self.vel, self.cog, self.fix_type, self.satellites_visible, self.dgps_numch), force_mavlink1=force_mavlink1)
class MAVLink_power_status_message(MAVLink_message):
'''
Power supply status
'''
id = MAVLINK_MSG_ID_POWER_STATUS
name = 'POWER_STATUS'
fieldnames = ['Vcc', 'Vservo', 'flags']
ordered_fieldnames = ['Vcc', 'Vservo', 'flags']
fieldtypes = ['uint16_t', 'uint16_t', 'uint16_t']
fielddisplays_by_name = {"flags": "bitmask"}
fieldenums_by_name = {"flags": "MAV_POWER_STATUS"}
fieldunits_by_name = {"Vcc": "mV", "Vservo": "mV"}
format = '<HHH'
native_format = bytearray('<HHH', 'ascii')
orders = [0, 1, 2]
lengths = [1, 1, 1]
array_lengths = [0, 0, 0]
crc_extra = 203
unpacker = struct.Struct('<HHH')
instance_field = None
instance_offset = -1
def __init__(self, Vcc, Vservo, flags):
MAVLink_message.__init__(self, MAVLink_power_status_message.id, MAVLink_power_status_message.name)
self._fieldnames = MAVLink_power_status_message.fieldnames
self._instance_field = MAVLink_power_status_message.instance_field
self._instance_offset = MAVLink_power_status_message.instance_offset
self.Vcc = Vcc
self.Vservo = Vservo
self.flags = flags
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 203, struct.pack('<HHH', self.Vcc, self.Vservo, self.flags), force_mavlink1=force_mavlink1)
class MAVLink_serial_control_message(MAVLink_message):
'''
Control a serial port. This can be used for raw access to an
onboard serial peripheral such as a GPS or telemetry radio. It
is designed to make it possible to update the devices firmware
via MAVLink messages or change the devices settings. A message
with zero bytes can be used to change just the baudrate.
'''
id = MAVLINK_MSG_ID_SERIAL_CONTROL
name = 'SERIAL_CONTROL'
fieldnames = ['device', 'flags', 'timeout', 'baudrate', 'count', 'data']
ordered_fieldnames = ['baudrate', 'timeout', 'device', 'flags', 'count', 'data']
fieldtypes = ['uint8_t', 'uint8_t', 'uint16_t', 'uint32_t', 'uint8_t', 'uint8_t']
fielddisplays_by_name = {"flags": "bitmask"}
fieldenums_by_name = {"device": "SERIAL_CONTROL_DEV", "flags": "SERIAL_CONTROL_FLAG"}
fieldunits_by_name = {"timeout": "ms", "baudrate": "bits/s", "count": "bytes"}
format = '<IHBBB70B'
native_format = bytearray('<IHBBBB', 'ascii')
orders = [2, 3, 1, 0, 4, 5]
lengths = [1, 1, 1, 1, 1, 70]
array_lengths = [0, 0, 0, 0, 0, 70]
crc_extra = 220
unpacker = struct.Struct('<IHBBB70B')
instance_field = None
instance_offset = -1
def __init__(self, device, flags, timeout, baudrate, count, data):
MAVLink_message.__init__(self, MAVLink_serial_control_message.id, MAVLink_serial_control_message.name)
self._fieldnames = MAVLink_serial_control_message.fieldnames
self._instance_field = MAVLink_serial_control_message.instance_field
self._instance_offset = MAVLink_serial_control_message.instance_offset
self.device = device
self.flags = flags
self.timeout = timeout
self.baudrate = baudrate
self.count = count
self.data = data
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 220, struct.pack('<IHBBB70B', self.baudrate, self.timeout, self.device, self.flags, self.count, self.data[0], self.data[1], self.data[2], self.data[3], self.data[4], self.data[5], self.data[6], self.data[7], self.data[8], self.data[9], self.data[10], self.data[11], self.data[12], self.data[13], self.data[14], self.data[15], self.data[16], self.data[17], self.data[18], self.data[19], self.data[20], self.data[21], self.data[22], self.data[23], self.data[24], self.data[25], self.data[26], self.data[27], self.data[28], self.data[29], self.data[30], self.data[31], self.data[32], self.data[33], self.data[34], self.data[35], self.data[36], self.data[37], self.data[38], self.data[39], self.data[40], self.data[41], self.data[42], self.data[43], self.data[44], self.data[45], self.data[46], self.data[47], self.data[48], self.data[49], self.data[50], self.data[51], self.data[52], self.data[53], self.data[54], self.data[55], self.data[56], self.data[57], self.data[58], self.data[59], self.data[60], self.data[61], self.data[62], self.data[63], self.data[64], self.data[65], self.data[66], self.data[67], self.data[68], self.data[69]), force_mavlink1=force_mavlink1)
class MAVLink_gps_rtk_message(MAVLink_message):
'''
RTK GPS data. Gives information on the relative baseline
calculation the GPS is reporting
'''
id = MAVLINK_MSG_ID_GPS_RTK
name = 'GPS_RTK'
fieldnames = ['time_last_baseline_ms', 'rtk_receiver_id', 'wn', 'tow', 'rtk_health', 'rtk_rate', 'nsats', 'baseline_coords_type', 'baseline_a_mm', 'baseline_b_mm', 'baseline_c_mm', 'accuracy', 'iar_num_hypotheses']
ordered_fieldnames = ['time_last_baseline_ms', 'tow', 'baseline_a_mm', 'baseline_b_mm', 'baseline_c_mm', 'accuracy', 'iar_num_hypotheses', 'wn', 'rtk_receiver_id', 'rtk_health', 'rtk_rate', 'nsats', 'baseline_coords_type']
fieldtypes = ['uint32_t', 'uint8_t', 'uint16_t', 'uint32_t', 'uint8_t', 'uint8_t', 'uint8_t', 'uint8_t', 'int32_t', 'int32_t', 'int32_t', 'uint32_t', 'int32_t']
fielddisplays_by_name = {}
fieldenums_by_name = {"baseline_coords_type": "RTK_BASELINE_COORDINATE_SYSTEM"}
fieldunits_by_name = {"time_last_baseline_ms": "ms", "tow": "ms", "rtk_rate": "Hz", "baseline_a_mm": "mm", "baseline_b_mm": "mm", "baseline_c_mm": "mm"}
format = '<IIiiiIiHBBBBB'
native_format = bytearray('<IIiiiIiHBBBBB', 'ascii')
orders = [0, 8, 7, 1, 9, 10, 11, 12, 2, 3, 4, 5, 6]
lengths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
crc_extra = 25
unpacker = struct.Struct('<IIiiiIiHBBBBB')
instance_field = None
instance_offset = -1
def __init__(self, time_last_baseline_ms, rtk_receiver_id, wn, tow, rtk_health, rtk_rate, nsats, baseline_coords_type, baseline_a_mm, baseline_b_mm, baseline_c_mm, accuracy, iar_num_hypotheses):
MAVLink_message.__init__(self, MAVLink_gps_rtk_message.id, MAVLink_gps_rtk_message.name)
self._fieldnames = MAVLink_gps_rtk_message.fieldnames
self._instance_field = MAVLink_gps_rtk_message.instance_field
self._instance_offset = MAVLink_gps_rtk_message.instance_offset
self.time_last_baseline_ms = time_last_baseline_ms
self.rtk_receiver_id = rtk_receiver_id
self.wn = wn
self.tow = tow
self.rtk_health = rtk_health
self.rtk_rate = rtk_rate
self.nsats = nsats
self.baseline_coords_type = baseline_coords_type
self.baseline_a_mm = baseline_a_mm
self.baseline_b_mm = baseline_b_mm
self.baseline_c_mm = baseline_c_mm
self.accuracy = accuracy
self.iar_num_hypotheses = iar_num_hypotheses
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 25, struct.pack('<IIiiiIiHBBBBB', self.time_last_baseline_ms, self.tow, self.baseline_a_mm, self.baseline_b_mm, self.baseline_c_mm, self.accuracy, self.iar_num_hypotheses, self.wn, self.rtk_receiver_id, self.rtk_health, self.rtk_rate, self.nsats, self.baseline_coords_type), force_mavlink1=force_mavlink1)
class MAVLink_gps2_rtk_message(MAVLink_message):
'''
RTK GPS data. Gives information on the relative baseline
calculation the GPS is reporting
'''
id = MAVLINK_MSG_ID_GPS2_RTK
name = 'GPS2_RTK'
fieldnames = ['time_last_baseline_ms', 'rtk_receiver_id', 'wn', 'tow', 'rtk_health', 'rtk_rate', 'nsats', 'baseline_coords_type', 'baseline_a_mm', 'baseline_b_mm', 'baseline_c_mm', 'accuracy', 'iar_num_hypotheses']
ordered_fieldnames = ['time_last_baseline_ms', 'tow', 'baseline_a_mm', 'baseline_b_mm', 'baseline_c_mm', 'accuracy', 'iar_num_hypotheses', 'wn', 'rtk_receiver_id', 'rtk_health', 'rtk_rate', 'nsats', 'baseline_coords_type']
fieldtypes = ['uint32_t', 'uint8_t', 'uint16_t', 'uint32_t', 'uint8_t', 'uint8_t', 'uint8_t', 'uint8_t', 'int32_t', 'int32_t', 'int32_t', 'uint32_t', 'int32_t']
fielddisplays_by_name = {}
fieldenums_by_name = {"baseline_coords_type": "RTK_BASELINE_COORDINATE_SYSTEM"}
fieldunits_by_name = {"time_last_baseline_ms": "ms", "tow": "ms", "rtk_rate": "Hz", "baseline_a_mm": "mm", "baseline_b_mm": "mm", "baseline_c_mm": "mm"}
format = '<IIiiiIiHBBBBB'
native_format = bytearray('<IIiiiIiHBBBBB', 'ascii')
orders = [0, 8, 7, 1, 9, 10, 11, 12, 2, 3, 4, 5, 6]
lengths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
crc_extra = 226
unpacker = struct.Struct('<IIiiiIiHBBBBB')
instance_field = None
instance_offset = -1
def __init__(self, time_last_baseline_ms, rtk_receiver_id, wn, tow, rtk_health, rtk_rate, nsats, baseline_coords_type, baseline_a_mm, baseline_b_mm, baseline_c_mm, accuracy, iar_num_hypotheses):
MAVLink_message.__init__(self, MAVLink_gps2_rtk_message.id, MAVLink_gps2_rtk_message.name)
self._fieldnames = MAVLink_gps2_rtk_message.fieldnames
self._instance_field = MAVLink_gps2_rtk_message.instance_field
self._instance_offset = MAVLink_gps2_rtk_message.instance_offset
self.time_last_baseline_ms = time_last_baseline_ms
self.rtk_receiver_id = rtk_receiver_id
self.wn = wn
self.tow = tow
self.rtk_health = rtk_health
self.rtk_rate = rtk_rate
self.nsats = nsats
self.baseline_coords_type = baseline_coords_type
self.baseline_a_mm = baseline_a_mm
self.baseline_b_mm = baseline_b_mm
self.baseline_c_mm = baseline_c_mm
self.accuracy = accuracy
self.iar_num_hypotheses = iar_num_hypotheses
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 226, struct.pack('<IIiiiIiHBBBBB', self.time_last_baseline_ms, self.tow, self.baseline_a_mm, self.baseline_b_mm, self.baseline_c_mm, self.accuracy, self.iar_num_hypotheses, self.wn, self.rtk_receiver_id, self.rtk_health, self.rtk_rate, self.nsats, self.baseline_coords_type), force_mavlink1=force_mavlink1)
class MAVLink_scaled_imu3_message(MAVLink_message):
'''
The RAW IMU readings for 3rd 9DOF sensor setup. This message
should contain the scaled values to the described units
'''
id = MAVLINK_MSG_ID_SCALED_IMU3
name = 'SCALED_IMU3'
fieldnames = ['time_boot_ms', 'xacc', 'yacc', 'zacc', 'xgyro', 'ygyro', 'zgyro', 'xmag', 'ymag', 'zmag']
ordered_fieldnames = ['time_boot_ms', 'xacc', 'yacc', 'zacc', 'xgyro', 'ygyro', 'zgyro', 'xmag', 'ymag', 'zmag']
fieldtypes = ['uint32_t', 'int16_t', 'int16_t', 'int16_t', 'int16_t', 'int16_t', 'int16_t', 'int16_t', 'int16_t', 'int16_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"time_boot_ms": "ms", "xacc": "mG", "yacc": "mG", "zacc": "mG", "xgyro": "mrad/s", "ygyro": "mrad/s", "zgyro": "mrad/s", "xmag": "mgauss", "ymag": "mgauss", "zmag": "mgauss"}
format = '<Ihhhhhhhhh'
native_format = bytearray('<Ihhhhhhhhh', 'ascii')
orders = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
lengths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
crc_extra = 46
unpacker = struct.Struct('<Ihhhhhhhhh')
instance_field = None
instance_offset = -1
def __init__(self, time_boot_ms, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag):
MAVLink_message.__init__(self, MAVLink_scaled_imu3_message.id, MAVLink_scaled_imu3_message.name)
self._fieldnames = MAVLink_scaled_imu3_message.fieldnames
self._instance_field = MAVLink_scaled_imu3_message.instance_field
self._instance_offset = MAVLink_scaled_imu3_message.instance_offset
self.time_boot_ms = time_boot_ms
self.xacc = xacc
self.yacc = yacc
self.zacc = zacc
self.xgyro = xgyro
self.ygyro = ygyro
self.zgyro = zgyro
self.xmag = xmag
self.ymag = ymag
self.zmag = zmag
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 46, struct.pack('<Ihhhhhhhhh', self.time_boot_ms, self.xacc, self.yacc, self.zacc, self.xgyro, self.ygyro, self.zgyro, self.xmag, self.ymag, self.zmag), force_mavlink1=force_mavlink1)
class MAVLink_data_transmission_handshake_message(MAVLink_message):
'''
Handshake message to initiate, control and stop image
streaming when using the Image Transmission Protocol:
https://mavlink.io/en/services/image_transmission.html.
'''
id = MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE
name = 'DATA_TRANSMISSION_HANDSHAKE'
fieldnames = ['type', 'size', 'width', 'height', 'packets', 'payload', 'jpg_quality']
ordered_fieldnames = ['size', 'width', 'height', 'packets', 'type', 'payload', 'jpg_quality']
fieldtypes = ['uint8_t', 'uint32_t', 'uint16_t', 'uint16_t', 'uint16_t', 'uint8_t', 'uint8_t']
fielddisplays_by_name = {}
fieldenums_by_name = {"type": "MAVLINK_DATA_STREAM_TYPE"}
fieldunits_by_name = {"size": "bytes", "payload": "bytes", "jpg_quality": "%"}
format = '<IHHHBBB'
native_format = bytearray('<IHHHBBB', 'ascii')
orders = [4, 0, 1, 2, 3, 5, 6]
lengths = [1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0]
crc_extra = 29
unpacker = struct.Struct('<IHHHBBB')
instance_field = None
instance_offset = -1
def __init__(self, type, size, width, height, packets, payload, jpg_quality):
MAVLink_message.__init__(self, MAVLink_data_transmission_handshake_message.id, MAVLink_data_transmission_handshake_message.name)
self._fieldnames = MAVLink_data_transmission_handshake_message.fieldnames
self._instance_field = MAVLink_data_transmission_handshake_message.instance_field
self._instance_offset = MAVLink_data_transmission_handshake_message.instance_offset
self.type = type
self.size = size
self.width = width
self.height = height
self.packets = packets
self.payload = payload
self.jpg_quality = jpg_quality
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 29, struct.pack('<IHHHBBB', self.size, self.width, self.height, self.packets, self.type, self.payload, self.jpg_quality), force_mavlink1=force_mavlink1)
class MAVLink_encapsulated_data_message(MAVLink_message):
'''
Data packet for images sent using the Image Transmission
Protocol:
https://mavlink.io/en/services/image_transmission.html.
'''
id = MAVLINK_MSG_ID_ENCAPSULATED_DATA
name = 'ENCAPSULATED_DATA'
fieldnames = ['seqnr', 'data']
ordered_fieldnames = ['seqnr', 'data']
fieldtypes = ['uint16_t', 'uint8_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {}
format = '<H253B'
native_format = bytearray('<HB', 'ascii')
orders = [0, 1]
lengths = [1, 253]
array_lengths = [0, 253]
crc_extra = 223
unpacker = struct.Struct('<H253B')
instance_field = None
instance_offset = -1
def __init__(self, seqnr, data):
MAVLink_message.__init__(self, MAVLink_encapsulated_data_message.id, MAVLink_encapsulated_data_message.name)
self._fieldnames = MAVLink_encapsulated_data_message.fieldnames
self._instance_field = MAVLink_encapsulated_data_message.instance_field
self._instance_offset = MAVLink_encapsulated_data_message.instance_offset
self.seqnr = seqnr
self.data = data
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 223, struct.pack('<H253B', self.seqnr, self.data[0], self.data[1], self.data[2], self.data[3], self.data[4], self.data[5], self.data[6], self.data[7], self.data[8], self.data[9], self.data[10], self.data[11], self.data[12], self.data[13], self.data[14], self.data[15], self.data[16], self.data[17], self.data[18], self.data[19], self.data[20], self.data[21], self.data[22], self.data[23], self.data[24], self.data[25], self.data[26], self.data[27], self.data[28], self.data[29], self.data[30], self.data[31], self.data[32], self.data[33], self.data[34], self.data[35], self.data[36], self.data[37], self.data[38], self.data[39], self.data[40], self.data[41], self.data[42], self.data[43], self.data[44], self.data[45], self.data[46], self.data[47], self.data[48], self.data[49], self.data[50], self.data[51], self.data[52], self.data[53], self.data[54], self.data[55], self.data[56], self.data[57], self.data[58], self.data[59], self.data[60], self.data[61], self.data[62], self.data[63], self.data[64], self.data[65], self.data[66], self.data[67], self.data[68], self.data[69], self.data[70], self.data[71], self.data[72], self.data[73], self.data[74], self.data[75], self.data[76], self.data[77], self.data[78], self.data[79], self.data[80], self.data[81], self.data[82], self.data[83], self.data[84], self.data[85], self.data[86], self.data[87], self.data[88], self.data[89], self.data[90], self.data[91], self.data[92], self.data[93], self.data[94], self.data[95], self.data[96], self.data[97], self.data[98], self.data[99], self.data[100], self.data[101], self.data[102], self.data[103], self.data[104], self.data[105], self.data[106], self.data[107], self.data[108], self.data[109], self.data[110], self.data[111], self.data[112], self.data[113], self.data[114], self.data[115], self.data[116], self.data[117], self.data[118], self.data[119], self.data[120], self.data[121], self.data[122], self.data[123], self.data[124], self.data[125], self.data[126], self.data[127], self.data[128], self.data[129], self.data[130], self.data[131], self.data[132], self.data[133], self.data[134], self.data[135], self.data[136], self.data[137], self.data[138], self.data[139], self.data[140], self.data[141], self.data[142], self.data[143], self.data[144], self.data[145], self.data[146], self.data[147], self.data[148], self.data[149], self.data[150], self.data[151], self.data[152], self.data[153], self.data[154], self.data[155], self.data[156], self.data[157], self.data[158], self.data[159], self.data[160], self.data[161], self.data[162], self.data[163], self.data[164], self.data[165], self.data[166], self.data[167], self.data[168], self.data[169], self.data[170], self.data[171], self.data[172], self.data[173], self.data[174], self.data[175], self.data[176], self.data[177], self.data[178], self.data[179], self.data[180], self.data[181], self.data[182], self.data[183], self.data[184], self.data[185], self.data[186], self.data[187], self.data[188], self.data[189], self.data[190], self.data[191], self.data[192], self.data[193], self.data[194], self.data[195], self.data[196], self.data[197], self.data[198], self.data[199], self.data[200], self.data[201], self.data[202], self.data[203], self.data[204], self.data[205], self.data[206], self.data[207], self.data[208], self.data[209], self.data[210], self.data[211], self.data[212], self.data[213], self.data[214], self.data[215], self.data[216], self.data[217], self.data[218], self.data[219], self.data[220], self.data[221], self.data[222], self.data[223], self.data[224], self.data[225], self.data[226], self.data[227], self.data[228], self.data[229], self.data[230], self.data[231], self.data[232], self.data[233], self.data[234], self.data[235], self.data[236], self.data[237], self.data[238], self.data[239], self.data[240], self.data[241], self.data[242], self.data[243], self.data[244], self.data[245], self.data[246], self.data[247], self.data[248], self.data[249], self.data[250], self.data[251], self.data[252]), force_mavlink1=force_mavlink1)
class MAVLink_distance_sensor_message(MAVLink_message):
'''
Distance sensor information for an onboard rangefinder.
'''
id = MAVLINK_MSG_ID_DISTANCE_SENSOR
name = 'DISTANCE_SENSOR'
fieldnames = ['time_boot_ms', 'min_distance', 'max_distance', 'current_distance', 'type', 'id', 'orientation', 'covariance']
ordered_fieldnames = ['time_boot_ms', 'min_distance', 'max_distance', 'current_distance', 'type', 'id', 'orientation', 'covariance']
fieldtypes = ['uint32_t', 'uint16_t', 'uint16_t', 'uint16_t', 'uint8_t', 'uint8_t', 'uint8_t', 'uint8_t']
fielddisplays_by_name = {}
fieldenums_by_name = {"type": "MAV_DISTANCE_SENSOR", "orientation": "MAV_SENSOR_ORIENTATION"}
fieldunits_by_name = {"time_boot_ms": "ms", "min_distance": "cm", "max_distance": "cm", "current_distance": "cm", "covariance": "cm^2"}
format = '<IHHHBBBB'
native_format = bytearray('<IHHHBBBB', 'ascii')
orders = [0, 1, 2, 3, 4, 5, 6, 7]
lengths = [1, 1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0, 0]
crc_extra = 85
unpacker = struct.Struct('<IHHHBBBB')
instance_field = 'id'
instance_offset = 11
def __init__(self, time_boot_ms, min_distance, max_distance, current_distance, type, id, orientation, covariance):
MAVLink_message.__init__(self, MAVLink_distance_sensor_message.id, MAVLink_distance_sensor_message.name)
self._fieldnames = MAVLink_distance_sensor_message.fieldnames
self._instance_field = MAVLink_distance_sensor_message.instance_field
self._instance_offset = MAVLink_distance_sensor_message.instance_offset
self.time_boot_ms = time_boot_ms
self.min_distance = min_distance
self.max_distance = max_distance
self.current_distance = current_distance
self.type = type
self.id = id
self.orientation = orientation
self.covariance = covariance
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 85, struct.pack('<IHHHBBBB', self.time_boot_ms, self.min_distance, self.max_distance, self.current_distance, self.type, self.id, self.orientation, self.covariance), force_mavlink1=force_mavlink1)
class MAVLink_terrain_request_message(MAVLink_message):
'''
Request for terrain data and terrain status
'''
id = MAVLINK_MSG_ID_TERRAIN_REQUEST
name = 'TERRAIN_REQUEST'
fieldnames = ['lat', 'lon', 'grid_spacing', 'mask']
ordered_fieldnames = ['mask', 'lat', 'lon', 'grid_spacing']
fieldtypes = ['int32_t', 'int32_t', 'uint16_t', 'uint64_t']
fielddisplays_by_name = {"mask": "bitmask"}
fieldenums_by_name = {}
fieldunits_by_name = {"lat": "degE7", "lon": "degE7", "grid_spacing": "m"}
format = '<QiiH'
native_format = bytearray('<QiiH', 'ascii')
orders = [1, 2, 3, 0]
lengths = [1, 1, 1, 1]
array_lengths = [0, 0, 0, 0]
crc_extra = 6
unpacker = struct.Struct('<QiiH')
instance_field = None
instance_offset = -1
def __init__(self, lat, lon, grid_spacing, mask):
MAVLink_message.__init__(self, MAVLink_terrain_request_message.id, MAVLink_terrain_request_message.name)
self._fieldnames = MAVLink_terrain_request_message.fieldnames
self._instance_field = MAVLink_terrain_request_message.instance_field
self._instance_offset = MAVLink_terrain_request_message.instance_offset
self.lat = lat
self.lon = lon
self.grid_spacing = grid_spacing
self.mask = mask
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 6, struct.pack('<QiiH', self.mask, self.lat, self.lon, self.grid_spacing), force_mavlink1=force_mavlink1)
class MAVLink_terrain_data_message(MAVLink_message):
'''
Terrain data sent from GCS. The lat/lon and grid_spacing must
be the same as a lat/lon from a TERRAIN_REQUEST
'''
id = MAVLINK_MSG_ID_TERRAIN_DATA
name = 'TERRAIN_DATA'
fieldnames = ['lat', 'lon', 'grid_spacing', 'gridbit', 'data']
ordered_fieldnames = ['lat', 'lon', 'grid_spacing', 'data', 'gridbit']
fieldtypes = ['int32_t', 'int32_t', 'uint16_t', 'uint8_t', 'int16_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"lat": "degE7", "lon": "degE7", "grid_spacing": "m", "data": "m"}
format = '<iiH16hB'
native_format = bytearray('<iiHhB', 'ascii')
orders = [0, 1, 2, 4, 3]
lengths = [1, 1, 1, 16, 1]
array_lengths = [0, 0, 0, 16, 0]
crc_extra = 229
unpacker = struct.Struct('<iiH16hB')
instance_field = None
instance_offset = -1
def __init__(self, lat, lon, grid_spacing, gridbit, data):
MAVLink_message.__init__(self, MAVLink_terrain_data_message.id, MAVLink_terrain_data_message.name)
self._fieldnames = MAVLink_terrain_data_message.fieldnames
self._instance_field = MAVLink_terrain_data_message.instance_field
self._instance_offset = MAVLink_terrain_data_message.instance_offset
self.lat = lat
self.lon = lon
self.grid_spacing = grid_spacing
self.gridbit = gridbit
self.data = data
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 229, struct.pack('<iiH16hB', self.lat, self.lon, self.grid_spacing, self.data[0], self.data[1], self.data[2], self.data[3], self.data[4], self.data[5], self.data[6], self.data[7], self.data[8], self.data[9], self.data[10], self.data[11], self.data[12], self.data[13], self.data[14], self.data[15], self.gridbit), force_mavlink1=force_mavlink1)
class MAVLink_terrain_check_message(MAVLink_message):
'''
Request that the vehicle report terrain height at the given
location. Used by GCS to check if vehicle has all terrain data
needed for a mission.
'''
id = MAVLINK_MSG_ID_TERRAIN_CHECK
name = 'TERRAIN_CHECK'
fieldnames = ['lat', 'lon']
ordered_fieldnames = ['lat', 'lon']
fieldtypes = ['int32_t', 'int32_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"lat": "degE7", "lon": "degE7"}
format = '<ii'
native_format = bytearray('<ii', 'ascii')
orders = [0, 1]
lengths = [1, 1]
array_lengths = [0, 0]
crc_extra = 203
unpacker = struct.Struct('<ii')
instance_field = None
instance_offset = -1
def __init__(self, lat, lon):
MAVLink_message.__init__(self, MAVLink_terrain_check_message.id, MAVLink_terrain_check_message.name)
self._fieldnames = MAVLink_terrain_check_message.fieldnames
self._instance_field = MAVLink_terrain_check_message.instance_field
self._instance_offset = MAVLink_terrain_check_message.instance_offset
self.lat = lat
self.lon = lon
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 203, struct.pack('<ii', self.lat, self.lon), force_mavlink1=force_mavlink1)
class MAVLink_terrain_report_message(MAVLink_message):
'''
Response from a TERRAIN_CHECK request
'''
id = MAVLINK_MSG_ID_TERRAIN_REPORT
name = 'TERRAIN_REPORT'
fieldnames = ['lat', 'lon', 'spacing', 'terrain_height', 'current_height', 'pending', 'loaded']
ordered_fieldnames = ['lat', 'lon', 'terrain_height', 'current_height', 'spacing', 'pending', 'loaded']
fieldtypes = ['int32_t', 'int32_t', 'uint16_t', 'float', 'float', 'uint16_t', 'uint16_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"lat": "degE7", "lon": "degE7", "terrain_height": "m", "current_height": "m"}
format = '<iiffHHH'
native_format = bytearray('<iiffHHH', 'ascii')
orders = [0, 1, 4, 2, 3, 5, 6]
lengths = [1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0]
crc_extra = 1
unpacker = struct.Struct('<iiffHHH')
instance_field = None
instance_offset = -1
def __init__(self, lat, lon, spacing, terrain_height, current_height, pending, loaded):
MAVLink_message.__init__(self, MAVLink_terrain_report_message.id, MAVLink_terrain_report_message.name)
self._fieldnames = MAVLink_terrain_report_message.fieldnames
self._instance_field = MAVLink_terrain_report_message.instance_field
self._instance_offset = MAVLink_terrain_report_message.instance_offset
self.lat = lat
self.lon = lon
self.spacing = spacing
self.terrain_height = terrain_height
self.current_height = current_height
self.pending = pending
self.loaded = loaded
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 1, struct.pack('<iiffHHH', self.lat, self.lon, self.terrain_height, self.current_height, self.spacing, self.pending, self.loaded), force_mavlink1=force_mavlink1)
class MAVLink_scaled_pressure2_message(MAVLink_message):
'''
Barometer readings for 2nd barometer
'''
id = MAVLINK_MSG_ID_SCALED_PRESSURE2
name = 'SCALED_PRESSURE2'
fieldnames = ['time_boot_ms', 'press_abs', 'press_diff', 'temperature']
ordered_fieldnames = ['time_boot_ms', 'press_abs', 'press_diff', 'temperature']
fieldtypes = ['uint32_t', 'float', 'float', 'int16_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"time_boot_ms": "ms", "press_abs": "hPa", "press_diff": "hPa", "temperature": "cdegC"}
format = '<Iffh'
native_format = bytearray('<Iffh', 'ascii')
orders = [0, 1, 2, 3]
lengths = [1, 1, 1, 1]
array_lengths = [0, 0, 0, 0]
crc_extra = 195
unpacker = struct.Struct('<Iffh')
instance_field = None
instance_offset = -1
def __init__(self, time_boot_ms, press_abs, press_diff, temperature):
MAVLink_message.__init__(self, MAVLink_scaled_pressure2_message.id, MAVLink_scaled_pressure2_message.name)
self._fieldnames = MAVLink_scaled_pressure2_message.fieldnames
self._instance_field = MAVLink_scaled_pressure2_message.instance_field
self._instance_offset = MAVLink_scaled_pressure2_message.instance_offset
self.time_boot_ms = time_boot_ms
self.press_abs = press_abs
self.press_diff = press_diff
self.temperature = temperature
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 195, struct.pack('<Iffh', self.time_boot_ms, self.press_abs, self.press_diff, self.temperature), force_mavlink1=force_mavlink1)
class MAVLink_att_pos_mocap_message(MAVLink_message):
'''
Motion capture attitude and position
'''
id = MAVLINK_MSG_ID_ATT_POS_MOCAP
name = 'ATT_POS_MOCAP'
fieldnames = ['time_usec', 'q', 'x', 'y', 'z']
ordered_fieldnames = ['time_usec', 'q', 'x', 'y', 'z']
fieldtypes = ['uint64_t', 'float', 'float', 'float', 'float']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"time_usec": "us", "x": "m", "y": "m", "z": "m"}
format = '<Q4ffff'
native_format = bytearray('<Qffff', 'ascii')
orders = [0, 1, 2, 3, 4]
lengths = [1, 4, 1, 1, 1]
array_lengths = [0, 4, 0, 0, 0]
crc_extra = 109
unpacker = struct.Struct('<Q4ffff')
instance_field = None
instance_offset = -1
def __init__(self, time_usec, q, x, y, z):
MAVLink_message.__init__(self, MAVLink_att_pos_mocap_message.id, MAVLink_att_pos_mocap_message.name)
self._fieldnames = MAVLink_att_pos_mocap_message.fieldnames
self._instance_field = MAVLink_att_pos_mocap_message.instance_field
self._instance_offset = MAVLink_att_pos_mocap_message.instance_offset
self.time_usec = time_usec
self.q = q
self.x = x
self.y = y
self.z = z
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 109, struct.pack('<Q4ffff', self.time_usec, self.q[0], self.q[1], self.q[2], self.q[3], self.x, self.y, self.z), force_mavlink1=force_mavlink1)
class MAVLink_set_actuator_control_target_message(MAVLink_message):
'''
Set the vehicle attitude and body angular rates.
'''
id = MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET
name = 'SET_ACTUATOR_CONTROL_TARGET'
fieldnames = ['time_usec', 'group_mlx', 'target_system', 'target_component', 'controls']
ordered_fieldnames = ['time_usec', 'controls', 'group_mlx', 'target_system', 'target_component']
fieldtypes = ['uint64_t', 'uint8_t', 'uint8_t', 'uint8_t', 'float']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"time_usec": "us"}
format = '<Q8fBBB'
native_format = bytearray('<QfBBB', 'ascii')
orders = [0, 2, 3, 4, 1]
lengths = [1, 8, 1, 1, 1]
array_lengths = [0, 8, 0, 0, 0]
crc_extra = 168
unpacker = struct.Struct('<Q8fBBB')
instance_field = None
instance_offset = -1
def __init__(self, time_usec, group_mlx, target_system, target_component, controls):
MAVLink_message.__init__(self, MAVLink_set_actuator_control_target_message.id, MAVLink_set_actuator_control_target_message.name)
self._fieldnames = MAVLink_set_actuator_control_target_message.fieldnames
self._instance_field = MAVLink_set_actuator_control_target_message.instance_field
self._instance_offset = MAVLink_set_actuator_control_target_message.instance_offset
self.time_usec = time_usec
self.group_mlx = group_mlx
self.target_system = target_system
self.target_component = target_component
self.controls = controls
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 168, struct.pack('<Q8fBBB', self.time_usec, self.controls[0], self.controls[1], self.controls[2], self.controls[3], self.controls[4], self.controls[5], self.controls[6], self.controls[7], self.group_mlx, self.target_system, self.target_component), force_mavlink1=force_mavlink1)
class MAVLink_actuator_control_target_message(MAVLink_message):
'''
Set the vehicle attitude and body angular rates.
'''
id = MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET
name = 'ACTUATOR_CONTROL_TARGET'
fieldnames = ['time_usec', 'group_mlx', 'controls']
ordered_fieldnames = ['time_usec', 'controls', 'group_mlx']
fieldtypes = ['uint64_t', 'uint8_t', 'float']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"time_usec": "us"}
format = '<Q8fB'
native_format = bytearray('<QfB', 'ascii')
orders = [0, 2, 1]
lengths = [1, 8, 1]
array_lengths = [0, 8, 0]
crc_extra = 181
unpacker = struct.Struct('<Q8fB')
instance_field = None
instance_offset = -1
def __init__(self, time_usec, group_mlx, controls):
MAVLink_message.__init__(self, MAVLink_actuator_control_target_message.id, MAVLink_actuator_control_target_message.name)
self._fieldnames = MAVLink_actuator_control_target_message.fieldnames
self._instance_field = MAVLink_actuator_control_target_message.instance_field
self._instance_offset = MAVLink_actuator_control_target_message.instance_offset
self.time_usec = time_usec
self.group_mlx = group_mlx
self.controls = controls
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 181, struct.pack('<Q8fB', self.time_usec, self.controls[0], self.controls[1], self.controls[2], self.controls[3], self.controls[4], self.controls[5], self.controls[6], self.controls[7], self.group_mlx), force_mavlink1=force_mavlink1)
class MAVLink_altitude_message(MAVLink_message):
'''
The current system altitude.
'''
id = MAVLINK_MSG_ID_ALTITUDE
name = 'ALTITUDE'
fieldnames = ['time_usec', 'altitude_monotonic', 'altitude_amsl', 'altitude_local', 'altitude_relative', 'altitude_terrain', 'bottom_clearance']
ordered_fieldnames = ['time_usec', 'altitude_monotonic', 'altitude_amsl', 'altitude_local', 'altitude_relative', 'altitude_terrain', 'bottom_clearance']
fieldtypes = ['uint64_t', 'float', 'float', 'float', 'float', 'float', 'float']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"time_usec": "us", "altitude_monotonic": "m", "altitude_amsl": "m", "altitude_local": "m", "altitude_relative": "m", "altitude_terrain": "m", "bottom_clearance": "m"}
format = '<Qffffff'
native_format = bytearray('<Qffffff', 'ascii')
orders = [0, 1, 2, 3, 4, 5, 6]
lengths = [1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0]
crc_extra = 47
unpacker = struct.Struct('<Qffffff')
instance_field = None
instance_offset = -1
def __init__(self, time_usec, altitude_monotonic, altitude_amsl, altitude_local, altitude_relative, altitude_terrain, bottom_clearance):
MAVLink_message.__init__(self, MAVLink_altitude_message.id, MAVLink_altitude_message.name)
self._fieldnames = MAVLink_altitude_message.fieldnames
self._instance_field = MAVLink_altitude_message.instance_field
self._instance_offset = MAVLink_altitude_message.instance_offset
self.time_usec = time_usec
self.altitude_monotonic = altitude_monotonic
self.altitude_amsl = altitude_amsl
self.altitude_local = altitude_local
self.altitude_relative = altitude_relative
self.altitude_terrain = altitude_terrain
self.bottom_clearance = bottom_clearance
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 47, struct.pack('<Qffffff', self.time_usec, self.altitude_monotonic, self.altitude_amsl, self.altitude_local, self.altitude_relative, self.altitude_terrain, self.bottom_clearance), force_mavlink1=force_mavlink1)
class MAVLink_resource_request_message(MAVLink_message):
'''
The autopilot is requesting a resource (file, binary, other
type of data)
'''
id = MAVLINK_MSG_ID_RESOURCE_REQUEST
name = 'RESOURCE_REQUEST'
fieldnames = ['request_id', 'uri_type', 'uri', 'transfer_type', 'storage']
ordered_fieldnames = ['request_id', 'uri_type', 'uri', 'transfer_type', 'storage']
fieldtypes = ['uint8_t', 'uint8_t', 'uint8_t', 'uint8_t', 'uint8_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {}
format = '<BB120BB120B'
native_format = bytearray('<BBBBB', 'ascii')
orders = [0, 1, 2, 3, 4]
lengths = [1, 1, 120, 1, 120]
array_lengths = [0, 0, 120, 0, 120]
crc_extra = 72
unpacker = struct.Struct('<BB120BB120B')
instance_field = None
instance_offset = -1
def __init__(self, request_id, uri_type, uri, transfer_type, storage):
MAVLink_message.__init__(self, MAVLink_resource_request_message.id, MAVLink_resource_request_message.name)
self._fieldnames = MAVLink_resource_request_message.fieldnames
self._instance_field = MAVLink_resource_request_message.instance_field
self._instance_offset = MAVLink_resource_request_message.instance_offset
self.request_id = request_id
self.uri_type = uri_type
self.uri = uri
self.transfer_type = transfer_type
self.storage = storage
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 72, struct.pack('<BB120BB120B', self.request_id, self.uri_type, self.uri[0], self.uri[1], self.uri[2], self.uri[3], self.uri[4], self.uri[5], self.uri[6], self.uri[7], self.uri[8], self.uri[9], self.uri[10], self.uri[11], self.uri[12], self.uri[13], self.uri[14], self.uri[15], self.uri[16], self.uri[17], self.uri[18], self.uri[19], self.uri[20], self.uri[21], self.uri[22], self.uri[23], self.uri[24], self.uri[25], self.uri[26], self.uri[27], self.uri[28], self.uri[29], self.uri[30], self.uri[31], self.uri[32], self.uri[33], self.uri[34], self.uri[35], self.uri[36], self.uri[37], self.uri[38], self.uri[39], self.uri[40], self.uri[41], self.uri[42], self.uri[43], self.uri[44], self.uri[45], self.uri[46], self.uri[47], self.uri[48], self.uri[49], self.uri[50], self.uri[51], self.uri[52], self.uri[53], self.uri[54], self.uri[55], self.uri[56], self.uri[57], self.uri[58], self.uri[59], self.uri[60], self.uri[61], self.uri[62], self.uri[63], self.uri[64], self.uri[65], self.uri[66], self.uri[67], self.uri[68], self.uri[69], self.uri[70], self.uri[71], self.uri[72], self.uri[73], self.uri[74], self.uri[75], self.uri[76], self.uri[77], self.uri[78], self.uri[79], self.uri[80], self.uri[81], self.uri[82], self.uri[83], self.uri[84], self.uri[85], self.uri[86], self.uri[87], self.uri[88], self.uri[89], self.uri[90], self.uri[91], self.uri[92], self.uri[93], self.uri[94], self.uri[95], self.uri[96], self.uri[97], self.uri[98], self.uri[99], self.uri[100], self.uri[101], self.uri[102], self.uri[103], self.uri[104], self.uri[105], self.uri[106], self.uri[107], self.uri[108], self.uri[109], self.uri[110], self.uri[111], self.uri[112], self.uri[113], self.uri[114], self.uri[115], self.uri[116], self.uri[117], self.uri[118], self.uri[119], self.transfer_type, self.storage[0], self.storage[1], self.storage[2], self.storage[3], self.storage[4], self.storage[5], self.storage[6], self.storage[7], self.storage[8], self.storage[9], self.storage[10], self.storage[11], self.storage[12], self.storage[13], self.storage[14], self.storage[15], self.storage[16], self.storage[17], self.storage[18], self.storage[19], self.storage[20], self.storage[21], self.storage[22], self.storage[23], self.storage[24], self.storage[25], self.storage[26], self.storage[27], self.storage[28], self.storage[29], self.storage[30], self.storage[31], self.storage[32], self.storage[33], self.storage[34], self.storage[35], self.storage[36], self.storage[37], self.storage[38], self.storage[39], self.storage[40], self.storage[41], self.storage[42], self.storage[43], self.storage[44], self.storage[45], self.storage[46], self.storage[47], self.storage[48], self.storage[49], self.storage[50], self.storage[51], self.storage[52], self.storage[53], self.storage[54], self.storage[55], self.storage[56], self.storage[57], self.storage[58], self.storage[59], self.storage[60], self.storage[61], self.storage[62], self.storage[63], self.storage[64], self.storage[65], self.storage[66], self.storage[67], self.storage[68], self.storage[69], self.storage[70], self.storage[71], self.storage[72], self.storage[73], self.storage[74], self.storage[75], self.storage[76], self.storage[77], self.storage[78], self.storage[79], self.storage[80], self.storage[81], self.storage[82], self.storage[83], self.storage[84], self.storage[85], self.storage[86], self.storage[87], self.storage[88], self.storage[89], self.storage[90], self.storage[91], self.storage[92], self.storage[93], self.storage[94], self.storage[95], self.storage[96], self.storage[97], self.storage[98], self.storage[99], self.storage[100], self.storage[101], self.storage[102], self.storage[103], self.storage[104], self.storage[105], self.storage[106], self.storage[107], self.storage[108], self.storage[109], self.storage[110], self.storage[111], self.storage[112], self.storage[113], self.storage[114], self.storage[115], self.storage[116], self.storage[117], self.storage[118], self.storage[119]), force_mavlink1=force_mavlink1)
class MAVLink_scaled_pressure3_message(MAVLink_message):
'''
Barometer readings for 3rd barometer
'''
id = MAVLINK_MSG_ID_SCALED_PRESSURE3
name = 'SCALED_PRESSURE3'
fieldnames = ['time_boot_ms', 'press_abs', 'press_diff', 'temperature']
ordered_fieldnames = ['time_boot_ms', 'press_abs', 'press_diff', 'temperature']
fieldtypes = ['uint32_t', 'float', 'float', 'int16_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"time_boot_ms": "ms", "press_abs": "hPa", "press_diff": "hPa", "temperature": "cdegC"}
format = '<Iffh'
native_format = bytearray('<Iffh', 'ascii')
orders = [0, 1, 2, 3]
lengths = [1, 1, 1, 1]
array_lengths = [0, 0, 0, 0]
crc_extra = 131
unpacker = struct.Struct('<Iffh')
instance_field = None
instance_offset = -1
def __init__(self, time_boot_ms, press_abs, press_diff, temperature):
MAVLink_message.__init__(self, MAVLink_scaled_pressure3_message.id, MAVLink_scaled_pressure3_message.name)
self._fieldnames = MAVLink_scaled_pressure3_message.fieldnames
self._instance_field = MAVLink_scaled_pressure3_message.instance_field
self._instance_offset = MAVLink_scaled_pressure3_message.instance_offset
self.time_boot_ms = time_boot_ms
self.press_abs = press_abs
self.press_diff = press_diff
self.temperature = temperature
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 131, struct.pack('<Iffh', self.time_boot_ms, self.press_abs, self.press_diff, self.temperature), force_mavlink1=force_mavlink1)
class MAVLink_follow_target_message(MAVLink_message):
'''
Current motion information from a designated system
'''
id = MAVLINK_MSG_ID_FOLLOW_TARGET
name = 'FOLLOW_TARGET'
fieldnames = ['timestamp', 'est_capabilities', 'lat', 'lon', 'alt', 'vel', 'acc', 'attitude_q', 'rates', 'position_cov', 'custom_state']
ordered_fieldnames = ['timestamp', 'custom_state', 'lat', 'lon', 'alt', 'vel', 'acc', 'attitude_q', 'rates', 'position_cov', 'est_capabilities']
fieldtypes = ['uint64_t', 'uint8_t', 'int32_t', 'int32_t', 'float', 'float', 'float', 'float', 'float', 'float', 'uint64_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"timestamp": "ms", "lat": "degE7", "lon": "degE7", "alt": "m", "vel": "m/s", "acc": "m/s/s"}
format = '<QQiif3f3f4f3f3fB'
native_format = bytearray('<QQiiffffffB', 'ascii')
orders = [0, 10, 2, 3, 4, 5, 6, 7, 8, 9, 1]
lengths = [1, 1, 1, 1, 1, 3, 3, 4, 3, 3, 1]
array_lengths = [0, 0, 0, 0, 0, 3, 3, 4, 3, 3, 0]
crc_extra = 127
unpacker = struct.Struct('<QQiif3f3f4f3f3fB')
instance_field = None
instance_offset = -1
def __init__(self, timestamp, est_capabilities, lat, lon, alt, vel, acc, attitude_q, rates, position_cov, custom_state):
MAVLink_message.__init__(self, MAVLink_follow_target_message.id, MAVLink_follow_target_message.name)
self._fieldnames = MAVLink_follow_target_message.fieldnames
self._instance_field = MAVLink_follow_target_message.instance_field
self._instance_offset = MAVLink_follow_target_message.instance_offset
self.timestamp = timestamp
self.est_capabilities = est_capabilities
self.lat = lat
self.lon = lon
self.alt = alt
self.vel = vel
self.acc = acc
self.attitude_q = attitude_q
self.rates = rates
self.position_cov = position_cov
self.custom_state = custom_state
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 127, struct.pack('<QQiif3f3f4f3f3fB', self.timestamp, self.custom_state, self.lat, self.lon, self.alt, self.vel[0], self.vel[1], self.vel[2], self.acc[0], self.acc[1], self.acc[2], self.attitude_q[0], self.attitude_q[1], self.attitude_q[2], self.attitude_q[3], self.rates[0], self.rates[1], self.rates[2], self.position_cov[0], self.position_cov[1], self.position_cov[2], self.est_capabilities), force_mavlink1=force_mavlink1)
class MAVLink_control_system_state_message(MAVLink_message):
'''
The smoothed, monotonic system state used to feed the control
loops of the system.
'''
id = MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE
name = 'CONTROL_SYSTEM_STATE'
fieldnames = ['time_usec', 'x_acc', 'y_acc', 'z_acc', 'x_vel', 'y_vel', 'z_vel', 'x_pos', 'y_pos', 'z_pos', 'airspeed', 'vel_variance', 'pos_variance', 'q', 'roll_rate', 'pitch_rate', 'yaw_rate']
ordered_fieldnames = ['time_usec', 'x_acc', 'y_acc', 'z_acc', 'x_vel', 'y_vel', 'z_vel', 'x_pos', 'y_pos', 'z_pos', 'airspeed', 'vel_variance', 'pos_variance', 'q', 'roll_rate', 'pitch_rate', 'yaw_rate']
fieldtypes = ['uint64_t', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"time_usec": "us", "x_acc": "m/s/s", "y_acc": "m/s/s", "z_acc": "m/s/s", "x_vel": "m/s", "y_vel": "m/s", "z_vel": "m/s", "x_pos": "m", "y_pos": "m", "z_pos": "m", "airspeed": "m/s", "roll_rate": "rad/s", "pitch_rate": "rad/s", "yaw_rate": "rad/s"}
format = '<Qffffffffff3f3f4ffff'
native_format = bytearray('<Qffffffffffffffff', 'ascii')
orders = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
lengths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 4, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 4, 0, 0, 0]
crc_extra = 103
unpacker = struct.Struct('<Qffffffffff3f3f4ffff')
instance_field = None
instance_offset = -1
def __init__(self, time_usec, x_acc, y_acc, z_acc, x_vel, y_vel, z_vel, x_pos, y_pos, z_pos, airspeed, vel_variance, pos_variance, q, roll_rate, pitch_rate, yaw_rate):
MAVLink_message.__init__(self, MAVLink_control_system_state_message.id, MAVLink_control_system_state_message.name)
self._fieldnames = MAVLink_control_system_state_message.fieldnames
self._instance_field = MAVLink_control_system_state_message.instance_field
self._instance_offset = MAVLink_control_system_state_message.instance_offset
self.time_usec = time_usec
self.x_acc = x_acc
self.y_acc = y_acc
self.z_acc = z_acc
self.x_vel = x_vel
self.y_vel = y_vel
self.z_vel = z_vel
self.x_pos = x_pos
self.y_pos = y_pos
self.z_pos = z_pos
self.airspeed = airspeed
self.vel_variance = vel_variance
self.pos_variance = pos_variance
self.q = q
self.roll_rate = roll_rate
self.pitch_rate = pitch_rate
self.yaw_rate = yaw_rate
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 103, struct.pack('<Qffffffffff3f3f4ffff', self.time_usec, self.x_acc, self.y_acc, self.z_acc, self.x_vel, self.y_vel, self.z_vel, self.x_pos, self.y_pos, self.z_pos, self.airspeed, self.vel_variance[0], self.vel_variance[1], self.vel_variance[2], self.pos_variance[0], self.pos_variance[1], self.pos_variance[2], self.q[0], self.q[1], self.q[2], self.q[3], self.roll_rate, self.pitch_rate, self.yaw_rate), force_mavlink1=force_mavlink1)
class MAVLink_battery_status_message(MAVLink_message):
'''
Battery information
'''
id = MAVLINK_MSG_ID_BATTERY_STATUS
name = 'BATTERY_STATUS'
fieldnames = ['id', 'battery_function', 'type', 'temperature', 'voltages', 'current_battery', 'current_consumed', 'energy_consumed', 'battery_remaining']
ordered_fieldnames = ['current_consumed', 'energy_consumed', 'temperature', 'voltages', 'current_battery', 'id', 'battery_function', 'type', 'battery_remaining']
fieldtypes = ['uint8_t', 'uint8_t', 'uint8_t', 'int16_t', 'uint16_t', 'int16_t', 'int32_t', 'int32_t', 'int8_t']
fielddisplays_by_name = {}
fieldenums_by_name = {"battery_function": "MAV_BATTERY_FUNCTION", "type": "MAV_BATTERY_TYPE"}
fieldunits_by_name = {"temperature": "cdegC", "voltages": "mV", "current_battery": "cA", "current_consumed": "mAh", "energy_consumed": "hJ", "battery_remaining": "%"}
format = '<iih10HhBBBb'
native_format = bytearray('<iihHhBBBb', 'ascii')
orders = [5, 6, 7, 2, 3, 4, 0, 1, 8]
lengths = [1, 1, 1, 10, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 10, 0, 0, 0, 0, 0]
crc_extra = 154
unpacker = struct.Struct('<iih10HhBBBb')
instance_field = 'id'
instance_offset = 32
def __init__(self, id, battery_function, type, temperature, voltages, current_battery, current_consumed, energy_consumed, battery_remaining):
MAVLink_message.__init__(self, MAVLink_battery_status_message.id, MAVLink_battery_status_message.name)
self._fieldnames = MAVLink_battery_status_message.fieldnames
self._instance_field = MAVLink_battery_status_message.instance_field
self._instance_offset = MAVLink_battery_status_message.instance_offset
self.id = id
self.battery_function = battery_function
self.type = type
self.temperature = temperature
self.voltages = voltages
self.current_battery = current_battery
self.current_consumed = current_consumed
self.energy_consumed = energy_consumed
self.battery_remaining = battery_remaining
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 154, struct.pack('<iih10HhBBBb', self.current_consumed, self.energy_consumed, self.temperature, self.voltages[0], self.voltages[1], self.voltages[2], self.voltages[3], self.voltages[4], self.voltages[5], self.voltages[6], self.voltages[7], self.voltages[8], self.voltages[9], self.current_battery, self.id, self.battery_function, self.type, self.battery_remaining), force_mavlink1=force_mavlink1)
class MAVLink_autopilot_version_message(MAVLink_message):
'''
Version and capability of autopilot software. This should be
emitted in response to a
MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES command.
'''
id = MAVLINK_MSG_ID_AUTOPILOT_VERSION
name = 'AUTOPILOT_VERSION'
fieldnames = ['capabilities', 'flight_sw_version', 'middleware_sw_version', 'os_sw_version', 'board_version', 'flight_custom_version', 'middleware_custom_version', 'os_custom_version', 'vendor_id', 'product_id', 'uid']
ordered_fieldnames = ['capabilities', 'uid', 'flight_sw_version', 'middleware_sw_version', 'os_sw_version', 'board_version', 'vendor_id', 'product_id', 'flight_custom_version', 'middleware_custom_version', 'os_custom_version']
fieldtypes = ['uint64_t', 'uint32_t', 'uint32_t', 'uint32_t', 'uint32_t', 'uint8_t', 'uint8_t', 'uint8_t', 'uint16_t', 'uint16_t', 'uint64_t']
fielddisplays_by_name = {"capabilities": "bitmask"}
fieldenums_by_name = {"capabilities": "MAV_PROTOCOL_CAPABILITY"}
fieldunits_by_name = {}
format = '<QQIIIIHH8B8B8B'
native_format = bytearray('<QQIIIIHHBBB', 'ascii')
orders = [0, 2, 3, 4, 5, 8, 9, 10, 6, 7, 1]
lengths = [1, 1, 1, 1, 1, 1, 1, 1, 8, 8, 8]
array_lengths = [0, 0, 0, 0, 0, 0, 0, 0, 8, 8, 8]
crc_extra = 178
unpacker = struct.Struct('<QQIIIIHH8B8B8B')
instance_field = None
instance_offset = -1
def __init__(self, capabilities, flight_sw_version, middleware_sw_version, os_sw_version, board_version, flight_custom_version, middleware_custom_version, os_custom_version, vendor_id, product_id, uid):
MAVLink_message.__init__(self, MAVLink_autopilot_version_message.id, MAVLink_autopilot_version_message.name)
self._fieldnames = MAVLink_autopilot_version_message.fieldnames
self._instance_field = MAVLink_autopilot_version_message.instance_field
self._instance_offset = MAVLink_autopilot_version_message.instance_offset
self.capabilities = capabilities
self.flight_sw_version = flight_sw_version
self.middleware_sw_version = middleware_sw_version
self.os_sw_version = os_sw_version
self.board_version = board_version
self.flight_custom_version = flight_custom_version
self.middleware_custom_version = middleware_custom_version
self.os_custom_version = os_custom_version
self.vendor_id = vendor_id
self.product_id = product_id
self.uid = uid
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 178, struct.pack('<QQIIIIHH8B8B8B', self.capabilities, self.uid, self.flight_sw_version, self.middleware_sw_version, self.os_sw_version, self.board_version, self.vendor_id, self.product_id, self.flight_custom_version[0], self.flight_custom_version[1], self.flight_custom_version[2], self.flight_custom_version[3], self.flight_custom_version[4], self.flight_custom_version[5], self.flight_custom_version[6], self.flight_custom_version[7], self.middleware_custom_version[0], self.middleware_custom_version[1], self.middleware_custom_version[2], self.middleware_custom_version[3], self.middleware_custom_version[4], self.middleware_custom_version[5], self.middleware_custom_version[6], self.middleware_custom_version[7], self.os_custom_version[0], self.os_custom_version[1], self.os_custom_version[2], self.os_custom_version[3], self.os_custom_version[4], self.os_custom_version[5], self.os_custom_version[6], self.os_custom_version[7]), force_mavlink1=force_mavlink1)
class MAVLink_landing_target_message(MAVLink_message):
'''
The location of a landing target. See:
https://mavlink.io/en/services/landing_target.html
'''
id = MAVLINK_MSG_ID_LANDING_TARGET
name = 'LANDING_TARGET'
fieldnames = ['time_usec', 'target_num', 'frame', 'angle_x', 'angle_y', 'distance', 'size_x', 'size_y']
ordered_fieldnames = ['time_usec', 'angle_x', 'angle_y', 'distance', 'size_x', 'size_y', 'target_num', 'frame']
fieldtypes = ['uint64_t', 'uint8_t', 'uint8_t', 'float', 'float', 'float', 'float', 'float']
fielddisplays_by_name = {}
fieldenums_by_name = {"frame": "MAV_FRAME"}
fieldunits_by_name = {"time_usec": "us", "angle_x": "rad", "angle_y": "rad", "distance": "m", "size_x": "rad", "size_y": "rad"}
format = '<QfffffBB'
native_format = bytearray('<QfffffBB', 'ascii')
orders = [0, 6, 7, 1, 2, 3, 4, 5]
lengths = [1, 1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0, 0]
crc_extra = 200
unpacker = struct.Struct('<QfffffBB')
instance_field = None
instance_offset = -1
def __init__(self, time_usec, target_num, frame, angle_x, angle_y, distance, size_x, size_y):
MAVLink_message.__init__(self, MAVLink_landing_target_message.id, MAVLink_landing_target_message.name)
self._fieldnames = MAVLink_landing_target_message.fieldnames
self._instance_field = MAVLink_landing_target_message.instance_field
self._instance_offset = MAVLink_landing_target_message.instance_offset
self.time_usec = time_usec
self.target_num = target_num
self.frame = frame
self.angle_x = angle_x
self.angle_y = angle_y
self.distance = distance
self.size_x = size_x
self.size_y = size_y
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 200, struct.pack('<QfffffBB', self.time_usec, self.angle_x, self.angle_y, self.distance, self.size_x, self.size_y, self.target_num, self.frame), force_mavlink1=force_mavlink1)
class MAVLink_fence_status_message(MAVLink_message):
'''
Status of geo-fencing. Sent in extended status stream when
fencing enabled.
'''
id = MAVLINK_MSG_ID_FENCE_STATUS
name = 'FENCE_STATUS'
fieldnames = ['breach_status', 'breach_count', 'breach_type', 'breach_time']
ordered_fieldnames = ['breach_time', 'breach_count', 'breach_status', 'breach_type']
fieldtypes = ['uint8_t', 'uint16_t', 'uint8_t', 'uint32_t']
fielddisplays_by_name = {}
fieldenums_by_name = {"breach_type": "FENCE_BREACH"}
fieldunits_by_name = {"breach_time": "ms"}
format = '<IHBB'
native_format = bytearray('<IHBB', 'ascii')
orders = [2, 1, 3, 0]
lengths = [1, 1, 1, 1]
array_lengths = [0, 0, 0, 0]
crc_extra = 189
unpacker = struct.Struct('<IHBB')
instance_field = None
instance_offset = -1
def __init__(self, breach_status, breach_count, breach_type, breach_time):
MAVLink_message.__init__(self, MAVLink_fence_status_message.id, MAVLink_fence_status_message.name)
self._fieldnames = MAVLink_fence_status_message.fieldnames
self._instance_field = MAVLink_fence_status_message.instance_field
self._instance_offset = MAVLink_fence_status_message.instance_offset
self.breach_status = breach_status
self.breach_count = breach_count
self.breach_type = breach_type
self.breach_time = breach_time
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 189, struct.pack('<IHBB', self.breach_time, self.breach_count, self.breach_status, self.breach_type), force_mavlink1=force_mavlink1)
class MAVLink_estimator_status_message(MAVLink_message):
'''
Estimator status message including flags, innovation test
ratios and estimated accuracies. The flags message is an
integer bitmask containing information on which EKF outputs
are valid. See the ESTIMATOR_STATUS_FLAGS enum definition for
further information. The innovation test ratios show the
magnitude of the sensor innovation divided by the innovation
check threshold. Under normal operation the innovation test
ratios should be below 0.5 with occasional values up to 1.0.
Values greater than 1.0 should be rare under normal operation
and indicate that a measurement has been rejected by the
filter. The user should be notified if an innovation test
ratio greater than 1.0 is recorded. Notifications for values
in the range between 0.5 and 1.0 should be optional and
controllable by the user.
'''
id = MAVLINK_MSG_ID_ESTIMATOR_STATUS
name = 'ESTIMATOR_STATUS'
fieldnames = ['time_usec', 'flags', 'vel_ratio', 'pos_horiz_ratio', 'pos_vert_ratio', 'mag_ratio', 'hagl_ratio', 'tas_ratio', 'pos_horiz_accuracy', 'pos_vert_accuracy']
ordered_fieldnames = ['time_usec', 'vel_ratio', 'pos_horiz_ratio', 'pos_vert_ratio', 'mag_ratio', 'hagl_ratio', 'tas_ratio', 'pos_horiz_accuracy', 'pos_vert_accuracy', 'flags']
fieldtypes = ['uint64_t', 'uint16_t', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float']
fielddisplays_by_name = {"flags": "bitmask"}
fieldenums_by_name = {"flags": "ESTIMATOR_STATUS_FLAGS"}
fieldunits_by_name = {"time_usec": "us", "pos_horiz_accuracy": "m", "pos_vert_accuracy": "m"}
format = '<QffffffffH'
native_format = bytearray('<QffffffffH', 'ascii')
orders = [0, 9, 1, 2, 3, 4, 5, 6, 7, 8]
lengths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
crc_extra = 163
unpacker = struct.Struct('<QffffffffH')
instance_field = None
instance_offset = -1
def __init__(self, time_usec, flags, vel_ratio, pos_horiz_ratio, pos_vert_ratio, mag_ratio, hagl_ratio, tas_ratio, pos_horiz_accuracy, pos_vert_accuracy):
MAVLink_message.__init__(self, MAVLink_estimator_status_message.id, MAVLink_estimator_status_message.name)
self._fieldnames = MAVLink_estimator_status_message.fieldnames
self._instance_field = MAVLink_estimator_status_message.instance_field
self._instance_offset = MAVLink_estimator_status_message.instance_offset
self.time_usec = time_usec
self.flags = flags
self.vel_ratio = vel_ratio
self.pos_horiz_ratio = pos_horiz_ratio
self.pos_vert_ratio = pos_vert_ratio
self.mag_ratio = mag_ratio
self.hagl_ratio = hagl_ratio
self.tas_ratio = tas_ratio
self.pos_horiz_accuracy = pos_horiz_accuracy
self.pos_vert_accuracy = pos_vert_accuracy
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 163, struct.pack('<QffffffffH', self.time_usec, self.vel_ratio, self.pos_horiz_ratio, self.pos_vert_ratio, self.mag_ratio, self.hagl_ratio, self.tas_ratio, self.pos_horiz_accuracy, self.pos_vert_accuracy, self.flags), force_mavlink1=force_mavlink1)
class MAVLink_wind_cov_message(MAVLink_message):
'''
Wind covariance estimate from vehicle.
'''
id = MAVLINK_MSG_ID_WIND_COV
name = 'WIND_COV'
fieldnames = ['time_usec', 'wind_x', 'wind_y', 'wind_z', 'var_horiz', 'var_vert', 'wind_alt', 'horiz_accuracy', 'vert_accuracy']
ordered_fieldnames = ['time_usec', 'wind_x', 'wind_y', 'wind_z', 'var_horiz', 'var_vert', 'wind_alt', 'horiz_accuracy', 'vert_accuracy']
fieldtypes = ['uint64_t', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"time_usec": "us", "wind_x": "m/s", "wind_y": "m/s", "wind_z": "m/s", "var_horiz": "m/s", "var_vert": "m/s", "wind_alt": "m", "horiz_accuracy": "m", "vert_accuracy": "m"}
format = '<Qffffffff'
native_format = bytearray('<Qffffffff', 'ascii')
orders = [0, 1, 2, 3, 4, 5, 6, 7, 8]
lengths = [1, 1, 1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0, 0, 0]
crc_extra = 105
unpacker = struct.Struct('<Qffffffff')
instance_field = None
instance_offset = -1
def __init__(self, time_usec, wind_x, wind_y, wind_z, var_horiz, var_vert, wind_alt, horiz_accuracy, vert_accuracy):
MAVLink_message.__init__(self, MAVLink_wind_cov_message.id, MAVLink_wind_cov_message.name)
self._fieldnames = MAVLink_wind_cov_message.fieldnames
self._instance_field = MAVLink_wind_cov_message.instance_field
self._instance_offset = MAVLink_wind_cov_message.instance_offset
self.time_usec = time_usec
self.wind_x = wind_x
self.wind_y = wind_y
self.wind_z = wind_z
self.var_horiz = var_horiz
self.var_vert = var_vert
self.wind_alt = wind_alt
self.horiz_accuracy = horiz_accuracy
self.vert_accuracy = vert_accuracy
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 105, struct.pack('<Qffffffff', self.time_usec, self.wind_x, self.wind_y, self.wind_z, self.var_horiz, self.var_vert, self.wind_alt, self.horiz_accuracy, self.vert_accuracy), force_mavlink1=force_mavlink1)
class MAVLink_gps_input_message(MAVLink_message):
'''
GPS sensor input message. This is a raw sensor value sent by
the GPS. This is NOT the global position estimate of the
system.
'''
id = MAVLINK_MSG_ID_GPS_INPUT
name = 'GPS_INPUT'
fieldnames = ['time_usec', 'gps_id', 'ignore_flags', 'time_week_ms', 'time_week', 'fix_type', 'lat', 'lon', 'alt', 'hdop', 'vdop', 'vn', 've', 'vd', 'speed_accuracy', 'horiz_accuracy', 'vert_accuracy', 'satellites_visible']
ordered_fieldnames = ['time_usec', 'time_week_ms', 'lat', 'lon', 'alt', 'hdop', 'vdop', 'vn', 've', 'vd', 'speed_accuracy', 'horiz_accuracy', 'vert_accuracy', 'ignore_flags', 'time_week', 'gps_id', 'fix_type', 'satellites_visible']
fieldtypes = ['uint64_t', 'uint8_t', 'uint16_t', 'uint32_t', 'uint16_t', 'uint8_t', 'int32_t', 'int32_t', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'uint8_t']
fielddisplays_by_name = {"ignore_flags": "bitmask"}
fieldenums_by_name = {"ignore_flags": "GPS_INPUT_IGNORE_FLAGS"}
fieldunits_by_name = {"time_usec": "us", "time_week_ms": "ms", "lat": "degE7", "lon": "degE7", "alt": "m", "hdop": "m", "vdop": "m", "vn": "m/s", "ve": "m/s", "vd": "m/s", "speed_accuracy": "m/s", "horiz_accuracy": "m", "vert_accuracy": "m"}
format = '<QIiifffffffffHHBBB'
native_format = bytearray('<QIiifffffffffHHBBB', 'ascii')
orders = [0, 15, 13, 1, 14, 16, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 17]
lengths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
crc_extra = 151
unpacker = struct.Struct('<QIiifffffffffHHBBB')
instance_field = None
instance_offset = -1
def __init__(self, time_usec, gps_id, ignore_flags, time_week_ms, time_week, fix_type, lat, lon, alt, hdop, vdop, vn, ve, vd, speed_accuracy, horiz_accuracy, vert_accuracy, satellites_visible):
MAVLink_message.__init__(self, MAVLink_gps_input_message.id, MAVLink_gps_input_message.name)
self._fieldnames = MAVLink_gps_input_message.fieldnames
self._instance_field = MAVLink_gps_input_message.instance_field
self._instance_offset = MAVLink_gps_input_message.instance_offset
self.time_usec = time_usec
self.gps_id = gps_id
self.ignore_flags = ignore_flags
self.time_week_ms = time_week_ms
self.time_week = time_week
self.fix_type = fix_type
self.lat = lat
self.lon = lon
self.alt = alt
self.hdop = hdop
self.vdop = vdop
self.vn = vn
self.ve = ve
self.vd = vd
self.speed_accuracy = speed_accuracy
self.horiz_accuracy = horiz_accuracy
self.vert_accuracy = vert_accuracy
self.satellites_visible = satellites_visible
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 151, struct.pack('<QIiifffffffffHHBBB', self.time_usec, self.time_week_ms, self.lat, self.lon, self.alt, self.hdop, self.vdop, self.vn, self.ve, self.vd, self.speed_accuracy, self.horiz_accuracy, self.vert_accuracy, self.ignore_flags, self.time_week, self.gps_id, self.fix_type, self.satellites_visible), force_mavlink1=force_mavlink1)
class MAVLink_gps_rtcm_data_message(MAVLink_message):
'''
RTCM message for injecting into the onboard GPS (used for
DGPS)
'''
id = MAVLINK_MSG_ID_GPS_RTCM_DATA
name = 'GPS_RTCM_DATA'
fieldnames = ['flags', 'len', 'data']
ordered_fieldnames = ['flags', 'len', 'data']
fieldtypes = ['uint8_t', 'uint8_t', 'uint8_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"len": "bytes"}
format = '<BB180B'
native_format = bytearray('<BBB', 'ascii')
orders = [0, 1, 2]
lengths = [1, 1, 180]
array_lengths = [0, 0, 180]
crc_extra = 35
unpacker = struct.Struct('<BB180B')
instance_field = None
instance_offset = -1
def __init__(self, flags, len, data):
MAVLink_message.__init__(self, MAVLink_gps_rtcm_data_message.id, MAVLink_gps_rtcm_data_message.name)
self._fieldnames = MAVLink_gps_rtcm_data_message.fieldnames
self._instance_field = MAVLink_gps_rtcm_data_message.instance_field
self._instance_offset = MAVLink_gps_rtcm_data_message.instance_offset
self.flags = flags
self.len = len
self.data = data
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 35, struct.pack('<BB180B', self.flags, self.len, self.data[0], self.data[1], self.data[2], self.data[3], self.data[4], self.data[5], self.data[6], self.data[7], self.data[8], self.data[9], self.data[10], self.data[11], self.data[12], self.data[13], self.data[14], self.data[15], self.data[16], self.data[17], self.data[18], self.data[19], self.data[20], self.data[21], self.data[22], self.data[23], self.data[24], self.data[25], self.data[26], self.data[27], self.data[28], self.data[29], self.data[30], self.data[31], self.data[32], self.data[33], self.data[34], self.data[35], self.data[36], self.data[37], self.data[38], self.data[39], self.data[40], self.data[41], self.data[42], self.data[43], self.data[44], self.data[45], self.data[46], self.data[47], self.data[48], self.data[49], self.data[50], self.data[51], self.data[52], self.data[53], self.data[54], self.data[55], self.data[56], self.data[57], self.data[58], self.data[59], self.data[60], self.data[61], self.data[62], self.data[63], self.data[64], self.data[65], self.data[66], self.data[67], self.data[68], self.data[69], self.data[70], self.data[71], self.data[72], self.data[73], self.data[74], self.data[75], self.data[76], self.data[77], self.data[78], self.data[79], self.data[80], self.data[81], self.data[82], self.data[83], self.data[84], self.data[85], self.data[86], self.data[87], self.data[88], self.data[89], self.data[90], self.data[91], self.data[92], self.data[93], self.data[94], self.data[95], self.data[96], self.data[97], self.data[98], self.data[99], self.data[100], self.data[101], self.data[102], self.data[103], self.data[104], self.data[105], self.data[106], self.data[107], self.data[108], self.data[109], self.data[110], self.data[111], self.data[112], self.data[113], self.data[114], self.data[115], self.data[116], self.data[117], self.data[118], self.data[119], self.data[120], self.data[121], self.data[122], self.data[123], self.data[124], self.data[125], self.data[126], self.data[127], self.data[128], self.data[129], self.data[130], self.data[131], self.data[132], self.data[133], self.data[134], self.data[135], self.data[136], self.data[137], self.data[138], self.data[139], self.data[140], self.data[141], self.data[142], self.data[143], self.data[144], self.data[145], self.data[146], self.data[147], self.data[148], self.data[149], self.data[150], self.data[151], self.data[152], self.data[153], self.data[154], self.data[155], self.data[156], self.data[157], self.data[158], self.data[159], self.data[160], self.data[161], self.data[162], self.data[163], self.data[164], self.data[165], self.data[166], self.data[167], self.data[168], self.data[169], self.data[170], self.data[171], self.data[172], self.data[173], self.data[174], self.data[175], self.data[176], self.data[177], self.data[178], self.data[179]), force_mavlink1=force_mavlink1)
class MAVLink_high_latency_message(MAVLink_message):
'''
Message appropriate for high latency connections like Iridium
'''
id = MAVLINK_MSG_ID_HIGH_LATENCY
name = 'HIGH_LATENCY'
fieldnames = ['base_mode', 'custom_mode', 'landed_state', 'roll', 'pitch', 'heading', 'throttle', 'heading_sp', 'latitude', 'longitude', 'altitude_amsl', 'altitude_sp', 'airspeed', 'airspeed_sp', 'groundspeed', 'climb_rate', 'gps_nsat', 'gps_fix_type', 'battery_remaining', 'temperature', 'temperature_air', 'failsafe', 'wp_num', 'wp_distance']
ordered_fieldnames = ['custom_mode', 'latitude', 'longitude', 'roll', 'pitch', 'heading', 'heading_sp', 'altitude_amsl', 'altitude_sp', 'wp_distance', 'base_mode', 'landed_state', 'throttle', 'airspeed', 'airspeed_sp', 'groundspeed', 'climb_rate', 'gps_nsat', 'gps_fix_type', 'battery_remaining', 'temperature', 'temperature_air', 'failsafe', 'wp_num']
fieldtypes = ['uint8_t', 'uint32_t', 'uint8_t', 'int16_t', 'int16_t', 'uint16_t', 'int8_t', 'int16_t', 'int32_t', 'int32_t', 'int16_t', 'int16_t', 'uint8_t', 'uint8_t', 'uint8_t', 'int8_t', 'uint8_t', 'uint8_t', 'uint8_t', 'int8_t', 'int8_t', 'uint8_t', 'uint8_t', 'uint16_t']
fielddisplays_by_name = {"base_mode": "bitmask", "custom_mode": "bitmask"}
fieldenums_by_name = {"base_mode": "MAV_MODE_FLAG", "landed_state": "MAV_LANDED_STATE", "gps_fix_type": "GPS_FIX_TYPE"}
fieldunits_by_name = {"roll": "cdeg", "pitch": "cdeg", "heading": "cdeg", "throttle": "%", "heading_sp": "cdeg", "latitude": "degE7", "longitude": "degE7", "altitude_amsl": "m", "altitude_sp": "m", "airspeed": "m/s", "airspeed_sp": "m/s", "groundspeed": "m/s", "climb_rate": "m/s", "battery_remaining": "%", "temperature": "degC", "temperature_air": "degC", "wp_distance": "m"}
format = '<IiihhHhhhHBBbBBBbBBBbbBB'
native_format = bytearray('<IiihhHhhhHBBbBBBbBBBbbBB', 'ascii')
orders = [10, 0, 11, 3, 4, 5, 12, 6, 1, 2, 7, 8, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 9]
lengths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
crc_extra = 150
unpacker = struct.Struct('<IiihhHhhhHBBbBBBbBBBbbBB')
instance_field = None
instance_offset = -1
def __init__(self, base_mode, custom_mode, landed_state, roll, pitch, heading, throttle, heading_sp, latitude, longitude, altitude_amsl, altitude_sp, airspeed, airspeed_sp, groundspeed, climb_rate, gps_nsat, gps_fix_type, battery_remaining, temperature, temperature_air, failsafe, wp_num, wp_distance):
MAVLink_message.__init__(self, MAVLink_high_latency_message.id, MAVLink_high_latency_message.name)
self._fieldnames = MAVLink_high_latency_message.fieldnames
self._instance_field = MAVLink_high_latency_message.instance_field
self._instance_offset = MAVLink_high_latency_message.instance_offset
self.base_mode = base_mode
self.custom_mode = custom_mode
self.landed_state = landed_state
self.roll = roll
self.pitch = pitch
self.heading = heading
self.throttle = throttle
self.heading_sp = heading_sp
self.latitude = latitude
self.longitude = longitude
self.altitude_amsl = altitude_amsl
self.altitude_sp = altitude_sp
self.airspeed = airspeed
self.airspeed_sp = airspeed_sp
self.groundspeed = groundspeed
self.climb_rate = climb_rate
self.gps_nsat = gps_nsat
self.gps_fix_type = gps_fix_type
self.battery_remaining = battery_remaining
self.temperature = temperature
self.temperature_air = temperature_air
self.failsafe = failsafe
self.wp_num = wp_num
self.wp_distance = wp_distance
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 150, struct.pack('<IiihhHhhhHBBbBBBbBBBbbBB', self.custom_mode, self.latitude, self.longitude, self.roll, self.pitch, self.heading, self.heading_sp, self.altitude_amsl, self.altitude_sp, self.wp_distance, self.base_mode, self.landed_state, self.throttle, self.airspeed, self.airspeed_sp, self.groundspeed, self.climb_rate, self.gps_nsat, self.gps_fix_type, self.battery_remaining, self.temperature, self.temperature_air, self.failsafe, self.wp_num), force_mavlink1=force_mavlink1)
class MAVLink_vibration_message(MAVLink_message):
'''
Vibration levels and accelerometer clipping
'''
id = MAVLINK_MSG_ID_VIBRATION
name = 'VIBRATION'
fieldnames = ['time_usec', 'vibration_x', 'vibration_y', 'vibration_z', 'clipping_0', 'clipping_1', 'clipping_2']
ordered_fieldnames = ['time_usec', 'vibration_x', 'vibration_y', 'vibration_z', 'clipping_0', 'clipping_1', 'clipping_2']
fieldtypes = ['uint64_t', 'float', 'float', 'float', 'uint32_t', 'uint32_t', 'uint32_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"time_usec": "us"}
format = '<QfffIII'
native_format = bytearray('<QfffIII', 'ascii')
orders = [0, 1, 2, 3, 4, 5, 6]
lengths = [1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0]
crc_extra = 90
unpacker = struct.Struct('<QfffIII')
instance_field = None
instance_offset = -1
def __init__(self, time_usec, vibration_x, vibration_y, vibration_z, clipping_0, clipping_1, clipping_2):
MAVLink_message.__init__(self, MAVLink_vibration_message.id, MAVLink_vibration_message.name)
self._fieldnames = MAVLink_vibration_message.fieldnames
self._instance_field = MAVLink_vibration_message.instance_field
self._instance_offset = MAVLink_vibration_message.instance_offset
self.time_usec = time_usec
self.vibration_x = vibration_x
self.vibration_y = vibration_y
self.vibration_z = vibration_z
self.clipping_0 = clipping_0
self.clipping_1 = clipping_1
self.clipping_2 = clipping_2
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 90, struct.pack('<QfffIII', self.time_usec, self.vibration_x, self.vibration_y, self.vibration_z, self.clipping_0, self.clipping_1, self.clipping_2), force_mavlink1=force_mavlink1)
class MAVLink_home_position_message(MAVLink_message):
'''
This message can be requested by sending the
MAV_CMD_GET_HOME_POSITION command. The position the system
will return to and land on. The position is set automatically
by the system during the takeoff in case it was not explicitly
set by the operator before or after. The global and local
positions encode the position in the respective coordinate
frames, while the q parameter encodes the orientation of the
surface. Under normal conditions it describes the heading and
terrain slope, which can be used by the aircraft to adjust the
approach. The approach 3D vector describes the point to which
the system should fly in normal flight mode and then perform a
landing sequence along the vector.
'''
id = MAVLINK_MSG_ID_HOME_POSITION
name = 'HOME_POSITION'
fieldnames = ['latitude', 'longitude', 'altitude', 'x', 'y', 'z', 'q', 'approach_x', 'approach_y', 'approach_z']
ordered_fieldnames = ['latitude', 'longitude', 'altitude', 'x', 'y', 'z', 'q', 'approach_x', 'approach_y', 'approach_z']
fieldtypes = ['int32_t', 'int32_t', 'int32_t', 'float', 'float', 'float', 'float', 'float', 'float', 'float']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"latitude": "degE7", "longitude": "degE7", "altitude": "mm", "x": "m", "y": "m", "z": "m", "approach_x": "m", "approach_y": "m", "approach_z": "m"}
format = '<iiifff4ffff'
native_format = bytearray('<iiifffffff', 'ascii')
orders = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
lengths = [1, 1, 1, 1, 1, 1, 4, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 4, 0, 0, 0]
crc_extra = 104
unpacker = struct.Struct('<iiifff4ffff')
instance_field = None
instance_offset = -1
def __init__(self, latitude, longitude, altitude, x, y, z, q, approach_x, approach_y, approach_z):
MAVLink_message.__init__(self, MAVLink_home_position_message.id, MAVLink_home_position_message.name)
self._fieldnames = MAVLink_home_position_message.fieldnames
self._instance_field = MAVLink_home_position_message.instance_field
self._instance_offset = MAVLink_home_position_message.instance_offset
self.latitude = latitude
self.longitude = longitude
self.altitude = altitude
self.x = x
self.y = y
self.z = z
self.q = q
self.approach_x = approach_x
self.approach_y = approach_y
self.approach_z = approach_z
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 104, struct.pack('<iiifff4ffff', self.latitude, self.longitude, self.altitude, self.x, self.y, self.z, self.q[0], self.q[1], self.q[2], self.q[3], self.approach_x, self.approach_y, self.approach_z), force_mavlink1=force_mavlink1)
class MAVLink_set_home_position_message(MAVLink_message):
'''
The position the system will return to and land on. The
position is set automatically by the system during the takeoff
in case it was not explicitly set by the operator before or
after. The global and local positions encode the position in
the respective coordinate frames, while the q parameter
encodes the orientation of the surface. Under normal
conditions it describes the heading and terrain slope, which
can be used by the aircraft to adjust the approach. The
approach 3D vector describes the point to which the system
should fly in normal flight mode and then perform a landing
sequence along the vector.
'''
id = MAVLINK_MSG_ID_SET_HOME_POSITION
name = 'SET_HOME_POSITION'
fieldnames = ['target_system', 'latitude', 'longitude', 'altitude', 'x', 'y', 'z', 'q', 'approach_x', 'approach_y', 'approach_z']
ordered_fieldnames = ['latitude', 'longitude', 'altitude', 'x', 'y', 'z', 'q', 'approach_x', 'approach_y', 'approach_z', 'target_system']
fieldtypes = ['uint8_t', 'int32_t', 'int32_t', 'int32_t', 'float', 'float', 'float', 'float', 'float', 'float', 'float']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"latitude": "degE7", "longitude": "degE7", "altitude": "mm", "x": "m", "y": "m", "z": "m", "approach_x": "m", "approach_y": "m", "approach_z": "m"}
format = '<iiifff4ffffB'
native_format = bytearray('<iiifffffffB', 'ascii')
orders = [10, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
lengths = [1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0]
crc_extra = 85
unpacker = struct.Struct('<iiifff4ffffB')
instance_field = None
instance_offset = -1
def __init__(self, target_system, latitude, longitude, altitude, x, y, z, q, approach_x, approach_y, approach_z):
MAVLink_message.__init__(self, MAVLink_set_home_position_message.id, MAVLink_set_home_position_message.name)
self._fieldnames = MAVLink_set_home_position_message.fieldnames
self._instance_field = MAVLink_set_home_position_message.instance_field
self._instance_offset = MAVLink_set_home_position_message.instance_offset
self.target_system = target_system
self.latitude = latitude
self.longitude = longitude
self.altitude = altitude
self.x = x
self.y = y
self.z = z
self.q = q
self.approach_x = approach_x
self.approach_y = approach_y
self.approach_z = approach_z
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 85, struct.pack('<iiifff4ffffB', self.latitude, self.longitude, self.altitude, self.x, self.y, self.z, self.q[0], self.q[1], self.q[2], self.q[3], self.approach_x, self.approach_y, self.approach_z, self.target_system), force_mavlink1=force_mavlink1)
class MAVLink_message_interval_message(MAVLink_message):
'''
The interval between messages for a particular MAVLink message
ID. This message is the response to the
MAV_CMD_GET_MESSAGE_INTERVAL command. This interface replaces
DATA_STREAM.
'''
id = MAVLINK_MSG_ID_MESSAGE_INTERVAL
name = 'MESSAGE_INTERVAL'
fieldnames = ['message_id', 'interval_us']
ordered_fieldnames = ['interval_us', 'message_id']
fieldtypes = ['uint16_t', 'int32_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"interval_us": "us"}
format = '<iH'
native_format = bytearray('<iH', 'ascii')
orders = [1, 0]
lengths = [1, 1]
array_lengths = [0, 0]
crc_extra = 95
unpacker = struct.Struct('<iH')
instance_field = None
instance_offset = -1
def __init__(self, message_id, interval_us):
MAVLink_message.__init__(self, MAVLink_message_interval_message.id, MAVLink_message_interval_message.name)
self._fieldnames = MAVLink_message_interval_message.fieldnames
self._instance_field = MAVLink_message_interval_message.instance_field
self._instance_offset = MAVLink_message_interval_message.instance_offset
self.message_id = message_id
self.interval_us = interval_us
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 95, struct.pack('<iH', self.interval_us, self.message_id), force_mavlink1=force_mavlink1)
class MAVLink_extended_sys_state_message(MAVLink_message):
'''
Provides state for additional features
'''
id = MAVLINK_MSG_ID_EXTENDED_SYS_STATE
name = 'EXTENDED_SYS_STATE'
fieldnames = ['vtol_state', 'landed_state']
ordered_fieldnames = ['vtol_state', 'landed_state']
fieldtypes = ['uint8_t', 'uint8_t']
fielddisplays_by_name = {}
fieldenums_by_name = {"vtol_state": "MAV_VTOL_STATE", "landed_state": "MAV_LANDED_STATE"}
fieldunits_by_name = {}
format = '<BB'
native_format = bytearray('<BB', 'ascii')
orders = [0, 1]
lengths = [1, 1]
array_lengths = [0, 0]
crc_extra = 130
unpacker = struct.Struct('<BB')
instance_field = None
instance_offset = -1
def __init__(self, vtol_state, landed_state):
MAVLink_message.__init__(self, MAVLink_extended_sys_state_message.id, MAVLink_extended_sys_state_message.name)
self._fieldnames = MAVLink_extended_sys_state_message.fieldnames
self._instance_field = MAVLink_extended_sys_state_message.instance_field
self._instance_offset = MAVLink_extended_sys_state_message.instance_offset
self.vtol_state = vtol_state
self.landed_state = landed_state
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 130, struct.pack('<BB', self.vtol_state, self.landed_state), force_mavlink1=force_mavlink1)
class MAVLink_adsb_vehicle_message(MAVLink_message):
'''
The location and information of an ADSB vehicle
'''
id = MAVLINK_MSG_ID_ADSB_VEHICLE
name = 'ADSB_VEHICLE'
fieldnames = ['ICAO_address', 'lat', 'lon', 'altitude_type', 'altitude', 'heading', 'hor_velocity', 'ver_velocity', 'callsign', 'emitter_type', 'tslc', 'flags', 'squawk']
ordered_fieldnames = ['ICAO_address', 'lat', 'lon', 'altitude', 'heading', 'hor_velocity', 'ver_velocity', 'flags', 'squawk', 'altitude_type', 'callsign', 'emitter_type', 'tslc']
fieldtypes = ['uint32_t', 'int32_t', 'int32_t', 'uint8_t', 'int32_t', 'uint16_t', 'uint16_t', 'int16_t', 'char', 'uint8_t', 'uint8_t', 'uint16_t', 'uint16_t']
fielddisplays_by_name = {"flags": "bitmask"}
fieldenums_by_name = {"altitude_type": "ADSB_ALTITUDE_TYPE", "emitter_type": "ADSB_EMITTER_TYPE", "flags": "ADSB_FLAGS"}
fieldunits_by_name = {"lat": "degE7", "lon": "degE7", "altitude": "mm", "heading": "cdeg", "hor_velocity": "cm/s", "ver_velocity": "cm/s", "tslc": "s"}
format = '<IiiiHHhHHB9sBB'
native_format = bytearray('<IiiiHHhHHBcBB', 'ascii')
orders = [0, 1, 2, 9, 3, 4, 5, 6, 10, 11, 12, 7, 8]
lengths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0]
crc_extra = 184
unpacker = struct.Struct('<IiiiHHhHHB9sBB')
instance_field = None
instance_offset = -1
def __init__(self, ICAO_address, lat, lon, altitude_type, altitude, heading, hor_velocity, ver_velocity, callsign, emitter_type, tslc, flags, squawk):
MAVLink_message.__init__(self, MAVLink_adsb_vehicle_message.id, MAVLink_adsb_vehicle_message.name)
self._fieldnames = MAVLink_adsb_vehicle_message.fieldnames
self._instance_field = MAVLink_adsb_vehicle_message.instance_field
self._instance_offset = MAVLink_adsb_vehicle_message.instance_offset
self.ICAO_address = ICAO_address
self.lat = lat
self.lon = lon
self.altitude_type = altitude_type
self.altitude = altitude
self.heading = heading
self.hor_velocity = hor_velocity
self.ver_velocity = ver_velocity
self.callsign = callsign
self.emitter_type = emitter_type
self.tslc = tslc
self.flags = flags
self.squawk = squawk
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 184, struct.pack('<IiiiHHhHHB9sBB', self.ICAO_address, self.lat, self.lon, self.altitude, self.heading, self.hor_velocity, self.ver_velocity, self.flags, self.squawk, self.altitude_type, self.callsign, self.emitter_type, self.tslc), force_mavlink1=force_mavlink1)
class MAVLink_collision_message(MAVLink_message):
'''
Information about a potential collision
'''
id = MAVLINK_MSG_ID_COLLISION
name = 'COLLISION'
fieldnames = ['src', 'id', 'action', 'threat_level', 'time_to_minimum_delta', 'altitude_minimum_delta', 'horizontal_minimum_delta']
ordered_fieldnames = ['id', 'time_to_minimum_delta', 'altitude_minimum_delta', 'horizontal_minimum_delta', 'src', 'action', 'threat_level']
fieldtypes = ['uint8_t', 'uint32_t', 'uint8_t', 'uint8_t', 'float', 'float', 'float']
fielddisplays_by_name = {}
fieldenums_by_name = {"src": "MAV_COLLISION_SRC", "action": "MAV_COLLISION_ACTION", "threat_level": "MAV_COLLISION_THREAT_LEVEL"}
fieldunits_by_name = {"time_to_minimum_delta": "s", "altitude_minimum_delta": "m", "horizontal_minimum_delta": "m"}
format = '<IfffBBB'
native_format = bytearray('<IfffBBB', 'ascii')
orders = [4, 0, 5, 6, 1, 2, 3]
lengths = [1, 1, 1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 0, 0, 0]
crc_extra = 81
unpacker = struct.Struct('<IfffBBB')
instance_field = None
instance_offset = -1
def __init__(self, src, id, action, threat_level, time_to_minimum_delta, altitude_minimum_delta, horizontal_minimum_delta):
MAVLink_message.__init__(self, MAVLink_collision_message.id, MAVLink_collision_message.name)
self._fieldnames = MAVLink_collision_message.fieldnames
self._instance_field = MAVLink_collision_message.instance_field
self._instance_offset = MAVLink_collision_message.instance_offset
self.src = src
self.id = id
self.action = action
self.threat_level = threat_level
self.time_to_minimum_delta = time_to_minimum_delta
self.altitude_minimum_delta = altitude_minimum_delta
self.horizontal_minimum_delta = horizontal_minimum_delta
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 81, struct.pack('<IfffBBB', self.id, self.time_to_minimum_delta, self.altitude_minimum_delta, self.horizontal_minimum_delta, self.src, self.action, self.threat_level), force_mavlink1=force_mavlink1)
class MAVLink_v2_extension_message(MAVLink_message):
'''
Message implementing parts of the V2 payload specs in V1
frames for transitional support.
'''
id = MAVLINK_MSG_ID_V2_EXTENSION
name = 'V2_EXTENSION'
fieldnames = ['target_network', 'target_system', 'target_component', 'message_type', 'payload']
ordered_fieldnames = ['message_type', 'target_network', 'target_system', 'target_component', 'payload']
fieldtypes = ['uint8_t', 'uint8_t', 'uint8_t', 'uint16_t', 'uint8_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {}
format = '<HBBB249B'
native_format = bytearray('<HBBBB', 'ascii')
orders = [1, 2, 3, 0, 4]
lengths = [1, 1, 1, 1, 249]
array_lengths = [0, 0, 0, 0, 249]
crc_extra = 8
unpacker = struct.Struct('<HBBB249B')
instance_field = None
instance_offset = -1
def __init__(self, target_network, target_system, target_component, message_type, payload):
MAVLink_message.__init__(self, MAVLink_v2_extension_message.id, MAVLink_v2_extension_message.name)
self._fieldnames = MAVLink_v2_extension_message.fieldnames
self._instance_field = MAVLink_v2_extension_message.instance_field
self._instance_offset = MAVLink_v2_extension_message.instance_offset
self.target_network = target_network
self.target_system = target_system
self.target_component = target_component
self.message_type = message_type
self.payload = payload
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 8, struct.pack('<HBBB249B', self.message_type, self.target_network, self.target_system, self.target_component, self.payload[0], self.payload[1], self.payload[2], self.payload[3], self.payload[4], self.payload[5], self.payload[6], self.payload[7], self.payload[8], self.payload[9], self.payload[10], self.payload[11], self.payload[12], self.payload[13], self.payload[14], self.payload[15], self.payload[16], self.payload[17], self.payload[18], self.payload[19], self.payload[20], self.payload[21], self.payload[22], self.payload[23], self.payload[24], self.payload[25], self.payload[26], self.payload[27], self.payload[28], self.payload[29], self.payload[30], self.payload[31], self.payload[32], self.payload[33], self.payload[34], self.payload[35], self.payload[36], self.payload[37], self.payload[38], self.payload[39], self.payload[40], self.payload[41], self.payload[42], self.payload[43], self.payload[44], self.payload[45], self.payload[46], self.payload[47], self.payload[48], self.payload[49], self.payload[50], self.payload[51], self.payload[52], self.payload[53], self.payload[54], self.payload[55], self.payload[56], self.payload[57], self.payload[58], self.payload[59], self.payload[60], self.payload[61], self.payload[62], self.payload[63], self.payload[64], self.payload[65], self.payload[66], self.payload[67], self.payload[68], self.payload[69], self.payload[70], self.payload[71], self.payload[72], self.payload[73], self.payload[74], self.payload[75], self.payload[76], self.payload[77], self.payload[78], self.payload[79], self.payload[80], self.payload[81], self.payload[82], self.payload[83], self.payload[84], self.payload[85], self.payload[86], self.payload[87], self.payload[88], self.payload[89], self.payload[90], self.payload[91], self.payload[92], self.payload[93], self.payload[94], self.payload[95], self.payload[96], self.payload[97], self.payload[98], self.payload[99], self.payload[100], self.payload[101], self.payload[102], self.payload[103], self.payload[104], self.payload[105], self.payload[106], self.payload[107], self.payload[108], self.payload[109], self.payload[110], self.payload[111], self.payload[112], self.payload[113], self.payload[114], self.payload[115], self.payload[116], self.payload[117], self.payload[118], self.payload[119], self.payload[120], self.payload[121], self.payload[122], self.payload[123], self.payload[124], self.payload[125], self.payload[126], self.payload[127], self.payload[128], self.payload[129], self.payload[130], self.payload[131], self.payload[132], self.payload[133], self.payload[134], self.payload[135], self.payload[136], self.payload[137], self.payload[138], self.payload[139], self.payload[140], self.payload[141], self.payload[142], self.payload[143], self.payload[144], self.payload[145], self.payload[146], self.payload[147], self.payload[148], self.payload[149], self.payload[150], self.payload[151], self.payload[152], self.payload[153], self.payload[154], self.payload[155], self.payload[156], self.payload[157], self.payload[158], self.payload[159], self.payload[160], self.payload[161], self.payload[162], self.payload[163], self.payload[164], self.payload[165], self.payload[166], self.payload[167], self.payload[168], self.payload[169], self.payload[170], self.payload[171], self.payload[172], self.payload[173], self.payload[174], self.payload[175], self.payload[176], self.payload[177], self.payload[178], self.payload[179], self.payload[180], self.payload[181], self.payload[182], self.payload[183], self.payload[184], self.payload[185], self.payload[186], self.payload[187], self.payload[188], self.payload[189], self.payload[190], self.payload[191], self.payload[192], self.payload[193], self.payload[194], self.payload[195], self.payload[196], self.payload[197], self.payload[198], self.payload[199], self.payload[200], self.payload[201], self.payload[202], self.payload[203], self.payload[204], self.payload[205], self.payload[206], self.payload[207], self.payload[208], self.payload[209], self.payload[210], self.payload[211], self.payload[212], self.payload[213], self.payload[214], self.payload[215], self.payload[216], self.payload[217], self.payload[218], self.payload[219], self.payload[220], self.payload[221], self.payload[222], self.payload[223], self.payload[224], self.payload[225], self.payload[226], self.payload[227], self.payload[228], self.payload[229], self.payload[230], self.payload[231], self.payload[232], self.payload[233], self.payload[234], self.payload[235], self.payload[236], self.payload[237], self.payload[238], self.payload[239], self.payload[240], self.payload[241], self.payload[242], self.payload[243], self.payload[244], self.payload[245], self.payload[246], self.payload[247], self.payload[248]), force_mavlink1=force_mavlink1)
class MAVLink_memory_vect_message(MAVLink_message):
'''
Send raw controller memory. The use of this message is
discouraged for normal packets, but a quite efficient way for
testing new messages and getting experimental debug output.
'''
id = MAVLINK_MSG_ID_MEMORY_VECT
name = 'MEMORY_VECT'
fieldnames = ['address', 'ver', 'type', 'value']
ordered_fieldnames = ['address', 'ver', 'type', 'value']
fieldtypes = ['uint16_t', 'uint8_t', 'uint8_t', 'int8_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {}
format = '<HBB32b'
native_format = bytearray('<HBBb', 'ascii')
orders = [0, 1, 2, 3]
lengths = [1, 1, 1, 32]
array_lengths = [0, 0, 0, 32]
crc_extra = 204
unpacker = struct.Struct('<HBB32b')
instance_field = None
instance_offset = -1
def __init__(self, address, ver, type, value):
MAVLink_message.__init__(self, MAVLink_memory_vect_message.id, MAVLink_memory_vect_message.name)
self._fieldnames = MAVLink_memory_vect_message.fieldnames
self._instance_field = MAVLink_memory_vect_message.instance_field
self._instance_offset = MAVLink_memory_vect_message.instance_offset
self.address = address
self.ver = ver
self.type = type
self.value = value
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 204, struct.pack('<HBB32b', self.address, self.ver, self.type, self.value[0], self.value[1], self.value[2], self.value[3], self.value[4], self.value[5], self.value[6], self.value[7], self.value[8], self.value[9], self.value[10], self.value[11], self.value[12], self.value[13], self.value[14], self.value[15], self.value[16], self.value[17], self.value[18], self.value[19], self.value[20], self.value[21], self.value[22], self.value[23], self.value[24], self.value[25], self.value[26], self.value[27], self.value[28], self.value[29], self.value[30], self.value[31]), force_mavlink1=force_mavlink1)
class MAVLink_debug_vect_message(MAVLink_message):
'''
To debug something using a named 3D vector.
'''
id = MAVLINK_MSG_ID_DEBUG_VECT
name = 'DEBUG_VECT'
fieldnames = ['name', 'time_usec', 'x', 'y', 'z']
ordered_fieldnames = ['time_usec', 'x', 'y', 'z', 'name']
fieldtypes = ['char', 'uint64_t', 'float', 'float', 'float']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"time_usec": "us"}
format = '<Qfff10s'
native_format = bytearray('<Qfffc', 'ascii')
orders = [4, 0, 1, 2, 3]
lengths = [1, 1, 1, 1, 1]
array_lengths = [0, 0, 0, 0, 10]
crc_extra = 49
unpacker = struct.Struct('<Qfff10s')
instance_field = 'name'
instance_offset = 20
def __init__(self, name, time_usec, x, y, z):
MAVLink_message.__init__(self, MAVLink_debug_vect_message.id, MAVLink_debug_vect_message.name)
self._fieldnames = MAVLink_debug_vect_message.fieldnames
self._instance_field = MAVLink_debug_vect_message.instance_field
self._instance_offset = MAVLink_debug_vect_message.instance_offset
self.name = name
self.time_usec = time_usec
self.x = x
self.y = y
self.z = z
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 49, struct.pack('<Qfff10s', self.time_usec, self.x, self.y, self.z, self.name), force_mavlink1=force_mavlink1)
class MAVLink_named_value_float_message(MAVLink_message):
'''
Send a key-value pair as float. The use of this message is
discouraged for normal packets, but a quite efficient way for
testing new messages and getting experimental debug output.
'''
id = MAVLINK_MSG_ID_NAMED_VALUE_FLOAT
name = 'NAMED_VALUE_FLOAT'
fieldnames = ['time_boot_ms', 'name', 'value']
ordered_fieldnames = ['time_boot_ms', 'value', 'name']
fieldtypes = ['uint32_t', 'char', 'float']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"time_boot_ms": "ms"}
format = '<If10s'
native_format = bytearray('<Ifc', 'ascii')
orders = [0, 2, 1]
lengths = [1, 1, 1]
array_lengths = [0, 0, 10]
crc_extra = 170
unpacker = struct.Struct('<If10s')
instance_field = 'name'
instance_offset = 8
def __init__(self, time_boot_ms, name, value):
MAVLink_message.__init__(self, MAVLink_named_value_float_message.id, MAVLink_named_value_float_message.name)
self._fieldnames = MAVLink_named_value_float_message.fieldnames
self._instance_field = MAVLink_named_value_float_message.instance_field
self._instance_offset = MAVLink_named_value_float_message.instance_offset
self.time_boot_ms = time_boot_ms
self.name = name
self.value = value
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 170, struct.pack('<If10s', self.time_boot_ms, self.value, self.name), force_mavlink1=force_mavlink1)
class MAVLink_named_value_int_message(MAVLink_message):
'''
Send a key-value pair as integer. The use of this message is
discouraged for normal packets, but a quite efficient way for
testing new messages and getting experimental debug output.
'''
id = MAVLINK_MSG_ID_NAMED_VALUE_INT
name = 'NAMED_VALUE_INT'
fieldnames = ['time_boot_ms', 'name', 'value']
ordered_fieldnames = ['time_boot_ms', 'value', 'name']
fieldtypes = ['uint32_t', 'char', 'int32_t']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"time_boot_ms": "ms"}
format = '<Ii10s'
native_format = bytearray('<Iic', 'ascii')
orders = [0, 2, 1]
lengths = [1, 1, 1]
array_lengths = [0, 0, 10]
crc_extra = 44
unpacker = struct.Struct('<Ii10s')
instance_field = 'name'
instance_offset = 8
def __init__(self, time_boot_ms, name, value):
MAVLink_message.__init__(self, MAVLink_named_value_int_message.id, MAVLink_named_value_int_message.name)
self._fieldnames = MAVLink_named_value_int_message.fieldnames
self._instance_field = MAVLink_named_value_int_message.instance_field
self._instance_offset = MAVLink_named_value_int_message.instance_offset
self.time_boot_ms = time_boot_ms
self.name = name
self.value = value
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 44, struct.pack('<Ii10s', self.time_boot_ms, self.value, self.name), force_mavlink1=force_mavlink1)
class MAVLink_statustext_message(MAVLink_message):
'''
Status text message. These messages are printed in yellow in
the COMM console of QGroundControl. WARNING: They consume
quite some bandwidth, so use only for important status and
error messages. If implemented wisely, these messages are
buffered on the MCU and sent only at a limited rate (e.g. 10
Hz).
'''
id = MAVLINK_MSG_ID_STATUSTEXT
name = 'STATUSTEXT'
fieldnames = ['severity', 'text']
ordered_fieldnames = ['severity', 'text']
fieldtypes = ['uint8_t', 'char']
fielddisplays_by_name = {}
fieldenums_by_name = {"severity": "MAV_SEVERITY"}
fieldunits_by_name = {}
format = '<B50s'
native_format = bytearray('<Bc', 'ascii')
orders = [0, 1]
lengths = [1, 1]
array_lengths = [0, 50]
crc_extra = 83
unpacker = struct.Struct('<B50s')
instance_field = None
instance_offset = -1
def __init__(self, severity, text):
MAVLink_message.__init__(self, MAVLink_statustext_message.id, MAVLink_statustext_message.name)
self._fieldnames = MAVLink_statustext_message.fieldnames
self._instance_field = MAVLink_statustext_message.instance_field
self._instance_offset = MAVLink_statustext_message.instance_offset
self.severity = severity
self.text = text
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 83, struct.pack('<B50s', self.severity, self.text), force_mavlink1=force_mavlink1)
class MAVLink_debug_message(MAVLink_message):
'''
Send a debug value. The index is used to discriminate between
values. These values show up in the plot of QGroundControl as
DEBUG N.
'''
id = MAVLINK_MSG_ID_DEBUG
name = 'DEBUG'
fieldnames = ['time_boot_ms', 'ind', 'value']
ordered_fieldnames = ['time_boot_ms', 'value', 'ind']
fieldtypes = ['uint32_t', 'uint8_t', 'float']
fielddisplays_by_name = {}
fieldenums_by_name = {}
fieldunits_by_name = {"time_boot_ms": "ms"}
format = '<IfB'
native_format = bytearray('<IfB', 'ascii')
orders = [0, 2, 1]
lengths = [1, 1, 1]
array_lengths = [0, 0, 0]
crc_extra = 46
unpacker = struct.Struct('<IfB')
instance_field = None
instance_offset = -1
def __init__(self, time_boot_ms, ind, value):
MAVLink_message.__init__(self, MAVLink_debug_message.id, MAVLink_debug_message.name)
self._fieldnames = MAVLink_debug_message.fieldnames
self._instance_field = MAVLink_debug_message.instance_field
self._instance_offset = MAVLink_debug_message.instance_offset
self.time_boot_ms = time_boot_ms
self.ind = ind
self.value = value
def pack(self, mav, force_mavlink1=False):
return MAVLink_message.pack(self, mav, 46, struct.pack('<IfB', self.time_boot_ms, self.value, self.ind), force_mavlink1=force_mavlink1)
mavlink_map = {
MAVLINK_MSG_ID_SENSOR_OFFSETS : MAVLink_sensor_offsets_message,
MAVLINK_MSG_ID_SET_MAG_OFFSETS : MAVLink_set_mag_offsets_message,
MAVLINK_MSG_ID_MEMINFO : MAVLink_meminfo_message,
MAVLINK_MSG_ID_AP_ADC : MAVLink_ap_adc_message,
MAVLINK_MSG_ID_DIGICAM_CONFIGURE : MAVLink_digicam_configure_message,
MAVLINK_MSG_ID_DIGICAM_CONTROL : MAVLink_digicam_control_message,
MAVLINK_MSG_ID_MOUNT_CONFIGURE : MAVLink_mount_configure_message,
MAVLINK_MSG_ID_MOUNT_CONTROL : MAVLink_mount_control_message,
MAVLINK_MSG_ID_MOUNT_STATUS : MAVLink_mount_status_message,
MAVLINK_MSG_ID_FENCE_POINT : MAVLink_fence_point_message,
MAVLINK_MSG_ID_FENCE_FETCH_POINT : MAVLink_fence_fetch_point_message,
MAVLINK_MSG_ID_AHRS : MAVLink_ahrs_message,
MAVLINK_MSG_ID_SIMSTATE : MAVLink_simstate_message,
MAVLINK_MSG_ID_HWSTATUS : MAVLink_hwstatus_message,
MAVLINK_MSG_ID_RADIO : MAVLink_radio_message,
MAVLINK_MSG_ID_LIMITS_STATUS : MAVLink_limits_status_message,
MAVLINK_MSG_ID_WIND : MAVLink_wind_message,
MAVLINK_MSG_ID_DATA16 : MAVLink_data16_message,
MAVLINK_MSG_ID_DATA32 : MAVLink_data32_message,
MAVLINK_MSG_ID_DATA64 : MAVLink_data64_message,
MAVLINK_MSG_ID_DATA96 : MAVLink_data96_message,
MAVLINK_MSG_ID_RANGEFINDER : MAVLink_rangefinder_message,
MAVLINK_MSG_ID_AIRSPEED_AUTOCAL : MAVLink_airspeed_autocal_message,
MAVLINK_MSG_ID_RALLY_POINT : MAVLink_rally_point_message,
MAVLINK_MSG_ID_RALLY_FETCH_POINT : MAVLink_rally_fetch_point_message,
MAVLINK_MSG_ID_COMPASSMOT_STATUS : MAVLink_compassmot_status_message,
MAVLINK_MSG_ID_AHRS2 : MAVLink_ahrs2_message,
MAVLINK_MSG_ID_CAMERA_STATUS : MAVLink_camera_status_message,
MAVLINK_MSG_ID_CAMERA_FEEDBACK : MAVLink_camera_feedback_message,
MAVLINK_MSG_ID_BATTERY2 : MAVLink_battery2_message,
MAVLINK_MSG_ID_AHRS3 : MAVLink_ahrs3_message,
MAVLINK_MSG_ID_AUTOPILOT_VERSION_REQUEST : MAVLink_autopilot_version_request_message,
MAVLINK_MSG_ID_REMOTE_LOG_DATA_BLOCK : MAVLink_remote_log_data_block_message,
MAVLINK_MSG_ID_REMOTE_LOG_BLOCK_STATUS : MAVLink_remote_log_block_status_message,
MAVLINK_MSG_ID_LED_CONTROL : MAVLink_led_control_message,
MAVLINK_MSG_ID_MAG_CAL_PROGRESS : MAVLink_mag_cal_progress_message,
MAVLINK_MSG_ID_MAG_CAL_REPORT : MAVLink_mag_cal_report_message,
MAVLINK_MSG_ID_EKF_STATUS_REPORT : MAVLink_ekf_status_report_message,
MAVLINK_MSG_ID_PID_TUNING : MAVLink_pid_tuning_message,
MAVLINK_MSG_ID_DEEPSTALL : MAVLink_deepstall_message,
MAVLINK_MSG_ID_GIMBAL_REPORT : MAVLink_gimbal_report_message,
MAVLINK_MSG_ID_GIMBAL_CONTROL : MAVLink_gimbal_control_message,
MAVLINK_MSG_ID_GIMBAL_TORQUE_CMD_REPORT : MAVLink_gimbal_torque_cmd_report_message,
MAVLINK_MSG_ID_GOPRO_HEARTBEAT : MAVLink_gopro_heartbeat_message,
MAVLINK_MSG_ID_GOPRO_GET_REQUEST : MAVLink_gopro_get_request_message,
MAVLINK_MSG_ID_GOPRO_GET_RESPONSE : MAVLink_gopro_get_response_message,
MAVLINK_MSG_ID_GOPRO_SET_REQUEST : MAVLink_gopro_set_request_message,
MAVLINK_MSG_ID_GOPRO_SET_RESPONSE : MAVLink_gopro_set_response_message,
MAVLINK_MSG_ID_EFI_STATUS : MAVLink_efi_status_message,
MAVLINK_MSG_ID_RPM : MAVLink_rpm_message,
MAVLINK_MSG_ID_HEARTBEAT : MAVLink_heartbeat_message,
MAVLINK_MSG_ID_SYS_STATUS : MAVLink_sys_status_message,
MAVLINK_MSG_ID_SYSTEM_TIME : MAVLink_system_time_message,
MAVLINK_MSG_ID_PING : MAVLink_ping_message,
MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL : MAVLink_change_operator_control_message,
MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK : MAVLink_change_operator_control_ack_message,
MAVLINK_MSG_ID_AUTH_KEY : MAVLink_auth_key_message,
MAVLINK_MSG_ID_SET_MODE : MAVLink_set_mode_message,
MAVLINK_MSG_ID_PARAM_REQUEST_READ : MAVLink_param_request_read_message,
MAVLINK_MSG_ID_PARAM_REQUEST_LIST : MAVLink_param_request_list_message,
MAVLINK_MSG_ID_PARAM_VALUE : MAVLink_param_value_message,
MAVLINK_MSG_ID_PARAM_SET : MAVLink_param_set_message,
MAVLINK_MSG_ID_GPS_RAW_INT : MAVLink_gps_raw_int_message,
MAVLINK_MSG_ID_GPS_STATUS : MAVLink_gps_status_message,
MAVLINK_MSG_ID_SCALED_IMU : MAVLink_scaled_imu_message,
MAVLINK_MSG_ID_RAW_IMU : MAVLink_raw_imu_message,
MAVLINK_MSG_ID_RAW_PRESSURE : MAVLink_raw_pressure_message,
MAVLINK_MSG_ID_SCALED_PRESSURE : MAVLink_scaled_pressure_message,
MAVLINK_MSG_ID_ATTITUDE : MAVLink_attitude_message,
MAVLINK_MSG_ID_ATTITUDE_QUATERNION : MAVLink_attitude_quaternion_message,
MAVLINK_MSG_ID_LOCAL_POSITION_NED : MAVLink_local_position_ned_message,
MAVLINK_MSG_ID_GLOBAL_POSITION_INT : MAVLink_global_position_int_message,
MAVLINK_MSG_ID_RC_CHANNELS_SCALED : MAVLink_rc_channels_scaled_message,
MAVLINK_MSG_ID_RC_CHANNELS_RAW : MAVLink_rc_channels_raw_message,
MAVLINK_MSG_ID_SERVO_OUTPUT_RAW : MAVLink_servo_output_raw_message,
MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST : MAVLink_mission_request_partial_list_message,
MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST : MAVLink_mission_write_partial_list_message,
MAVLINK_MSG_ID_MISSION_ITEM : MAVLink_mission_item_message,
MAVLINK_MSG_ID_MISSION_REQUEST : MAVLink_mission_request_message,
MAVLINK_MSG_ID_MISSION_SET_CURRENT : MAVLink_mission_set_current_message,
MAVLINK_MSG_ID_MISSION_CURRENT : MAVLink_mission_current_message,
MAVLINK_MSG_ID_MISSION_REQUEST_LIST : MAVLink_mission_request_list_message,
MAVLINK_MSG_ID_MISSION_COUNT : MAVLink_mission_count_message,
MAVLINK_MSG_ID_MISSION_CLEAR_ALL : MAVLink_mission_clear_all_message,
MAVLINK_MSG_ID_MISSION_ITEM_REACHED : MAVLink_mission_item_reached_message,
MAVLINK_MSG_ID_MISSION_ACK : MAVLink_mission_ack_message,
MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN : MAVLink_set_gps_global_origin_message,
MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN : MAVLink_gps_global_origin_message,
MAVLINK_MSG_ID_PARAM_MAP_RC : MAVLink_param_map_rc_message,
MAVLINK_MSG_ID_MISSION_REQUEST_INT : MAVLink_mission_request_int_message,
MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA : MAVLink_safety_set_allowed_area_message,
MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA : MAVLink_safety_allowed_area_message,
MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV : MAVLink_attitude_quaternion_cov_message,
MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT : MAVLink_nav_controller_output_message,
MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV : MAVLink_global_position_int_cov_message,
MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV : MAVLink_local_position_ned_cov_message,
MAVLINK_MSG_ID_RC_CHANNELS : MAVLink_rc_channels_message,
MAVLINK_MSG_ID_REQUEST_DATA_STREAM : MAVLink_request_data_stream_message,
MAVLINK_MSG_ID_DATA_STREAM : MAVLink_data_stream_message,
MAVLINK_MSG_ID_MANUAL_CONTROL : MAVLink_manual_control_message,
MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE : MAVLink_rc_channels_override_message,
MAVLINK_MSG_ID_MISSION_ITEM_INT : MAVLink_mission_item_int_message,
MAVLINK_MSG_ID_VFR_HUD : MAVLink_vfr_hud_message,
MAVLINK_MSG_ID_COMMAND_INT : MAVLink_command_int_message,
MAVLINK_MSG_ID_COMMAND_LONG : MAVLink_command_long_message,
MAVLINK_MSG_ID_COMMAND_ACK : MAVLink_command_ack_message,
MAVLINK_MSG_ID_MANUAL_SETPOINT : MAVLink_manual_setpoint_message,
MAVLINK_MSG_ID_SET_ATTITUDE_TARGET : MAVLink_set_attitude_target_message,
MAVLINK_MSG_ID_ATTITUDE_TARGET : MAVLink_attitude_target_message,
MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED : MAVLink_set_position_target_local_ned_message,
MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED : MAVLink_position_target_local_ned_message,
MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT : MAVLink_set_position_target_global_int_message,
MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT : MAVLink_position_target_global_int_message,
MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET : MAVLink_local_position_ned_system_global_offset_message,
MAVLINK_MSG_ID_HIL_STATE : MAVLink_hil_state_message,
MAVLINK_MSG_ID_HIL_CONTROLS : MAVLink_hil_controls_message,
MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW : MAVLink_hil_rc_inputs_raw_message,
MAVLINK_MSG_ID_HIL_ACTUATOR_CONTROLS : MAVLink_hil_actuator_controls_message,
MAVLINK_MSG_ID_OPTICAL_FLOW : MAVLink_optical_flow_message,
MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE : MAVLink_global_vision_position_estimate_message,
MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE : MAVLink_vision_position_estimate_message,
MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE : MAVLink_vision_speed_estimate_message,
MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE : MAVLink_vicon_position_estimate_message,
MAVLINK_MSG_ID_HIGHRES_IMU : MAVLink_highres_imu_message,
MAVLINK_MSG_ID_OPTICAL_FLOW_RAD : MAVLink_optical_flow_rad_message,
MAVLINK_MSG_ID_HIL_SENSOR : MAVLink_hil_sensor_message,
MAVLINK_MSG_ID_SIM_STATE : MAVLink_sim_state_message,
MAVLINK_MSG_ID_RADIO_STATUS : MAVLink_radio_status_message,
MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL : MAVLink_file_transfer_protocol_message,
MAVLINK_MSG_ID_TIMESYNC : MAVLink_timesync_message,
MAVLINK_MSG_ID_CAMERA_TRIGGER : MAVLink_camera_trigger_message,
MAVLINK_MSG_ID_HIL_GPS : MAVLink_hil_gps_message,
MAVLINK_MSG_ID_HIL_OPTICAL_FLOW : MAVLink_hil_optical_flow_message,
MAVLINK_MSG_ID_HIL_STATE_QUATERNION : MAVLink_hil_state_quaternion_message,
MAVLINK_MSG_ID_SCALED_IMU2 : MAVLink_scaled_imu2_message,
MAVLINK_MSG_ID_LOG_REQUEST_LIST : MAVLink_log_request_list_message,
MAVLINK_MSG_ID_LOG_ENTRY : MAVLink_log_entry_message,
MAVLINK_MSG_ID_LOG_REQUEST_DATA : MAVLink_log_request_data_message,
MAVLINK_MSG_ID_LOG_DATA : MAVLink_log_data_message,
MAVLINK_MSG_ID_LOG_ERASE : MAVLink_log_erase_message,
MAVLINK_MSG_ID_LOG_REQUEST_END : MAVLink_log_request_end_message,
MAVLINK_MSG_ID_GPS_INJECT_DATA : MAVLink_gps_inject_data_message,
MAVLINK_MSG_ID_GPS2_RAW : MAVLink_gps2_raw_message,
MAVLINK_MSG_ID_POWER_STATUS : MAVLink_power_status_message,
MAVLINK_MSG_ID_SERIAL_CONTROL : MAVLink_serial_control_message,
MAVLINK_MSG_ID_GPS_RTK : MAVLink_gps_rtk_message,
MAVLINK_MSG_ID_GPS2_RTK : MAVLink_gps2_rtk_message,
MAVLINK_MSG_ID_SCALED_IMU3 : MAVLink_scaled_imu3_message,
MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE : MAVLink_data_transmission_handshake_message,
MAVLINK_MSG_ID_ENCAPSULATED_DATA : MAVLink_encapsulated_data_message,
MAVLINK_MSG_ID_DISTANCE_SENSOR : MAVLink_distance_sensor_message,
MAVLINK_MSG_ID_TERRAIN_REQUEST : MAVLink_terrain_request_message,
MAVLINK_MSG_ID_TERRAIN_DATA : MAVLink_terrain_data_message,
MAVLINK_MSG_ID_TERRAIN_CHECK : MAVLink_terrain_check_message,
MAVLINK_MSG_ID_TERRAIN_REPORT : MAVLink_terrain_report_message,
MAVLINK_MSG_ID_SCALED_PRESSURE2 : MAVLink_scaled_pressure2_message,
MAVLINK_MSG_ID_ATT_POS_MOCAP : MAVLink_att_pos_mocap_message,
MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET : MAVLink_set_actuator_control_target_message,
MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET : MAVLink_actuator_control_target_message,
MAVLINK_MSG_ID_ALTITUDE : MAVLink_altitude_message,
MAVLINK_MSG_ID_RESOURCE_REQUEST : MAVLink_resource_request_message,
MAVLINK_MSG_ID_SCALED_PRESSURE3 : MAVLink_scaled_pressure3_message,
MAVLINK_MSG_ID_FOLLOW_TARGET : MAVLink_follow_target_message,
MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE : MAVLink_control_system_state_message,
MAVLINK_MSG_ID_BATTERY_STATUS : MAVLink_battery_status_message,
MAVLINK_MSG_ID_AUTOPILOT_VERSION : MAVLink_autopilot_version_message,
MAVLINK_MSG_ID_LANDING_TARGET : MAVLink_landing_target_message,
MAVLINK_MSG_ID_FENCE_STATUS : MAVLink_fence_status_message,
MAVLINK_MSG_ID_ESTIMATOR_STATUS : MAVLink_estimator_status_message,
MAVLINK_MSG_ID_WIND_COV : MAVLink_wind_cov_message,
MAVLINK_MSG_ID_GPS_INPUT : MAVLink_gps_input_message,
MAVLINK_MSG_ID_GPS_RTCM_DATA : MAVLink_gps_rtcm_data_message,
MAVLINK_MSG_ID_HIGH_LATENCY : MAVLink_high_latency_message,
MAVLINK_MSG_ID_VIBRATION : MAVLink_vibration_message,
MAVLINK_MSG_ID_HOME_POSITION : MAVLink_home_position_message,
MAVLINK_MSG_ID_SET_HOME_POSITION : MAVLink_set_home_position_message,
MAVLINK_MSG_ID_MESSAGE_INTERVAL : MAVLink_message_interval_message,
MAVLINK_MSG_ID_EXTENDED_SYS_STATE : MAVLink_extended_sys_state_message,
MAVLINK_MSG_ID_ADSB_VEHICLE : MAVLink_adsb_vehicle_message,
MAVLINK_MSG_ID_COLLISION : MAVLink_collision_message,
MAVLINK_MSG_ID_V2_EXTENSION : MAVLink_v2_extension_message,
MAVLINK_MSG_ID_MEMORY_VECT : MAVLink_memory_vect_message,
MAVLINK_MSG_ID_DEBUG_VECT : MAVLink_debug_vect_message,
MAVLINK_MSG_ID_NAMED_VALUE_FLOAT : MAVLink_named_value_float_message,
MAVLINK_MSG_ID_NAMED_VALUE_INT : MAVLink_named_value_int_message,
MAVLINK_MSG_ID_STATUSTEXT : MAVLink_statustext_message,
MAVLINK_MSG_ID_DEBUG : MAVLink_debug_message,
}
class MAVError(Exception):
'''MAVLink error class'''
def __init__(self, msg):
Exception.__init__(self, msg)
self.message = msg
class MAVString(str):
'''NUL terminated string'''
def __init__(self, s):
str.__init__(self)
def __str__(self):
i = self.find(chr(0))
if i == -1:
return self[:]
return self[0:i]
class MAVLink_bad_data(MAVLink_message):
'''
a piece of bad data in a mavlink stream
'''
def __init__(self, data, reason):
MAVLink_message.__init__(self, MAVLINK_MSG_ID_BAD_DATA, 'BAD_DATA')
self._fieldnames = ['data', 'reason']
self.data = data
self.reason = reason
self._msgbuf = data
self._instance_field = None
def __str__(self):
'''Override the __str__ function from MAVLink_messages because non-printable characters are common in to be the reason for this message to exist.'''
return '%s {%s, data:%s}' % (self._type, self.reason, [('%x' % ord(i) if isinstance(i, str) else '%x' % i) for i in self.data])
class MAVLinkSigning(object):
'''MAVLink signing state class'''
def __init__(self):
self.secret_key = None
self.timestamp = 0
self.link_id = 0
self.sign_outgoing = False
self.allow_unsigned_callback = None
self.stream_timestamps = {}
self.sig_count = 0
self.badsig_count = 0
self.goodsig_count = 0
self.unsigned_count = 0
self.reject_count = 0
class MAVLink(object):
'''MAVLink protocol handling class'''
def __init__(self, file, srcSystem=0, srcComponent=0, use_native=False):
self.seq = 0
self.file = file
self.srcSystem = srcSystem
self.srcComponent = srcComponent
self.callback = None
self.callback_args = None
self.callback_kwargs = None
self.send_callback = None
self.send_callback_args = None
self.send_callback_kwargs = None
self.buf = bytearray()
self.buf_index = 0
self.expected_length = HEADER_LEN_V1+2
self.have_prefix_error = False
self.robust_parsing = False
self.protocol_marker = 254
self.little_endian = True
self.crc_extra = True
self.sort_fields = True
self.total_packets_sent = 0
self.total_bytes_sent = 0
self.total_packets_received = 0
self.total_bytes_received = 0
self.total_receive_errors = 0
self.startup_time = time.time()
self.signing = MAVLinkSigning()
if native_supported and (use_native or native_testing or native_force):
print("NOTE: mavnative is currently beta-test code")
self.native = mavnative.NativeConnection(MAVLink_message, mavlink_map)
else:
self.native = None
if native_testing:
self.test_buf = bytearray()
self.mav20_unpacker = struct.Struct('<cBBBBBBHB')
self.mav10_unpacker = struct.Struct('<cBBBBB')
self.mav20_h3_unpacker = struct.Struct('BBB')
self.mav_csum_unpacker = struct.Struct('<H')
self.mav_sign_unpacker = struct.Struct('<IH')
def set_callback(self, callback, *args, **kwargs):
self.callback = callback
self.callback_args = args
self.callback_kwargs = kwargs
def set_send_callback(self, callback, *args, **kwargs):
self.send_callback = callback
self.send_callback_args = args
self.send_callback_kwargs = kwargs
def send(self, mavmsg, force_mavlink1=False):
'''send a MAVLink message'''
buf = mavmsg.pack(self, force_mavlink1=force_mavlink1)
self.file.write(buf)
self.seq = (self.seq + 1) % 256
self.total_packets_sent += 1
self.total_bytes_sent += len(buf)
if self.send_callback:
self.send_callback(mavmsg, *self.send_callback_args, **self.send_callback_kwargs)
def buf_len(self):
return len(self.buf) - self.buf_index
def bytes_needed(self):
'''return number of bytes needed for next parsing stage'''
if self.native:
ret = self.native.expected_length - self.buf_len()
else:
ret = self.expected_length - self.buf_len()
if ret <= 0:
return 1
return ret
def __parse_char_native(self, c):
'''this method exists only to see in profiling results'''
m = self.native.parse_chars(c)
return m
def __callbacks(self, msg):
'''this method exists only to make profiling results easier to read'''
if self.callback:
self.callback(msg, *self.callback_args, **self.callback_kwargs)
def parse_char(self, c):
'''input some data bytes, possibly returning a new message'''
self.buf.extend(c)
self.total_bytes_received += len(c)
if self.native:
if native_testing:
self.test_buf.extend(c)
m = self.__parse_char_native(self.test_buf)
m2 = self.__parse_char_legacy()
if m2 != m:
print("Native: %s\nLegacy: %s\n" % (m, m2))
raise Exception('Native vs. Legacy mismatch')
else:
m = self.__parse_char_native(self.buf)
else:
m = self.__parse_char_legacy()
if m is not None:
self.total_packets_received += 1
self.__callbacks(m)
else:
# XXX The idea here is if we've read something and there's nothing left in
# the buffer, reset it to 0 which frees the memory
if self.buf_len() == 0 and self.buf_index != 0:
self.buf = bytearray()
self.buf_index = 0
return m
def __parse_char_legacy(self):
'''input some data bytes, possibly returning a new message (uses no native code)'''
header_len = HEADER_LEN_V1
if self.buf_len() >= 1 and self.buf[self.buf_index] == PROTOCOL_MARKER_V2:
header_len = HEADER_LEN_V2
if self.buf_len() >= 1 and self.buf[self.buf_index] != PROTOCOL_MARKER_V1 and self.buf[self.buf_index] != PROTOCOL_MARKER_V2:
magic = self.buf[self.buf_index]
self.buf_index += 1
if self.robust_parsing:
m = MAVLink_bad_data(bytearray([magic]), 'Bad prefix')
self.expected_length = header_len+2
self.total_receive_errors += 1
return m
if self.have_prefix_error:
return None
self.have_prefix_error = True
self.total_receive_errors += 1
raise MAVError("invalid MAVLink prefix '%s'" % magic)
self.have_prefix_error = False
if self.buf_len() >= 3:
sbuf = self.buf[self.buf_index:3+self.buf_index]
if sys.version_info.major < 3:
sbuf = str(sbuf)
(magic, self.expected_length, incompat_flags) = self.mav20_h3_unpacker.unpack(sbuf)
if magic == PROTOCOL_MARKER_V2 and (incompat_flags & MAVLINK_IFLAG_SIGNED):
self.expected_length += MAVLINK_SIGNATURE_BLOCK_LEN
self.expected_length += header_len + 2
if self.expected_length >= (header_len+2) and self.buf_len() >= self.expected_length:
mbuf = array.array('B', self.buf[self.buf_index:self.buf_index+self.expected_length])
self.buf_index += self.expected_length
self.expected_length = header_len+2
if self.robust_parsing:
try:
if magic == PROTOCOL_MARKER_V2 and (incompat_flags & ~MAVLINK_IFLAG_SIGNED) != 0:
raise MAVError('invalid incompat_flags 0x%x 0x%x %u' % (incompat_flags, magic, self.expected_length))
m = self.decode(mbuf)
except MAVError as reason:
m = MAVLink_bad_data(mbuf, reason.message)
self.total_receive_errors += 1
else:
if magic == PROTOCOL_MARKER_V2 and (incompat_flags & ~MAVLINK_IFLAG_SIGNED) != 0:
raise MAVError('invalid incompat_flags 0x%x 0x%x %u' % (incompat_flags, magic, self.expected_length))
m = self.decode(mbuf)
return m
return None
def parse_buffer(self, s):
'''input some data bytes, possibly returning a list of new messages'''
m = self.parse_char(s)
if m is None:
return None
ret = [m]
while True:
m = self.parse_char("")
if m is None:
return ret
ret.append(m)
return ret
def check_signature(self, msgbuf, srcSystem, srcComponent):
'''check signature on incoming message'''
if isinstance(msgbuf, array.array):
msgbuf = msgbuf.tostring()
timestamp_buf = msgbuf[-12:-6]
link_id = msgbuf[-13]
(tlow, thigh) = self.mav_sign_unpacker.unpack(timestamp_buf)
timestamp = tlow + (thigh<<32)
# see if the timestamp is acceptable
stream_key = (link_id,srcSystem,srcComponent)
if stream_key in self.signing.stream_timestamps:
if timestamp <= self.signing.stream_timestamps[stream_key]:
# reject old timestamp
# print('old timestamp')
return False
else:
# a new stream has appeared. Accept the timestamp if it is at most
# one minute behind our current timestamp
if timestamp + 6000*1000 < self.signing.timestamp:
# print('bad new stream ', timestamp/(100.0*1000*60*60*24*365), self.signing.timestamp/(100.0*1000*60*60*24*365))
return False
self.signing.stream_timestamps[stream_key] = timestamp
# print('new stream')
h = hashlib.new('sha256')
h.update(self.signing.secret_key)
h.update(msgbuf[:-6])
if str(type(msgbuf)) == "<class 'bytes'>":
# Python 3
sig1 = h.digest()[:6]
sig2 = msgbuf[-6:]
else:
sig1 = str(h.digest())[:6]
sig2 = str(msgbuf)[-6:]
if sig1 != sig2:
# print('sig mismatch')
return False
# the timestamp we next send with is the max of the received timestamp and
# our current timestamp
self.signing.timestamp = max(self.signing.timestamp, timestamp)
return True
# swiped from DFReader.py
def to_string(self, s):
'''desperate attempt to convert a string regardless of what garbage we get'''
try:
return s.decode("utf-8")
except Exception as e:
pass
try:
s2 = s.encode('utf-8', 'ignore')
x = u"%s" % s2
return s2
except Exception:
pass
# so its a nasty one. Let's grab as many characters as we can
r = ''
while s != '':
try:
r2 = r + s[0]
s = s[1:]
r2 = r2.encode('ascii', 'ignore')
x = u"%s" % r2
r = r2
except Exception:
break
return r + '_XXX'
def decode(self, msgbuf):
'''decode a buffer as a MAVLink message'''
# decode the header
if msgbuf[0] != PROTOCOL_MARKER_V1:
headerlen = 10
try:
magic, mlen, incompat_flags, compat_flags, seq, srcSystem, srcComponent, msgIdlow, msgIdhigh = self.mav20_unpacker.unpack(msgbuf[:headerlen])
except struct.error as emsg:
raise MAVError('Unable to unpack MAVLink header: %s' % emsg)
msgId = msgIdlow | (msgIdhigh<<16)
mapkey = msgId
else:
headerlen = 6
try:
magic, mlen, seq, srcSystem, srcComponent, msgId = self.mav10_unpacker.unpack(msgbuf[:headerlen])
incompat_flags = 0
compat_flags = 0
except struct.error as emsg:
raise MAVError('Unable to unpack MAVLink header: %s' % emsg)
mapkey = msgId
if (incompat_flags & MAVLINK_IFLAG_SIGNED) != 0:
signature_len = MAVLINK_SIGNATURE_BLOCK_LEN
else:
signature_len = 0
if ord(magic) != PROTOCOL_MARKER_V1 and ord(magic) != PROTOCOL_MARKER_V2:
raise MAVError("invalid MAVLink prefix '%s'" % magic)
if mlen != len(msgbuf)-(headerlen+2+signature_len):
raise MAVError('invalid MAVLink message length. Got %u expected %u, msgId=%u headerlen=%u' % (len(msgbuf)-(headerlen+2+signature_len), mlen, msgId, headerlen))
if not mapkey in mavlink_map:
raise MAVError('unknown MAVLink message ID %s' % str(mapkey))
# decode the payload
type = mavlink_map[mapkey]
fmt = type.format
order_map = type.orders
len_map = type.lengths
crc_extra = type.crc_extra
# decode the checksum
try:
crc, = self.mav_csum_unpacker.unpack(msgbuf[-(2+signature_len):][:2])
except struct.error as emsg:
raise MAVError('Unable to unpack MAVLink CRC: %s' % emsg)
crcbuf = msgbuf[1:-(2+signature_len)]
if True: # using CRC extra
crcbuf.append(crc_extra)
crc2 = x25crc(crcbuf)
if crc != crc2.crc:
raise MAVError('invalid MAVLink CRC in msgID %u 0x%04x should be 0x%04x' % (msgId, crc, crc2.crc))
sig_ok = False
if signature_len == MAVLINK_SIGNATURE_BLOCK_LEN:
self.signing.sig_count += 1
if self.signing.secret_key is not None:
accept_signature = False
if signature_len == MAVLINK_SIGNATURE_BLOCK_LEN:
sig_ok = self.check_signature(msgbuf, srcSystem, srcComponent)
accept_signature = sig_ok
if sig_ok:
self.signing.goodsig_count += 1
else:
self.signing.badsig_count += 1
if not accept_signature and self.signing.allow_unsigned_callback is not None:
accept_signature = self.signing.allow_unsigned_callback(self, msgId)
if accept_signature:
self.signing.unsigned_count += 1
else:
self.signing.reject_count += 1
elif self.signing.allow_unsigned_callback is not None:
accept_signature = self.signing.allow_unsigned_callback(self, msgId)
if accept_signature:
self.signing.unsigned_count += 1
else:
self.signing.reject_count += 1
if not accept_signature:
raise MAVError('Invalid signature')
csize = type.unpacker.size
mbuf = msgbuf[headerlen:-(2+signature_len)]
if len(mbuf) < csize:
# zero pad to give right size
mbuf.extend([0]*(csize - len(mbuf)))
if len(mbuf) < csize:
raise MAVError('Bad message of type %s length %u needs %s' % (
type, len(mbuf), csize))
mbuf = mbuf[:csize]
try:
t = type.unpacker.unpack(mbuf)
except struct.error as emsg:
raise MAVError('Unable to unpack MAVLink payload type=%s fmt=%s payloadLength=%u: %s' % (
type, fmt, len(mbuf), emsg))
tlist = list(t)
# handle sorted fields
if True:
t = tlist[:]
if sum(len_map) == len(len_map):
# message has no arrays in it
for i in range(0, len(tlist)):
tlist[i] = t[order_map[i]]
else:
# message has some arrays
tlist = []
for i in range(0, len(order_map)):
order = order_map[i]
L = len_map[order]
tip = sum(len_map[:order])
field = t[tip]
if L == 1 or isinstance(field, str):
tlist.append(field)
else:
tlist.append(t[tip:(tip + L)])
# terminate any strings
for i in range(0, len(tlist)):
if type.fieldtypes[i] == 'char':
if sys.version_info.major >= 3:
tlist[i] = self.to_string(tlist[i])
tlist[i] = str(MAVString(tlist[i]))
t = tuple(tlist)
# construct the message object
try:
m = type(*t)
except Exception as emsg:
raise MAVError('Unable to instantiate MAVLink message of type %s : %s' % (type, emsg))
m._signed = sig_ok
if m._signed:
m._link_id = msgbuf[-13]
m._msgbuf = msgbuf
m._payload = msgbuf[6:-(2+signature_len)]
m._crc = crc
m._header = MAVLink_header(msgId, incompat_flags, compat_flags, mlen, seq, srcSystem, srcComponent)
return m
def sensor_offsets_encode(self, mag_ofs_x, mag_ofs_y, mag_ofs_z, mag_declination, raw_press, raw_temp, gyro_cal_x, gyro_cal_y, gyro_cal_z, accel_cal_x, accel_cal_y, accel_cal_z):
'''
Offsets and calibrations values for hardware sensors. This makes it
easier to debug the calibration process.
mag_ofs_x : Magnetometer X offset. (type:int16_t)
mag_ofs_y : Magnetometer Y offset. (type:int16_t)
mag_ofs_z : Magnetometer Z offset. (type:int16_t)
mag_declination : Magnetic declination. [rad] (type:float)
raw_press : Raw pressure from barometer. (type:int32_t)
raw_temp : Raw temperature from barometer. (type:int32_t)
gyro_cal_x : Gyro X calibration. (type:float)
gyro_cal_y : Gyro Y calibration. (type:float)
gyro_cal_z : Gyro Z calibration. (type:float)
accel_cal_x : Accel X calibration. (type:float)
accel_cal_y : Accel Y calibration. (type:float)
accel_cal_z : Accel Z calibration. (type:float)
'''
return MAVLink_sensor_offsets_message(mag_ofs_x, mag_ofs_y, mag_ofs_z, mag_declination, raw_press, raw_temp, gyro_cal_x, gyro_cal_y, gyro_cal_z, accel_cal_x, accel_cal_y, accel_cal_z)
def sensor_offsets_send(self, mag_ofs_x, mag_ofs_y, mag_ofs_z, mag_declination, raw_press, raw_temp, gyro_cal_x, gyro_cal_y, gyro_cal_z, accel_cal_x, accel_cal_y, accel_cal_z, force_mavlink1=False):
'''
Offsets and calibrations values for hardware sensors. This makes it
easier to debug the calibration process.
mag_ofs_x : Magnetometer X offset. (type:int16_t)
mag_ofs_y : Magnetometer Y offset. (type:int16_t)
mag_ofs_z : Magnetometer Z offset. (type:int16_t)
mag_declination : Magnetic declination. [rad] (type:float)
raw_press : Raw pressure from barometer. (type:int32_t)
raw_temp : Raw temperature from barometer. (type:int32_t)
gyro_cal_x : Gyro X calibration. (type:float)
gyro_cal_y : Gyro Y calibration. (type:float)
gyro_cal_z : Gyro Z calibration. (type:float)
accel_cal_x : Accel X calibration. (type:float)
accel_cal_y : Accel Y calibration. (type:float)
accel_cal_z : Accel Z calibration. (type:float)
'''
return self.send(self.sensor_offsets_encode(mag_ofs_x, mag_ofs_y, mag_ofs_z, mag_declination, raw_press, raw_temp, gyro_cal_x, gyro_cal_y, gyro_cal_z, accel_cal_x, accel_cal_y, accel_cal_z), force_mavlink1=force_mavlink1)
def set_mag_offsets_encode(self, target_system, target_component, mag_ofs_x, mag_ofs_y, mag_ofs_z):
'''
Set the magnetometer offsets
target_system : System ID. (type:uint8_t)
target_component : Component ID. (type:uint8_t)
mag_ofs_x : Magnetometer X offset. (type:int16_t)
mag_ofs_y : Magnetometer Y offset. (type:int16_t)
mag_ofs_z : Magnetometer Z offset. (type:int16_t)
'''
return MAVLink_set_mag_offsets_message(target_system, target_component, mag_ofs_x, mag_ofs_y, mag_ofs_z)
def set_mag_offsets_send(self, target_system, target_component, mag_ofs_x, mag_ofs_y, mag_ofs_z, force_mavlink1=False):
'''
Set the magnetometer offsets
target_system : System ID. (type:uint8_t)
target_component : Component ID. (type:uint8_t)
mag_ofs_x : Magnetometer X offset. (type:int16_t)
mag_ofs_y : Magnetometer Y offset. (type:int16_t)
mag_ofs_z : Magnetometer Z offset. (type:int16_t)
'''
return self.send(self.set_mag_offsets_encode(target_system, target_component, mag_ofs_x, mag_ofs_y, mag_ofs_z), force_mavlink1=force_mavlink1)
def meminfo_encode(self, brkval, freemem):
'''
State of APM memory.
brkval : Heap top. (type:uint16_t)
freemem : Free memory. [bytes] (type:uint16_t)
'''
return MAVLink_meminfo_message(brkval, freemem)
def meminfo_send(self, brkval, freemem, force_mavlink1=False):
'''
State of APM memory.
brkval : Heap top. (type:uint16_t)
freemem : Free memory. [bytes] (type:uint16_t)
'''
return self.send(self.meminfo_encode(brkval, freemem), force_mavlink1=force_mavlink1)
def ap_adc_encode(self, adc1, adc2, adc3, adc4, adc5, adc6):
'''
Raw ADC output.
adc1 : ADC output 1. (type:uint16_t)
adc2 : ADC output 2. (type:uint16_t)
adc3 : ADC output 3. (type:uint16_t)
adc4 : ADC output 4. (type:uint16_t)
adc5 : ADC output 5. (type:uint16_t)
adc6 : ADC output 6. (type:uint16_t)
'''
return MAVLink_ap_adc_message(adc1, adc2, adc3, adc4, adc5, adc6)
def ap_adc_send(self, adc1, adc2, adc3, adc4, adc5, adc6, force_mavlink1=False):
'''
Raw ADC output.
adc1 : ADC output 1. (type:uint16_t)
adc2 : ADC output 2. (type:uint16_t)
adc3 : ADC output 3. (type:uint16_t)
adc4 : ADC output 4. (type:uint16_t)
adc5 : ADC output 5. (type:uint16_t)
adc6 : ADC output 6. (type:uint16_t)
'''
return self.send(self.ap_adc_encode(adc1, adc2, adc3, adc4, adc5, adc6), force_mavlink1=force_mavlink1)
def digicam_configure_encode(self, target_system, target_component, mode, shutter_speed, aperture, iso, exposure_type, command_id, engine_cut_off, extra_param, extra_value):
'''
Configure on-board Camera Control System.
target_system : System ID. (type:uint8_t)
target_component : Component ID. (type:uint8_t)
mode : Mode enumeration from 1 to N //P, TV, AV, M, etc. (0 means ignore). (type:uint8_t)
shutter_speed : Divisor number //e.g. 1000 means 1/1000 (0 means ignore). (type:uint16_t)
aperture : F stop number x 10 //e.g. 28 means 2.8 (0 means ignore). (type:uint8_t)
iso : ISO enumeration from 1 to N //e.g. 80, 100, 200, Etc (0 means ignore). (type:uint8_t)
exposure_type : Exposure type enumeration from 1 to N (0 means ignore). (type:uint8_t)
command_id : Command Identity (incremental loop: 0 to 255). //A command sent multiple times will be executed or pooled just once. (type:uint8_t)
engine_cut_off : Main engine cut-off time before camera trigger (0 means no cut-off). [ds] (type:uint8_t)
extra_param : Extra parameters enumeration (0 means ignore). (type:uint8_t)
extra_value : Correspondent value to given extra_param. (type:float)
'''
return MAVLink_digicam_configure_message(target_system, target_component, mode, shutter_speed, aperture, iso, exposure_type, command_id, engine_cut_off, extra_param, extra_value)
def digicam_configure_send(self, target_system, target_component, mode, shutter_speed, aperture, iso, exposure_type, command_id, engine_cut_off, extra_param, extra_value, force_mavlink1=False):
'''
Configure on-board Camera Control System.
target_system : System ID. (type:uint8_t)
target_component : Component ID. (type:uint8_t)
mode : Mode enumeration from 1 to N //P, TV, AV, M, etc. (0 means ignore). (type:uint8_t)
shutter_speed : Divisor number //e.g. 1000 means 1/1000 (0 means ignore). (type:uint16_t)
aperture : F stop number x 10 //e.g. 28 means 2.8 (0 means ignore). (type:uint8_t)
iso : ISO enumeration from 1 to N //e.g. 80, 100, 200, Etc (0 means ignore). (type:uint8_t)
exposure_type : Exposure type enumeration from 1 to N (0 means ignore). (type:uint8_t)
command_id : Command Identity (incremental loop: 0 to 255). //A command sent multiple times will be executed or pooled just once. (type:uint8_t)
engine_cut_off : Main engine cut-off time before camera trigger (0 means no cut-off). [ds] (type:uint8_t)
extra_param : Extra parameters enumeration (0 means ignore). (type:uint8_t)
extra_value : Correspondent value to given extra_param. (type:float)
'''
return self.send(self.digicam_configure_encode(target_system, target_component, mode, shutter_speed, aperture, iso, exposure_type, command_id, engine_cut_off, extra_param, extra_value), force_mavlink1=force_mavlink1)
def digicam_control_encode(self, target_system, target_component, session, zoom_pos, zoom_step, focus_lock, shot, command_id, extra_param, extra_value):
'''
Control on-board Camera Control System to take shots.
target_system : System ID. (type:uint8_t)
target_component : Component ID. (type:uint8_t)
session : 0: stop, 1: start or keep it up //Session control e.g. show/hide lens. (type:uint8_t)
zoom_pos : 1 to N //Zoom's absolute position (0 means ignore). (type:uint8_t)
zoom_step : -100 to 100 //Zooming step value to offset zoom from the current position. (type:int8_t)
focus_lock : 0: unlock focus or keep unlocked, 1: lock focus or keep locked, 3: re-lock focus. (type:uint8_t)
shot : 0: ignore, 1: shot or start filming. (type:uint8_t)
command_id : Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once. (type:uint8_t)
extra_param : Extra parameters enumeration (0 means ignore). (type:uint8_t)
extra_value : Correspondent value to given extra_param. (type:float)
'''
return MAVLink_digicam_control_message(target_system, target_component, session, zoom_pos, zoom_step, focus_lock, shot, command_id, extra_param, extra_value)
def digicam_control_send(self, target_system, target_component, session, zoom_pos, zoom_step, focus_lock, shot, command_id, extra_param, extra_value, force_mavlink1=False):
'''
Control on-board Camera Control System to take shots.
target_system : System ID. (type:uint8_t)
target_component : Component ID. (type:uint8_t)
session : 0: stop, 1: start or keep it up //Session control e.g. show/hide lens. (type:uint8_t)
zoom_pos : 1 to N //Zoom's absolute position (0 means ignore). (type:uint8_t)
zoom_step : -100 to 100 //Zooming step value to offset zoom from the current position. (type:int8_t)
focus_lock : 0: unlock focus or keep unlocked, 1: lock focus or keep locked, 3: re-lock focus. (type:uint8_t)
shot : 0: ignore, 1: shot or start filming. (type:uint8_t)
command_id : Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once. (type:uint8_t)
extra_param : Extra parameters enumeration (0 means ignore). (type:uint8_t)
extra_value : Correspondent value to given extra_param. (type:float)
'''
return self.send(self.digicam_control_encode(target_system, target_component, session, zoom_pos, zoom_step, focus_lock, shot, command_id, extra_param, extra_value), force_mavlink1=force_mavlink1)
def mount_configure_encode(self, target_system, target_component, mount_mode, stab_roll, stab_pitch, stab_yaw):
'''
Message to configure a camera mount, directional antenna, etc.
target_system : System ID. (type:uint8_t)
target_component : Component ID. (type:uint8_t)
mount_mode : Mount operating mode. (type:uint8_t, values:MAV_MOUNT_MODE)
stab_roll : (1 = yes, 0 = no). (type:uint8_t)
stab_pitch : (1 = yes, 0 = no). (type:uint8_t)
stab_yaw : (1 = yes, 0 = no). (type:uint8_t)
'''
return MAVLink_mount_configure_message(target_system, target_component, mount_mode, stab_roll, stab_pitch, stab_yaw)
def mount_configure_send(self, target_system, target_component, mount_mode, stab_roll, stab_pitch, stab_yaw, force_mavlink1=False):
'''
Message to configure a camera mount, directional antenna, etc.
target_system : System ID. (type:uint8_t)
target_component : Component ID. (type:uint8_t)
mount_mode : Mount operating mode. (type:uint8_t, values:MAV_MOUNT_MODE)
stab_roll : (1 = yes, 0 = no). (type:uint8_t)
stab_pitch : (1 = yes, 0 = no). (type:uint8_t)
stab_yaw : (1 = yes, 0 = no). (type:uint8_t)
'''
return self.send(self.mount_configure_encode(target_system, target_component, mount_mode, stab_roll, stab_pitch, stab_yaw), force_mavlink1=force_mavlink1)
def mount_control_encode(self, target_system, target_component, input_a, input_b, input_c, save_position):
'''
Message to control a camera mount, directional antenna, etc.
target_system : System ID. (type:uint8_t)
target_component : Component ID. (type:uint8_t)
input_a : Pitch (centi-degrees) or lat (degE7), depending on mount mode. (type:int32_t)
input_b : Roll (centi-degrees) or lon (degE7) depending on mount mode. (type:int32_t)
input_c : Yaw (centi-degrees) or alt (cm) depending on mount mode. (type:int32_t)
save_position : If "1" it will save current trimmed position on EEPROM (just valid for NEUTRAL and LANDING). (type:uint8_t)
'''
return MAVLink_mount_control_message(target_system, target_component, input_a, input_b, input_c, save_position)
def mount_control_send(self, target_system, target_component, input_a, input_b, input_c, save_position, force_mavlink1=False):
'''
Message to control a camera mount, directional antenna, etc.
target_system : System ID. (type:uint8_t)
target_component : Component ID. (type:uint8_t)
input_a : Pitch (centi-degrees) or lat (degE7), depending on mount mode. (type:int32_t)
input_b : Roll (centi-degrees) or lon (degE7) depending on mount mode. (type:int32_t)
input_c : Yaw (centi-degrees) or alt (cm) depending on mount mode. (type:int32_t)
save_position : If "1" it will save current trimmed position on EEPROM (just valid for NEUTRAL and LANDING). (type:uint8_t)
'''
return self.send(self.mount_control_encode(target_system, target_component, input_a, input_b, input_c, save_position), force_mavlink1=force_mavlink1)
def mount_status_encode(self, target_system, target_component, pointing_a, pointing_b, pointing_c):
'''
Message with some status from APM to GCS about camera or antenna
mount.
target_system : System ID. (type:uint8_t)
target_component : Component ID. (type:uint8_t)
pointing_a : Pitch. [cdeg] (type:int32_t)
pointing_b : Roll. [cdeg] (type:int32_t)
pointing_c : Yaw. [cdeg] (type:int32_t)
'''
return MAVLink_mount_status_message(target_system, target_component, pointing_a, pointing_b, pointing_c)
def mount_status_send(self, target_system, target_component, pointing_a, pointing_b, pointing_c, force_mavlink1=False):
'''
Message with some status from APM to GCS about camera or antenna
mount.
target_system : System ID. (type:uint8_t)
target_component : Component ID. (type:uint8_t)
pointing_a : Pitch. [cdeg] (type:int32_t)
pointing_b : Roll. [cdeg] (type:int32_t)
pointing_c : Yaw. [cdeg] (type:int32_t)
'''
return self.send(self.mount_status_encode(target_system, target_component, pointing_a, pointing_b, pointing_c), force_mavlink1=force_mavlink1)
def fence_point_encode(self, target_system, target_component, idx, count, lat, lng):
'''
A fence point. Used to set a point when from GCS -> MAV. Also used to
return a point from MAV -> GCS.
target_system : System ID. (type:uint8_t)
target_component : Component ID. (type:uint8_t)
idx : Point index (first point is 1, 0 is for return point). (type:uint8_t)
count : Total number of points (for sanity checking). (type:uint8_t)
lat : Latitude of point. [deg] (type:float)
lng : Longitude of point. [deg] (type:float)
'''
return MAVLink_fence_point_message(target_system, target_component, idx, count, lat, lng)
def fence_point_send(self, target_system, target_component, idx, count, lat, lng, force_mavlink1=False):
'''
A fence point. Used to set a point when from GCS -> MAV. Also used to
return a point from MAV -> GCS.
target_system : System ID. (type:uint8_t)
target_component : Component ID. (type:uint8_t)
idx : Point index (first point is 1, 0 is for return point). (type:uint8_t)
count : Total number of points (for sanity checking). (type:uint8_t)
lat : Latitude of point. [deg] (type:float)
lng : Longitude of point. [deg] (type:float)
'''
return self.send(self.fence_point_encode(target_system, target_component, idx, count, lat, lng), force_mavlink1=force_mavlink1)
def fence_fetch_point_encode(self, target_system, target_component, idx):
'''
Request a current fence point from MAV.
target_system : System ID. (type:uint8_t)
target_component : Component ID. (type:uint8_t)
idx : Point index (first point is 1, 0 is for return point). (type:uint8_t)
'''
return MAVLink_fence_fetch_point_message(target_system, target_component, idx)
def fence_fetch_point_send(self, target_system, target_component, idx, force_mavlink1=False):
'''
Request a current fence point from MAV.
target_system : System ID. (type:uint8_t)
target_component : Component ID. (type:uint8_t)
idx : Point index (first point is 1, 0 is for return point). (type:uint8_t)
'''
return self.send(self.fence_fetch_point_encode(target_system, target_component, idx), force_mavlink1=force_mavlink1)
def ahrs_encode(self, omegaIx, omegaIy, omegaIz, accel_weight, renorm_val, error_rp, error_yaw):
'''
Status of DCM attitude estimator.
omegaIx : X gyro drift estimate. [rad/s] (type:float)
omegaIy : Y gyro drift estimate. [rad/s] (type:float)
omegaIz : Z gyro drift estimate. [rad/s] (type:float)
accel_weight : Average accel_weight. (type:float)
renorm_val : Average renormalisation value. (type:float)
error_rp : Average error_roll_pitch value. (type:float)
error_yaw : Average error_yaw value. (type:float)
'''
return MAVLink_ahrs_message(omegaIx, omegaIy, omegaIz, accel_weight, renorm_val, error_rp, error_yaw)
def ahrs_send(self, omegaIx, omegaIy, omegaIz, accel_weight, renorm_val, error_rp, error_yaw, force_mavlink1=False):
'''
Status of DCM attitude estimator.
omegaIx : X gyro drift estimate. [rad/s] (type:float)
omegaIy : Y gyro drift estimate. [rad/s] (type:float)
omegaIz : Z gyro drift estimate. [rad/s] (type:float)
accel_weight : Average accel_weight. (type:float)
renorm_val : Average renormalisation value. (type:float)
error_rp : Average error_roll_pitch value. (type:float)
error_yaw : Average error_yaw value. (type:float)
'''
return self.send(self.ahrs_encode(omegaIx, omegaIy, omegaIz, accel_weight, renorm_val, error_rp, error_yaw), force_mavlink1=force_mavlink1)
def simstate_encode(self, roll, pitch, yaw, xacc, yacc, zacc, xgyro, ygyro, zgyro, lat, lng):
'''
Status of simulation environment, if used.
roll : Roll angle. [rad] (type:float)
pitch : Pitch angle. [rad] (type:float)
yaw : Yaw angle. [rad] (type:float)
xacc : X acceleration. [m/s/s] (type:float)
yacc : Y acceleration. [m/s/s] (type:float)
zacc : Z acceleration. [m/s/s] (type:float)
xgyro : Angular speed around X axis. [rad/s] (type:float)
ygyro : Angular speed around Y axis. [rad/s] (type:float)
zgyro : Angular speed around Z axis. [rad/s] (type:float)
lat : Latitude. [degE7] (type:int32_t)
lng : Longitude. [degE7] (type:int32_t)
'''
return MAVLink_simstate_message(roll, pitch, yaw, xacc, yacc, zacc, xgyro, ygyro, zgyro, lat, lng)
def simstate_send(self, roll, pitch, yaw, xacc, yacc, zacc, xgyro, ygyro, zgyro, lat, lng, force_mavlink1=False):
'''
Status of simulation environment, if used.
roll : Roll angle. [rad] (type:float)
pitch : Pitch angle. [rad] (type:float)
yaw : Yaw angle. [rad] (type:float)
xacc : X acceleration. [m/s/s] (type:float)
yacc : Y acceleration. [m/s/s] (type:float)
zacc : Z acceleration. [m/s/s] (type:float)
xgyro : Angular speed around X axis. [rad/s] (type:float)
ygyro : Angular speed around Y axis. [rad/s] (type:float)
zgyro : Angular speed around Z axis. [rad/s] (type:float)
lat : Latitude. [degE7] (type:int32_t)
lng : Longitude. [degE7] (type:int32_t)
'''
return self.send(self.simstate_encode(roll, pitch, yaw, xacc, yacc, zacc, xgyro, ygyro, zgyro, lat, lng), force_mavlink1=force_mavlink1)
def hwstatus_encode(self, Vcc, I2Cerr):
'''
Status of key hardware.
Vcc : Board voltage. [mV] (type:uint16_t)
I2Cerr : I2C error count. (type:uint8_t)
'''
return MAVLink_hwstatus_message(Vcc, I2Cerr)
def hwstatus_send(self, Vcc, I2Cerr, force_mavlink1=False):
'''
Status of key hardware.
Vcc : Board voltage. [mV] (type:uint16_t)
I2Cerr : I2C error count. (type:uint8_t)
'''
return self.send(self.hwstatus_encode(Vcc, I2Cerr), force_mavlink1=force_mavlink1)
def radio_encode(self, rssi, remrssi, txbuf, noise, remnoise, rxerrors, fixed):
'''
Status generated by radio.
rssi : Local signal strength. (type:uint8_t)
remrssi : Remote signal strength. (type:uint8_t)
txbuf : How full the tx buffer is. [%] (type:uint8_t)
noise : Background noise level. (type:uint8_t)
remnoise : Remote background noise level. (type:uint8_t)
rxerrors : Receive errors. (type:uint16_t)
fixed : Count of error corrected packets. (type:uint16_t)
'''
return MAVLink_radio_message(rssi, remrssi, txbuf, noise, remnoise, rxerrors, fixed)
def radio_send(self, rssi, remrssi, txbuf, noise, remnoise, rxerrors, fixed, force_mavlink1=False):
'''
Status generated by radio.
rssi : Local signal strength. (type:uint8_t)
remrssi : Remote signal strength. (type:uint8_t)
txbuf : How full the tx buffer is. [%] (type:uint8_t)
noise : Background noise level. (type:uint8_t)
remnoise : Remote background noise level. (type:uint8_t)
rxerrors : Receive errors. (type:uint16_t)
fixed : Count of error corrected packets. (type:uint16_t)
'''
return self.send(self.radio_encode(rssi, remrssi, txbuf, noise, remnoise, rxerrors, fixed), force_mavlink1=force_mavlink1)
def limits_status_encode(self, limits_state, last_trigger, last_action, last_recovery, last_clear, breach_count, mods_enabled, mods_required, mods_triggered):
'''
Status of AP_Limits. Sent in extended status stream when AP_Limits is
enabled.
limits_state : State of AP_Limits. (type:uint8_t, values:LIMITS_STATE)
last_trigger : Time (since boot) of last breach. [ms] (type:uint32_t)
last_action : Time (since boot) of last recovery action. [ms] (type:uint32_t)
last_recovery : Time (since boot) of last successful recovery. [ms] (type:uint32_t)
last_clear : Time (since boot) of last all-clear. [ms] (type:uint32_t)
breach_count : Number of fence breaches. (type:uint16_t)
mods_enabled : AP_Limit_Module bitfield of enabled modules. (type:uint8_t, values:LIMIT_MODULE)
mods_required : AP_Limit_Module bitfield of required modules. (type:uint8_t, values:LIMIT_MODULE)
mods_triggered : AP_Limit_Module bitfield of triggered modules. (type:uint8_t, values:LIMIT_MODULE)
'''
return MAVLink_limits_status_message(limits_state, last_trigger, last_action, last_recovery, last_clear, breach_count, mods_enabled, mods_required, mods_triggered)
def limits_status_send(self, limits_state, last_trigger, last_action, last_recovery, last_clear, breach_count, mods_enabled, mods_required, mods_triggered, force_mavlink1=False):
'''
Status of AP_Limits. Sent in extended status stream when AP_Limits is
enabled.
limits_state : State of AP_Limits. (type:uint8_t, values:LIMITS_STATE)
last_trigger : Time (since boot) of last breach. [ms] (type:uint32_t)
last_action : Time (since boot) of last recovery action. [ms] (type:uint32_t)
last_recovery : Time (since boot) of last successful recovery. [ms] (type:uint32_t)
last_clear : Time (since boot) of last all-clear. [ms] (type:uint32_t)
breach_count : Number of fence breaches. (type:uint16_t)
mods_enabled : AP_Limit_Module bitfield of enabled modules. (type:uint8_t, values:LIMIT_MODULE)
mods_required : AP_Limit_Module bitfield of required modules. (type:uint8_t, values:LIMIT_MODULE)
mods_triggered : AP_Limit_Module bitfield of triggered modules. (type:uint8_t, values:LIMIT_MODULE)
'''
return self.send(self.limits_status_encode(limits_state, last_trigger, last_action, last_recovery, last_clear, breach_count, mods_enabled, mods_required, mods_triggered), force_mavlink1=force_mavlink1)
def wind_encode(self, direction, speed, speed_z):
'''
Wind estimation.
direction : Wind direction (that wind is coming from). [deg] (type:float)
speed : Wind speed in ground plane. [m/s] (type:float)
speed_z : Vertical wind speed. [m/s] (type:float)
'''
return MAVLink_wind_message(direction, speed, speed_z)
def wind_send(self, direction, speed, speed_z, force_mavlink1=False):
'''
Wind estimation.
direction : Wind direction (that wind is coming from). [deg] (type:float)
speed : Wind speed in ground plane. [m/s] (type:float)
speed_z : Vertical wind speed. [m/s] (type:float)
'''
return self.send(self.wind_encode(direction, speed, speed_z), force_mavlink1=force_mavlink1)
def data16_encode(self, type, len, data):
'''
Data packet, size 16.
type : Data type. (type:uint8_t)
len : Data length. [bytes] (type:uint8_t)
data : Raw data. (type:uint8_t)
'''
return MAVLink_data16_message(type, len, data)
def data16_send(self, type, len, data, force_mavlink1=False):
'''
Data packet, size 16.
type : Data type. (type:uint8_t)
len : Data length. [bytes] (type:uint8_t)
data : Raw data. (type:uint8_t)
'''
return self.send(self.data16_encode(type, len, data), force_mavlink1=force_mavlink1)
def data32_encode(self, type, len, data):
'''
Data packet, size 32.
type : Data type. (type:uint8_t)
len : Data length. [bytes] (type:uint8_t)
data : Raw data. (type:uint8_t)
'''
return MAVLink_data32_message(type, len, data)
def data32_send(self, type, len, data, force_mavlink1=False):
'''
Data packet, size 32.
type : Data type. (type:uint8_t)
len : Data length. [bytes] (type:uint8_t)
data : Raw data. (type:uint8_t)
'''
return self.send(self.data32_encode(type, len, data), force_mavlink1=force_mavlink1)
def data64_encode(self, type, len, data):
'''
Data packet, size 64.
type : Data type. (type:uint8_t)
len : Data length. [bytes] (type:uint8_t)
data : Raw data. (type:uint8_t)
'''
return MAVLink_data64_message(type, len, data)
def data64_send(self, type, len, data, force_mavlink1=False):
'''
Data packet, size 64.
type : Data type. (type:uint8_t)
len : Data length. [bytes] (type:uint8_t)
data : Raw data. (type:uint8_t)
'''
return self.send(self.data64_encode(type, len, data), force_mavlink1=force_mavlink1)
def data96_encode(self, type, len, data):
'''
Data packet, size 96.
type : Data type. (type:uint8_t)
len : Data length. [bytes] (type:uint8_t)
data : Raw data. (type:uint8_t)
'''
return MAVLink_data96_message(type, len, data)
def data96_send(self, type, len, data, force_mavlink1=False):
'''
Data packet, size 96.
type : Data type. (type:uint8_t)
len : Data length. [bytes] (type:uint8_t)
data : Raw data. (type:uint8_t)
'''
return self.send(self.data96_encode(type, len, data), force_mavlink1=force_mavlink1)
def rangefinder_encode(self, distance, voltage):
'''
Rangefinder reporting.
distance : Distance. [m] (type:float)
voltage : Raw voltage if available, zero otherwise. [V] (type:float)
'''
return MAVLink_rangefinder_message(distance, voltage)
def rangefinder_send(self, distance, voltage, force_mavlink1=False):
'''
Rangefinder reporting.
distance : Distance. [m] (type:float)
voltage : Raw voltage if available, zero otherwise. [V] (type:float)
'''
return self.send(self.rangefinder_encode(distance, voltage), force_mavlink1=force_mavlink1)
def airspeed_autocal_encode(self, vx, vy, vz, diff_pressure, EAS2TAS, ratio, state_x, state_y, state_z, Pax, Pby, Pcz):
'''
Airspeed auto-calibration.
vx : GPS velocity north. [m/s] (type:float)
vy : GPS velocity east. [m/s] (type:float)
vz : GPS velocity down. [m/s] (type:float)
diff_pressure : Differential pressure. [Pa] (type:float)
EAS2TAS : Estimated to true airspeed ratio. (type:float)
ratio : Airspeed ratio. (type:float)
state_x : EKF state x. (type:float)
state_y : EKF state y. (type:float)
state_z : EKF state z. (type:float)
Pax : EKF Pax. (type:float)
Pby : EKF Pby. (type:float)
Pcz : EKF Pcz. (type:float)
'''
return MAVLink_airspeed_autocal_message(vx, vy, vz, diff_pressure, EAS2TAS, ratio, state_x, state_y, state_z, Pax, Pby, Pcz)
def airspeed_autocal_send(self, vx, vy, vz, diff_pressure, EAS2TAS, ratio, state_x, state_y, state_z, Pax, Pby, Pcz, force_mavlink1=False):
'''
Airspeed auto-calibration.
vx : GPS velocity north. [m/s] (type:float)
vy : GPS velocity east. [m/s] (type:float)
vz : GPS velocity down. [m/s] (type:float)
diff_pressure : Differential pressure. [Pa] (type:float)
EAS2TAS : Estimated to true airspeed ratio. (type:float)
ratio : Airspeed ratio. (type:float)
state_x : EKF state x. (type:float)
state_y : EKF state y. (type:float)
state_z : EKF state z. (type:float)
Pax : EKF Pax. (type:float)
Pby : EKF Pby. (type:float)
Pcz : EKF Pcz. (type:float)
'''
return self.send(self.airspeed_autocal_encode(vx, vy, vz, diff_pressure, EAS2TAS, ratio, state_x, state_y, state_z, Pax, Pby, Pcz), force_mavlink1=force_mavlink1)
def rally_point_encode(self, target_system, target_component, idx, count, lat, lng, alt, break_alt, land_dir, flags):
'''
A rally point. Used to set a point when from GCS -> MAV. Also used to
return a point from MAV -> GCS.
target_system : System ID. (type:uint8_t)
target_component : Component ID. (type:uint8_t)
idx : Point index (first point is 0). (type:uint8_t)
count : Total number of points (for sanity checking). (type:uint8_t)
lat : Latitude of point. [degE7] (type:int32_t)
lng : Longitude of point. [degE7] (type:int32_t)
alt : Transit / loiter altitude relative to home. [m] (type:int16_t)
break_alt : Break altitude relative to home. [m] (type:int16_t)
land_dir : Heading to aim for when landing. [cdeg] (type:uint16_t)
flags : Configuration flags. (type:uint8_t, values:RALLY_FLAGS)
'''
return MAVLink_rally_point_message(target_system, target_component, idx, count, lat, lng, alt, break_alt, land_dir, flags)
def rally_point_send(self, target_system, target_component, idx, count, lat, lng, alt, break_alt, land_dir, flags, force_mavlink1=False):
'''
A rally point. Used to set a point when from GCS -> MAV. Also used to
return a point from MAV -> GCS.
target_system : System ID. (type:uint8_t)
target_component : Component ID. (type:uint8_t)
idx : Point index (first point is 0). (type:uint8_t)
count : Total number of points (for sanity checking). (type:uint8_t)
lat : Latitude of point. [degE7] (type:int32_t)
lng : Longitude of point. [degE7] (type:int32_t)
alt : Transit / loiter altitude relative to home. [m] (type:int16_t)
break_alt : Break altitude relative to home. [m] (type:int16_t)
land_dir : Heading to aim for when landing. [cdeg] (type:uint16_t)
flags : Configuration flags. (type:uint8_t, values:RALLY_FLAGS)
'''
return self.send(self.rally_point_encode(target_system, target_component, idx, count, lat, lng, alt, break_alt, land_dir, flags), force_mavlink1=force_mavlink1)
def rally_fetch_point_encode(self, target_system, target_component, idx):
'''
Request a current rally point from MAV. MAV should respond with a
RALLY_POINT message. MAV should not respond if the
request is invalid.
target_system : System ID. (type:uint8_t)
target_component : Component ID. (type:uint8_t)
idx : Point index (first point is 0). (type:uint8_t)
'''
return MAVLink_rally_fetch_point_message(target_system, target_component, idx)
def rally_fetch_point_send(self, target_system, target_component, idx, force_mavlink1=False):
'''
Request a current rally point from MAV. MAV should respond with a
RALLY_POINT message. MAV should not respond if the
request is invalid.
target_system : System ID. (type:uint8_t)
target_component : Component ID. (type:uint8_t)
idx : Point index (first point is 0). (type:uint8_t)
'''
return self.send(self.rally_fetch_point_encode(target_system, target_component, idx), force_mavlink1=force_mavlink1)
def compassmot_status_encode(self, throttle, current, interference, CompensationX, CompensationY, CompensationZ):
'''
Status of compassmot calibration.
throttle : Throttle. [d%] (type:uint16_t)
current : Current. [A] (type:float)
interference : Interference. [%] (type:uint16_t)
CompensationX : Motor Compensation X. (type:float)
CompensationY : Motor Compensation Y. (type:float)
CompensationZ : Motor Compensation Z. (type:float)
'''
return MAVLink_compassmot_status_message(throttle, current, interference, CompensationX, CompensationY, CompensationZ)
def compassmot_status_send(self, throttle, current, interference, CompensationX, CompensationY, CompensationZ, force_mavlink1=False):
'''
Status of compassmot calibration.
throttle : Throttle. [d%] (type:uint16_t)
current : Current. [A] (type:float)
interference : Interference. [%] (type:uint16_t)
CompensationX : Motor Compensation X. (type:float)
CompensationY : Motor Compensation Y. (type:float)
CompensationZ : Motor Compensation Z. (type:float)
'''
return self.send(self.compassmot_status_encode(throttle, current, interference, CompensationX, CompensationY, CompensationZ), force_mavlink1=force_mavlink1)
def ahrs2_encode(self, roll, pitch, yaw, altitude, lat, lng):
'''
Status of secondary AHRS filter if available.
roll : Roll angle. [rad] (type:float)
pitch : Pitch angle. [rad] (type:float)
yaw : Yaw angle. [rad] (type:float)
altitude : Altitude (MSL). [m] (type:float)
lat : Latitude. [degE7] (type:int32_t)
lng : Longitude. [degE7] (type:int32_t)
'''
return MAVLink_ahrs2_message(roll, pitch, yaw, altitude, lat, lng)
def ahrs2_send(self, roll, pitch, yaw, altitude, lat, lng, force_mavlink1=False):
'''
Status of secondary AHRS filter if available.
roll : Roll angle. [rad] (type:float)
pitch : Pitch angle. [rad] (type:float)
yaw : Yaw angle. [rad] (type:float)
altitude : Altitude (MSL). [m] (type:float)
lat : Latitude. [degE7] (type:int32_t)
lng : Longitude. [degE7] (type:int32_t)
'''
return self.send(self.ahrs2_encode(roll, pitch, yaw, altitude, lat, lng), force_mavlink1=force_mavlink1)
def camera_status_encode(self, time_usec, target_system, cam_idx, img_idx, event_id, p1, p2, p3, p4):
'''
Camera Event.
time_usec : Image timestamp (since UNIX epoch, according to camera clock). [us] (type:uint64_t)
target_system : System ID. (type:uint8_t)
cam_idx : Camera ID. (type:uint8_t)
img_idx : Image index. (type:uint16_t)
event_id : Event type. (type:uint8_t, values:CAMERA_STATUS_TYPES)
p1 : Parameter 1 (meaning depends on event_id, see CAMERA_STATUS_TYPES enum). (type:float)
p2 : Parameter 2 (meaning depends on event_id, see CAMERA_STATUS_TYPES enum). (type:float)
p3 : Parameter 3 (meaning depends on event_id, see CAMERA_STATUS_TYPES enum). (type:float)
p4 : Parameter 4 (meaning depends on event_id, see CAMERA_STATUS_TYPES enum). (type:float)
'''
return MAVLink_camera_status_message(time_usec, target_system, cam_idx, img_idx, event_id, p1, p2, p3, p4)
def camera_status_send(self, time_usec, target_system, cam_idx, img_idx, event_id, p1, p2, p3, p4, force_mavlink1=False):
'''
Camera Event.
time_usec : Image timestamp (since UNIX epoch, according to camera clock). [us] (type:uint64_t)
target_system : System ID. (type:uint8_t)
cam_idx : Camera ID. (type:uint8_t)
img_idx : Image index. (type:uint16_t)
event_id : Event type. (type:uint8_t, values:CAMERA_STATUS_TYPES)
p1 : Parameter 1 (meaning depends on event_id, see CAMERA_STATUS_TYPES enum). (type:float)
p2 : Parameter 2 (meaning depends on event_id, see CAMERA_STATUS_TYPES enum). (type:float)
p3 : Parameter 3 (meaning depends on event_id, see CAMERA_STATUS_TYPES enum). (type:float)
p4 : Parameter 4 (meaning depends on event_id, see CAMERA_STATUS_TYPES enum). (type:float)
'''
return self.send(self.camera_status_encode(time_usec, target_system, cam_idx, img_idx, event_id, p1, p2, p3, p4), force_mavlink1=force_mavlink1)
def camera_feedback_encode(self, time_usec, target_system, cam_idx, img_idx, lat, lng, alt_msl, alt_rel, roll, pitch, yaw, foc_len, flags):
'''
Camera Capture Feedback.
time_usec : Image timestamp (since UNIX epoch), as passed in by CAMERA_STATUS message (or autopilot if no CCB). [us] (type:uint64_t)
target_system : System ID. (type:uint8_t)
cam_idx : Camera ID. (type:uint8_t)
img_idx : Image index. (type:uint16_t)
lat : Latitude. [degE7] (type:int32_t)
lng : Longitude. [degE7] (type:int32_t)
alt_msl : Altitude (MSL). [m] (type:float)
alt_rel : Altitude (Relative to HOME location). [m] (type:float)
roll : Camera Roll angle (earth frame, +-180). [deg] (type:float)
pitch : Camera Pitch angle (earth frame, +-180). [deg] (type:float)
yaw : Camera Yaw (earth frame, 0-360, true). [deg] (type:float)
foc_len : Focal Length. [mm] (type:float)
flags : Feedback flags. (type:uint8_t, values:CAMERA_FEEDBACK_FLAGS)
'''
return MAVLink_camera_feedback_message(time_usec, target_system, cam_idx, img_idx, lat, lng, alt_msl, alt_rel, roll, pitch, yaw, foc_len, flags)
def camera_feedback_send(self, time_usec, target_system, cam_idx, img_idx, lat, lng, alt_msl, alt_rel, roll, pitch, yaw, foc_len, flags, force_mavlink1=False):
'''
Camera Capture Feedback.
time_usec : Image timestamp (since UNIX epoch), as passed in by CAMERA_STATUS message (or autopilot if no CCB). [us] (type:uint64_t)
target_system : System ID. (type:uint8_t)
cam_idx : Camera ID. (type:uint8_t)
img_idx : Image index. (type:uint16_t)
lat : Latitude. [degE7] (type:int32_t)
lng : Longitude. [degE7] (type:int32_t)
alt_msl : Altitude (MSL). [m] (type:float)
alt_rel : Altitude (Relative to HOME location). [m] (type:float)
roll : Camera Roll angle (earth frame, +-180). [deg] (type:float)
pitch : Camera Pitch angle (earth frame, +-180). [deg] (type:float)
yaw : Camera Yaw (earth frame, 0-360, true). [deg] (type:float)
foc_len : Focal Length. [mm] (type:float)
flags : Feedback flags. (type:uint8_t, values:CAMERA_FEEDBACK_FLAGS)
'''
return self.send(self.camera_feedback_encode(time_usec, target_system, cam_idx, img_idx, lat, lng, alt_msl, alt_rel, roll, pitch, yaw, foc_len, flags), force_mavlink1=force_mavlink1)
def battery2_encode(self, voltage, current_battery):
'''
2nd Battery status
voltage : Voltage. [mV] (type:uint16_t)
current_battery : Battery current, -1: autopilot does not measure the current. [cA] (type:int16_t)
'''
return MAVLink_battery2_message(voltage, current_battery)
def battery2_send(self, voltage, current_battery, force_mavlink1=False):
'''
2nd Battery status
voltage : Voltage. [mV] (type:uint16_t)
current_battery : Battery current, -1: autopilot does not measure the current. [cA] (type:int16_t)
'''
return self.send(self.battery2_encode(voltage, current_battery), force_mavlink1=force_mavlink1)
def ahrs3_encode(self, roll, pitch, yaw, altitude, lat, lng, v1, v2, v3, v4):
'''
Status of third AHRS filter if available. This is for ANU research
group (Ali and Sean).
roll : Roll angle. [rad] (type:float)
pitch : Pitch angle. [rad] (type:float)
yaw : Yaw angle. [rad] (type:float)
altitude : Altitude (MSL). [m] (type:float)
lat : Latitude. [degE7] (type:int32_t)
lng : Longitude. [degE7] (type:int32_t)
v1 : Test variable1. (type:float)
v2 : Test variable2. (type:float)
v3 : Test variable3. (type:float)
v4 : Test variable4. (type:float)
'''
return MAVLink_ahrs3_message(roll, pitch, yaw, altitude, lat, lng, v1, v2, v3, v4)
def ahrs3_send(self, roll, pitch, yaw, altitude, lat, lng, v1, v2, v3, v4, force_mavlink1=False):
'''
Status of third AHRS filter if available. This is for ANU research
group (Ali and Sean).
roll : Roll angle. [rad] (type:float)
pitch : Pitch angle. [rad] (type:float)
yaw : Yaw angle. [rad] (type:float)
altitude : Altitude (MSL). [m] (type:float)
lat : Latitude. [degE7] (type:int32_t)
lng : Longitude. [degE7] (type:int32_t)
v1 : Test variable1. (type:float)
v2 : Test variable2. (type:float)
v3 : Test variable3. (type:float)
v4 : Test variable4. (type:float)
'''
return self.send(self.ahrs3_encode(roll, pitch, yaw, altitude, lat, lng, v1, v2, v3, v4), force_mavlink1=force_mavlink1)
def autopilot_version_request_encode(self, target_system, target_component):
'''
Request the autopilot version from the system/component.
target_system : System ID. (type:uint8_t)
target_component : Component ID. (type:uint8_t)
'''
return MAVLink_autopilot_version_request_message(target_system, target_component)
def autopilot_version_request_send(self, target_system, target_component, force_mavlink1=False):
'''
Request the autopilot version from the system/component.
target_system : System ID. (type:uint8_t)
target_component : Component ID. (type:uint8_t)
'''
return self.send(self.autopilot_version_request_encode(target_system, target_component), force_mavlink1=force_mavlink1)
def remote_log_data_block_encode(self, target_system, target_component, seqno, data):
'''
Send a block of log data to remote location.
target_system : System ID. (type:uint8_t)
target_component : Component ID. (type:uint8_t)
seqno : Log data block sequence number. (type:uint32_t, values:MAV_REMOTE_LOG_DATA_BLOCK_COMMANDS)
data : Log data block. (type:uint8_t)
'''
return MAVLink_remote_log_data_block_message(target_system, target_component, seqno, data)
def remote_log_data_block_send(self, target_system, target_component, seqno, data, force_mavlink1=False):
'''
Send a block of log data to remote location.
target_system : System ID. (type:uint8_t)
target_component : Component ID. (type:uint8_t)
seqno : Log data block sequence number. (type:uint32_t, values:MAV_REMOTE_LOG_DATA_BLOCK_COMMANDS)
data : Log data block. (type:uint8_t)
'''
return self.send(self.remote_log_data_block_encode(target_system, target_component, seqno, data), force_mavlink1=force_mavlink1)
def remote_log_block_status_encode(self, target_system, target_component, seqno, status):
'''
Send Status of each log block that autopilot board might have sent.
target_system : System ID. (type:uint8_t)
target_component : Component ID. (type:uint8_t)
seqno : Log data block sequence number. (type:uint32_t)
status : Log data block status. (type:uint8_t, values:MAV_REMOTE_LOG_DATA_BLOCK_STATUSES)
'''
return MAVLink_remote_log_block_status_message(target_system, target_component, seqno, status)
def remote_log_block_status_send(self, target_system, target_component, seqno, status, force_mavlink1=False):
'''
Send Status of each log block that autopilot board might have sent.
target_system : System ID. (type:uint8_t)
target_component : Component ID. (type:uint8_t)
seqno : Log data block sequence number. (type:uint32_t)
status : Log data block status. (type:uint8_t, values:MAV_REMOTE_LOG_DATA_BLOCK_STATUSES)
'''
return self.send(self.remote_log_block_status_encode(target_system, target_component, seqno, status), force_mavlink1=force_mavlink1)
def led_control_encode(self, target_system, target_component, instance, pattern, custom_len, custom_bytes):
'''
Control vehicle LEDs.
target_system : System ID. (type:uint8_t)
target_component : Component ID. (type:uint8_t)
instance : Instance (LED instance to control or 255 for all LEDs). (type:uint8_t)
pattern : Pattern (see LED_PATTERN_ENUM). (type:uint8_t)
custom_len : Custom Byte Length. (type:uint8_t)
custom_bytes : Custom Bytes. (type:uint8_t)
'''
return MAVLink_led_control_message(target_system, target_component, instance, pattern, custom_len, custom_bytes)
def led_control_send(self, target_system, target_component, instance, pattern, custom_len, custom_bytes, force_mavlink1=False):
'''
Control vehicle LEDs.
target_system : System ID. (type:uint8_t)
target_component : Component ID. (type:uint8_t)
instance : Instance (LED instance to control or 255 for all LEDs). (type:uint8_t)
pattern : Pattern (see LED_PATTERN_ENUM). (type:uint8_t)
custom_len : Custom Byte Length. (type:uint8_t)
custom_bytes : Custom Bytes. (type:uint8_t)
'''
return self.send(self.led_control_encode(target_system, target_component, instance, pattern, custom_len, custom_bytes), force_mavlink1=force_mavlink1)
def mag_cal_progress_encode(self, compass_id, cal_mask, cal_status, attempt, completion_pct, completion_mask, direction_x, direction_y, direction_z):
'''
Reports progress of compass calibration.
compass_id : Compass being calibrated. (type:uint8_t)
cal_mask : Bitmask of compasses being calibrated. (type:uint8_t)
cal_status : Calibration Status. (type:uint8_t, values:MAG_CAL_STATUS)
attempt : Attempt number. (type:uint8_t)
completion_pct : Completion percentage. [%] (type:uint8_t)
completion_mask : Bitmask of sphere sections (see http://en.wikipedia.org/wiki/Geodesic_grid). (type:uint8_t)
direction_x : Body frame direction vector for display. (type:float)
direction_y : Body frame direction vector for display. (type:float)
direction_z : Body frame direction vector for display. (type:float)
'''
return MAVLink_mag_cal_progress_message(compass_id, cal_mask, cal_status, attempt, completion_pct, completion_mask, direction_x, direction_y, direction_z)
def mag_cal_progress_send(self, compass_id, cal_mask, cal_status, attempt, completion_pct, completion_mask, direction_x, direction_y, direction_z, force_mavlink1=False):
'''
Reports progress of compass calibration.
compass_id : Compass being calibrated. (type:uint8_t)
cal_mask : Bitmask of compasses being calibrated. (type:uint8_t)
cal_status : Calibration Status. (type:uint8_t, values:MAG_CAL_STATUS)
attempt : Attempt number. (type:uint8_t)
completion_pct : Completion percentage. [%] (type:uint8_t)
completion_mask : Bitmask of sphere sections (see http://en.wikipedia.org/wiki/Geodesic_grid). (type:uint8_t)
direction_x : Body frame direction vector for display. (type:float)
direction_y : Body frame direction vector for display. (type:float)
direction_z : Body frame direction vector for display. (type:float)
'''
return self.send(self.mag_cal_progress_encode(compass_id, cal_mask, cal_status, attempt, completion_pct, completion_mask, direction_x, direction_y, direction_z), force_mavlink1=force_mavlink1)
def mag_cal_report_encode(self, compass_id, cal_mask, cal_status, autosaved, fitness, ofs_x, ofs_y, ofs_z, diag_x, diag_y, diag_z, offdiag_x, offdiag_y, offdiag_z):
'''
Reports results of completed compass calibration. Sent until
MAG_CAL_ACK received.
compass_id : Compass being calibrated. (type:uint8_t)
cal_mask : Bitmask of compasses being calibrated. (type:uint8_t)
cal_status : Calibration Status. (type:uint8_t, values:MAG_CAL_STATUS)
autosaved : 0=requires a MAV_CMD_DO_ACCEPT_MAG_CAL, 1=saved to parameters. (type:uint8_t)
fitness : RMS milligauss residuals. [mgauss] (type:float)
ofs_x : X offset. (type:float)
ofs_y : Y offset. (type:float)
ofs_z : Z offset. (type:float)
diag_x : X diagonal (matrix 11). (type:float)
diag_y : Y diagonal (matrix 22). (type:float)
diag_z : Z diagonal (matrix 33). (type:float)
offdiag_x : X off-diagonal (matrix 12 and 21). (type:float)
offdiag_y : Y off-diagonal (matrix 13 and 31). (type:float)
offdiag_z : Z off-diagonal (matrix 32 and 23). (type:float)
'''
return MAVLink_mag_cal_report_message(compass_id, cal_mask, cal_status, autosaved, fitness, ofs_x, ofs_y, ofs_z, diag_x, diag_y, diag_z, offdiag_x, offdiag_y, offdiag_z)
def mag_cal_report_send(self, compass_id, cal_mask, cal_status, autosaved, fitness, ofs_x, ofs_y, ofs_z, diag_x, diag_y, diag_z, offdiag_x, offdiag_y, offdiag_z, force_mavlink1=False):
'''
Reports results of completed compass calibration. Sent until
MAG_CAL_ACK received.
compass_id : Compass being calibrated. (type:uint8_t)
cal_mask : Bitmask of compasses being calibrated. (type:uint8_t)
cal_status : Calibration Status. (type:uint8_t, values:MAG_CAL_STATUS)
autosaved : 0=requires a MAV_CMD_DO_ACCEPT_MAG_CAL, 1=saved to parameters. (type:uint8_t)
fitness : RMS milligauss residuals. [mgauss] (type:float)
ofs_x : X offset. (type:float)
ofs_y : Y offset. (type:float)
ofs_z : Z offset. (type:float)
diag_x : X diagonal (matrix 11). (type:float)
diag_y : Y diagonal (matrix 22). (type:float)
diag_z : Z diagonal (matrix 33). (type:float)
offdiag_x : X off-diagonal (matrix 12 and 21). (type:float)
offdiag_y : Y off-diagonal (matrix 13 and 31). (type:float)
offdiag_z : Z off-diagonal (matrix 32 and 23). (type:float)
'''
return self.send(self.mag_cal_report_encode(compass_id, cal_mask, cal_status, autosaved, fitness, ofs_x, ofs_y, ofs_z, diag_x, diag_y, diag_z, offdiag_x, offdiag_y, offdiag_z), force_mavlink1=force_mavlink1)
def ekf_status_report_encode(self, flags, velocity_variance, pos_horiz_variance, pos_vert_variance, compass_variance, terrain_alt_variance):
'''
EKF Status message including flags and variances.
flags : Flags. (type:uint16_t, values:EKF_STATUS_FLAGS)
velocity_variance : Velocity variance. (type:float)
pos_horiz_variance : Horizontal Position variance. (type:float)
pos_vert_variance : Vertical Position variance. (type:float)
compass_variance : Compass variance. (type:float)
terrain_alt_variance : Terrain Altitude variance. (type:float)
'''
return MAVLink_ekf_status_report_message(flags, velocity_variance, pos_horiz_variance, pos_vert_variance, compass_variance, terrain_alt_variance)
def ekf_status_report_send(self, flags, velocity_variance, pos_horiz_variance, pos_vert_variance, compass_variance, terrain_alt_variance, force_mavlink1=False):
'''
EKF Status message including flags and variances.
flags : Flags. (type:uint16_t, values:EKF_STATUS_FLAGS)
velocity_variance : Velocity variance. (type:float)
pos_horiz_variance : Horizontal Position variance. (type:float)
pos_vert_variance : Vertical Position variance. (type:float)
compass_variance : Compass variance. (type:float)
terrain_alt_variance : Terrain Altitude variance. (type:float)
'''
return self.send(self.ekf_status_report_encode(flags, velocity_variance, pos_horiz_variance, pos_vert_variance, compass_variance, terrain_alt_variance), force_mavlink1=force_mavlink1)
def pid_tuning_encode(self, axis, desired, achieved, FF, P, I, D):
'''
PID tuning information.
axis : Axis. (type:uint8_t, values:PID_TUNING_AXIS)
desired : Desired rate. (type:float)
achieved : Achieved rate. (type:float)
FF : FF component. (type:float)
P : P component. (type:float)
I : I component. (type:float)
D : D component. (type:float)
'''
return MAVLink_pid_tuning_message(axis, desired, achieved, FF, P, I, D)
def pid_tuning_send(self, axis, desired, achieved, FF, P, I, D, force_mavlink1=False):
'''
PID tuning information.
axis : Axis. (type:uint8_t, values:PID_TUNING_AXIS)
desired : Desired rate. (type:float)
achieved : Achieved rate. (type:float)
FF : FF component. (type:float)
P : P component. (type:float)
I : I component. (type:float)
D : D component. (type:float)
'''
return self.send(self.pid_tuning_encode(axis, desired, achieved, FF, P, I, D), force_mavlink1=force_mavlink1)
def deepstall_encode(self, landing_lat, landing_lon, path_lat, path_lon, arc_entry_lat, arc_entry_lon, altitude, expected_travel_distance, cross_track_error, stage):
'''
Deepstall path planning.
landing_lat : Landing latitude. [degE7] (type:int32_t)
landing_lon : Landing longitude. [degE7] (type:int32_t)
path_lat : Final heading start point, latitude. [degE7] (type:int32_t)
path_lon : Final heading start point, longitude. [degE7] (type:int32_t)
arc_entry_lat : Arc entry point, latitude. [degE7] (type:int32_t)
arc_entry_lon : Arc entry point, longitude. [degE7] (type:int32_t)
altitude : Altitude. [m] (type:float)
expected_travel_distance : Distance the aircraft expects to travel during the deepstall. [m] (type:float)
cross_track_error : Deepstall cross track error (only valid when in DEEPSTALL_STAGE_LAND). [m] (type:float)
stage : Deepstall stage. (type:uint8_t, values:DEEPSTALL_STAGE)
'''
return MAVLink_deepstall_message(landing_lat, landing_lon, path_lat, path_lon, arc_entry_lat, arc_entry_lon, altitude, expected_travel_distance, cross_track_error, stage)
def deepstall_send(self, landing_lat, landing_lon, path_lat, path_lon, arc_entry_lat, arc_entry_lon, altitude, expected_travel_distance, cross_track_error, stage, force_mavlink1=False):
'''
Deepstall path planning.
landing_lat : Landing latitude. [degE7] (type:int32_t)
landing_lon : Landing longitude. [degE7] (type:int32_t)
path_lat : Final heading start point, latitude. [degE7] (type:int32_t)
path_lon : Final heading start point, longitude. [degE7] (type:int32_t)
arc_entry_lat : Arc entry point, latitude. [degE7] (type:int32_t)
arc_entry_lon : Arc entry point, longitude. [degE7] (type:int32_t)
altitude : Altitude. [m] (type:float)
expected_travel_distance : Distance the aircraft expects to travel during the deepstall. [m] (type:float)
cross_track_error : Deepstall cross track error (only valid when in DEEPSTALL_STAGE_LAND). [m] (type:float)
stage : Deepstall stage. (type:uint8_t, values:DEEPSTALL_STAGE)
'''
return self.send(self.deepstall_encode(landing_lat, landing_lon, path_lat, path_lon, arc_entry_lat, arc_entry_lon, altitude, expected_travel_distance, cross_track_error, stage), force_mavlink1=force_mavlink1)
def gimbal_report_encode(self, target_system, target_component, delta_time, delta_angle_x, delta_angle_y, delta_angle_z, delta_velocity_x, delta_velocity_y, delta_velocity_z, joint_roll, joint_el, joint_az):
'''
3 axis gimbal measurements.
target_system : System ID. (type:uint8_t)
target_component : Component ID. (type:uint8_t)
delta_time : Time since last update. [s] (type:float)
delta_angle_x : Delta angle X. [rad] (type:float)
delta_angle_y : Delta angle Y. [rad] (type:float)
delta_angle_z : Delta angle X. [rad] (type:float)
delta_velocity_x : Delta velocity X. [m/s] (type:float)
delta_velocity_y : Delta velocity Y. [m/s] (type:float)
delta_velocity_z : Delta velocity Z. [m/s] (type:float)
joint_roll : Joint ROLL. [rad] (type:float)
joint_el : Joint EL. [rad] (type:float)
joint_az : Joint AZ. [rad] (type:float)
'''
return MAVLink_gimbal_report_message(target_system, target_component, delta_time, delta_angle_x, delta_angle_y, delta_angle_z, delta_velocity_x, delta_velocity_y, delta_velocity_z, joint_roll, joint_el, joint_az)
def gimbal_report_send(self, target_system, target_component, delta_time, delta_angle_x, delta_angle_y, delta_angle_z, delta_velocity_x, delta_velocity_y, delta_velocity_z, joint_roll, joint_el, joint_az, force_mavlink1=False):
'''
3 axis gimbal measurements.
target_system : System ID. (type:uint8_t)
target_component : Component ID. (type:uint8_t)
delta_time : Time since last update. [s] (type:float)
delta_angle_x : Delta angle X. [rad] (type:float)
delta_angle_y : Delta angle Y. [rad] (type:float)
delta_angle_z : Delta angle X. [rad] (type:float)
delta_velocity_x : Delta velocity X. [m/s] (type:float)
delta_velocity_y : Delta velocity Y. [m/s] (type:float)
delta_velocity_z : Delta velocity Z. [m/s] (type:float)
joint_roll : Joint ROLL. [rad] (type:float)
joint_el : Joint EL. [rad] (type:float)
joint_az : Joint AZ. [rad] (type:float)
'''
return self.send(self.gimbal_report_encode(target_system, target_component, delta_time, delta_angle_x, delta_angle_y, delta_angle_z, delta_velocity_x, delta_velocity_y, delta_velocity_z, joint_roll, joint_el, joint_az), force_mavlink1=force_mavlink1)
def gimbal_control_encode(self, target_system, target_component, demanded_rate_x, demanded_rate_y, demanded_rate_z):
'''
Control message for rate gimbal.
target_system : System ID. (type:uint8_t)
target_component : Component ID. (type:uint8_t)
demanded_rate_x : Demanded angular rate X. [rad/s] (type:float)
demanded_rate_y : Demanded angular rate Y. [rad/s] (type:float)
demanded_rate_z : Demanded angular rate Z. [rad/s] (type:float)
'''
return MAVLink_gimbal_control_message(target_system, target_component, demanded_rate_x, demanded_rate_y, demanded_rate_z)
def gimbal_control_send(self, target_system, target_component, demanded_rate_x, demanded_rate_y, demanded_rate_z, force_mavlink1=False):
'''
Control message for rate gimbal.
target_system : System ID. (type:uint8_t)
target_component : Component ID. (type:uint8_t)
demanded_rate_x : Demanded angular rate X. [rad/s] (type:float)
demanded_rate_y : Demanded angular rate Y. [rad/s] (type:float)
demanded_rate_z : Demanded angular rate Z. [rad/s] (type:float)
'''
return self.send(self.gimbal_control_encode(target_system, target_component, demanded_rate_x, demanded_rate_y, demanded_rate_z), force_mavlink1=force_mavlink1)
def gimbal_torque_cmd_report_encode(self, target_system, target_component, rl_torque_cmd, el_torque_cmd, az_torque_cmd):
'''
100 Hz gimbal torque command telemetry.
target_system : System ID. (type:uint8_t)
target_component : Component ID. (type:uint8_t)
rl_torque_cmd : Roll Torque Command. (type:int16_t)
el_torque_cmd : Elevation Torque Command. (type:int16_t)
az_torque_cmd : Azimuth Torque Command. (type:int16_t)
'''
return MAVLink_gimbal_torque_cmd_report_message(target_system, target_component, rl_torque_cmd, el_torque_cmd, az_torque_cmd)
def gimbal_torque_cmd_report_send(self, target_system, target_component, rl_torque_cmd, el_torque_cmd, az_torque_cmd, force_mavlink1=False):
'''
100 Hz gimbal torque command telemetry.
target_system : System ID. (type:uint8_t)
target_component : Component ID. (type:uint8_t)
rl_torque_cmd : Roll Torque Command. (type:int16_t)
el_torque_cmd : Elevation Torque Command. (type:int16_t)
az_torque_cmd : Azimuth Torque Command. (type:int16_t)
'''
return self.send(self.gimbal_torque_cmd_report_encode(target_system, target_component, rl_torque_cmd, el_torque_cmd, az_torque_cmd), force_mavlink1=force_mavlink1)
def gopro_heartbeat_encode(self, status, capture_mode, flags):
'''
Heartbeat from a HeroBus attached GoPro.
status : Status. (type:uint8_t, values:GOPRO_HEARTBEAT_STATUS)
capture_mode : Current capture mode. (type:uint8_t, values:GOPRO_CAPTURE_MODE)
flags : Additional status bits. (type:uint8_t, values:GOPRO_HEARTBEAT_FLAGS)
'''
return MAVLink_gopro_heartbeat_message(status, capture_mode, flags)
def gopro_heartbeat_send(self, status, capture_mode, flags, force_mavlink1=False):
'''
Heartbeat from a HeroBus attached GoPro.
status : Status. (type:uint8_t, values:GOPRO_HEARTBEAT_STATUS)
capture_mode : Current capture mode. (type:uint8_t, values:GOPRO_CAPTURE_MODE)
flags : Additional status bits. (type:uint8_t, values:GOPRO_HEARTBEAT_FLAGS)
'''
return self.send(self.gopro_heartbeat_encode(status, capture_mode, flags), force_mavlink1=force_mavlink1)
def gopro_get_request_encode(self, target_system, target_component, cmd_id):
'''
Request a GOPRO_COMMAND response from the GoPro.
target_system : System ID. (type:uint8_t)
target_component : Component ID. (type:uint8_t)
cmd_id : Command ID. (type:uint8_t, values:GOPRO_COMMAND)
'''
return MAVLink_gopro_get_request_message(target_system, target_component, cmd_id)
def gopro_get_request_send(self, target_system, target_component, cmd_id, force_mavlink1=False):
'''
Request a GOPRO_COMMAND response from the GoPro.
target_system : System ID. (type:uint8_t)
target_component : Component ID. (type:uint8_t)
cmd_id : Command ID. (type:uint8_t, values:GOPRO_COMMAND)
'''
return self.send(self.gopro_get_request_encode(target_system, target_component, cmd_id), force_mavlink1=force_mavlink1)
def gopro_get_response_encode(self, cmd_id, status, value):
'''
Response from a GOPRO_COMMAND get request.
cmd_id : Command ID. (type:uint8_t, values:GOPRO_COMMAND)
status : Status. (type:uint8_t, values:GOPRO_REQUEST_STATUS)
value : Value. (type:uint8_t)
'''
return MAVLink_gopro_get_response_message(cmd_id, status, value)
def gopro_get_response_send(self, cmd_id, status, value, force_mavlink1=False):
'''
Response from a GOPRO_COMMAND get request.
cmd_id : Command ID. (type:uint8_t, values:GOPRO_COMMAND)
status : Status. (type:uint8_t, values:GOPRO_REQUEST_STATUS)
value : Value. (type:uint8_t)
'''
return self.send(self.gopro_get_response_encode(cmd_id, status, value), force_mavlink1=force_mavlink1)
def gopro_set_request_encode(self, target_system, target_component, cmd_id, value):
'''
Request to set a GOPRO_COMMAND with a desired.
target_system : System ID. (type:uint8_t)
target_component : Component ID. (type:uint8_t)
cmd_id : Command ID. (type:uint8_t, values:GOPRO_COMMAND)
value : Value. (type:uint8_t)
'''
return MAVLink_gopro_set_request_message(target_system, target_component, cmd_id, value)
def gopro_set_request_send(self, target_system, target_component, cmd_id, value, force_mavlink1=False):
'''
Request to set a GOPRO_COMMAND with a desired.
target_system : System ID. (type:uint8_t)
target_component : Component ID. (type:uint8_t)
cmd_id : Command ID. (type:uint8_t, values:GOPRO_COMMAND)
value : Value. (type:uint8_t)
'''
return self.send(self.gopro_set_request_encode(target_system, target_component, cmd_id, value), force_mavlink1=force_mavlink1)
def gopro_set_response_encode(self, cmd_id, status):
'''
Response from a GOPRO_COMMAND set request.
cmd_id : Command ID. (type:uint8_t, values:GOPRO_COMMAND)
status : Status. (type:uint8_t, values:GOPRO_REQUEST_STATUS)
'''
return MAVLink_gopro_set_response_message(cmd_id, status)
def gopro_set_response_send(self, cmd_id, status, force_mavlink1=False):
'''
Response from a GOPRO_COMMAND set request.
cmd_id : Command ID. (type:uint8_t, values:GOPRO_COMMAND)
status : Status. (type:uint8_t, values:GOPRO_REQUEST_STATUS)
'''
return self.send(self.gopro_set_response_encode(cmd_id, status), force_mavlink1=force_mavlink1)
def efi_status_encode(self, health, ecu_index, rpm, fuel_consumed, fuel_flow, engine_load, throttle_position, spark_dwell_time, barometric_pressure, intake_manifold_pressure, intake_manifold_temperature, cylinder_head_temperature, ignition_timing, injection_time, exhaust_gas_temperature, throttle_out, pt_compensation):
'''
EFI status output
health : EFI health status (type:uint8_t)
ecu_index : ECU index (type:float)
rpm : RPM (type:float)
fuel_consumed : Fuel consumed [g] (type:float)
fuel_flow : Fuel flow rate [g/min] (type:float)
engine_load : Engine load [%] (type:float)
throttle_position : Throttle position [%] (type:float)
spark_dwell_time : Spark dwell time [ms] (type:float)
barometric_pressure : Barometric pressure [kPa] (type:float)
intake_manifold_pressure : Intake manifold pressure( [kPa] (type:float)
intake_manifold_temperature : Intake manifold temperature [degC] (type:float)
cylinder_head_temperature : Cylinder head temperature [degC] (type:float)
ignition_timing : Ignition timing (Crank angle degrees) [deg] (type:float)
injection_time : Injection time [ms] (type:float)
exhaust_gas_temperature : Exhaust gas temperature [degC] (type:float)
throttle_out : Output throttle [%] (type:float)
pt_compensation : Pressure/temperature compensation (type:float)
'''
return MAVLink_efi_status_message(health, ecu_index, rpm, fuel_consumed, fuel_flow, engine_load, throttle_position, spark_dwell_time, barometric_pressure, intake_manifold_pressure, intake_manifold_temperature, cylinder_head_temperature, ignition_timing, injection_time, exhaust_gas_temperature, throttle_out, pt_compensation)
def efi_status_send(self, health, ecu_index, rpm, fuel_consumed, fuel_flow, engine_load, throttle_position, spark_dwell_time, barometric_pressure, intake_manifold_pressure, intake_manifold_temperature, cylinder_head_temperature, ignition_timing, injection_time, exhaust_gas_temperature, throttle_out, pt_compensation, force_mavlink1=False):
'''
EFI status output
health : EFI health status (type:uint8_t)
ecu_index : ECU index (type:float)
rpm : RPM (type:float)
fuel_consumed : Fuel consumed [g] (type:float)
fuel_flow : Fuel flow rate [g/min] (type:float)
engine_load : Engine load [%] (type:float)
throttle_position : Throttle position [%] (type:float)
spark_dwell_time : Spark dwell time [ms] (type:float)
barometric_pressure : Barometric pressure [kPa] (type:float)
intake_manifold_pressure : Intake manifold pressure( [kPa] (type:float)
intake_manifold_temperature : Intake manifold temperature [degC] (type:float)
cylinder_head_temperature : Cylinder head temperature [degC] (type:float)
ignition_timing : Ignition timing (Crank angle degrees) [deg] (type:float)
injection_time : Injection time [ms] (type:float)
exhaust_gas_temperature : Exhaust gas temperature [degC] (type:float)
throttle_out : Output throttle [%] (type:float)
pt_compensation : Pressure/temperature compensation (type:float)
'''
return self.send(self.efi_status_encode(health, ecu_index, rpm, fuel_consumed, fuel_flow, engine_load, throttle_position, spark_dwell_time, barometric_pressure, intake_manifold_pressure, intake_manifold_temperature, cylinder_head_temperature, ignition_timing, injection_time, exhaust_gas_temperature, throttle_out, pt_compensation), force_mavlink1=force_mavlink1)
def rpm_encode(self, rpm1, rpm2):
'''
RPM sensor output.
rpm1 : RPM Sensor1. (type:float)
rpm2 : RPM Sensor2. (type:float)
'''
return MAVLink_rpm_message(rpm1, rpm2)
def rpm_send(self, rpm1, rpm2, force_mavlink1=False):
'''
RPM sensor output.
rpm1 : RPM Sensor1. (type:float)
rpm2 : RPM Sensor2. (type:float)
'''
return self.send(self.rpm_encode(rpm1, rpm2), force_mavlink1=force_mavlink1)
def heartbeat_encode(self, type, autopilot, base_mode, custom_mode, system_status, mavlink_version=3):
'''
The heartbeat message shows that a system or component is present and
responding. The type and autopilot fields (along with
the message component id), allow the receiving system
to treat further messages from this system
appropriately (e.g. by laying out the user interface
based on the autopilot). This microservice is
documented at
https://mavlink.io/en/services/heartbeat.html
type : Vehicle or component type. For a flight controller component the vehicle type (quadrotor, helicopter, etc.). For other components the component type (e.g. camera, gimbal, etc.). This should be used in preference to component id for identifying the component type. (type:uint8_t, values:MAV_TYPE)
autopilot : Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers. (type:uint8_t, values:MAV_AUTOPILOT)
base_mode : System mode bitmap. (type:uint8_t, values:MAV_MODE_FLAG)
custom_mode : A bitfield for use for autopilot-specific flags (type:uint32_t)
system_status : System status flag. (type:uint8_t, values:MAV_STATE)
mavlink_version : MAVLink version, not writable by user, gets added by protocol because of magic data type: uint8_t_mavlink_version (type:uint8_t)
'''
return MAVLink_heartbeat_message(type, autopilot, base_mode, custom_mode, system_status, mavlink_version)
def heartbeat_send(self, type, autopilot, base_mode, custom_mode, system_status, mavlink_version=3, force_mavlink1=False):
'''
The heartbeat message shows that a system or component is present and
responding. The type and autopilot fields (along with
the message component id), allow the receiving system
to treat further messages from this system
appropriately (e.g. by laying out the user interface
based on the autopilot). This microservice is
documented at
https://mavlink.io/en/services/heartbeat.html
type : Vehicle or component type. For a flight controller component the vehicle type (quadrotor, helicopter, etc.). For other components the component type (e.g. camera, gimbal, etc.). This should be used in preference to component id for identifying the component type. (type:uint8_t, values:MAV_TYPE)
autopilot : Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers. (type:uint8_t, values:MAV_AUTOPILOT)
base_mode : System mode bitmap. (type:uint8_t, values:MAV_MODE_FLAG)
custom_mode : A bitfield for use for autopilot-specific flags (type:uint32_t)
system_status : System status flag. (type:uint8_t, values:MAV_STATE)
mavlink_version : MAVLink version, not writable by user, gets added by protocol because of magic data type: uint8_t_mavlink_version (type:uint8_t)
'''
return self.send(self.heartbeat_encode(type, autopilot, base_mode, custom_mode, system_status, mavlink_version), force_mavlink1=force_mavlink1)
def sys_status_encode(self, onboard_control_sensors_present, onboard_control_sensors_enabled, onboard_control_sensors_health, load, voltage_battery, current_battery, battery_remaining, drop_rate_comm, errors_comm, errors_count1, errors_count2, errors_count3, errors_count4):
'''
The general system state. If the system is following the MAVLink
standard, the system state is mainly defined by three
orthogonal states/modes: The system mode, which is
either LOCKED (motors shut down and locked), MANUAL
(system under RC control), GUIDED (system with
autonomous position control, position setpoint
controlled manually) or AUTO (system guided by
path/waypoint planner). The NAV_MODE defined the
current flight state: LIFTOFF (often an open-loop
maneuver), LANDING, WAYPOINTS or VECTOR. This
represents the internal navigation state machine. The
system status shows whether the system is currently
active or not and if an emergency occurred. During the
CRITICAL and EMERGENCY states the MAV is still
considered to be active, but should start emergency
procedures autonomously. After a failure occurred it
should first move from active to critical to allow
manual intervention and then move to emergency after a
certain timeout.
onboard_control_sensors_present : Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present. (type:uint32_t, values:MAV_SYS_STATUS_SENSOR)
onboard_control_sensors_enabled : Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled. (type:uint32_t, values:MAV_SYS_STATUS_SENSOR)
onboard_control_sensors_health : Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy. (type:uint32_t, values:MAV_SYS_STATUS_SENSOR)
load : Maximum usage in percent of the mainloop time. Values: [0-1000] - should always be below 1000 [d%] (type:uint16_t)
voltage_battery : Battery voltage, UINT16_MAX: Voltage not sent by autopilot [mV] (type:uint16_t)
current_battery : Battery current, -1: Current not sent by autopilot [cA] (type:int16_t)
battery_remaining : Battery energy remaining, -1: Battery remaining energy not sent by autopilot [%] (type:int8_t)
drop_rate_comm : Communication drop rate, (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV) [c%] (type:uint16_t)
errors_comm : Communication errors (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV) (type:uint16_t)
errors_count1 : Autopilot-specific errors (type:uint16_t)
errors_count2 : Autopilot-specific errors (type:uint16_t)
errors_count3 : Autopilot-specific errors (type:uint16_t)
errors_count4 : Autopilot-specific errors (type:uint16_t)
'''
return MAVLink_sys_status_message(onboard_control_sensors_present, onboard_control_sensors_enabled, onboard_control_sensors_health, load, voltage_battery, current_battery, battery_remaining, drop_rate_comm, errors_comm, errors_count1, errors_count2, errors_count3, errors_count4)
def sys_status_send(self, onboard_control_sensors_present, onboard_control_sensors_enabled, onboard_control_sensors_health, load, voltage_battery, current_battery, battery_remaining, drop_rate_comm, errors_comm, errors_count1, errors_count2, errors_count3, errors_count4, force_mavlink1=False):
'''
The general system state. If the system is following the MAVLink
standard, the system state is mainly defined by three
orthogonal states/modes: The system mode, which is
either LOCKED (motors shut down and locked), MANUAL
(system under RC control), GUIDED (system with
autonomous position control, position setpoint
controlled manually) or AUTO (system guided by
path/waypoint planner). The NAV_MODE defined the
current flight state: LIFTOFF (often an open-loop
maneuver), LANDING, WAYPOINTS or VECTOR. This
represents the internal navigation state machine. The
system status shows whether the system is currently
active or not and if an emergency occurred. During the
CRITICAL and EMERGENCY states the MAV is still
considered to be active, but should start emergency
procedures autonomously. After a failure occurred it
should first move from active to critical to allow
manual intervention and then move to emergency after a
certain timeout.
onboard_control_sensors_present : Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present. (type:uint32_t, values:MAV_SYS_STATUS_SENSOR)
onboard_control_sensors_enabled : Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled. (type:uint32_t, values:MAV_SYS_STATUS_SENSOR)
onboard_control_sensors_health : Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy. (type:uint32_t, values:MAV_SYS_STATUS_SENSOR)
load : Maximum usage in percent of the mainloop time. Values: [0-1000] - should always be below 1000 [d%] (type:uint16_t)
voltage_battery : Battery voltage, UINT16_MAX: Voltage not sent by autopilot [mV] (type:uint16_t)
current_battery : Battery current, -1: Current not sent by autopilot [cA] (type:int16_t)
battery_remaining : Battery energy remaining, -1: Battery remaining energy not sent by autopilot [%] (type:int8_t)
drop_rate_comm : Communication drop rate, (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV) [c%] (type:uint16_t)
errors_comm : Communication errors (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV) (type:uint16_t)
errors_count1 : Autopilot-specific errors (type:uint16_t)
errors_count2 : Autopilot-specific errors (type:uint16_t)
errors_count3 : Autopilot-specific errors (type:uint16_t)
errors_count4 : Autopilot-specific errors (type:uint16_t)
'''
return self.send(self.sys_status_encode(onboard_control_sensors_present, onboard_control_sensors_enabled, onboard_control_sensors_health, load, voltage_battery, current_battery, battery_remaining, drop_rate_comm, errors_comm, errors_count1, errors_count2, errors_count3, errors_count4), force_mavlink1=force_mavlink1)
def system_time_encode(self, time_unix_usec, time_boot_ms):
'''
The system time is the time of the master clock, typically the
computer clock of the main onboard computer.
time_unix_usec : Timestamp (UNIX epoch time). [us] (type:uint64_t)
time_boot_ms : Timestamp (time since system boot). [ms] (type:uint32_t)
'''
return MAVLink_system_time_message(time_unix_usec, time_boot_ms)
def system_time_send(self, time_unix_usec, time_boot_ms, force_mavlink1=False):
'''
The system time is the time of the master clock, typically the
computer clock of the main onboard computer.
time_unix_usec : Timestamp (UNIX epoch time). [us] (type:uint64_t)
time_boot_ms : Timestamp (time since system boot). [ms] (type:uint32_t)
'''
return self.send(self.system_time_encode(time_unix_usec, time_boot_ms), force_mavlink1=force_mavlink1)
def ping_encode(self, time_usec, seq, target_system, target_component):
'''
A ping message either requesting or responding to a ping. This allows
to measure the system latencies, including serial
port, radio modem and UDP connections. The ping
microservice is documented at
https://mavlink.io/en/services/ping.html
time_usec : 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. [us] (type:uint64_t)
seq : PING sequence (type:uint32_t)
target_system : 0: request ping from all receiving systems. If greater than 0: message is a ping response and number is the system id of the requesting system (type:uint8_t)
target_component : 0: request ping from all receiving components. If greater than 0: message is a ping response and number is the component id of the requesting component. (type:uint8_t)
'''
return MAVLink_ping_message(time_usec, seq, target_system, target_component)
def ping_send(self, time_usec, seq, target_system, target_component, force_mavlink1=False):
'''
A ping message either requesting or responding to a ping. This allows
to measure the system latencies, including serial
port, radio modem and UDP connections. The ping
microservice is documented at
https://mavlink.io/en/services/ping.html
time_usec : 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. [us] (type:uint64_t)
seq : PING sequence (type:uint32_t)
target_system : 0: request ping from all receiving systems. If greater than 0: message is a ping response and number is the system id of the requesting system (type:uint8_t)
target_component : 0: request ping from all receiving components. If greater than 0: message is a ping response and number is the component id of the requesting component. (type:uint8_t)
'''
return self.send(self.ping_encode(time_usec, seq, target_system, target_component), force_mavlink1=force_mavlink1)
def change_operator_control_encode(self, target_system, control_request, version, passkey):
'''
Request to control this MAV
target_system : System the GCS requests control for (type:uint8_t)
control_request : 0: request control of this MAV, 1: Release control of this MAV (type: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. [rad] (type:uint8_t)
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 "!?,.-" (type:char)
'''
return MAVLink_change_operator_control_message(target_system, control_request, version, passkey)
def change_operator_control_send(self, target_system, control_request, version, passkey, force_mavlink1=False):
'''
Request to control this MAV
target_system : System the GCS requests control for (type:uint8_t)
control_request : 0: request control of this MAV, 1: Release control of this MAV (type: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. [rad] (type:uint8_t)
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 "!?,.-" (type:char)
'''
return self.send(self.change_operator_control_encode(target_system, control_request, version, passkey), force_mavlink1=force_mavlink1)
def change_operator_control_ack_encode(self, gcs_system_id, control_request, ack):
'''
Accept / deny control of this MAV
gcs_system_id : ID of the GCS this message (type:uint8_t)
control_request : 0: request control of this MAV, 1: Release control of this MAV (type:uint8_t)
ack : 0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control (type:uint8_t)
'''
return MAVLink_change_operator_control_ack_message(gcs_system_id, control_request, ack)
def change_operator_control_ack_send(self, gcs_system_id, control_request, ack, force_mavlink1=False):
'''
Accept / deny control of this MAV
gcs_system_id : ID of the GCS this message (type:uint8_t)
control_request : 0: request control of this MAV, 1: Release control of this MAV (type:uint8_t)
ack : 0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control (type:uint8_t)
'''
return self.send(self.change_operator_control_ack_encode(gcs_system_id, control_request, ack), force_mavlink1=force_mavlink1)
def auth_key_encode(self, key):
'''
Emit an encrypted signature / key identifying this system. PLEASE
NOTE: This protocol has been kept simple, so
transmitting the key requires an encrypted channel for
true safety.
key : key (type:char)
'''
return MAVLink_auth_key_message(key)
def auth_key_send(self, key, force_mavlink1=False):
'''
Emit an encrypted signature / key identifying this system. PLEASE
NOTE: This protocol has been kept simple, so
transmitting the key requires an encrypted channel for
true safety.
key : key (type:char)
'''
return self.send(self.auth_key_encode(key), force_mavlink1=force_mavlink1)
def set_mode_encode(self, target_system, base_mode, custom_mode):
'''
Set the system mode, as defined by enum MAV_MODE. There is no target
component id as the mode is by definition for the
overall aircraft, not only for one component.
target_system : The system setting the mode (type:uint8_t)
base_mode : The new base mode. (type:uint8_t, values:MAV_MODE)
custom_mode : The new autopilot-specific mode. This field can be ignored by an autopilot. (type:uint32_t)
'''
return MAVLink_set_mode_message(target_system, base_mode, custom_mode)
def set_mode_send(self, target_system, base_mode, custom_mode, force_mavlink1=False):
'''
Set the system mode, as defined by enum MAV_MODE. There is no target
component id as the mode is by definition for the
overall aircraft, not only for one component.
target_system : The system setting the mode (type:uint8_t)
base_mode : The new base mode. (type:uint8_t, values:MAV_MODE)
custom_mode : The new autopilot-specific mode. This field can be ignored by an autopilot. (type:uint32_t)
'''
return self.send(self.set_mode_encode(target_system, base_mode, custom_mode), force_mavlink1=force_mavlink1)
def param_request_read_encode(self, target_system, target_component, param_id, param_index):
'''
Request to read the onboard parameter with the param_id string id.
Onboard parameters are stored as key[const char*] ->
value[float]. This allows to send a parameter to any
other component (such as the GCS) without the need of
previous knowledge of possible parameter names. Thus
the same GCS can store different parameters for
different autopilots. See also
https://mavlink.io/en/services/parameter.html for a
full documentation of QGroundControl and IMU code.
target_system : System ID (type:uint8_t)
target_component : Component ID (type:uint8_t)
param_id : Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string (type:char)
param_index : Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored) (type:int16_t)
'''
return MAVLink_param_request_read_message(target_system, target_component, param_id, param_index)
def param_request_read_send(self, target_system, target_component, param_id, param_index, force_mavlink1=False):
'''
Request to read the onboard parameter with the param_id string id.
Onboard parameters are stored as key[const char*] ->
value[float]. This allows to send a parameter to any
other component (such as the GCS) without the need of
previous knowledge of possible parameter names. Thus
the same GCS can store different parameters for
different autopilots. See also
https://mavlink.io/en/services/parameter.html for a
full documentation of QGroundControl and IMU code.
target_system : System ID (type:uint8_t)
target_component : Component ID (type:uint8_t)
param_id : Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string (type:char)
param_index : Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored) (type:int16_t)
'''
return self.send(self.param_request_read_encode(target_system, target_component, param_id, param_index), force_mavlink1=force_mavlink1)
def param_request_list_encode(self, target_system, target_component):
'''
Request all parameters of this component. After this request, all
parameters are emitted. The parameter microservice is
documented at
https://mavlink.io/en/services/parameter.html
target_system : System ID (type:uint8_t)
target_component : Component ID (type:uint8_t)
'''
return MAVLink_param_request_list_message(target_system, target_component)
def param_request_list_send(self, target_system, target_component, force_mavlink1=False):
'''
Request all parameters of this component. After this request, all
parameters are emitted. The parameter microservice is
documented at
https://mavlink.io/en/services/parameter.html
target_system : System ID (type:uint8_t)
target_component : Component ID (type:uint8_t)
'''
return self.send(self.param_request_list_encode(target_system, target_component), force_mavlink1=force_mavlink1)
def param_value_encode(self, param_id, param_value, param_type, param_count, param_index):
'''
Emit the value of a onboard parameter. The inclusion of param_count
and param_index in the message allows the recipient to
keep track of received parameters and allows him to
re-request missing parameters after a loss or timeout.
The parameter microservice is documented at
https://mavlink.io/en/services/parameter.html
param_id : Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string (type:char)
param_value : Onboard parameter value (type:float)
param_type : Onboard parameter type. (type:uint8_t, values:MAV_PARAM_TYPE)
param_count : Total number of onboard parameters (type:uint16_t)
param_index : Index of this onboard parameter (type:uint16_t)
'''
return MAVLink_param_value_message(param_id, param_value, param_type, param_count, param_index)
def param_value_send(self, param_id, param_value, param_type, param_count, param_index, force_mavlink1=False):
'''
Emit the value of a onboard parameter. The inclusion of param_count
and param_index in the message allows the recipient to
keep track of received parameters and allows him to
re-request missing parameters after a loss or timeout.
The parameter microservice is documented at
https://mavlink.io/en/services/parameter.html
param_id : Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string (type:char)
param_value : Onboard parameter value (type:float)
param_type : Onboard parameter type. (type:uint8_t, values:MAV_PARAM_TYPE)
param_count : Total number of onboard parameters (type:uint16_t)
param_index : Index of this onboard parameter (type:uint16_t)
'''
return self.send(self.param_value_encode(param_id, param_value, param_type, param_count, param_index), force_mavlink1=force_mavlink1)
def param_set_encode(self, target_system, target_component, param_id, param_value, param_type):
'''
Set a parameter value (write new value to permanent storage).
IMPORTANT: The receiving component should acknowledge
the new parameter value by sending a PARAM_VALUE
message to all communication partners. This will also
ensure that multiple GCS all have an up-to-date list
of all parameters. If the sending GCS did not receive
a PARAM_VALUE message within its timeout time, it
should re-send the PARAM_SET message. The parameter
microservice is documented at
https://mavlink.io/en/services/parameter.html
target_system : System ID (type:uint8_t)
target_component : Component ID (type:uint8_t)
param_id : Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string (type:char)
param_value : Onboard parameter value (type:float)
param_type : Onboard parameter type. (type:uint8_t, values:MAV_PARAM_TYPE)
'''
return MAVLink_param_set_message(target_system, target_component, param_id, param_value, param_type)
def param_set_send(self, target_system, target_component, param_id, param_value, param_type, force_mavlink1=False):
'''
Set a parameter value (write new value to permanent storage).
IMPORTANT: The receiving component should acknowledge
the new parameter value by sending a PARAM_VALUE
message to all communication partners. This will also
ensure that multiple GCS all have an up-to-date list
of all parameters. If the sending GCS did not receive
a PARAM_VALUE message within its timeout time, it
should re-send the PARAM_SET message. The parameter
microservice is documented at
https://mavlink.io/en/services/parameter.html
target_system : System ID (type:uint8_t)
target_component : Component ID (type:uint8_t)
param_id : Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string (type:char)
param_value : Onboard parameter value (type:float)
param_type : Onboard parameter type. (type:uint8_t, values:MAV_PARAM_TYPE)
'''
return self.send(self.param_set_encode(target_system, target_component, param_id, param_value, param_type), force_mavlink1=force_mavlink1)
def gps_raw_int_encode(self, time_usec, fix_type, lat, lon, alt, eph, epv, vel, cog, satellites_visible):
'''
The global position, as returned by the Global Positioning System
(GPS). This is NOT the global position
estimate of the system, but rather a RAW sensor value.
See message GLOBAL_POSITION for the global position
estimate.
time_usec : 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. [us] (type:uint64_t)
fix_type : GPS fix type. (type:uint8_t, values:GPS_FIX_TYPE)
lat : Latitude (WGS84, EGM96 ellipsoid) [degE7] (type:int32_t)
lon : Longitude (WGS84, EGM96 ellipsoid) [degE7] (type:int32_t)
alt : Altitude (MSL). Positive for up. Note that virtually all GPS modules provide the MSL altitude in addition to the WGS84 altitude. [mm] (type:int32_t)
eph : GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX (type:uint16_t)
epv : GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX (type:uint16_t)
vel : GPS ground speed. If unknown, set to: UINT16_MAX [cm/s] (type: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 [cdeg] (type:uint16_t)
satellites_visible : Number of satellites visible. If unknown, set to 255 (type:uint8_t)
'''
return MAVLink_gps_raw_int_message(time_usec, fix_type, lat, lon, alt, eph, epv, vel, cog, satellites_visible)
def gps_raw_int_send(self, time_usec, fix_type, lat, lon, alt, eph, epv, vel, cog, satellites_visible, force_mavlink1=False):
'''
The global position, as returned by the Global Positioning System
(GPS). This is NOT the global position
estimate of the system, but rather a RAW sensor value.
See message GLOBAL_POSITION for the global position
estimate.
time_usec : 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. [us] (type:uint64_t)
fix_type : GPS fix type. (type:uint8_t, values:GPS_FIX_TYPE)
lat : Latitude (WGS84, EGM96 ellipsoid) [degE7] (type:int32_t)
lon : Longitude (WGS84, EGM96 ellipsoid) [degE7] (type:int32_t)
alt : Altitude (MSL). Positive for up. Note that virtually all GPS modules provide the MSL altitude in addition to the WGS84 altitude. [mm] (type:int32_t)
eph : GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX (type:uint16_t)
epv : GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX (type:uint16_t)
vel : GPS ground speed. If unknown, set to: UINT16_MAX [cm/s] (type: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 [cdeg] (type:uint16_t)
satellites_visible : Number of satellites visible. If unknown, set to 255 (type:uint8_t)
'''
return self.send(self.gps_raw_int_encode(time_usec, fix_type, lat, lon, alt, eph, epv, vel, cog, satellites_visible), force_mavlink1=force_mavlink1)
def gps_status_encode(self, satellites_visible, satellite_prn, satellite_used, satellite_elevation, satellite_azimuth, satellite_snr):
'''
The positioning status, as reported by GPS. This message is intended
to display status information about each satellite
visible to the receiver. See message GLOBAL_POSITION
for the global position estimate. This message can
contain information for up to 20 satellites.
satellites_visible : Number of satellites visible (type:uint8_t)
satellite_prn : Global satellite ID (type:uint8_t)
satellite_used : 0: Satellite not used, 1: used for localization (type:uint8_t)
satellite_elevation : Elevation (0: right on top of receiver, 90: on the horizon) of satellite [deg] (type:uint8_t)
satellite_azimuth : Direction of satellite, 0: 0 deg, 255: 360 deg. [deg] (type:uint8_t)
satellite_snr : Signal to noise ratio of satellite [dB] (type:uint8_t)
'''
return MAVLink_gps_status_message(satellites_visible, satellite_prn, satellite_used, satellite_elevation, satellite_azimuth, satellite_snr)
def gps_status_send(self, satellites_visible, satellite_prn, satellite_used, satellite_elevation, satellite_azimuth, satellite_snr, force_mavlink1=False):
'''
The positioning status, as reported by GPS. This message is intended
to display status information about each satellite
visible to the receiver. See message GLOBAL_POSITION
for the global position estimate. This message can
contain information for up to 20 satellites.
satellites_visible : Number of satellites visible (type:uint8_t)
satellite_prn : Global satellite ID (type:uint8_t)
satellite_used : 0: Satellite not used, 1: used for localization (type:uint8_t)
satellite_elevation : Elevation (0: right on top of receiver, 90: on the horizon) of satellite [deg] (type:uint8_t)
satellite_azimuth : Direction of satellite, 0: 0 deg, 255: 360 deg. [deg] (type:uint8_t)
satellite_snr : Signal to noise ratio of satellite [dB] (type:uint8_t)
'''
return self.send(self.gps_status_encode(satellites_visible, satellite_prn, satellite_used, satellite_elevation, satellite_azimuth, satellite_snr), force_mavlink1=force_mavlink1)
def scaled_imu_encode(self, time_boot_ms, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag):
'''
The RAW IMU readings for the usual 9DOF sensor setup. This message
should contain the scaled values to the described
units
time_boot_ms : Timestamp (time since system boot). [ms] (type:uint32_t)
xacc : X acceleration [mG] (type:int16_t)
yacc : Y acceleration [mG] (type:int16_t)
zacc : Z acceleration [mG] (type:int16_t)
xgyro : Angular speed around X axis [mrad/s] (type:int16_t)
ygyro : Angular speed around Y axis [mrad/s] (type:int16_t)
zgyro : Angular speed around Z axis [mrad/s] (type:int16_t)
xmag : X Magnetic field [mgauss] (type:int16_t)
ymag : Y Magnetic field [mgauss] (type:int16_t)
zmag : Z Magnetic field [mgauss] (type:int16_t)
'''
return MAVLink_scaled_imu_message(time_boot_ms, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag)
def scaled_imu_send(self, time_boot_ms, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag, force_mavlink1=False):
'''
The RAW IMU readings for the usual 9DOF sensor setup. This message
should contain the scaled values to the described
units
time_boot_ms : Timestamp (time since system boot). [ms] (type:uint32_t)
xacc : X acceleration [mG] (type:int16_t)
yacc : Y acceleration [mG] (type:int16_t)
zacc : Z acceleration [mG] (type:int16_t)
xgyro : Angular speed around X axis [mrad/s] (type:int16_t)
ygyro : Angular speed around Y axis [mrad/s] (type:int16_t)
zgyro : Angular speed around Z axis [mrad/s] (type:int16_t)
xmag : X Magnetic field [mgauss] (type:int16_t)
ymag : Y Magnetic field [mgauss] (type:int16_t)
zmag : Z Magnetic field [mgauss] (type:int16_t)
'''
return self.send(self.scaled_imu_encode(time_boot_ms, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag), force_mavlink1=force_mavlink1)
def raw_imu_encode(self, time_usec, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag):
'''
The RAW IMU readings for a 9DOF sensor, which is identified by the id
(default IMU1). This message should always contain the
true raw values without any scaling to allow data
capture and system debugging.
time_usec : 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. [us] (type:uint64_t)
xacc : X acceleration (raw) (type:int16_t)
yacc : Y acceleration (raw) (type:int16_t)
zacc : Z acceleration (raw) (type:int16_t)
xgyro : Angular speed around X axis (raw) (type:int16_t)
ygyro : Angular speed around Y axis (raw) (type:int16_t)
zgyro : Angular speed around Z axis (raw) (type:int16_t)
xmag : X Magnetic field (raw) (type:int16_t)
ymag : Y Magnetic field (raw) (type:int16_t)
zmag : Z Magnetic field (raw) (type:int16_t)
'''
return MAVLink_raw_imu_message(time_usec, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag)
def raw_imu_send(self, time_usec, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag, force_mavlink1=False):
'''
The RAW IMU readings for a 9DOF sensor, which is identified by the id
(default IMU1). This message should always contain the
true raw values without any scaling to allow data
capture and system debugging.
time_usec : 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. [us] (type:uint64_t)
xacc : X acceleration (raw) (type:int16_t)
yacc : Y acceleration (raw) (type:int16_t)
zacc : Z acceleration (raw) (type:int16_t)
xgyro : Angular speed around X axis (raw) (type:int16_t)
ygyro : Angular speed around Y axis (raw) (type:int16_t)
zgyro : Angular speed around Z axis (raw) (type:int16_t)
xmag : X Magnetic field (raw) (type:int16_t)
ymag : Y Magnetic field (raw) (type:int16_t)
zmag : Z Magnetic field (raw) (type:int16_t)
'''
return self.send(self.raw_imu_encode(time_usec, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag), force_mavlink1=force_mavlink1)
def raw_pressure_encode(self, time_usec, press_abs, press_diff1, press_diff2, temperature):
'''
The RAW pressure readings for the typical setup of one absolute
pressure and one differential pressure sensor. The
sensor values should be the raw, UNSCALED ADC values.
time_usec : 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. [us] (type:uint64_t)
press_abs : Absolute pressure (raw) (type:int16_t)
press_diff1 : Differential pressure 1 (raw, 0 if nonexistent) (type:int16_t)
press_diff2 : Differential pressure 2 (raw, 0 if nonexistent) (type:int16_t)
temperature : Raw Temperature measurement (raw) (type:int16_t)
'''
return MAVLink_raw_pressure_message(time_usec, press_abs, press_diff1, press_diff2, temperature)
def raw_pressure_send(self, time_usec, press_abs, press_diff1, press_diff2, temperature, force_mavlink1=False):
'''
The RAW pressure readings for the typical setup of one absolute
pressure and one differential pressure sensor. The
sensor values should be the raw, UNSCALED ADC values.
time_usec : 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. [us] (type:uint64_t)
press_abs : Absolute pressure (raw) (type:int16_t)
press_diff1 : Differential pressure 1 (raw, 0 if nonexistent) (type:int16_t)
press_diff2 : Differential pressure 2 (raw, 0 if nonexistent) (type:int16_t)
temperature : Raw Temperature measurement (raw) (type:int16_t)
'''
return self.send(self.raw_pressure_encode(time_usec, press_abs, press_diff1, press_diff2, temperature), force_mavlink1=force_mavlink1)
def scaled_pressure_encode(self, time_boot_ms, press_abs, press_diff, temperature):
'''
The pressure readings for the typical setup of one absolute and
differential pressure sensor. The units are as
specified in each field.
time_boot_ms : Timestamp (time since system boot). [ms] (type:uint32_t)
press_abs : Absolute pressure [hPa] (type:float)
press_diff : Differential pressure 1 [hPa] (type:float)
temperature : Absolute pressure temperature [cdegC] (type:int16_t)
'''
return MAVLink_scaled_pressure_message(time_boot_ms, press_abs, press_diff, temperature)
def scaled_pressure_send(self, time_boot_ms, press_abs, press_diff, temperature, force_mavlink1=False):
'''
The pressure readings for the typical setup of one absolute and
differential pressure sensor. The units are as
specified in each field.
time_boot_ms : Timestamp (time since system boot). [ms] (type:uint32_t)
press_abs : Absolute pressure [hPa] (type:float)
press_diff : Differential pressure 1 [hPa] (type:float)
temperature : Absolute pressure temperature [cdegC] (type:int16_t)
'''
return self.send(self.scaled_pressure_encode(time_boot_ms, press_abs, press_diff, temperature), force_mavlink1=force_mavlink1)
def attitude_encode(self, time_boot_ms, roll, pitch, yaw, rollspeed, pitchspeed, yawspeed):
'''
The attitude in the aeronautical frame (right-handed, Z-down, X-front,
Y-right).
time_boot_ms : Timestamp (time since system boot). [ms] (type:uint32_t)
roll : Roll angle (-pi..+pi) [rad] (type:float)
pitch : Pitch angle (-pi..+pi) [rad] (type:float)
yaw : Yaw angle (-pi..+pi) [rad] (type:float)
rollspeed : Roll angular speed [rad/s] (type:float)
pitchspeed : Pitch angular speed [rad/s] (type:float)
yawspeed : Yaw angular speed [rad/s] (type:float)
'''
return MAVLink_attitude_message(time_boot_ms, roll, pitch, yaw, rollspeed, pitchspeed, yawspeed)
def attitude_send(self, time_boot_ms, roll, pitch, yaw, rollspeed, pitchspeed, yawspeed, force_mavlink1=False):
'''
The attitude in the aeronautical frame (right-handed, Z-down, X-front,
Y-right).
time_boot_ms : Timestamp (time since system boot). [ms] (type:uint32_t)
roll : Roll angle (-pi..+pi) [rad] (type:float)
pitch : Pitch angle (-pi..+pi) [rad] (type:float)
yaw : Yaw angle (-pi..+pi) [rad] (type:float)
rollspeed : Roll angular speed [rad/s] (type:float)
pitchspeed : Pitch angular speed [rad/s] (type:float)
yawspeed : Yaw angular speed [rad/s] (type:float)
'''
return self.send(self.attitude_encode(time_boot_ms, roll, pitch, yaw, rollspeed, pitchspeed, yawspeed), force_mavlink1=force_mavlink1)
def attitude_quaternion_encode(self, time_boot_ms, q1, q2, q3, q4, rollspeed, pitchspeed, yawspeed):
'''
The attitude in the aeronautical frame (right-handed, Z-down, X-front,
Y-right), expressed as quaternion. Quaternion order is
w, x, y, z and a zero rotation would be expressed as
(1 0 0 0).
time_boot_ms : Timestamp (time since system boot). [ms] (type:uint32_t)
q1 : Quaternion component 1, w (1 in null-rotation) (type:float)
q2 : Quaternion component 2, x (0 in null-rotation) (type:float)
q3 : Quaternion component 3, y (0 in null-rotation) (type:float)
q4 : Quaternion component 4, z (0 in null-rotation) (type:float)
rollspeed : Roll angular speed [rad/s] (type:float)
pitchspeed : Pitch angular speed [rad/s] (type:float)
yawspeed : Yaw angular speed [rad/s] (type:float)
'''
return MAVLink_attitude_quaternion_message(time_boot_ms, q1, q2, q3, q4, rollspeed, pitchspeed, yawspeed)
def attitude_quaternion_send(self, time_boot_ms, q1, q2, q3, q4, rollspeed, pitchspeed, yawspeed, force_mavlink1=False):
'''
The attitude in the aeronautical frame (right-handed, Z-down, X-front,
Y-right), expressed as quaternion. Quaternion order is
w, x, y, z and a zero rotation would be expressed as
(1 0 0 0).
time_boot_ms : Timestamp (time since system boot). [ms] (type:uint32_t)
q1 : Quaternion component 1, w (1 in null-rotation) (type:float)
q2 : Quaternion component 2, x (0 in null-rotation) (type:float)
q3 : Quaternion component 3, y (0 in null-rotation) (type:float)
q4 : Quaternion component 4, z (0 in null-rotation) (type:float)
rollspeed : Roll angular speed [rad/s] (type:float)
pitchspeed : Pitch angular speed [rad/s] (type:float)
yawspeed : Yaw angular speed [rad/s] (type:float)
'''
return self.send(self.attitude_quaternion_encode(time_boot_ms, q1, q2, q3, q4, rollspeed, pitchspeed, yawspeed), force_mavlink1=force_mavlink1)
def local_position_ned_encode(self, time_boot_ms, x, y, z, vx, vy, vz):
'''
The filtered local position (e.g. fused computer vision and
accelerometers). Coordinate frame is right-handed,
Z-axis down (aeronautical frame, NED / north-east-down
convention)
time_boot_ms : Timestamp (time since system boot). [ms] (type:uint32_t)
x : X Position [m] (type:float)
y : Y Position [m] (type:float)
z : Z Position [m] (type:float)
vx : X Speed [m/s] (type:float)
vy : Y Speed [m/s] (type:float)
vz : Z Speed [m/s] (type:float)
'''
return MAVLink_local_position_ned_message(time_boot_ms, x, y, z, vx, vy, vz)
def local_position_ned_send(self, time_boot_ms, x, y, z, vx, vy, vz, force_mavlink1=False):
'''
The filtered local position (e.g. fused computer vision and
accelerometers). Coordinate frame is right-handed,
Z-axis down (aeronautical frame, NED / north-east-down
convention)
time_boot_ms : Timestamp (time since system boot). [ms] (type:uint32_t)
x : X Position [m] (type:float)
y : Y Position [m] (type:float)
z : Z Position [m] (type:float)
vx : X Speed [m/s] (type:float)
vy : Y Speed [m/s] (type:float)
vz : Z Speed [m/s] (type:float)
'''
return self.send(self.local_position_ned_encode(time_boot_ms, x, y, z, vx, vy, vz), force_mavlink1=force_mavlink1)
def global_position_int_encode(self, time_boot_ms, lat, lon, alt, relative_alt, vx, vy, vz, hdg):
'''
The filtered global position (e.g. fused GPS and accelerometers). The
position is in GPS-frame (right-handed, Z-up). It
is designed as scaled integer message since the
resolution of float is not sufficient.
time_boot_ms : Timestamp (time since system boot). [ms] (type:uint32_t)
lat : Latitude, expressed [degE7] (type:int32_t)
lon : Longitude, expressed [degE7] (type:int32_t)
alt : Altitude (MSL). Note that virtually all GPS modules provide both WGS84 and MSL. [mm] (type:int32_t)
relative_alt : Altitude above ground [mm] (type:int32_t)
vx : Ground X Speed (Latitude, positive north) [cm/s] (type:int16_t)
vy : Ground Y Speed (Longitude, positive east) [cm/s] (type:int16_t)
vz : Ground Z Speed (Altitude, positive down) [cm/s] (type:int16_t)
hdg : Vehicle heading (yaw angle), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX [cdeg] (type:uint16_t)
'''
return MAVLink_global_position_int_message(time_boot_ms, lat, lon, alt, relative_alt, vx, vy, vz, hdg)
def global_position_int_send(self, time_boot_ms, lat, lon, alt, relative_alt, vx, vy, vz, hdg, force_mavlink1=False):
'''
The filtered global position (e.g. fused GPS and accelerometers). The
position is in GPS-frame (right-handed, Z-up). It
is designed as scaled integer message since the
resolution of float is not sufficient.
time_boot_ms : Timestamp (time since system boot). [ms] (type:uint32_t)
lat : Latitude, expressed [degE7] (type:int32_t)
lon : Longitude, expressed [degE7] (type:int32_t)
alt : Altitude (MSL). Note that virtually all GPS modules provide both WGS84 and MSL. [mm] (type:int32_t)
relative_alt : Altitude above ground [mm] (type:int32_t)
vx : Ground X Speed (Latitude, positive north) [cm/s] (type:int16_t)
vy : Ground Y Speed (Longitude, positive east) [cm/s] (type:int16_t)
vz : Ground Z Speed (Altitude, positive down) [cm/s] (type:int16_t)
hdg : Vehicle heading (yaw angle), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX [cdeg] (type:uint16_t)
'''
return self.send(self.global_position_int_encode(time_boot_ms, lat, lon, alt, relative_alt, vx, vy, vz, hdg), force_mavlink1=force_mavlink1)
def rc_channels_scaled_encode(self, time_boot_ms, port, chan1_scaled, chan2_scaled, chan3_scaled, chan4_scaled, chan5_scaled, chan6_scaled, chan7_scaled, chan8_scaled, rssi):
'''
The scaled values of the RC channels received: (-100%) -10000, (0%) 0,
(100%) 10000. Channels that are inactive should be set
to UINT16_MAX.
time_boot_ms : Timestamp (time since system boot). [ms] (type:uint32_t)
port : Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX. (type:uint8_t)
chan1_scaled : RC channel 1 value scaled. (type:int16_t)
chan2_scaled : RC channel 2 value scaled. (type:int16_t)
chan3_scaled : RC channel 3 value scaled. (type:int16_t)
chan4_scaled : RC channel 4 value scaled. (type:int16_t)
chan5_scaled : RC channel 5 value scaled. (type:int16_t)
chan6_scaled : RC channel 6 value scaled. (type:int16_t)
chan7_scaled : RC channel 7 value scaled. (type:int16_t)
chan8_scaled : RC channel 8 value scaled. (type:int16_t)
rssi : Receive signal strength indicator in device-dependent units/scale. Values: [0-254], 255: invalid/unknown. (type:uint8_t)
'''
return MAVLink_rc_channels_scaled_message(time_boot_ms, port, chan1_scaled, chan2_scaled, chan3_scaled, chan4_scaled, chan5_scaled, chan6_scaled, chan7_scaled, chan8_scaled, rssi)
def rc_channels_scaled_send(self, time_boot_ms, port, chan1_scaled, chan2_scaled, chan3_scaled, chan4_scaled, chan5_scaled, chan6_scaled, chan7_scaled, chan8_scaled, rssi, force_mavlink1=False):
'''
The scaled values of the RC channels received: (-100%) -10000, (0%) 0,
(100%) 10000. Channels that are inactive should be set
to UINT16_MAX.
time_boot_ms : Timestamp (time since system boot). [ms] (type:uint32_t)
port : Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX. (type:uint8_t)
chan1_scaled : RC channel 1 value scaled. (type:int16_t)
chan2_scaled : RC channel 2 value scaled. (type:int16_t)
chan3_scaled : RC channel 3 value scaled. (type:int16_t)
chan4_scaled : RC channel 4 value scaled. (type:int16_t)
chan5_scaled : RC channel 5 value scaled. (type:int16_t)
chan6_scaled : RC channel 6 value scaled. (type:int16_t)
chan7_scaled : RC channel 7 value scaled. (type:int16_t)
chan8_scaled : RC channel 8 value scaled. (type:int16_t)
rssi : Receive signal strength indicator in device-dependent units/scale. Values: [0-254], 255: invalid/unknown. (type:uint8_t)
'''
return self.send(self.rc_channels_scaled_encode(time_boot_ms, port, chan1_scaled, chan2_scaled, chan3_scaled, chan4_scaled, chan5_scaled, chan6_scaled, chan7_scaled, chan8_scaled, rssi), force_mavlink1=force_mavlink1)
def rc_channels_raw_encode(self, time_boot_ms, port, chan1_raw, chan2_raw, chan3_raw, chan4_raw, chan5_raw, chan6_raw, chan7_raw, chan8_raw, rssi):
'''
The RAW values of the RC channels received. The standard PPM
modulation is as follows: 1000 microseconds: 0%, 2000
microseconds: 100%. A value of UINT16_MAX implies the
channel is unused. Individual receivers/transmitters
might violate this specification.
time_boot_ms : Timestamp (time since system boot). [ms] (type:uint32_t)
port : Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX. (type:uint8_t)
chan1_raw : RC channel 1 value. [us] (type:uint16_t)
chan2_raw : RC channel 2 value. [us] (type:uint16_t)
chan3_raw : RC channel 3 value. [us] (type:uint16_t)
chan4_raw : RC channel 4 value. [us] (type:uint16_t)
chan5_raw : RC channel 5 value. [us] (type:uint16_t)
chan6_raw : RC channel 6 value. [us] (type:uint16_t)
chan7_raw : RC channel 7 value. [us] (type:uint16_t)
chan8_raw : RC channel 8 value. [us] (type:uint16_t)
rssi : Receive signal strength indicator in device-dependent units/scale. Values: [0-254], 255: invalid/unknown. (type:uint8_t)
'''
return MAVLink_rc_channels_raw_message(time_boot_ms, port, chan1_raw, chan2_raw, chan3_raw, chan4_raw, chan5_raw, chan6_raw, chan7_raw, chan8_raw, rssi)
def rc_channels_raw_send(self, time_boot_ms, port, chan1_raw, chan2_raw, chan3_raw, chan4_raw, chan5_raw, chan6_raw, chan7_raw, chan8_raw, rssi, force_mavlink1=False):
'''
The RAW values of the RC channels received. The standard PPM
modulation is as follows: 1000 microseconds: 0%, 2000
microseconds: 100%. A value of UINT16_MAX implies the
channel is unused. Individual receivers/transmitters
might violate this specification.
time_boot_ms : Timestamp (time since system boot). [ms] (type:uint32_t)
port : Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX. (type:uint8_t)
chan1_raw : RC channel 1 value. [us] (type:uint16_t)
chan2_raw : RC channel 2 value. [us] (type:uint16_t)
chan3_raw : RC channel 3 value. [us] (type:uint16_t)
chan4_raw : RC channel 4 value. [us] (type:uint16_t)
chan5_raw : RC channel 5 value. [us] (type:uint16_t)
chan6_raw : RC channel 6 value. [us] (type:uint16_t)
chan7_raw : RC channel 7 value. [us] (type:uint16_t)
chan8_raw : RC channel 8 value. [us] (type:uint16_t)
rssi : Receive signal strength indicator in device-dependent units/scale. Values: [0-254], 255: invalid/unknown. (type:uint8_t)
'''
return self.send(self.rc_channels_raw_encode(time_boot_ms, port, chan1_raw, chan2_raw, chan3_raw, chan4_raw, chan5_raw, chan6_raw, chan7_raw, chan8_raw, rssi), force_mavlink1=force_mavlink1)
def servo_output_raw_encode(self, time_usec, port, servo1_raw, servo2_raw, servo3_raw, servo4_raw, servo5_raw, servo6_raw, servo7_raw, servo8_raw):
'''
Superseded by ACTUATOR_OUTPUT_STATUS. The RAW values of the servo
outputs (for RC input from the remote, use the
RC_CHANNELS messages). The standard PPM modulation is
as follows: 1000 microseconds: 0%, 2000 microseconds:
100%.
time_usec : 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. [us] (type:uint32_t)
port : Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX. (type:uint8_t)
servo1_raw : Servo output 1 value [us] (type:uint16_t)
servo2_raw : Servo output 2 value [us] (type:uint16_t)
servo3_raw : Servo output 3 value [us] (type:uint16_t)
servo4_raw : Servo output 4 value [us] (type:uint16_t)
servo5_raw : Servo output 5 value [us] (type:uint16_t)
servo6_raw : Servo output 6 value [us] (type:uint16_t)
servo7_raw : Servo output 7 value [us] (type:uint16_t)
servo8_raw : Servo output 8 value [us] (type:uint16_t)
'''
return MAVLink_servo_output_raw_message(time_usec, port, servo1_raw, servo2_raw, servo3_raw, servo4_raw, servo5_raw, servo6_raw, servo7_raw, servo8_raw)
def servo_output_raw_send(self, time_usec, port, servo1_raw, servo2_raw, servo3_raw, servo4_raw, servo5_raw, servo6_raw, servo7_raw, servo8_raw, force_mavlink1=False):
'''
Superseded by ACTUATOR_OUTPUT_STATUS. The RAW values of the servo
outputs (for RC input from the remote, use the
RC_CHANNELS messages). The standard PPM modulation is
as follows: 1000 microseconds: 0%, 2000 microseconds:
100%.
time_usec : 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. [us] (type:uint32_t)
port : Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX. (type:uint8_t)
servo1_raw : Servo output 1 value [us] (type:uint16_t)
servo2_raw : Servo output 2 value [us] (type:uint16_t)
servo3_raw : Servo output 3 value [us] (type:uint16_t)
servo4_raw : Servo output 4 value [us] (type:uint16_t)
servo5_raw : Servo output 5 value [us] (type:uint16_t)
servo6_raw : Servo output 6 value [us] (type:uint16_t)
servo7_raw : Servo output 7 value [us] (type:uint16_t)
servo8_raw : Servo output 8 value [us] (type:uint16_t)
'''
return self.send(self.servo_output_raw_encode(time_usec, port, servo1_raw, servo2_raw, servo3_raw, servo4_raw, servo5_raw, servo6_raw, servo7_raw, servo8_raw), force_mavlink1=force_mavlink1)
def mission_request_partial_list_encode(self, target_system, target_component, start_index, end_index):
'''
Request a partial list of mission items from the system/component.
https://mavlink.io/en/services/mission.html. If start
and end index are the same, just send one waypoint.
target_system : System ID (type:uint8_t)
target_component : Component ID (type:uint8_t)
start_index : Start index (type:int16_t)
end_index : End index, -1 by default (-1: send list to end). Else a valid index of the list (type:int16_t)
'''
return MAVLink_mission_request_partial_list_message(target_system, target_component, start_index, end_index)
def mission_request_partial_list_send(self, target_system, target_component, start_index, end_index, force_mavlink1=False):
'''
Request a partial list of mission items from the system/component.
https://mavlink.io/en/services/mission.html. If start
and end index are the same, just send one waypoint.
target_system : System ID (type:uint8_t)
target_component : Component ID (type:uint8_t)
start_index : Start index (type:int16_t)
end_index : End index, -1 by default (-1: send list to end). Else a valid index of the list (type:int16_t)
'''
return self.send(self.mission_request_partial_list_encode(target_system, target_component, start_index, end_index), force_mavlink1=force_mavlink1)
def mission_write_partial_list_encode(self, target_system, target_component, start_index, end_index):
'''
This message is sent to the MAV to write a partial list. If start
index == end index, only one item will be transmitted
/ updated. If the start index is NOT 0 and above the
current list size, this request should be REJECTED!
target_system : System ID (type:uint8_t)
target_component : Component ID (type:uint8_t)
start_index : Start index. Must be smaller / equal to the largest index of the current onboard list. (type:int16_t)
end_index : End index, equal or greater than start index. (type:int16_t)
'''
return MAVLink_mission_write_partial_list_message(target_system, target_component, start_index, end_index)
def mission_write_partial_list_send(self, target_system, target_component, start_index, end_index, force_mavlink1=False):
'''
This message is sent to the MAV to write a partial list. If start
index == end index, only one item will be transmitted
/ updated. If the start index is NOT 0 and above the
current list size, this request should be REJECTED!
target_system : System ID (type:uint8_t)
target_component : Component ID (type:uint8_t)
start_index : Start index. Must be smaller / equal to the largest index of the current onboard list. (type:int16_t)
end_index : End index, equal or greater than start index. (type:int16_t)
'''
return self.send(self.mission_write_partial_list_encode(target_system, target_component, start_index, end_index), force_mavlink1=force_mavlink1)
def mission_item_encode(self, target_system, target_component, seq, frame, command, current, autocontinue, param1, param2, param3, param4, x, y, z):
'''
Message encoding a mission item. This message is emitted to announce
the presence of a mission item and to set a mission
item on the system. The mission item can be either in
x, y, z meters (type: LOCAL) or x:lat, y:lon,
z:altitude. Local frame is Z-down, right handed (NED),
global frame is Z-up, right handed (ENU). NaN may be
used to indicate an optional/default value (e.g. to
use the system's current latitude or yaw rather than a
specific value). See also
https://mavlink.io/en/services/mission.html.
target_system : System ID (type:uint8_t)
target_component : Component ID (type:uint8_t)
seq : Sequence (type:uint16_t)
frame : The coordinate system of the waypoint. (type:uint8_t, values:MAV_FRAME)
command : The scheduled action for the waypoint. (type:uint16_t, values:MAV_CMD)
current : false:0, true:1 (type:uint8_t)
autocontinue : Autocontinue to next waypoint (type:uint8_t)
param1 : PARAM1, see MAV_CMD enum (type:float)
param2 : PARAM2, see MAV_CMD enum (type:float)
param3 : PARAM3, see MAV_CMD enum (type:float)
param4 : PARAM4, see MAV_CMD enum (type:float)
x : PARAM5 / local: X coordinate, global: latitude (type:float)
y : PARAM6 / local: Y coordinate, global: longitude (type:float)
z : PARAM7 / local: Z coordinate, global: altitude (relative or absolute, depending on frame). (type:float)
'''
return MAVLink_mission_item_message(target_system, target_component, seq, frame, command, current, autocontinue, param1, param2, param3, param4, x, y, z)
def mission_item_send(self, target_system, target_component, seq, frame, command, current, autocontinue, param1, param2, param3, param4, x, y, z, force_mavlink1=False):
'''
Message encoding a mission item. This message is emitted to announce
the presence of a mission item and to set a mission
item on the system. The mission item can be either in
x, y, z meters (type: LOCAL) or x:lat, y:lon,
z:altitude. Local frame is Z-down, right handed (NED),
global frame is Z-up, right handed (ENU). NaN may be
used to indicate an optional/default value (e.g. to
use the system's current latitude or yaw rather than a
specific value). See also
https://mavlink.io/en/services/mission.html.
target_system : System ID (type:uint8_t)
target_component : Component ID (type:uint8_t)
seq : Sequence (type:uint16_t)
frame : The coordinate system of the waypoint. (type:uint8_t, values:MAV_FRAME)
command : The scheduled action for the waypoint. (type:uint16_t, values:MAV_CMD)
current : false:0, true:1 (type:uint8_t)
autocontinue : Autocontinue to next waypoint (type:uint8_t)
param1 : PARAM1, see MAV_CMD enum (type:float)
param2 : PARAM2, see MAV_CMD enum (type:float)
param3 : PARAM3, see MAV_CMD enum (type:float)
param4 : PARAM4, see MAV_CMD enum (type:float)
x : PARAM5 / local: X coordinate, global: latitude (type:float)
y : PARAM6 / local: Y coordinate, global: longitude (type:float)
z : PARAM7 / local: Z coordinate, global: altitude (relative or absolute, depending on frame). (type:float)
'''
return self.send(self.mission_item_encode(target_system, target_component, seq, frame, command, current, autocontinue, param1, param2, param3, param4, x, y, z), force_mavlink1=force_mavlink1)
def mission_request_encode(self, target_system, target_component, seq):
'''
Request the information of the mission item with the sequence number
seq. The response of the system to this message should
be a MISSION_ITEM message.
https://mavlink.io/en/services/mission.html
target_system : System ID (type:uint8_t)
target_component : Component ID (type:uint8_t)
seq : Sequence (type:uint16_t)
'''
return MAVLink_mission_request_message(target_system, target_component, seq)
def mission_request_send(self, target_system, target_component, seq, force_mavlink1=False):
'''
Request the information of the mission item with the sequence number
seq. The response of the system to this message should
be a MISSION_ITEM message.
https://mavlink.io/en/services/mission.html
target_system : System ID (type:uint8_t)
target_component : Component ID (type:uint8_t)
seq : Sequence (type:uint16_t)
'''
return self.send(self.mission_request_encode(target_system, target_component, seq), force_mavlink1=force_mavlink1)
def mission_set_current_encode(self, target_system, target_component, seq):
'''
Set the mission item with sequence number seq as current item. This
means that the MAV will continue to this mission item
on the shortest path (not following the mission items
in-between).
target_system : System ID (type:uint8_t)
target_component : Component ID (type:uint8_t)
seq : Sequence (type:uint16_t)
'''
return MAVLink_mission_set_current_message(target_system, target_component, seq)
def mission_set_current_send(self, target_system, target_component, seq, force_mavlink1=False):
'''
Set the mission item with sequence number seq as current item. This
means that the MAV will continue to this mission item
on the shortest path (not following the mission items
in-between).
target_system : System ID (type:uint8_t)
target_component : Component ID (type:uint8_t)
seq : Sequence (type:uint16_t)
'''
return self.send(self.mission_set_current_encode(target_system, target_component, seq), force_mavlink1=force_mavlink1)
def mission_current_encode(self, seq):
'''
Message that announces the sequence number of the current active
mission item. The MAV will fly towards this mission
item.
seq : Sequence (type:uint16_t)
'''
return MAVLink_mission_current_message(seq)
def mission_current_send(self, seq, force_mavlink1=False):
'''
Message that announces the sequence number of the current active
mission item. The MAV will fly towards this mission
item.
seq : Sequence (type:uint16_t)
'''
return self.send(self.mission_current_encode(seq), force_mavlink1=force_mavlink1)
def mission_request_list_encode(self, target_system, target_component):
'''
Request the overall list of mission items from the system/component.
target_system : System ID (type:uint8_t)
target_component : Component ID (type:uint8_t)
'''
return MAVLink_mission_request_list_message(target_system, target_component)
def mission_request_list_send(self, target_system, target_component, force_mavlink1=False):
'''
Request the overall list of mission items from the system/component.
target_system : System ID (type:uint8_t)
target_component : Component ID (type:uint8_t)
'''
return self.send(self.mission_request_list_encode(target_system, target_component), force_mavlink1=force_mavlink1)
def mission_count_encode(self, target_system, target_component, count):
'''
This message is emitted as response to MISSION_REQUEST_LIST by the MAV
and to initiate a write transaction. The GCS can then
request the individual mission item based on the
knowledge of the total number of waypoints.
target_system : System ID (type:uint8_t)
target_component : Component ID (type:uint8_t)
count : Number of mission items in the sequence (type:uint16_t)
'''
return MAVLink_mission_count_message(target_system, target_component, count)
def mission_count_send(self, target_system, target_component, count, force_mavlink1=False):
'''
This message is emitted as response to MISSION_REQUEST_LIST by the MAV
and to initiate a write transaction. The GCS can then
request the individual mission item based on the
knowledge of the total number of waypoints.
target_system : System ID (type:uint8_t)
target_component : Component ID (type:uint8_t)
count : Number of mission items in the sequence (type:uint16_t)
'''
return self.send(self.mission_count_encode(target_system, target_component, count), force_mavlink1=force_mavlink1)
def mission_clear_all_encode(self, target_system, target_component):
'''
Delete all mission items at once.
target_system : System ID (type:uint8_t)
target_component : Component ID (type:uint8_t)
'''
return MAVLink_mission_clear_all_message(target_system, target_component)
def mission_clear_all_send(self, target_system, target_component, force_mavlink1=False):
'''
Delete all mission items at once.
target_system : System ID (type:uint8_t)
target_component : Component ID (type:uint8_t)
'''
return self.send(self.mission_clear_all_encode(target_system, target_component), force_mavlink1=force_mavlink1)
def mission_item_reached_encode(self, seq):
'''
A certain mission item has been reached. The system will either hold
this position (or circle on the orbit) or (if the
autocontinue on the WP was set) continue to the next
waypoint.
seq : Sequence (type:uint16_t)
'''
return MAVLink_mission_item_reached_message(seq)
def mission_item_reached_send(self, seq, force_mavlink1=False):
'''
A certain mission item has been reached. The system will either hold
this position (or circle on the orbit) or (if the
autocontinue on the WP was set) continue to the next
waypoint.
seq : Sequence (type:uint16_t)
'''
return self.send(self.mission_item_reached_encode(seq), force_mavlink1=force_mavlink1)
def mission_ack_encode(self, target_system, target_component, type):
'''
Acknowledgment message during waypoint handling. The type field states
if this message is a positive ack (type=0) or if an
error happened (type=non-zero).
target_system : System ID (type:uint8_t)
target_component : Component ID (type:uint8_t)
type : Mission result. (type:uint8_t, values:MAV_MISSION_RESULT)
'''
return MAVLink_mission_ack_message(target_system, target_component, type)
def mission_ack_send(self, target_system, target_component, type, force_mavlink1=False):
'''
Acknowledgment message during waypoint handling. The type field states
if this message is a positive ack (type=0) or if an
error happened (type=non-zero).
target_system : System ID (type:uint8_t)
target_component : Component ID (type:uint8_t)
type : Mission result. (type:uint8_t, values:MAV_MISSION_RESULT)
'''
return self.send(self.mission_ack_encode(target_system, target_component, type), force_mavlink1=force_mavlink1)
def set_gps_global_origin_encode(self, target_system, latitude, longitude, altitude):
'''
Sets the GPS co-ordinates of the vehicle local origin (0,0,0)
position. Vehicle should emit GPS_GLOBAL_ORIGIN
irrespective of whether the origin is changed. This
enables transform between the local coordinate frame
and the global (GPS) coordinate frame, which may be
necessary when (for example) indoor and outdoor
settings are connected and the MAV should move from
in- to outdoor.
target_system : System ID (type:uint8_t)
latitude : Latitude (WGS84) [degE7] (type:int32_t)
longitude : Longitude (WGS84) [degE7] (type:int32_t)
altitude : Altitude (MSL). Positive for up. [mm] (type:int32_t)
'''
return MAVLink_set_gps_global_origin_message(target_system, latitude, longitude, altitude)
def set_gps_global_origin_send(self, target_system, latitude, longitude, altitude, force_mavlink1=False):
'''
Sets the GPS co-ordinates of the vehicle local origin (0,0,0)
position. Vehicle should emit GPS_GLOBAL_ORIGIN
irrespective of whether the origin is changed. This
enables transform between the local coordinate frame
and the global (GPS) coordinate frame, which may be
necessary when (for example) indoor and outdoor
settings are connected and the MAV should move from
in- to outdoor.
target_system : System ID (type:uint8_t)
latitude : Latitude (WGS84) [degE7] (type:int32_t)
longitude : Longitude (WGS84) [degE7] (type:int32_t)
altitude : Altitude (MSL). Positive for up. [mm] (type:int32_t)
'''
return self.send(self.set_gps_global_origin_encode(target_system, latitude, longitude, altitude), force_mavlink1=force_mavlink1)
def gps_global_origin_encode(self, latitude, longitude, altitude):
'''
Publishes the GPS co-ordinates of the vehicle local origin (0,0,0)
position. Emitted whenever a new GPS-Local position
mapping is requested or set - e.g. following
SET_GPS_GLOBAL_ORIGIN message.
latitude : Latitude (WGS84) [degE7] (type:int32_t)
longitude : Longitude (WGS84) [degE7] (type:int32_t)
altitude : Altitude (MSL). Positive for up. [mm] (type:int32_t)
'''
return MAVLink_gps_global_origin_message(latitude, longitude, altitude)
def gps_global_origin_send(self, latitude, longitude, altitude, force_mavlink1=False):
'''
Publishes the GPS co-ordinates of the vehicle local origin (0,0,0)
position. Emitted whenever a new GPS-Local position
mapping is requested or set - e.g. following
SET_GPS_GLOBAL_ORIGIN message.
latitude : Latitude (WGS84) [degE7] (type:int32_t)
longitude : Longitude (WGS84) [degE7] (type:int32_t)
altitude : Altitude (MSL). Positive for up. [mm] (type:int32_t)
'''
return self.send(self.gps_global_origin_encode(latitude, longitude, altitude), force_mavlink1=force_mavlink1)
def param_map_rc_encode(self, target_system, target_component, param_id, param_index, parameter_rc_channel_index, param_value0, scale, param_value_min, param_value_max):
'''
Bind a RC channel to a parameter. The parameter should change
according to the RC channel value.
target_system : System ID (type:uint8_t)
target_component : Component ID (type:uint8_t)
param_id : Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string (type:char)
param_index : Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored), send -2 to disable any existing map for this rc_channel_index. (type:int16_t)
parameter_rc_channel_index : Index of parameter RC channel. Not equal to the RC channel id. Typically corresponds to a potentiometer-knob on the RC. (type:uint8_t)
param_value0 : Initial parameter value (type:float)
scale : Scale, maps the RC range [-1, 1] to a parameter value (type:float)
param_value_min : Minimum param value. The protocol does not define if this overwrites an onboard minimum value. (Depends on implementation) (type:float)
param_value_max : Maximum param value. The protocol does not define if this overwrites an onboard maximum value. (Depends on implementation) (type:float)
'''
return MAVLink_param_map_rc_message(target_system, target_component, param_id, param_index, parameter_rc_channel_index, param_value0, scale, param_value_min, param_value_max)
def param_map_rc_send(self, target_system, target_component, param_id, param_index, parameter_rc_channel_index, param_value0, scale, param_value_min, param_value_max, force_mavlink1=False):
'''
Bind a RC channel to a parameter. The parameter should change
according to the RC channel value.
target_system : System ID (type:uint8_t)
target_component : Component ID (type:uint8_t)
param_id : Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string (type:char)
param_index : Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored), send -2 to disable any existing map for this rc_channel_index. (type:int16_t)
parameter_rc_channel_index : Index of parameter RC channel. Not equal to the RC channel id. Typically corresponds to a potentiometer-knob on the RC. (type:uint8_t)
param_value0 : Initial parameter value (type:float)
scale : Scale, maps the RC range [-1, 1] to a parameter value (type:float)
param_value_min : Minimum param value. The protocol does not define if this overwrites an onboard minimum value. (Depends on implementation) (type:float)
param_value_max : Maximum param value. The protocol does not define if this overwrites an onboard maximum value. (Depends on implementation) (type:float)
'''
return self.send(self.param_map_rc_encode(target_system, target_component, param_id, param_index, parameter_rc_channel_index, param_value0, scale, param_value_min, param_value_max), force_mavlink1=force_mavlink1)
def mission_request_int_encode(self, target_system, target_component, seq):
'''
Request the information of the mission item with the sequence number
seq. The response of the system to this message should
be a MISSION_ITEM_INT message.
https://mavlink.io/en/services/mission.html
target_system : System ID (type:uint8_t)
target_component : Component ID (type:uint8_t)
seq : Sequence (type:uint16_t)
'''
return MAVLink_mission_request_int_message(target_system, target_component, seq)
def mission_request_int_send(self, target_system, target_component, seq, force_mavlink1=False):
'''
Request the information of the mission item with the sequence number
seq. The response of the system to this message should
be a MISSION_ITEM_INT message.
https://mavlink.io/en/services/mission.html
target_system : System ID (type:uint8_t)
target_component : Component ID (type:uint8_t)
seq : Sequence (type:uint16_t)
'''
return self.send(self.mission_request_int_encode(target_system, target_component, seq), force_mavlink1=force_mavlink1)
def safety_set_allowed_area_encode(self, target_system, target_component, frame, p1x, p1y, p1z, p2x, p2y, p2z):
'''
Set a safety zone (volume), which is defined by two corners of a cube.
This message can be used to tell the MAV which
setpoints/waypoints to accept and which to reject.
Safety areas are often enforced by national or
competition regulations.
target_system : System ID (type:uint8_t)
target_component : Component ID (type:uint8_t)
frame : Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down. (type:uint8_t, values:MAV_FRAME)
p1x : x position 1 / Latitude 1 [m] (type:float)
p1y : y position 1 / Longitude 1 [m] (type:float)
p1z : z position 1 / Altitude 1 [m] (type:float)
p2x : x position 2 / Latitude 2 [m] (type:float)
p2y : y position 2 / Longitude 2 [m] (type:float)
p2z : z position 2 / Altitude 2 [m] (type:float)
'''
return MAVLink_safety_set_allowed_area_message(target_system, target_component, frame, p1x, p1y, p1z, p2x, p2y, p2z)
def safety_set_allowed_area_send(self, target_system, target_component, frame, p1x, p1y, p1z, p2x, p2y, p2z, force_mavlink1=False):
'''
Set a safety zone (volume), which is defined by two corners of a cube.
This message can be used to tell the MAV which
setpoints/waypoints to accept and which to reject.
Safety areas are often enforced by national or
competition regulations.
target_system : System ID (type:uint8_t)
target_component : Component ID (type:uint8_t)
frame : Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down. (type:uint8_t, values:MAV_FRAME)
p1x : x position 1 / Latitude 1 [m] (type:float)
p1y : y position 1 / Longitude 1 [m] (type:float)
p1z : z position 1 / Altitude 1 [m] (type:float)
p2x : x position 2 / Latitude 2 [m] (type:float)
p2y : y position 2 / Longitude 2 [m] (type:float)
p2z : z position 2 / Altitude 2 [m] (type:float)
'''
return self.send(self.safety_set_allowed_area_encode(target_system, target_component, frame, p1x, p1y, p1z, p2x, p2y, p2z), force_mavlink1=force_mavlink1)
def safety_allowed_area_encode(self, frame, p1x, p1y, p1z, p2x, p2y, p2z):
'''
Read out the safety zone the MAV currently assumes.
frame : Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down. (type:uint8_t, values:MAV_FRAME)
p1x : x position 1 / Latitude 1 [m] (type:float)
p1y : y position 1 / Longitude 1 [m] (type:float)
p1z : z position 1 / Altitude 1 [m] (type:float)
p2x : x position 2 / Latitude 2 [m] (type:float)
p2y : y position 2 / Longitude 2 [m] (type:float)
p2z : z position 2 / Altitude 2 [m] (type:float)
'''
return MAVLink_safety_allowed_area_message(frame, p1x, p1y, p1z, p2x, p2y, p2z)
def safety_allowed_area_send(self, frame, p1x, p1y, p1z, p2x, p2y, p2z, force_mavlink1=False):
'''
Read out the safety zone the MAV currently assumes.
frame : Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down. (type:uint8_t, values:MAV_FRAME)
p1x : x position 1 / Latitude 1 [m] (type:float)
p1y : y position 1 / Longitude 1 [m] (type:float)
p1z : z position 1 / Altitude 1 [m] (type:float)
p2x : x position 2 / Latitude 2 [m] (type:float)
p2y : y position 2 / Longitude 2 [m] (type:float)
p2z : z position 2 / Altitude 2 [m] (type:float)
'''
return self.send(self.safety_allowed_area_encode(frame, p1x, p1y, p1z, p2x, p2y, p2z), force_mavlink1=force_mavlink1)
def attitude_quaternion_cov_encode(self, time_usec, q, rollspeed, pitchspeed, yawspeed, covariance):
'''
The attitude in the aeronautical frame (right-handed, Z-down, X-front,
Y-right), expressed as quaternion. Quaternion order is
w, x, y, z and a zero rotation would be expressed as
(1 0 0 0).
time_usec : 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. [us] (type:uint64_t)
q : Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation) (type:float)
rollspeed : Roll angular speed [rad/s] (type:float)
pitchspeed : Pitch angular speed [rad/s] (type:float)
yawspeed : Yaw angular speed [rad/s] (type:float)
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. (type:float)
'''
return MAVLink_attitude_quaternion_cov_message(time_usec, q, rollspeed, pitchspeed, yawspeed, covariance)
def attitude_quaternion_cov_send(self, time_usec, q, rollspeed, pitchspeed, yawspeed, covariance, force_mavlink1=False):
'''
The attitude in the aeronautical frame (right-handed, Z-down, X-front,
Y-right), expressed as quaternion. Quaternion order is
w, x, y, z and a zero rotation would be expressed as
(1 0 0 0).
time_usec : 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. [us] (type:uint64_t)
q : Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation) (type:float)
rollspeed : Roll angular speed [rad/s] (type:float)
pitchspeed : Pitch angular speed [rad/s] (type:float)
yawspeed : Yaw angular speed [rad/s] (type:float)
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. (type:float)
'''
return self.send(self.attitude_quaternion_cov_encode(time_usec, q, rollspeed, pitchspeed, yawspeed, covariance), force_mavlink1=force_mavlink1)
def nav_controller_output_encode(self, nav_roll, nav_pitch, nav_bearing, target_bearing, wp_dist, alt_error, aspd_error, xtrack_error):
'''
The state of the fixed wing navigation and position controller.
nav_roll : Current desired roll [deg] (type:float)
nav_pitch : Current desired pitch [deg] (type:float)
nav_bearing : Current desired heading [deg] (type:int16_t)
target_bearing : Bearing to current waypoint/target [deg] (type:int16_t)
wp_dist : Distance to active waypoint [m] (type:uint16_t)
alt_error : Current altitude error [m] (type:float)
aspd_error : Current airspeed error [m/s] (type:float)
xtrack_error : Current crosstrack error on x-y plane [m] (type:float)
'''
return MAVLink_nav_controller_output_message(nav_roll, nav_pitch, nav_bearing, target_bearing, wp_dist, alt_error, aspd_error, xtrack_error)
def nav_controller_output_send(self, nav_roll, nav_pitch, nav_bearing, target_bearing, wp_dist, alt_error, aspd_error, xtrack_error, force_mavlink1=False):
'''
The state of the fixed wing navigation and position controller.
nav_roll : Current desired roll [deg] (type:float)
nav_pitch : Current desired pitch [deg] (type:float)
nav_bearing : Current desired heading [deg] (type:int16_t)
target_bearing : Bearing to current waypoint/target [deg] (type:int16_t)
wp_dist : Distance to active waypoint [m] (type:uint16_t)
alt_error : Current altitude error [m] (type:float)
aspd_error : Current airspeed error [m/s] (type:float)
xtrack_error : Current crosstrack error on x-y plane [m] (type:float)
'''
return self.send(self.nav_controller_output_encode(nav_roll, nav_pitch, nav_bearing, target_bearing, wp_dist, alt_error, aspd_error, xtrack_error), force_mavlink1=force_mavlink1)
def global_position_int_cov_encode(self, time_usec, estimator_type, lat, lon, alt, relative_alt, vx, vy, vz, covariance):
'''
The filtered global position (e.g. fused GPS and accelerometers). The
position is in GPS-frame (right-handed, Z-up). It is
designed as scaled integer message since the
resolution of float is not sufficient. NOTE: This
message is intended for onboard networks / companion
computers and higher-bandwidth links and optimized for
accuracy and completeness. Please use the
GLOBAL_POSITION_INT message for a minimal subset.
time_usec : 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. [us] (type:uint64_t)
estimator_type : Class id of the estimator this estimate originated from. (type:uint8_t, values:MAV_ESTIMATOR_TYPE)
lat : Latitude [degE7] (type:int32_t)
lon : Longitude [degE7] (type:int32_t)
alt : Altitude in meters above MSL [mm] (type:int32_t)
relative_alt : Altitude above ground [mm] (type:int32_t)
vx : Ground X Speed (Latitude) [m/s] (type:float)
vy : Ground Y Speed (Longitude) [m/s] (type:float)
vz : Ground Z Speed (Altitude) [m/s] (type:float)
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. (type:float)
'''
return MAVLink_global_position_int_cov_message(time_usec, estimator_type, lat, lon, alt, relative_alt, vx, vy, vz, covariance)
def global_position_int_cov_send(self, time_usec, estimator_type, lat, lon, alt, relative_alt, vx, vy, vz, covariance, force_mavlink1=False):
'''
The filtered global position (e.g. fused GPS and accelerometers). The
position is in GPS-frame (right-handed, Z-up). It is
designed as scaled integer message since the
resolution of float is not sufficient. NOTE: This
message is intended for onboard networks / companion
computers and higher-bandwidth links and optimized for
accuracy and completeness. Please use the
GLOBAL_POSITION_INT message for a minimal subset.
time_usec : 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. [us] (type:uint64_t)
estimator_type : Class id of the estimator this estimate originated from. (type:uint8_t, values:MAV_ESTIMATOR_TYPE)
lat : Latitude [degE7] (type:int32_t)
lon : Longitude [degE7] (type:int32_t)
alt : Altitude in meters above MSL [mm] (type:int32_t)
relative_alt : Altitude above ground [mm] (type:int32_t)
vx : Ground X Speed (Latitude) [m/s] (type:float)
vy : Ground Y Speed (Longitude) [m/s] (type:float)
vz : Ground Z Speed (Altitude) [m/s] (type:float)
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. (type:float)
'''
return self.send(self.global_position_int_cov_encode(time_usec, estimator_type, lat, lon, alt, relative_alt, vx, vy, vz, covariance), force_mavlink1=force_mavlink1)
def local_position_ned_cov_encode(self, time_usec, estimator_type, x, y, z, vx, vy, vz, ax, ay, az, covariance):
'''
The filtered local position (e.g. fused computer vision and
accelerometers). Coordinate frame is right-handed,
Z-axis down (aeronautical frame, NED / north-east-down
convention)
time_usec : 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. [us] (type:uint64_t)
estimator_type : Class id of the estimator this estimate originated from. (type:uint8_t, values:MAV_ESTIMATOR_TYPE)
x : X Position [m] (type:float)
y : Y Position [m] (type:float)
z : Z Position [m] (type:float)
vx : X Speed [m/s] (type:float)
vy : Y Speed [m/s] (type:float)
vz : Z Speed [m/s] (type:float)
ax : X Acceleration [m/s/s] (type:float)
ay : Y Acceleration [m/s/s] (type:float)
az : Z Acceleration [m/s/s] (type:float)
covariance : Row-major representation of position, velocity and acceleration 9x9 cross-covariance matrix upper right triangle (states: x, y, z, vx, vy, vz, ax, ay, az; first nine entries are the first ROW, next eight entries are the second row, etc.). If unknown, assign NaN value to first element in the array. (type:float)
'''
return MAVLink_local_position_ned_cov_message(time_usec, estimator_type, x, y, z, vx, vy, vz, ax, ay, az, covariance)
def local_position_ned_cov_send(self, time_usec, estimator_type, x, y, z, vx, vy, vz, ax, ay, az, covariance, force_mavlink1=False):
'''
The filtered local position (e.g. fused computer vision and
accelerometers). Coordinate frame is right-handed,
Z-axis down (aeronautical frame, NED / north-east-down
convention)
time_usec : 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. [us] (type:uint64_t)
estimator_type : Class id of the estimator this estimate originated from. (type:uint8_t, values:MAV_ESTIMATOR_TYPE)
x : X Position [m] (type:float)
y : Y Position [m] (type:float)
z : Z Position [m] (type:float)
vx : X Speed [m/s] (type:float)
vy : Y Speed [m/s] (type:float)
vz : Z Speed [m/s] (type:float)
ax : X Acceleration [m/s/s] (type:float)
ay : Y Acceleration [m/s/s] (type:float)
az : Z Acceleration [m/s/s] (type:float)
covariance : Row-major representation of position, velocity and acceleration 9x9 cross-covariance matrix upper right triangle (states: x, y, z, vx, vy, vz, ax, ay, az; first nine entries are the first ROW, next eight entries are the second row, etc.). If unknown, assign NaN value to first element in the array. (type:float)
'''
return self.send(self.local_position_ned_cov_encode(time_usec, estimator_type, x, y, z, vx, vy, vz, ax, ay, az, covariance), force_mavlink1=force_mavlink1)
def rc_channels_encode(self, time_boot_ms, chancount, chan1_raw, chan2_raw, chan3_raw, chan4_raw, chan5_raw, chan6_raw, chan7_raw, chan8_raw, chan9_raw, chan10_raw, chan11_raw, chan12_raw, chan13_raw, chan14_raw, chan15_raw, chan16_raw, chan17_raw, chan18_raw, rssi):
'''
The PPM values of the RC channels received. The standard PPM
modulation is as follows: 1000 microseconds: 0%, 2000
microseconds: 100%. A value of UINT16_MAX implies the
channel is unused. Individual receivers/transmitters
might violate this specification.
time_boot_ms : Timestamp (time since system boot). [ms] (type:uint32_t)
chancount : Total number of RC channels being received. This can be larger than 18, indicating that more channels are available but not given in this message. This value should be 0 when no RC channels are available. (type:uint8_t)
chan1_raw : RC channel 1 value. [us] (type:uint16_t)
chan2_raw : RC channel 2 value. [us] (type:uint16_t)
chan3_raw : RC channel 3 value. [us] (type:uint16_t)
chan4_raw : RC channel 4 value. [us] (type:uint16_t)
chan5_raw : RC channel 5 value. [us] (type:uint16_t)
chan6_raw : RC channel 6 value. [us] (type:uint16_t)
chan7_raw : RC channel 7 value. [us] (type:uint16_t)
chan8_raw : RC channel 8 value. [us] (type:uint16_t)
chan9_raw : RC channel 9 value. [us] (type:uint16_t)
chan10_raw : RC channel 10 value. [us] (type:uint16_t)
chan11_raw : RC channel 11 value. [us] (type:uint16_t)
chan12_raw : RC channel 12 value. [us] (type:uint16_t)
chan13_raw : RC channel 13 value. [us] (type:uint16_t)
chan14_raw : RC channel 14 value. [us] (type:uint16_t)
chan15_raw : RC channel 15 value. [us] (type:uint16_t)
chan16_raw : RC channel 16 value. [us] (type:uint16_t)
chan17_raw : RC channel 17 value. [us] (type:uint16_t)
chan18_raw : RC channel 18 value. [us] (type:uint16_t)
rssi : Receive signal strength indicator in device-dependent units/scale. Values: [0-254], 255: invalid/unknown. (type:uint8_t)
'''
return MAVLink_rc_channels_message(time_boot_ms, chancount, chan1_raw, chan2_raw, chan3_raw, chan4_raw, chan5_raw, chan6_raw, chan7_raw, chan8_raw, chan9_raw, chan10_raw, chan11_raw, chan12_raw, chan13_raw, chan14_raw, chan15_raw, chan16_raw, chan17_raw, chan18_raw, rssi)
def rc_channels_send(self, time_boot_ms, chancount, chan1_raw, chan2_raw, chan3_raw, chan4_raw, chan5_raw, chan6_raw, chan7_raw, chan8_raw, chan9_raw, chan10_raw, chan11_raw, chan12_raw, chan13_raw, chan14_raw, chan15_raw, chan16_raw, chan17_raw, chan18_raw, rssi, force_mavlink1=False):
'''
The PPM values of the RC channels received. The standard PPM
modulation is as follows: 1000 microseconds: 0%, 2000
microseconds: 100%. A value of UINT16_MAX implies the
channel is unused. Individual receivers/transmitters
might violate this specification.
time_boot_ms : Timestamp (time since system boot). [ms] (type:uint32_t)
chancount : Total number of RC channels being received. This can be larger than 18, indicating that more channels are available but not given in this message. This value should be 0 when no RC channels are available. (type:uint8_t)
chan1_raw : RC channel 1 value. [us] (type:uint16_t)
chan2_raw : RC channel 2 value. [us] (type:uint16_t)
chan3_raw : RC channel 3 value. [us] (type:uint16_t)
chan4_raw : RC channel 4 value. [us] (type:uint16_t)
chan5_raw : RC channel 5 value. [us] (type:uint16_t)
chan6_raw : RC channel 6 value. [us] (type:uint16_t)
chan7_raw : RC channel 7 value. [us] (type:uint16_t)
chan8_raw : RC channel 8 value. [us] (type:uint16_t)
chan9_raw : RC channel 9 value. [us] (type:uint16_t)
chan10_raw : RC channel 10 value. [us] (type:uint16_t)
chan11_raw : RC channel 11 value. [us] (type:uint16_t)
chan12_raw : RC channel 12 value. [us] (type:uint16_t)
chan13_raw : RC channel 13 value. [us] (type:uint16_t)
chan14_raw : RC channel 14 value. [us] (type:uint16_t)
chan15_raw : RC channel 15 value. [us] (type:uint16_t)
chan16_raw : RC channel 16 value. [us] (type:uint16_t)
chan17_raw : RC channel 17 value. [us] (type:uint16_t)
chan18_raw : RC channel 18 value. [us] (type:uint16_t)
rssi : Receive signal strength indicator in device-dependent units/scale. Values: [0-254], 255: invalid/unknown. (type:uint8_t)
'''
return self.send(self.rc_channels_encode(time_boot_ms, chancount, chan1_raw, chan2_raw, chan3_raw, chan4_raw, chan5_raw, chan6_raw, chan7_raw, chan8_raw, chan9_raw, chan10_raw, chan11_raw, chan12_raw, chan13_raw, chan14_raw, chan15_raw, chan16_raw, chan17_raw, chan18_raw, rssi), force_mavlink1=force_mavlink1)
def request_data_stream_encode(self, target_system, target_component, req_stream_id, req_message_rate, start_stop):
'''
Request a data stream.
target_system : The target requested to send the message stream. (type:uint8_t)
target_component : The target requested to send the message stream. (type:uint8_t)
req_stream_id : The ID of the requested data stream (type:uint8_t)
req_message_rate : The requested message rate [Hz] (type:uint16_t)
start_stop : 1 to start sending, 0 to stop sending. (type:uint8_t)
'''
return MAVLink_request_data_stream_message(target_system, target_component, req_stream_id, req_message_rate, start_stop)
def request_data_stream_send(self, target_system, target_component, req_stream_id, req_message_rate, start_stop, force_mavlink1=False):
'''
Request a data stream.
target_system : The target requested to send the message stream. (type:uint8_t)
target_component : The target requested to send the message stream. (type:uint8_t)
req_stream_id : The ID of the requested data stream (type:uint8_t)
req_message_rate : The requested message rate [Hz] (type:uint16_t)
start_stop : 1 to start sending, 0 to stop sending. (type:uint8_t)
'''
return self.send(self.request_data_stream_encode(target_system, target_component, req_stream_id, req_message_rate, start_stop), force_mavlink1=force_mavlink1)
def data_stream_encode(self, stream_id, message_rate, on_off):
'''
Data stream status information.
stream_id : The ID of the requested data stream (type:uint8_t)
message_rate : The message rate [Hz] (type:uint16_t)
on_off : 1 stream is enabled, 0 stream is stopped. (type:uint8_t)
'''
return MAVLink_data_stream_message(stream_id, message_rate, on_off)
def data_stream_send(self, stream_id, message_rate, on_off, force_mavlink1=False):
'''
Data stream status information.
stream_id : The ID of the requested data stream (type:uint8_t)
message_rate : The message rate [Hz] (type:uint16_t)
on_off : 1 stream is enabled, 0 stream is stopped. (type:uint8_t)
'''
return self.send(self.data_stream_encode(stream_id, message_rate, on_off), force_mavlink1=force_mavlink1)
def manual_control_encode(self, target, x, y, z, r, buttons):
'''
This message provides an API for manually controlling the vehicle
using standard joystick axes nomenclature, along with
a joystick-like input device. Unused axes can be
disabled an buttons are also transmit as boolean
values of their
target : The system to be controlled. (type:uint8_t)
x : X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle. (type:int16_t)
y : Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle. (type:int16_t)
z : Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle. Positive values are positive thrust, negative values are negative thrust. (type:int16_t)
r : R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle. (type:int16_t)
buttons : A bitfield corresponding to the joystick buttons' current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1. (type:uint16_t)
'''
return MAVLink_manual_control_message(target, x, y, z, r, buttons)
def manual_control_send(self, target, x, y, z, r, buttons, force_mavlink1=False):
'''
This message provides an API for manually controlling the vehicle
using standard joystick axes nomenclature, along with
a joystick-like input device. Unused axes can be
disabled an buttons are also transmit as boolean
values of their
target : The system to be controlled. (type:uint8_t)
x : X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle. (type:int16_t)
y : Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle. (type:int16_t)
z : Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle. Positive values are positive thrust, negative values are negative thrust. (type:int16_t)
r : R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle. (type:int16_t)
buttons : A bitfield corresponding to the joystick buttons' current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1. (type:uint16_t)
'''
return self.send(self.manual_control_encode(target, x, y, z, r, buttons), force_mavlink1=force_mavlink1)
def rc_channels_override_encode(self, target_system, target_component, chan1_raw, chan2_raw, chan3_raw, chan4_raw, chan5_raw, chan6_raw, chan7_raw, chan8_raw):
'''
The RAW values of the RC channels sent to the MAV to override info
received from the RC radio. A value of UINT16_MAX
means no change to that channel. A value of 0 means
control of that channel should be released back to the
RC radio. The standard PPM modulation is as follows:
1000 microseconds: 0%, 2000 microseconds: 100%.
Individual receivers/transmitters might violate this
specification.
target_system : System ID (type:uint8_t)
target_component : Component ID (type:uint8_t)
chan1_raw : RC channel 1 value. A value of UINT16_MAX means to ignore this field. [us] (type:uint16_t)
chan2_raw : RC channel 2 value. A value of UINT16_MAX means to ignore this field. [us] (type:uint16_t)
chan3_raw : RC channel 3 value. A value of UINT16_MAX means to ignore this field. [us] (type:uint16_t)
chan4_raw : RC channel 4 value. A value of UINT16_MAX means to ignore this field. [us] (type:uint16_t)
chan5_raw : RC channel 5 value. A value of UINT16_MAX means to ignore this field. [us] (type:uint16_t)
chan6_raw : RC channel 6 value. A value of UINT16_MAX means to ignore this field. [us] (type:uint16_t)
chan7_raw : RC channel 7 value. A value of UINT16_MAX means to ignore this field. [us] (type:uint16_t)
chan8_raw : RC channel 8 value. A value of UINT16_MAX means to ignore this field. [us] (type:uint16_t)
'''
return MAVLink_rc_channels_override_message(target_system, target_component, chan1_raw, chan2_raw, chan3_raw, chan4_raw, chan5_raw, chan6_raw, chan7_raw, chan8_raw)
def rc_channels_override_send(self, target_system, target_component, chan1_raw, chan2_raw, chan3_raw, chan4_raw, chan5_raw, chan6_raw, chan7_raw, chan8_raw, force_mavlink1=False):
'''
The RAW values of the RC channels sent to the MAV to override info
received from the RC radio. A value of UINT16_MAX
means no change to that channel. A value of 0 means
control of that channel should be released back to the
RC radio. The standard PPM modulation is as follows:
1000 microseconds: 0%, 2000 microseconds: 100%.
Individual receivers/transmitters might violate this
specification.
target_system : System ID (type:uint8_t)
target_component : Component ID (type:uint8_t)
chan1_raw : RC channel 1 value. A value of UINT16_MAX means to ignore this field. [us] (type:uint16_t)
chan2_raw : RC channel 2 value. A value of UINT16_MAX means to ignore this field. [us] (type:uint16_t)
chan3_raw : RC channel 3 value. A value of UINT16_MAX means to ignore this field. [us] (type:uint16_t)
chan4_raw : RC channel 4 value. A value of UINT16_MAX means to ignore this field. [us] (type:uint16_t)
chan5_raw : RC channel 5 value. A value of UINT16_MAX means to ignore this field. [us] (type:uint16_t)
chan6_raw : RC channel 6 value. A value of UINT16_MAX means to ignore this field. [us] (type:uint16_t)
chan7_raw : RC channel 7 value. A value of UINT16_MAX means to ignore this field. [us] (type:uint16_t)
chan8_raw : RC channel 8 value. A value of UINT16_MAX means to ignore this field. [us] (type:uint16_t)
'''
return self.send(self.rc_channels_override_encode(target_system, target_component, chan1_raw, chan2_raw, chan3_raw, chan4_raw, chan5_raw, chan6_raw, chan7_raw, chan8_raw), force_mavlink1=force_mavlink1)
def mission_item_int_encode(self, target_system, target_component, seq, frame, command, current, autocontinue, param1, param2, param3, param4, x, y, z):
'''
Message encoding a mission item. This message is emitted to announce
the presence of a mission item and to set a mission
item on the system. The mission item can be either in
x, y, z meters (type: LOCAL) or x:lat, y:lon,
z:altitude. Local frame is Z-down, right handed (NED),
global frame is Z-up, right handed (ENU). NaN or
INT32_MAX may be used in float/integer params
(respectively) to indicate optional/default values
(e.g. to use the component's current latitude, yaw
rather than a specific value). See also
https://mavlink.io/en/services/mission.html.
target_system : System ID (type:uint8_t)
target_component : Component ID (type:uint8_t)
seq : Waypoint ID (sequence number). Starts at zero. Increases monotonically for each waypoint, no gaps in the sequence (0,1,2,3,4). (type:uint16_t)
frame : The coordinate system of the waypoint. (type:uint8_t, values:MAV_FRAME)
command : The scheduled action for the waypoint. (type:uint16_t, values:MAV_CMD)
current : false:0, true:1 (type:uint8_t)
autocontinue : Autocontinue to next waypoint (type:uint8_t)
param1 : PARAM1, see MAV_CMD enum (type:float)
param2 : PARAM2, see MAV_CMD enum (type:float)
param3 : PARAM3, see MAV_CMD enum (type:float)
param4 : PARAM4, see MAV_CMD enum (type:float)
x : PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7 (type:int32_t)
y : PARAM6 / y position: local: x position in meters * 1e4, global: longitude in degrees *10^7 (type:int32_t)
z : PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame. (type:float)
'''
return MAVLink_mission_item_int_message(target_system, target_component, seq, frame, command, current, autocontinue, param1, param2, param3, param4, x, y, z)
def mission_item_int_send(self, target_system, target_component, seq, frame, command, current, autocontinue, param1, param2, param3, param4, x, y, z, force_mavlink1=False):
'''
Message encoding a mission item. This message is emitted to announce
the presence of a mission item and to set a mission
item on the system. The mission item can be either in
x, y, z meters (type: LOCAL) or x:lat, y:lon,
z:altitude. Local frame is Z-down, right handed (NED),
global frame is Z-up, right handed (ENU). NaN or
INT32_MAX may be used in float/integer params
(respectively) to indicate optional/default values
(e.g. to use the component's current latitude, yaw
rather than a specific value). See also
https://mavlink.io/en/services/mission.html.
target_system : System ID (type:uint8_t)
target_component : Component ID (type:uint8_t)
seq : Waypoint ID (sequence number). Starts at zero. Increases monotonically for each waypoint, no gaps in the sequence (0,1,2,3,4). (type:uint16_t)
frame : The coordinate system of the waypoint. (type:uint8_t, values:MAV_FRAME)
command : The scheduled action for the waypoint. (type:uint16_t, values:MAV_CMD)
current : false:0, true:1 (type:uint8_t)
autocontinue : Autocontinue to next waypoint (type:uint8_t)
param1 : PARAM1, see MAV_CMD enum (type:float)
param2 : PARAM2, see MAV_CMD enum (type:float)
param3 : PARAM3, see MAV_CMD enum (type:float)
param4 : PARAM4, see MAV_CMD enum (type:float)
x : PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7 (type:int32_t)
y : PARAM6 / y position: local: x position in meters * 1e4, global: longitude in degrees *10^7 (type:int32_t)
z : PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame. (type:float)
'''
return self.send(self.mission_item_int_encode(target_system, target_component, seq, frame, command, current, autocontinue, param1, param2, param3, param4, x, y, z), force_mavlink1=force_mavlink1)
def vfr_hud_encode(self, airspeed, groundspeed, heading, throttle, alt, climb):
'''
Metrics typically displayed on a HUD for fixed wing aircraft.
airspeed : Current indicated airspeed (IAS). [m/s] (type:float)
groundspeed : Current ground speed. [m/s] (type:float)
heading : Current heading in compass units (0-360, 0=north). [deg] (type:int16_t)
throttle : Current throttle setting (0 to 100). [%] (type:uint16_t)
alt : Current altitude (MSL). [m] (type:float)
climb : Current climb rate. [m/s] (type:float)
'''
return MAVLink_vfr_hud_message(airspeed, groundspeed, heading, throttle, alt, climb)
def vfr_hud_send(self, airspeed, groundspeed, heading, throttle, alt, climb, force_mavlink1=False):
'''
Metrics typically displayed on a HUD for fixed wing aircraft.
airspeed : Current indicated airspeed (IAS). [m/s] (type:float)
groundspeed : Current ground speed. [m/s] (type:float)
heading : Current heading in compass units (0-360, 0=north). [deg] (type:int16_t)
throttle : Current throttle setting (0 to 100). [%] (type:uint16_t)
alt : Current altitude (MSL). [m] (type:float)
climb : Current climb rate. [m/s] (type:float)
'''
return self.send(self.vfr_hud_encode(airspeed, groundspeed, heading, throttle, alt, climb), force_mavlink1=force_mavlink1)
def command_int_encode(self, target_system, target_component, frame, command, current, autocontinue, param1, param2, param3, param4, x, y, z):
'''
Message encoding a command with parameters as scaled integers. Scaling
depends on the actual command value. The command
microservice is documented at
https://mavlink.io/en/services/command.html
target_system : System ID (type:uint8_t)
target_component : Component ID (type:uint8_t)
frame : The coordinate system of the COMMAND. (type:uint8_t, values:MAV_FRAME)
command : The scheduled action for the mission item. (type:uint16_t, values:MAV_CMD)
current : false:0, true:1 (type:uint8_t)
autocontinue : autocontinue to next wp (type:uint8_t)
param1 : PARAM1, see MAV_CMD enum (type:float)
param2 : PARAM2, see MAV_CMD enum (type:float)
param3 : PARAM3, see MAV_CMD enum (type:float)
param4 : PARAM4, see MAV_CMD enum (type:float)
x : PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7 (type:int32_t)
y : PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7 (type:int32_t)
z : PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame). (type:float)
'''
return MAVLink_command_int_message(target_system, target_component, frame, command, current, autocontinue, param1, param2, param3, param4, x, y, z)
def command_int_send(self, target_system, target_component, frame, command, current, autocontinue, param1, param2, param3, param4, x, y, z, force_mavlink1=False):
'''
Message encoding a command with parameters as scaled integers. Scaling
depends on the actual command value. The command
microservice is documented at
https://mavlink.io/en/services/command.html
target_system : System ID (type:uint8_t)
target_component : Component ID (type:uint8_t)
frame : The coordinate system of the COMMAND. (type:uint8_t, values:MAV_FRAME)
command : The scheduled action for the mission item. (type:uint16_t, values:MAV_CMD)
current : false:0, true:1 (type:uint8_t)
autocontinue : autocontinue to next wp (type:uint8_t)
param1 : PARAM1, see MAV_CMD enum (type:float)
param2 : PARAM2, see MAV_CMD enum (type:float)
param3 : PARAM3, see MAV_CMD enum (type:float)
param4 : PARAM4, see MAV_CMD enum (type:float)
x : PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7 (type:int32_t)
y : PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7 (type:int32_t)
z : PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame). (type:float)
'''
return self.send(self.command_int_encode(target_system, target_component, frame, command, current, autocontinue, param1, param2, param3, param4, x, y, z), force_mavlink1=force_mavlink1)
def command_long_encode(self, target_system, target_component, command, confirmation, param1, param2, param3, param4, param5, param6, param7):
'''
Send a command with up to seven parameters to the MAV. The command
microservice is documented at
https://mavlink.io/en/services/command.html
target_system : System which should execute the command (type:uint8_t)
target_component : Component which should execute the command, 0 for all components (type:uint8_t)
command : Command ID (of command to send). (type:uint16_t, values:MAV_CMD)
confirmation : 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command) (type:uint8_t)
param1 : Parameter 1 (for the specific command). (type:float)
param2 : Parameter 2 (for the specific command). (type:float)
param3 : Parameter 3 (for the specific command). (type:float)
param4 : Parameter 4 (for the specific command). (type:float)
param5 : Parameter 5 (for the specific command). (type:float)
param6 : Parameter 6 (for the specific command). (type:float)
param7 : Parameter 7 (for the specific command). (type:float)
'''
return MAVLink_command_long_message(target_system, target_component, command, confirmation, param1, param2, param3, param4, param5, param6, param7)
def command_long_send(self, target_system, target_component, command, confirmation, param1, param2, param3, param4, param5, param6, param7, force_mavlink1=False):
'''
Send a command with up to seven parameters to the MAV. The command
microservice is documented at
https://mavlink.io/en/services/command.html
target_system : System which should execute the command (type:uint8_t)
target_component : Component which should execute the command, 0 for all components (type:uint8_t)
command : Command ID (of command to send). (type:uint16_t, values:MAV_CMD)
confirmation : 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command) (type:uint8_t)
param1 : Parameter 1 (for the specific command). (type:float)
param2 : Parameter 2 (for the specific command). (type:float)
param3 : Parameter 3 (for the specific command). (type:float)
param4 : Parameter 4 (for the specific command). (type:float)
param5 : Parameter 5 (for the specific command). (type:float)
param6 : Parameter 6 (for the specific command). (type:float)
param7 : Parameter 7 (for the specific command). (type:float)
'''
return self.send(self.command_long_encode(target_system, target_component, command, confirmation, param1, param2, param3, param4, param5, param6, param7), force_mavlink1=force_mavlink1)
def command_ack_encode(self, command, result):
'''
Report status of a command. Includes feedback whether the command was
executed. The command microservice is documented at
https://mavlink.io/en/services/command.html
command : Command ID (of acknowledged command). (type:uint16_t, values:MAV_CMD)
result : Result of command. (type:uint8_t, values:MAV_RESULT)
'''
return MAVLink_command_ack_message(command, result)
def command_ack_send(self, command, result, force_mavlink1=False):
'''
Report status of a command. Includes feedback whether the command was
executed. The command microservice is documented at
https://mavlink.io/en/services/command.html
command : Command ID (of acknowledged command). (type:uint16_t, values:MAV_CMD)
result : Result of command. (type:uint8_t, values:MAV_RESULT)
'''
return self.send(self.command_ack_encode(command, result), force_mavlink1=force_mavlink1)
def manual_setpoint_encode(self, time_boot_ms, roll, pitch, yaw, thrust, mode_switch, manual_override_switch):
'''
Setpoint in roll, pitch, yaw and thrust from the operator
time_boot_ms : Timestamp (time since system boot). [ms] (type:uint32_t)
roll : Desired roll rate [rad/s] (type:float)
pitch : Desired pitch rate [rad/s] (type:float)
yaw : Desired yaw rate [rad/s] (type:float)
thrust : Collective thrust, normalized to 0 .. 1 (type:float)
mode_switch : Flight mode switch position, 0.. 255 (type:uint8_t)
manual_override_switch : Override mode switch position, 0.. 255 (type:uint8_t)
'''
return MAVLink_manual_setpoint_message(time_boot_ms, roll, pitch, yaw, thrust, mode_switch, manual_override_switch)
def manual_setpoint_send(self, time_boot_ms, roll, pitch, yaw, thrust, mode_switch, manual_override_switch, force_mavlink1=False):
'''
Setpoint in roll, pitch, yaw and thrust from the operator
time_boot_ms : Timestamp (time since system boot). [ms] (type:uint32_t)
roll : Desired roll rate [rad/s] (type:float)
pitch : Desired pitch rate [rad/s] (type:float)
yaw : Desired yaw rate [rad/s] (type:float)
thrust : Collective thrust, normalized to 0 .. 1 (type:float)
mode_switch : Flight mode switch position, 0.. 255 (type:uint8_t)
manual_override_switch : Override mode switch position, 0.. 255 (type:uint8_t)
'''
return self.send(self.manual_setpoint_encode(time_boot_ms, roll, pitch, yaw, thrust, mode_switch, manual_override_switch), force_mavlink1=force_mavlink1)
def set_attitude_target_encode(self, time_boot_ms, target_system, target_component, type_mask, q, body_roll_rate, body_pitch_rate, body_yaw_rate, thrust):
'''
Sets a desired vehicle attitude. Used by an external controller to
command the vehicle (manual controller or other
system).
time_boot_ms : Timestamp (time since system boot). [ms] (type:uint32_t)
target_system : System ID (type:uint8_t)
target_component : Component ID (type:uint8_t)
type_mask : Mappings: If any of these bits are set, the corresponding input should be ignored: bit 1: body roll rate, bit 2: body pitch rate, bit 3: body yaw rate. bit 4-bit 6: reserved, bit 7: throttle, bit 8: attitude (type:uint8_t)
q : Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) (type:float)
body_roll_rate : Body roll rate [rad/s] (type:float)
body_pitch_rate : Body pitch rate [rad/s] (type:float)
body_yaw_rate : Body yaw rate [rad/s] (type:float)
thrust : Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust) (type:float)
'''
return MAVLink_set_attitude_target_message(time_boot_ms, target_system, target_component, type_mask, q, body_roll_rate, body_pitch_rate, body_yaw_rate, thrust)
def set_attitude_target_send(self, time_boot_ms, target_system, target_component, type_mask, q, body_roll_rate, body_pitch_rate, body_yaw_rate, thrust, force_mavlink1=False):
'''
Sets a desired vehicle attitude. Used by an external controller to
command the vehicle (manual controller or other
system).
time_boot_ms : Timestamp (time since system boot). [ms] (type:uint32_t)
target_system : System ID (type:uint8_t)
target_component : Component ID (type:uint8_t)
type_mask : Mappings: If any of these bits are set, the corresponding input should be ignored: bit 1: body roll rate, bit 2: body pitch rate, bit 3: body yaw rate. bit 4-bit 6: reserved, bit 7: throttle, bit 8: attitude (type:uint8_t)
q : Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) (type:float)
body_roll_rate : Body roll rate [rad/s] (type:float)
body_pitch_rate : Body pitch rate [rad/s] (type:float)
body_yaw_rate : Body yaw rate [rad/s] (type:float)
thrust : Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust) (type:float)
'''
return self.send(self.set_attitude_target_encode(time_boot_ms, target_system, target_component, type_mask, q, body_roll_rate, body_pitch_rate, body_yaw_rate, thrust), force_mavlink1=force_mavlink1)
def attitude_target_encode(self, time_boot_ms, type_mask, q, body_roll_rate, body_pitch_rate, body_yaw_rate, thrust):
'''
Reports the current commanded attitude of the vehicle as specified by
the autopilot. This should match the commands sent in
a SET_ATTITUDE_TARGET message if the vehicle is being
controlled this way.
time_boot_ms : Timestamp (time since system boot). [ms] (type:uint32_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 (type:uint8_t)
q : Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) (type:float)
body_roll_rate : Body roll rate [rad/s] (type:float)
body_pitch_rate : Body pitch rate [rad/s] (type:float)
body_yaw_rate : Body yaw rate [rad/s] (type:float)
thrust : Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust) (type:float)
'''
return MAVLink_attitude_target_message(time_boot_ms, type_mask, q, body_roll_rate, body_pitch_rate, body_yaw_rate, thrust)
def attitude_target_send(self, time_boot_ms, type_mask, q, body_roll_rate, body_pitch_rate, body_yaw_rate, thrust, force_mavlink1=False):
'''
Reports the current commanded attitude of the vehicle as specified by
the autopilot. This should match the commands sent in
a SET_ATTITUDE_TARGET message if the vehicle is being
controlled this way.
time_boot_ms : Timestamp (time since system boot). [ms] (type:uint32_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 (type:uint8_t)
q : Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) (type:float)
body_roll_rate : Body roll rate [rad/s] (type:float)
body_pitch_rate : Body pitch rate [rad/s] (type:float)
body_yaw_rate : Body yaw rate [rad/s] (type:float)
thrust : Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust) (type:float)
'''
return self.send(self.attitude_target_encode(time_boot_ms, type_mask, q, body_roll_rate, body_pitch_rate, body_yaw_rate, thrust), force_mavlink1=force_mavlink1)
def set_position_target_local_ned_encode(self, time_boot_ms, target_system, target_component, coordinate_frame, type_mask, x, y, z, vx, vy, vz, afx, afy, afz, yaw, yaw_rate):
'''
Sets a desired vehicle position in a local north-east-down coordinate
frame. Used by an external controller to command the
vehicle (manual controller or other system).
time_boot_ms : Timestamp (time since system boot). [ms] (type:uint32_t)
target_system : System ID (type:uint8_t)
target_component : Component ID (type:uint8_t)
coordinate_frame : Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9 (type:uint8_t, values:MAV_FRAME)
type_mask : Bitmap to indicate which dimensions should be ignored by the vehicle. (type:uint16_t, values:POSITION_TARGET_TYPEMASK)
x : X Position in NED frame [m] (type:float)
y : Y Position in NED frame [m] (type:float)
z : Z Position in NED frame (note, altitude is negative in NED) [m] (type:float)
vx : X velocity in NED frame [m/s] (type:float)
vy : Y velocity in NED frame [m/s] (type:float)
vz : Z velocity in NED frame [m/s] (type:float)
afx : X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N [m/s/s] (type:float)
afy : Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N [m/s/s] (type:float)
afz : Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N [m/s/s] (type:float)
yaw : yaw setpoint [rad] (type:float)
yaw_rate : yaw rate setpoint [rad/s] (type:float)
'''
return MAVLink_set_position_target_local_ned_message(time_boot_ms, target_system, target_component, coordinate_frame, type_mask, x, y, z, vx, vy, vz, afx, afy, afz, yaw, yaw_rate)
def set_position_target_local_ned_send(self, time_boot_ms, target_system, target_component, coordinate_frame, type_mask, x, y, z, vx, vy, vz, afx, afy, afz, yaw, yaw_rate, force_mavlink1=False):
'''
Sets a desired vehicle position in a local north-east-down coordinate
frame. Used by an external controller to command the
vehicle (manual controller or other system).
time_boot_ms : Timestamp (time since system boot). [ms] (type:uint32_t)
target_system : System ID (type:uint8_t)
target_component : Component ID (type:uint8_t)
coordinate_frame : Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9 (type:uint8_t, values:MAV_FRAME)
type_mask : Bitmap to indicate which dimensions should be ignored by the vehicle. (type:uint16_t, values:POSITION_TARGET_TYPEMASK)
x : X Position in NED frame [m] (type:float)
y : Y Position in NED frame [m] (type:float)
z : Z Position in NED frame (note, altitude is negative in NED) [m] (type:float)
vx : X velocity in NED frame [m/s] (type:float)
vy : Y velocity in NED frame [m/s] (type:float)
vz : Z velocity in NED frame [m/s] (type:float)
afx : X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N [m/s/s] (type:float)
afy : Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N [m/s/s] (type:float)
afz : Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N [m/s/s] (type:float)
yaw : yaw setpoint [rad] (type:float)
yaw_rate : yaw rate setpoint [rad/s] (type:float)
'''
return self.send(self.set_position_target_local_ned_encode(time_boot_ms, target_system, target_component, coordinate_frame, type_mask, x, y, z, vx, vy, vz, afx, afy, afz, yaw, yaw_rate), force_mavlink1=force_mavlink1)
def position_target_local_ned_encode(self, time_boot_ms, coordinate_frame, type_mask, x, y, z, vx, vy, vz, afx, afy, afz, yaw, yaw_rate):
'''
Reports the current commanded vehicle position, velocity, and
acceleration as specified by the autopilot. This
should match the commands sent in
SET_POSITION_TARGET_LOCAL_NED if the vehicle is being
controlled this way.
time_boot_ms : Timestamp (time since system boot). [ms] (type:uint32_t)
coordinate_frame : Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9 (type:uint8_t, values:MAV_FRAME)
type_mask : Bitmap to indicate which dimensions should be ignored by the vehicle. (type:uint16_t, values:POSITION_TARGET_TYPEMASK)
x : X Position in NED frame [m] (type:float)
y : Y Position in NED frame [m] (type:float)
z : Z Position in NED frame (note, altitude is negative in NED) [m] (type:float)
vx : X velocity in NED frame [m/s] (type:float)
vy : Y velocity in NED frame [m/s] (type:float)
vz : Z velocity in NED frame [m/s] (type:float)
afx : X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N [m/s/s] (type:float)
afy : Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N [m/s/s] (type:float)
afz : Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N [m/s/s] (type:float)
yaw : yaw setpoint [rad] (type:float)
yaw_rate : yaw rate setpoint [rad/s] (type:float)
'''
return MAVLink_position_target_local_ned_message(time_boot_ms, coordinate_frame, type_mask, x, y, z, vx, vy, vz, afx, afy, afz, yaw, yaw_rate)
def position_target_local_ned_send(self, time_boot_ms, coordinate_frame, type_mask, x, y, z, vx, vy, vz, afx, afy, afz, yaw, yaw_rate, force_mavlink1=False):
'''
Reports the current commanded vehicle position, velocity, and
acceleration as specified by the autopilot. This
should match the commands sent in
SET_POSITION_TARGET_LOCAL_NED if the vehicle is being
controlled this way.
time_boot_ms : Timestamp (time since system boot). [ms] (type:uint32_t)
coordinate_frame : Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9 (type:uint8_t, values:MAV_FRAME)
type_mask : Bitmap to indicate which dimensions should be ignored by the vehicle. (type:uint16_t, values:POSITION_TARGET_TYPEMASK)
x : X Position in NED frame [m] (type:float)
y : Y Position in NED frame [m] (type:float)
z : Z Position in NED frame (note, altitude is negative in NED) [m] (type:float)
vx : X velocity in NED frame [m/s] (type:float)
vy : Y velocity in NED frame [m/s] (type:float)
vz : Z velocity in NED frame [m/s] (type:float)
afx : X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N [m/s/s] (type:float)
afy : Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N [m/s/s] (type:float)
afz : Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N [m/s/s] (type:float)
yaw : yaw setpoint [rad] (type:float)
yaw_rate : yaw rate setpoint [rad/s] (type:float)
'''
return self.send(self.position_target_local_ned_encode(time_boot_ms, coordinate_frame, type_mask, x, y, z, vx, vy, vz, afx, afy, afz, yaw, yaw_rate), force_mavlink1=force_mavlink1)
def set_position_target_global_int_encode(self, time_boot_ms, target_system, target_component, coordinate_frame, type_mask, lat_int, lon_int, alt, vx, vy, vz, afx, afy, afz, yaw, yaw_rate):
'''
Sets a desired vehicle position, velocity, and/or acceleration in a
global coordinate system (WGS84). Used by an external
controller to command the vehicle (manual controller
or other system).
time_boot_ms : Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency. [ms] (type:uint32_t)
target_system : System ID (type:uint8_t)
target_component : Component ID (type:uint8_t)
coordinate_frame : Valid options are: MAV_FRAME_GLOBAL_INT = 5, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11 (type:uint8_t, values:MAV_FRAME)
type_mask : Bitmap to indicate which dimensions should be ignored by the vehicle. (type:uint16_t, values:POSITION_TARGET_TYPEMASK)
lat_int : X Position in WGS84 frame [degE7] (type:int32_t)
lon_int : Y Position in WGS84 frame [degE7] (type:int32_t)
alt : Altitude (MSL, Relative to home, or AGL - depending on frame) [m] (type:float)
vx : X velocity in NED frame [m/s] (type:float)
vy : Y velocity in NED frame [m/s] (type:float)
vz : Z velocity in NED frame [m/s] (type:float)
afx : X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N [m/s/s] (type:float)
afy : Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N [m/s/s] (type:float)
afz : Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N [m/s/s] (type:float)
yaw : yaw setpoint [rad] (type:float)
yaw_rate : yaw rate setpoint [rad/s] (type:float)
'''
return MAVLink_set_position_target_global_int_message(time_boot_ms, target_system, target_component, coordinate_frame, type_mask, lat_int, lon_int, alt, vx, vy, vz, afx, afy, afz, yaw, yaw_rate)
def set_position_target_global_int_send(self, time_boot_ms, target_system, target_component, coordinate_frame, type_mask, lat_int, lon_int, alt, vx, vy, vz, afx, afy, afz, yaw, yaw_rate, force_mavlink1=False):
'''
Sets a desired vehicle position, velocity, and/or acceleration in a
global coordinate system (WGS84). Used by an external
controller to command the vehicle (manual controller
or other system).
time_boot_ms : Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency. [ms] (type:uint32_t)
target_system : System ID (type:uint8_t)
target_component : Component ID (type:uint8_t)
coordinate_frame : Valid options are: MAV_FRAME_GLOBAL_INT = 5, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11 (type:uint8_t, values:MAV_FRAME)
type_mask : Bitmap to indicate which dimensions should be ignored by the vehicle. (type:uint16_t, values:POSITION_TARGET_TYPEMASK)
lat_int : X Position in WGS84 frame [degE7] (type:int32_t)
lon_int : Y Position in WGS84 frame [degE7] (type:int32_t)
alt : Altitude (MSL, Relative to home, or AGL - depending on frame) [m] (type:float)
vx : X velocity in NED frame [m/s] (type:float)
vy : Y velocity in NED frame [m/s] (type:float)
vz : Z velocity in NED frame [m/s] (type:float)
afx : X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N [m/s/s] (type:float)
afy : Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N [m/s/s] (type:float)
afz : Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N [m/s/s] (type:float)
yaw : yaw setpoint [rad] (type:float)
yaw_rate : yaw rate setpoint [rad/s] (type:float)
'''
return self.send(self.set_position_target_global_int_encode(time_boot_ms, target_system, target_component, coordinate_frame, type_mask, lat_int, lon_int, alt, vx, vy, vz, afx, afy, afz, yaw, yaw_rate), force_mavlink1=force_mavlink1)
def position_target_global_int_encode(self, time_boot_ms, coordinate_frame, type_mask, lat_int, lon_int, alt, vx, vy, vz, afx, afy, afz, yaw, yaw_rate):
'''
Reports the current commanded vehicle position, velocity, and
acceleration as specified by the autopilot. This
should match the commands sent in
SET_POSITION_TARGET_GLOBAL_INT if the vehicle is being
controlled this way.
time_boot_ms : Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency. [ms] (type:uint32_t)
coordinate_frame : Valid options are: MAV_FRAME_GLOBAL_INT = 5, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11 (type:uint8_t, values:MAV_FRAME)
type_mask : Bitmap to indicate which dimensions should be ignored by the vehicle. (type:uint16_t, values:POSITION_TARGET_TYPEMASK)
lat_int : X Position in WGS84 frame [degE7] (type:int32_t)
lon_int : Y Position in WGS84 frame [degE7] (type:int32_t)
alt : Altitude (MSL, AGL or relative to home altitude, depending on frame) [m] (type:float)
vx : X velocity in NED frame [m/s] (type:float)
vy : Y velocity in NED frame [m/s] (type:float)
vz : Z velocity in NED frame [m/s] (type:float)
afx : X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N [m/s/s] (type:float)
afy : Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N [m/s/s] (type:float)
afz : Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N [m/s/s] (type:float)
yaw : yaw setpoint [rad] (type:float)
yaw_rate : yaw rate setpoint [rad/s] (type:float)
'''
return MAVLink_position_target_global_int_message(time_boot_ms, coordinate_frame, type_mask, lat_int, lon_int, alt, vx, vy, vz, afx, afy, afz, yaw, yaw_rate)
def position_target_global_int_send(self, time_boot_ms, coordinate_frame, type_mask, lat_int, lon_int, alt, vx, vy, vz, afx, afy, afz, yaw, yaw_rate, force_mavlink1=False):
'''
Reports the current commanded vehicle position, velocity, and
acceleration as specified by the autopilot. This
should match the commands sent in
SET_POSITION_TARGET_GLOBAL_INT if the vehicle is being
controlled this way.
time_boot_ms : Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency. [ms] (type:uint32_t)
coordinate_frame : Valid options are: MAV_FRAME_GLOBAL_INT = 5, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11 (type:uint8_t, values:MAV_FRAME)
type_mask : Bitmap to indicate which dimensions should be ignored by the vehicle. (type:uint16_t, values:POSITION_TARGET_TYPEMASK)
lat_int : X Position in WGS84 frame [degE7] (type:int32_t)
lon_int : Y Position in WGS84 frame [degE7] (type:int32_t)
alt : Altitude (MSL, AGL or relative to home altitude, depending on frame) [m] (type:float)
vx : X velocity in NED frame [m/s] (type:float)
vy : Y velocity in NED frame [m/s] (type:float)
vz : Z velocity in NED frame [m/s] (type:float)
afx : X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N [m/s/s] (type:float)
afy : Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N [m/s/s] (type:float)
afz : Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N [m/s/s] (type:float)
yaw : yaw setpoint [rad] (type:float)
yaw_rate : yaw rate setpoint [rad/s] (type:float)
'''
return self.send(self.position_target_global_int_encode(time_boot_ms, coordinate_frame, type_mask, lat_int, lon_int, alt, vx, vy, vz, afx, afy, afz, yaw, yaw_rate), force_mavlink1=force_mavlink1)
def local_position_ned_system_global_offset_encode(self, time_boot_ms, x, y, z, roll, pitch, yaw):
'''
The offset in X, Y, Z and yaw between the LOCAL_POSITION_NED messages
of MAV X and the global coordinate frame in NED
coordinates. Coordinate frame is right-handed, Z-axis
down (aeronautical frame, NED / north-east-down
convention)
time_boot_ms : Timestamp (time since system boot). [ms] (type:uint32_t)
x : X Position [m] (type:float)
y : Y Position [m] (type:float)
z : Z Position [m] (type:float)
roll : Roll [rad] (type:float)
pitch : Pitch [rad] (type:float)
yaw : Yaw [rad] (type:float)
'''
return MAVLink_local_position_ned_system_global_offset_message(time_boot_ms, x, y, z, roll, pitch, yaw)
def local_position_ned_system_global_offset_send(self, time_boot_ms, x, y, z, roll, pitch, yaw, force_mavlink1=False):
'''
The offset in X, Y, Z and yaw between the LOCAL_POSITION_NED messages
of MAV X and the global coordinate frame in NED
coordinates. Coordinate frame is right-handed, Z-axis
down (aeronautical frame, NED / north-east-down
convention)
time_boot_ms : Timestamp (time since system boot). [ms] (type:uint32_t)
x : X Position [m] (type:float)
y : Y Position [m] (type:float)
z : Z Position [m] (type:float)
roll : Roll [rad] (type:float)
pitch : Pitch [rad] (type:float)
yaw : Yaw [rad] (type:float)
'''
return self.send(self.local_position_ned_system_global_offset_encode(time_boot_ms, x, y, z, roll, pitch, yaw), force_mavlink1=force_mavlink1)
def hil_state_encode(self, time_usec, roll, pitch, yaw, rollspeed, pitchspeed, yawspeed, lat, lon, alt, vx, vy, vz, xacc, yacc, zacc):
'''
Sent from simulation to autopilot. This packet is useful for high
throughput applications such as hardware in the loop
simulations.
time_usec : 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. [us] (type:uint64_t)
roll : Roll angle [rad] (type:float)
pitch : Pitch angle [rad] (type:float)
yaw : Yaw angle [rad] (type:float)
rollspeed : Body frame roll / phi angular speed [rad/s] (type:float)
pitchspeed : Body frame pitch / theta angular speed [rad/s] (type:float)
yawspeed : Body frame yaw / psi angular speed [rad/s] (type:float)
lat : Latitude [degE7] (type:int32_t)
lon : Longitude [degE7] (type:int32_t)
alt : Altitude [mm] (type:int32_t)
vx : Ground X Speed (Latitude) [cm/s] (type:int16_t)
vy : Ground Y Speed (Longitude) [cm/s] (type:int16_t)
vz : Ground Z Speed (Altitude) [cm/s] (type:int16_t)
xacc : X acceleration [mG] (type:int16_t)
yacc : Y acceleration [mG] (type:int16_t)
zacc : Z acceleration [mG] (type:int16_t)
'''
return MAVLink_hil_state_message(time_usec, roll, pitch, yaw, rollspeed, pitchspeed, yawspeed, lat, lon, alt, vx, vy, vz, xacc, yacc, zacc)
def hil_state_send(self, time_usec, roll, pitch, yaw, rollspeed, pitchspeed, yawspeed, lat, lon, alt, vx, vy, vz, xacc, yacc, zacc, force_mavlink1=False):
'''
Sent from simulation to autopilot. This packet is useful for high
throughput applications such as hardware in the loop
simulations.
time_usec : 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. [us] (type:uint64_t)
roll : Roll angle [rad] (type:float)
pitch : Pitch angle [rad] (type:float)
yaw : Yaw angle [rad] (type:float)
rollspeed : Body frame roll / phi angular speed [rad/s] (type:float)
pitchspeed : Body frame pitch / theta angular speed [rad/s] (type:float)
yawspeed : Body frame yaw / psi angular speed [rad/s] (type:float)
lat : Latitude [degE7] (type:int32_t)
lon : Longitude [degE7] (type:int32_t)
alt : Altitude [mm] (type:int32_t)
vx : Ground X Speed (Latitude) [cm/s] (type:int16_t)
vy : Ground Y Speed (Longitude) [cm/s] (type:int16_t)
vz : Ground Z Speed (Altitude) [cm/s] (type:int16_t)
xacc : X acceleration [mG] (type:int16_t)
yacc : Y acceleration [mG] (type:int16_t)
zacc : Z acceleration [mG] (type:int16_t)
'''
return self.send(self.hil_state_encode(time_usec, roll, pitch, yaw, rollspeed, pitchspeed, yawspeed, lat, lon, alt, vx, vy, vz, xacc, yacc, zacc), force_mavlink1=force_mavlink1)
def hil_controls_encode(self, time_usec, roll_ailerons, pitch_elevator, yaw_rudder, throttle, aux1, aux2, aux3, aux4, mode, nav_mode):
'''
Sent from autopilot to simulation. Hardware in the loop control
outputs
time_usec : 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. [us] (type:uint64_t)
roll_ailerons : Control output -1 .. 1 (type:float)
pitch_elevator : Control output -1 .. 1 (type:float)
yaw_rudder : Control output -1 .. 1 (type:float)
throttle : Throttle 0 .. 1 (type:float)
aux1 : Aux 1, -1 .. 1 (type:float)
aux2 : Aux 2, -1 .. 1 (type:float)
aux3 : Aux 3, -1 .. 1 (type:float)
aux4 : Aux 4, -1 .. 1 (type:float)
mode : System mode. (type:uint8_t, values:MAV_MODE)
nav_mode : Navigation mode (MAV_NAV_MODE) (type:uint8_t)
'''
return MAVLink_hil_controls_message(time_usec, roll_ailerons, pitch_elevator, yaw_rudder, throttle, aux1, aux2, aux3, aux4, mode, nav_mode)
def hil_controls_send(self, time_usec, roll_ailerons, pitch_elevator, yaw_rudder, throttle, aux1, aux2, aux3, aux4, mode, nav_mode, force_mavlink1=False):
'''
Sent from autopilot to simulation. Hardware in the loop control
outputs
time_usec : 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. [us] (type:uint64_t)
roll_ailerons : Control output -1 .. 1 (type:float)
pitch_elevator : Control output -1 .. 1 (type:float)
yaw_rudder : Control output -1 .. 1 (type:float)
throttle : Throttle 0 .. 1 (type:float)
aux1 : Aux 1, -1 .. 1 (type:float)
aux2 : Aux 2, -1 .. 1 (type:float)
aux3 : Aux 3, -1 .. 1 (type:float)
aux4 : Aux 4, -1 .. 1 (type:float)
mode : System mode. (type:uint8_t, values:MAV_MODE)
nav_mode : Navigation mode (MAV_NAV_MODE) (type:uint8_t)
'''
return self.send(self.hil_controls_encode(time_usec, roll_ailerons, pitch_elevator, yaw_rudder, throttle, aux1, aux2, aux3, aux4, mode, nav_mode), force_mavlink1=force_mavlink1)
def hil_rc_inputs_raw_encode(self, time_usec, chan1_raw, chan2_raw, chan3_raw, chan4_raw, chan5_raw, chan6_raw, chan7_raw, chan8_raw, chan9_raw, chan10_raw, chan11_raw, chan12_raw, rssi):
'''
Sent from simulation to autopilot. The RAW values of the RC channels
received. The standard PPM modulation is as follows:
1000 microseconds: 0%, 2000 microseconds: 100%.
Individual receivers/transmitters might violate this
specification.
time_usec : 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. [us] (type:uint64_t)
chan1_raw : RC channel 1 value [us] (type:uint16_t)
chan2_raw : RC channel 2 value [us] (type:uint16_t)
chan3_raw : RC channel 3 value [us] (type:uint16_t)
chan4_raw : RC channel 4 value [us] (type:uint16_t)
chan5_raw : RC channel 5 value [us] (type:uint16_t)
chan6_raw : RC channel 6 value [us] (type:uint16_t)
chan7_raw : RC channel 7 value [us] (type:uint16_t)
chan8_raw : RC channel 8 value [us] (type:uint16_t)
chan9_raw : RC channel 9 value [us] (type:uint16_t)
chan10_raw : RC channel 10 value [us] (type:uint16_t)
chan11_raw : RC channel 11 value [us] (type:uint16_t)
chan12_raw : RC channel 12 value [us] (type:uint16_t)
rssi : Receive signal strength indicator in device-dependent units/scale. Values: [0-254], 255: invalid/unknown. (type:uint8_t)
'''
return MAVLink_hil_rc_inputs_raw_message(time_usec, chan1_raw, chan2_raw, chan3_raw, chan4_raw, chan5_raw, chan6_raw, chan7_raw, chan8_raw, chan9_raw, chan10_raw, chan11_raw, chan12_raw, rssi)
def hil_rc_inputs_raw_send(self, time_usec, chan1_raw, chan2_raw, chan3_raw, chan4_raw, chan5_raw, chan6_raw, chan7_raw, chan8_raw, chan9_raw, chan10_raw, chan11_raw, chan12_raw, rssi, force_mavlink1=False):
'''
Sent from simulation to autopilot. The RAW values of the RC channels
received. The standard PPM modulation is as follows:
1000 microseconds: 0%, 2000 microseconds: 100%.
Individual receivers/transmitters might violate this
specification.
time_usec : 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. [us] (type:uint64_t)
chan1_raw : RC channel 1 value [us] (type:uint16_t)
chan2_raw : RC channel 2 value [us] (type:uint16_t)
chan3_raw : RC channel 3 value [us] (type:uint16_t)
chan4_raw : RC channel 4 value [us] (type:uint16_t)
chan5_raw : RC channel 5 value [us] (type:uint16_t)
chan6_raw : RC channel 6 value [us] (type:uint16_t)
chan7_raw : RC channel 7 value [us] (type:uint16_t)
chan8_raw : RC channel 8 value [us] (type:uint16_t)
chan9_raw : RC channel 9 value [us] (type:uint16_t)
chan10_raw : RC channel 10 value [us] (type:uint16_t)
chan11_raw : RC channel 11 value [us] (type:uint16_t)
chan12_raw : RC channel 12 value [us] (type:uint16_t)
rssi : Receive signal strength indicator in device-dependent units/scale. Values: [0-254], 255: invalid/unknown. (type:uint8_t)
'''
return self.send(self.hil_rc_inputs_raw_encode(time_usec, chan1_raw, chan2_raw, chan3_raw, chan4_raw, chan5_raw, chan6_raw, chan7_raw, chan8_raw, chan9_raw, chan10_raw, chan11_raw, chan12_raw, rssi), force_mavlink1=force_mavlink1)
def hil_actuator_controls_encode(self, time_usec, controls, mode, flags):
'''
Sent from autopilot to simulation. Hardware in the loop control
outputs (replacement for HIL_CONTROLS)
time_usec : 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. [us] (type:uint64_t)
controls : Control outputs -1 .. 1. Channel assignment depends on the simulated hardware. (type:float)
mode : System mode. Includes arming state. (type:uint8_t, values:MAV_MODE_FLAG)
flags : Flags as bitfield, 1: indicate simulation using lockstep. (type:uint64_t)
'''
return MAVLink_hil_actuator_controls_message(time_usec, controls, mode, flags)
def hil_actuator_controls_send(self, time_usec, controls, mode, flags, force_mavlink1=False):
'''
Sent from autopilot to simulation. Hardware in the loop control
outputs (replacement for HIL_CONTROLS)
time_usec : 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. [us] (type:uint64_t)
controls : Control outputs -1 .. 1. Channel assignment depends on the simulated hardware. (type:float)
mode : System mode. Includes arming state. (type:uint8_t, values:MAV_MODE_FLAG)
flags : Flags as bitfield, 1: indicate simulation using lockstep. (type:uint64_t)
'''
return self.send(self.hil_actuator_controls_encode(time_usec, controls, mode, flags), force_mavlink1=force_mavlink1)
def optical_flow_encode(self, time_usec, sensor_id, flow_x, flow_y, flow_comp_m_x, flow_comp_m_y, quality, ground_distance):
'''
Optical flow from a flow sensor (e.g. optical mouse sensor)
time_usec : 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. [us] (type:uint64_t)
sensor_id : Sensor ID (type:uint8_t)
flow_x : Flow in x-sensor direction [dpix] (type:int16_t)
flow_y : Flow in y-sensor direction [dpix] (type:int16_t)
flow_comp_m_x : Flow in x-sensor direction, angular-speed compensated [m/s] (type:float)
flow_comp_m_y : Flow in y-sensor direction, angular-speed compensated [m/s] (type:float)
quality : Optical flow quality / confidence. 0: bad, 255: maximum quality (type:uint8_t)
ground_distance : Ground distance. Positive value: distance known. Negative value: Unknown distance [m] (type:float)
'''
return MAVLink_optical_flow_message(time_usec, sensor_id, flow_x, flow_y, flow_comp_m_x, flow_comp_m_y, quality, ground_distance)
def optical_flow_send(self, time_usec, sensor_id, flow_x, flow_y, flow_comp_m_x, flow_comp_m_y, quality, ground_distance, force_mavlink1=False):
'''
Optical flow from a flow sensor (e.g. optical mouse sensor)
time_usec : 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. [us] (type:uint64_t)
sensor_id : Sensor ID (type:uint8_t)
flow_x : Flow in x-sensor direction [dpix] (type:int16_t)
flow_y : Flow in y-sensor direction [dpix] (type:int16_t)
flow_comp_m_x : Flow in x-sensor direction, angular-speed compensated [m/s] (type:float)
flow_comp_m_y : Flow in y-sensor direction, angular-speed compensated [m/s] (type:float)
quality : Optical flow quality / confidence. 0: bad, 255: maximum quality (type:uint8_t)
ground_distance : Ground distance. Positive value: distance known. Negative value: Unknown distance [m] (type:float)
'''
return self.send(self.optical_flow_encode(time_usec, sensor_id, flow_x, flow_y, flow_comp_m_x, flow_comp_m_y, quality, ground_distance), force_mavlink1=force_mavlink1)
def global_vision_position_estimate_encode(self, usec, x, y, z, roll, pitch, yaw):
'''
Global position/attitude estimate from a vision source.
usec : Timestamp (UNIX time or since system boot) [us] (type:uint64_t)
x : Global X position [m] (type:float)
y : Global Y position [m] (type:float)
z : Global Z position [m] (type:float)
roll : Roll angle [rad] (type:float)
pitch : Pitch angle [rad] (type:float)
yaw : Yaw angle [rad] (type:float)
'''
return MAVLink_global_vision_position_estimate_message(usec, x, y, z, roll, pitch, yaw)
def global_vision_position_estimate_send(self, usec, x, y, z, roll, pitch, yaw, force_mavlink1=False):
'''
Global position/attitude estimate from a vision source.
usec : Timestamp (UNIX time or since system boot) [us] (type:uint64_t)
x : Global X position [m] (type:float)
y : Global Y position [m] (type:float)
z : Global Z position [m] (type:float)
roll : Roll angle [rad] (type:float)
pitch : Pitch angle [rad] (type:float)
yaw : Yaw angle [rad] (type:float)
'''
return self.send(self.global_vision_position_estimate_encode(usec, x, y, z, roll, pitch, yaw), force_mavlink1=force_mavlink1)
def vision_position_estimate_encode(self, usec, x, y, z, roll, pitch, yaw):
'''
Local position/attitude estimate from a vision source.
usec : Timestamp (UNIX time or time since system boot) [us] (type:uint64_t)
x : Local X position [m] (type:float)
y : Local Y position [m] (type:float)
z : Local Z position [m] (type:float)
roll : Roll angle [rad] (type:float)
pitch : Pitch angle [rad] (type:float)
yaw : Yaw angle [rad] (type:float)
'''
return MAVLink_vision_position_estimate_message(usec, x, y, z, roll, pitch, yaw)
def vision_position_estimate_send(self, usec, x, y, z, roll, pitch, yaw, force_mavlink1=False):
'''
Local position/attitude estimate from a vision source.
usec : Timestamp (UNIX time or time since system boot) [us] (type:uint64_t)
x : Local X position [m] (type:float)
y : Local Y position [m] (type:float)
z : Local Z position [m] (type:float)
roll : Roll angle [rad] (type:float)
pitch : Pitch angle [rad] (type:float)
yaw : Yaw angle [rad] (type:float)
'''
return self.send(self.vision_position_estimate_encode(usec, x, y, z, roll, pitch, yaw), force_mavlink1=force_mavlink1)
def vision_speed_estimate_encode(self, usec, x, y, z):
'''
Speed estimate from a vision source.
usec : Timestamp (UNIX time or time since system boot) [us] (type:uint64_t)
x : Global X speed [m/s] (type:float)
y : Global Y speed [m/s] (type:float)
z : Global Z speed [m/s] (type:float)
'''
return MAVLink_vision_speed_estimate_message(usec, x, y, z)
def vision_speed_estimate_send(self, usec, x, y, z, force_mavlink1=False):
'''
Speed estimate from a vision source.
usec : Timestamp (UNIX time or time since system boot) [us] (type:uint64_t)
x : Global X speed [m/s] (type:float)
y : Global Y speed [m/s] (type:float)
z : Global Z speed [m/s] (type:float)
'''
return self.send(self.vision_speed_estimate_encode(usec, x, y, z), force_mavlink1=force_mavlink1)
def vicon_position_estimate_encode(self, usec, x, y, z, roll, pitch, yaw):
'''
Global position estimate from a Vicon motion system source.
usec : Timestamp (UNIX time or time since system boot) [us] (type:uint64_t)
x : Global X position [m] (type:float)
y : Global Y position [m] (type:float)
z : Global Z position [m] (type:float)
roll : Roll angle [rad] (type:float)
pitch : Pitch angle [rad] (type:float)
yaw : Yaw angle [rad] (type:float)
'''
return MAVLink_vicon_position_estimate_message(usec, x, y, z, roll, pitch, yaw)
def vicon_position_estimate_send(self, usec, x, y, z, roll, pitch, yaw, force_mavlink1=False):
'''
Global position estimate from a Vicon motion system source.
usec : Timestamp (UNIX time or time since system boot) [us] (type:uint64_t)
x : Global X position [m] (type:float)
y : Global Y position [m] (type:float)
z : Global Z position [m] (type:float)
roll : Roll angle [rad] (type:float)
pitch : Pitch angle [rad] (type:float)
yaw : Yaw angle [rad] (type:float)
'''
return self.send(self.vicon_position_estimate_encode(usec, x, y, z, roll, pitch, yaw), force_mavlink1=force_mavlink1)
def highres_imu_encode(self, time_usec, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag, abs_pressure, diff_pressure, pressure_alt, temperature, fields_updated):
'''
The IMU readings in SI units in NED body frame
time_usec : 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. [us] (type:uint64_t)
xacc : X acceleration [m/s/s] (type:float)
yacc : Y acceleration [m/s/s] (type:float)
zacc : Z acceleration [m/s/s] (type:float)
xgyro : Angular speed around X axis [rad/s] (type:float)
ygyro : Angular speed around Y axis [rad/s] (type:float)
zgyro : Angular speed around Z axis [rad/s] (type:float)
xmag : X Magnetic field [gauss] (type:float)
ymag : Y Magnetic field [gauss] (type:float)
zmag : Z Magnetic field [gauss] (type:float)
abs_pressure : Absolute pressure [mbar] (type:float)
diff_pressure : Differential pressure [mbar] (type:float)
pressure_alt : Altitude calculated from pressure (type:float)
temperature : Temperature [degC] (type:float)
fields_updated : Bitmap for fields that have updated since last message, bit 0 = xacc, bit 12: temperature (type:uint16_t)
'''
return MAVLink_highres_imu_message(time_usec, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag, abs_pressure, diff_pressure, pressure_alt, temperature, fields_updated)
def highres_imu_send(self, time_usec, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag, abs_pressure, diff_pressure, pressure_alt, temperature, fields_updated, force_mavlink1=False):
'''
The IMU readings in SI units in NED body frame
time_usec : 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. [us] (type:uint64_t)
xacc : X acceleration [m/s/s] (type:float)
yacc : Y acceleration [m/s/s] (type:float)
zacc : Z acceleration [m/s/s] (type:float)
xgyro : Angular speed around X axis [rad/s] (type:float)
ygyro : Angular speed around Y axis [rad/s] (type:float)
zgyro : Angular speed around Z axis [rad/s] (type:float)
xmag : X Magnetic field [gauss] (type:float)
ymag : Y Magnetic field [gauss] (type:float)
zmag : Z Magnetic field [gauss] (type:float)
abs_pressure : Absolute pressure [mbar] (type:float)
diff_pressure : Differential pressure [mbar] (type:float)
pressure_alt : Altitude calculated from pressure (type:float)
temperature : Temperature [degC] (type:float)
fields_updated : Bitmap for fields that have updated since last message, bit 0 = xacc, bit 12: temperature (type:uint16_t)
'''
return self.send(self.highres_imu_encode(time_usec, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag, abs_pressure, diff_pressure, pressure_alt, temperature, fields_updated), force_mavlink1=force_mavlink1)
def optical_flow_rad_encode(self, time_usec, sensor_id, integration_time_us, integrated_x, integrated_y, integrated_xgyro, integrated_ygyro, integrated_zgyro, temperature, quality, time_delta_distance_us, distance):
'''
Optical flow from an angular rate flow sensor (e.g. PX4FLOW or mouse
sensor)
time_usec : 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. [us] (type:uint64_t)
sensor_id : Sensor ID (type:uint8_t)
integration_time_us : Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the. [us] (type:uint32_t)
integrated_x : Flow around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.) [rad] (type:float)
integrated_y : Flow around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.) [rad] (type:float)
integrated_xgyro : RH rotation around X axis [rad] (type:float)
integrated_ygyro : RH rotation around Y axis [rad] (type:float)
integrated_zgyro : RH rotation around Z axis [rad] (type:float)
temperature : Temperature [cdegC] (type:int16_t)
quality : Optical flow quality / confidence. 0: no valid flow, 255: maximum quality (type:uint8_t)
time_delta_distance_us : Time since the distance was sampled. [us] (type:uint32_t)
distance : Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance. [m] (type:float)
'''
return MAVLink_optical_flow_rad_message(time_usec, sensor_id, integration_time_us, integrated_x, integrated_y, integrated_xgyro, integrated_ygyro, integrated_zgyro, temperature, quality, time_delta_distance_us, distance)
def optical_flow_rad_send(self, time_usec, sensor_id, integration_time_us, integrated_x, integrated_y, integrated_xgyro, integrated_ygyro, integrated_zgyro, temperature, quality, time_delta_distance_us, distance, force_mavlink1=False):
'''
Optical flow from an angular rate flow sensor (e.g. PX4FLOW or mouse
sensor)
time_usec : 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. [us] (type:uint64_t)
sensor_id : Sensor ID (type:uint8_t)
integration_time_us : Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the. [us] (type:uint32_t)
integrated_x : Flow around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.) [rad] (type:float)
integrated_y : Flow around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.) [rad] (type:float)
integrated_xgyro : RH rotation around X axis [rad] (type:float)
integrated_ygyro : RH rotation around Y axis [rad] (type:float)
integrated_zgyro : RH rotation around Z axis [rad] (type:float)
temperature : Temperature [cdegC] (type:int16_t)
quality : Optical flow quality / confidence. 0: no valid flow, 255: maximum quality (type:uint8_t)
time_delta_distance_us : Time since the distance was sampled. [us] (type:uint32_t)
distance : Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance. [m] (type:float)
'''
return self.send(self.optical_flow_rad_encode(time_usec, sensor_id, integration_time_us, integrated_x, integrated_y, integrated_xgyro, integrated_ygyro, integrated_zgyro, temperature, quality, time_delta_distance_us, distance), force_mavlink1=force_mavlink1)
def hil_sensor_encode(self, time_usec, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag, abs_pressure, diff_pressure, pressure_alt, temperature, fields_updated):
'''
The IMU readings in SI units in NED body frame
time_usec : 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. [us] (type:uint64_t)
xacc : X acceleration [m/s/s] (type:float)
yacc : Y acceleration [m/s/s] (type:float)
zacc : Z acceleration [m/s/s] (type:float)
xgyro : Angular speed around X axis in body frame [rad/s] (type:float)
ygyro : Angular speed around Y axis in body frame [rad/s] (type:float)
zgyro : Angular speed around Z axis in body frame [rad/s] (type:float)
xmag : X Magnetic field [gauss] (type:float)
ymag : Y Magnetic field [gauss] (type:float)
zmag : Z Magnetic field [gauss] (type:float)
abs_pressure : Absolute pressure [mbar] (type:float)
diff_pressure : Differential pressure (airspeed) [mbar] (type:float)
pressure_alt : Altitude calculated from pressure (type:float)
temperature : Temperature [degC] (type:float)
fields_updated : Bitmap for fields that have updated since last message, bit 0 = xacc, bit 12: temperature, bit 31: full reset of attitude/position/velocities/etc was performed in sim. (type:uint32_t)
'''
return MAVLink_hil_sensor_message(time_usec, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag, abs_pressure, diff_pressure, pressure_alt, temperature, fields_updated)
def hil_sensor_send(self, time_usec, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag, abs_pressure, diff_pressure, pressure_alt, temperature, fields_updated, force_mavlink1=False):
'''
The IMU readings in SI units in NED body frame
time_usec : 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. [us] (type:uint64_t)
xacc : X acceleration [m/s/s] (type:float)
yacc : Y acceleration [m/s/s] (type:float)
zacc : Z acceleration [m/s/s] (type:float)
xgyro : Angular speed around X axis in body frame [rad/s] (type:float)
ygyro : Angular speed around Y axis in body frame [rad/s] (type:float)
zgyro : Angular speed around Z axis in body frame [rad/s] (type:float)
xmag : X Magnetic field [gauss] (type:float)
ymag : Y Magnetic field [gauss] (type:float)
zmag : Z Magnetic field [gauss] (type:float)
abs_pressure : Absolute pressure [mbar] (type:float)
diff_pressure : Differential pressure (airspeed) [mbar] (type:float)
pressure_alt : Altitude calculated from pressure (type:float)
temperature : Temperature [degC] (type:float)
fields_updated : Bitmap for fields that have updated since last message, bit 0 = xacc, bit 12: temperature, bit 31: full reset of attitude/position/velocities/etc was performed in sim. (type:uint32_t)
'''
return self.send(self.hil_sensor_encode(time_usec, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag, abs_pressure, diff_pressure, pressure_alt, temperature, fields_updated), force_mavlink1=force_mavlink1)
def sim_state_encode(self, q1, q2, q3, q4, roll, pitch, yaw, xacc, yacc, zacc, xgyro, ygyro, zgyro, lat, lon, alt, std_dev_horz, std_dev_vert, vn, ve, vd):
'''
Status of simulation environment, if used
q1 : True attitude quaternion component 1, w (1 in null-rotation) (type:float)
q2 : True attitude quaternion component 2, x (0 in null-rotation) (type:float)
q3 : True attitude quaternion component 3, y (0 in null-rotation) (type:float)
q4 : True attitude quaternion component 4, z (0 in null-rotation) (type:float)
roll : Attitude roll expressed as Euler angles, not recommended except for human-readable outputs (type:float)
pitch : Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs (type:float)
yaw : Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs (type:float)
xacc : X acceleration [m/s/s] (type:float)
yacc : Y acceleration [m/s/s] (type:float)
zacc : Z acceleration [m/s/s] (type:float)
xgyro : Angular speed around X axis [rad/s] (type:float)
ygyro : Angular speed around Y axis [rad/s] (type:float)
zgyro : Angular speed around Z axis [rad/s] (type:float)
lat : Latitude [deg] (type:float)
lon : Longitude [deg] (type:float)
alt : Altitude [m] (type:float)
std_dev_horz : Horizontal position standard deviation (type:float)
std_dev_vert : Vertical position standard deviation (type:float)
vn : True velocity in north direction in earth-fixed NED frame [m/s] (type:float)
ve : True velocity in east direction in earth-fixed NED frame [m/s] (type:float)
vd : True velocity in down direction in earth-fixed NED frame [m/s] (type:float)
'''
return MAVLink_sim_state_message(q1, q2, q3, q4, roll, pitch, yaw, xacc, yacc, zacc, xgyro, ygyro, zgyro, lat, lon, alt, std_dev_horz, std_dev_vert, vn, ve, vd)
def sim_state_send(self, q1, q2, q3, q4, roll, pitch, yaw, xacc, yacc, zacc, xgyro, ygyro, zgyro, lat, lon, alt, std_dev_horz, std_dev_vert, vn, ve, vd, force_mavlink1=False):
'''
Status of simulation environment, if used
q1 : True attitude quaternion component 1, w (1 in null-rotation) (type:float)
q2 : True attitude quaternion component 2, x (0 in null-rotation) (type:float)
q3 : True attitude quaternion component 3, y (0 in null-rotation) (type:float)
q4 : True attitude quaternion component 4, z (0 in null-rotation) (type:float)
roll : Attitude roll expressed as Euler angles, not recommended except for human-readable outputs (type:float)
pitch : Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs (type:float)
yaw : Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs (type:float)
xacc : X acceleration [m/s/s] (type:float)
yacc : Y acceleration [m/s/s] (type:float)
zacc : Z acceleration [m/s/s] (type:float)
xgyro : Angular speed around X axis [rad/s] (type:float)
ygyro : Angular speed around Y axis [rad/s] (type:float)
zgyro : Angular speed around Z axis [rad/s] (type:float)
lat : Latitude [deg] (type:float)
lon : Longitude [deg] (type:float)
alt : Altitude [m] (type:float)
std_dev_horz : Horizontal position standard deviation (type:float)
std_dev_vert : Vertical position standard deviation (type:float)
vn : True velocity in north direction in earth-fixed NED frame [m/s] (type:float)
ve : True velocity in east direction in earth-fixed NED frame [m/s] (type:float)
vd : True velocity in down direction in earth-fixed NED frame [m/s] (type:float)
'''
return self.send(self.sim_state_encode(q1, q2, q3, q4, roll, pitch, yaw, xacc, yacc, zacc, xgyro, ygyro, zgyro, lat, lon, alt, std_dev_horz, std_dev_vert, vn, ve, vd), force_mavlink1=force_mavlink1)
def radio_status_encode(self, rssi, remrssi, txbuf, noise, remnoise, rxerrors, fixed):
'''
Status generated by radio and injected into MAVLink stream.
rssi : Local (message sender) recieved signal strength indication in device-dependent units/scale. Values: [0-254], 255: invalid/unknown. (type:uint8_t)
remrssi : Remote (message receiver) signal strength indication in device-dependent units/scale. Values: [0-254], 255: invalid/unknown. (type:uint8_t)
txbuf : Remaining free transmitter buffer space. [%] (type:uint8_t)
noise : Local background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], 255: invalid/unknown. (type:uint8_t)
remnoise : Remote background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], 255: invalid/unknown. (type:uint8_t)
rxerrors : Count of radio packet receive errors (since boot). (type:uint16_t)
fixed : Count of error corrected radio packets (since boot). (type:uint16_t)
'''
return MAVLink_radio_status_message(rssi, remrssi, txbuf, noise, remnoise, rxerrors, fixed)
def radio_status_send(self, rssi, remrssi, txbuf, noise, remnoise, rxerrors, fixed, force_mavlink1=False):
'''
Status generated by radio and injected into MAVLink stream.
rssi : Local (message sender) recieved signal strength indication in device-dependent units/scale. Values: [0-254], 255: invalid/unknown. (type:uint8_t)
remrssi : Remote (message receiver) signal strength indication in device-dependent units/scale. Values: [0-254], 255: invalid/unknown. (type:uint8_t)
txbuf : Remaining free transmitter buffer space. [%] (type:uint8_t)
noise : Local background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], 255: invalid/unknown. (type:uint8_t)
remnoise : Remote background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], 255: invalid/unknown. (type:uint8_t)
rxerrors : Count of radio packet receive errors (since boot). (type:uint16_t)
fixed : Count of error corrected radio packets (since boot). (type:uint16_t)
'''
return self.send(self.radio_status_encode(rssi, remrssi, txbuf, noise, remnoise, rxerrors, fixed), force_mavlink1=force_mavlink1)
def file_transfer_protocol_encode(self, target_network, target_system, target_component, payload):
'''
File transfer message
target_network : Network ID (0 for broadcast) (type:uint8_t)
target_system : System ID (0 for broadcast) (type:uint8_t)
target_component : Component ID (0 for broadcast) (type:uint8_t)
payload : Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The entire content of this block is opaque unless you understand any the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the mavlink specification. (type:uint8_t)
'''
return MAVLink_file_transfer_protocol_message(target_network, target_system, target_component, payload)
def file_transfer_protocol_send(self, target_network, target_system, target_component, payload, force_mavlink1=False):
'''
File transfer message
target_network : Network ID (0 for broadcast) (type:uint8_t)
target_system : System ID (0 for broadcast) (type:uint8_t)
target_component : Component ID (0 for broadcast) (type:uint8_t)
payload : Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The entire content of this block is opaque unless you understand any the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the mavlink specification. (type:uint8_t)
'''
return self.send(self.file_transfer_protocol_encode(target_network, target_system, target_component, payload), force_mavlink1=force_mavlink1)
def timesync_encode(self, tc1, ts1):
'''
Time synchronization message.
tc1 : Time sync timestamp 1 (type:int64_t)
ts1 : Time sync timestamp 2 (type:int64_t)
'''
return MAVLink_timesync_message(tc1, ts1)
def timesync_send(self, tc1, ts1, force_mavlink1=False):
'''
Time synchronization message.
tc1 : Time sync timestamp 1 (type:int64_t)
ts1 : Time sync timestamp 2 (type:int64_t)
'''
return self.send(self.timesync_encode(tc1, ts1), force_mavlink1=force_mavlink1)
def camera_trigger_encode(self, time_usec, seq):
'''
Camera-IMU triggering and synchronisation message.
time_usec : 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. [us] (type:uint64_t)
seq : Image frame sequence (type:uint32_t)
'''
return MAVLink_camera_trigger_message(time_usec, seq)
def camera_trigger_send(self, time_usec, seq, force_mavlink1=False):
'''
Camera-IMU triggering and synchronisation message.
time_usec : 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. [us] (type:uint64_t)
seq : Image frame sequence (type:uint32_t)
'''
return self.send(self.camera_trigger_encode(time_usec, seq), force_mavlink1=force_mavlink1)
def hil_gps_encode(self, time_usec, fix_type, lat, lon, alt, eph, epv, vel, vn, ve, vd, cog, satellites_visible):
'''
The global position, as returned by the Global Positioning System
(GPS). This is NOT the global
position estimate of the sytem, but rather a RAW
sensor value. See message GLOBAL_POSITION for the
global position estimate.
time_usec : 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. [us] (type:uint64_t)
fix_type : 0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix. (type:uint8_t)
lat : Latitude (WGS84) [degE7] (type:int32_t)
lon : Longitude (WGS84) [degE7] (type:int32_t)
alt : Altitude (MSL). Positive for up. [mm] (type:int32_t)
eph : GPS HDOP horizontal dilution of position. If unknown, set to: 65535 [cm] (type:uint16_t)
epv : GPS VDOP vertical dilution of position. If unknown, set to: 65535 [cm] (type:uint16_t)
vel : GPS ground speed. If unknown, set to: 65535 [cm/s] (type:uint16_t)
vn : GPS velocity in north direction in earth-fixed NED frame [cm/s] (type:int16_t)
ve : GPS velocity in east direction in earth-fixed NED frame [cm/s] (type:int16_t)
vd : GPS velocity in down direction in earth-fixed NED frame [cm/s] (type:int16_t)
cog : Course over ground (NOT heading, but direction of movement), 0.0..359.99 degrees. If unknown, set to: 65535 [cdeg] (type:uint16_t)
satellites_visible : Number of satellites visible. If unknown, set to 255 (type:uint8_t)
'''
return MAVLink_hil_gps_message(time_usec, fix_type, lat, lon, alt, eph, epv, vel, vn, ve, vd, cog, satellites_visible)
def hil_gps_send(self, time_usec, fix_type, lat, lon, alt, eph, epv, vel, vn, ve, vd, cog, satellites_visible, force_mavlink1=False):
'''
The global position, as returned by the Global Positioning System
(GPS). This is NOT the global
position estimate of the sytem, but rather a RAW
sensor value. See message GLOBAL_POSITION for the
global position estimate.
time_usec : 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. [us] (type:uint64_t)
fix_type : 0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix. (type:uint8_t)
lat : Latitude (WGS84) [degE7] (type:int32_t)
lon : Longitude (WGS84) [degE7] (type:int32_t)
alt : Altitude (MSL). Positive for up. [mm] (type:int32_t)
eph : GPS HDOP horizontal dilution of position. If unknown, set to: 65535 [cm] (type:uint16_t)
epv : GPS VDOP vertical dilution of position. If unknown, set to: 65535 [cm] (type:uint16_t)
vel : GPS ground speed. If unknown, set to: 65535 [cm/s] (type:uint16_t)
vn : GPS velocity in north direction in earth-fixed NED frame [cm/s] (type:int16_t)
ve : GPS velocity in east direction in earth-fixed NED frame [cm/s] (type:int16_t)
vd : GPS velocity in down direction in earth-fixed NED frame [cm/s] (type:int16_t)
cog : Course over ground (NOT heading, but direction of movement), 0.0..359.99 degrees. If unknown, set to: 65535 [cdeg] (type:uint16_t)
satellites_visible : Number of satellites visible. If unknown, set to 255 (type:uint8_t)
'''
return self.send(self.hil_gps_encode(time_usec, fix_type, lat, lon, alt, eph, epv, vel, vn, ve, vd, cog, satellites_visible), force_mavlink1=force_mavlink1)
def hil_optical_flow_encode(self, time_usec, sensor_id, integration_time_us, integrated_x, integrated_y, integrated_xgyro, integrated_ygyro, integrated_zgyro, temperature, quality, time_delta_distance_us, distance):
'''
Simulated optical flow from a flow sensor (e.g. PX4FLOW or optical
mouse sensor)
time_usec : 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. [us] (type:uint64_t)
sensor_id : Sensor ID (type:uint8_t)
integration_time_us : Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the. [us] (type:uint32_t)
integrated_x : Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.) [rad] (type:float)
integrated_y : Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.) [rad] (type:float)
integrated_xgyro : RH rotation around X axis [rad] (type:float)
integrated_ygyro : RH rotation around Y axis [rad] (type:float)
integrated_zgyro : RH rotation around Z axis [rad] (type:float)
temperature : Temperature [cdegC] (type:int16_t)
quality : Optical flow quality / confidence. 0: no valid flow, 255: maximum quality (type:uint8_t)
time_delta_distance_us : Time since the distance was sampled. [us] (type:uint32_t)
distance : Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance. [m] (type:float)
'''
return MAVLink_hil_optical_flow_message(time_usec, sensor_id, integration_time_us, integrated_x, integrated_y, integrated_xgyro, integrated_ygyro, integrated_zgyro, temperature, quality, time_delta_distance_us, distance)
def hil_optical_flow_send(self, time_usec, sensor_id, integration_time_us, integrated_x, integrated_y, integrated_xgyro, integrated_ygyro, integrated_zgyro, temperature, quality, time_delta_distance_us, distance, force_mavlink1=False):
'''
Simulated optical flow from a flow sensor (e.g. PX4FLOW or optical
mouse sensor)
time_usec : 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. [us] (type:uint64_t)
sensor_id : Sensor ID (type:uint8_t)
integration_time_us : Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the. [us] (type:uint32_t)
integrated_x : Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.) [rad] (type:float)
integrated_y : Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.) [rad] (type:float)
integrated_xgyro : RH rotation around X axis [rad] (type:float)
integrated_ygyro : RH rotation around Y axis [rad] (type:float)
integrated_zgyro : RH rotation around Z axis [rad] (type:float)
temperature : Temperature [cdegC] (type:int16_t)
quality : Optical flow quality / confidence. 0: no valid flow, 255: maximum quality (type:uint8_t)
time_delta_distance_us : Time since the distance was sampled. [us] (type:uint32_t)
distance : Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance. [m] (type:float)
'''
return self.send(self.hil_optical_flow_encode(time_usec, sensor_id, integration_time_us, integrated_x, integrated_y, integrated_xgyro, integrated_ygyro, integrated_zgyro, temperature, quality, time_delta_distance_us, distance), force_mavlink1=force_mavlink1)
def hil_state_quaternion_encode(self, time_usec, attitude_quaternion, rollspeed, pitchspeed, yawspeed, lat, lon, alt, vx, vy, vz, ind_airspeed, true_airspeed, xacc, yacc, zacc):
'''
Sent from simulation to autopilot, avoids in contrast to HIL_STATE
singularities. This packet is useful for high
throughput applications such as hardware in the loop
simulations.
time_usec : 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. [us] (type:uint64_t)
attitude_quaternion : Vehicle attitude expressed as normalized quaternion in w, x, y, z order (with 1 0 0 0 being the null-rotation) (type:float)
rollspeed : Body frame roll / phi angular speed [rad/s] (type:float)
pitchspeed : Body frame pitch / theta angular speed [rad/s] (type:float)
yawspeed : Body frame yaw / psi angular speed [rad/s] (type:float)
lat : Latitude [degE7] (type:int32_t)
lon : Longitude [degE7] (type:int32_t)
alt : Altitude [mm] (type:int32_t)
vx : Ground X Speed (Latitude) [cm/s] (type:int16_t)
vy : Ground Y Speed (Longitude) [cm/s] (type:int16_t)
vz : Ground Z Speed (Altitude) [cm/s] (type:int16_t)
ind_airspeed : Indicated airspeed [cm/s] (type:uint16_t)
true_airspeed : True airspeed [cm/s] (type:uint16_t)
xacc : X acceleration [mG] (type:int16_t)
yacc : Y acceleration [mG] (type:int16_t)
zacc : Z acceleration [mG] (type:int16_t)
'''
return MAVLink_hil_state_quaternion_message(time_usec, attitude_quaternion, rollspeed, pitchspeed, yawspeed, lat, lon, alt, vx, vy, vz, ind_airspeed, true_airspeed, xacc, yacc, zacc)
def hil_state_quaternion_send(self, time_usec, attitude_quaternion, rollspeed, pitchspeed, yawspeed, lat, lon, alt, vx, vy, vz, ind_airspeed, true_airspeed, xacc, yacc, zacc, force_mavlink1=False):
'''
Sent from simulation to autopilot, avoids in contrast to HIL_STATE
singularities. This packet is useful for high
throughput applications such as hardware in the loop
simulations.
time_usec : 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. [us] (type:uint64_t)
attitude_quaternion : Vehicle attitude expressed as normalized quaternion in w, x, y, z order (with 1 0 0 0 being the null-rotation) (type:float)
rollspeed : Body frame roll / phi angular speed [rad/s] (type:float)
pitchspeed : Body frame pitch / theta angular speed [rad/s] (type:float)
yawspeed : Body frame yaw / psi angular speed [rad/s] (type:float)
lat : Latitude [degE7] (type:int32_t)
lon : Longitude [degE7] (type:int32_t)
alt : Altitude [mm] (type:int32_t)
vx : Ground X Speed (Latitude) [cm/s] (type:int16_t)
vy : Ground Y Speed (Longitude) [cm/s] (type:int16_t)
vz : Ground Z Speed (Altitude) [cm/s] (type:int16_t)
ind_airspeed : Indicated airspeed [cm/s] (type:uint16_t)
true_airspeed : True airspeed [cm/s] (type:uint16_t)
xacc : X acceleration [mG] (type:int16_t)
yacc : Y acceleration [mG] (type:int16_t)
zacc : Z acceleration [mG] (type:int16_t)
'''
return self.send(self.hil_state_quaternion_encode(time_usec, attitude_quaternion, rollspeed, pitchspeed, yawspeed, lat, lon, alt, vx, vy, vz, ind_airspeed, true_airspeed, xacc, yacc, zacc), force_mavlink1=force_mavlink1)
def scaled_imu2_encode(self, time_boot_ms, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag):
'''
The RAW IMU readings for secondary 9DOF sensor setup. This message
should contain the scaled values to the described
units
time_boot_ms : Timestamp (time since system boot). [ms] (type:uint32_t)
xacc : X acceleration [mG] (type:int16_t)
yacc : Y acceleration [mG] (type:int16_t)
zacc : Z acceleration [mG] (type:int16_t)
xgyro : Angular speed around X axis [mrad/s] (type:int16_t)
ygyro : Angular speed around Y axis [mrad/s] (type:int16_t)
zgyro : Angular speed around Z axis [mrad/s] (type:int16_t)
xmag : X Magnetic field [mgauss] (type:int16_t)
ymag : Y Magnetic field [mgauss] (type:int16_t)
zmag : Z Magnetic field [mgauss] (type:int16_t)
'''
return MAVLink_scaled_imu2_message(time_boot_ms, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag)
def scaled_imu2_send(self, time_boot_ms, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag, force_mavlink1=False):
'''
The RAW IMU readings for secondary 9DOF sensor setup. This message
should contain the scaled values to the described
units
time_boot_ms : Timestamp (time since system boot). [ms] (type:uint32_t)
xacc : X acceleration [mG] (type:int16_t)
yacc : Y acceleration [mG] (type:int16_t)
zacc : Z acceleration [mG] (type:int16_t)
xgyro : Angular speed around X axis [mrad/s] (type:int16_t)
ygyro : Angular speed around Y axis [mrad/s] (type:int16_t)
zgyro : Angular speed around Z axis [mrad/s] (type:int16_t)
xmag : X Magnetic field [mgauss] (type:int16_t)
ymag : Y Magnetic field [mgauss] (type:int16_t)
zmag : Z Magnetic field [mgauss] (type:int16_t)
'''
return self.send(self.scaled_imu2_encode(time_boot_ms, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag), force_mavlink1=force_mavlink1)
def log_request_list_encode(self, target_system, target_component, start, end):
'''
Request a list of available logs. On some systems calling this may
stop on-board logging until LOG_REQUEST_END is called.
target_system : System ID (type:uint8_t)
target_component : Component ID (type:uint8_t)
start : First log id (0 for first available) (type:uint16_t)
end : Last log id (0xffff for last available) (type:uint16_t)
'''
return MAVLink_log_request_list_message(target_system, target_component, start, end)
def log_request_list_send(self, target_system, target_component, start, end, force_mavlink1=False):
'''
Request a list of available logs. On some systems calling this may
stop on-board logging until LOG_REQUEST_END is called.
target_system : System ID (type:uint8_t)
target_component : Component ID (type:uint8_t)
start : First log id (0 for first available) (type:uint16_t)
end : Last log id (0xffff for last available) (type:uint16_t)
'''
return self.send(self.log_request_list_encode(target_system, target_component, start, end), force_mavlink1=force_mavlink1)
def log_entry_encode(self, id, num_logs, last_log_num, time_utc, size):
'''
Reply to LOG_REQUEST_LIST
id : Log id (type:uint16_t)
num_logs : Total number of logs (type:uint16_t)
last_log_num : High log number (type:uint16_t)
time_utc : UTC timestamp of log since 1970, or 0 if not available [s] (type:uint32_t)
size : Size of the log (may be approximate) [bytes] (type:uint32_t)
'''
return MAVLink_log_entry_message(id, num_logs, last_log_num, time_utc, size)
def log_entry_send(self, id, num_logs, last_log_num, time_utc, size, force_mavlink1=False):
'''
Reply to LOG_REQUEST_LIST
id : Log id (type:uint16_t)
num_logs : Total number of logs (type:uint16_t)
last_log_num : High log number (type:uint16_t)
time_utc : UTC timestamp of log since 1970, or 0 if not available [s] (type:uint32_t)
size : Size of the log (may be approximate) [bytes] (type:uint32_t)
'''
return self.send(self.log_entry_encode(id, num_logs, last_log_num, time_utc, size), force_mavlink1=force_mavlink1)
def log_request_data_encode(self, target_system, target_component, id, ofs, count):
'''
Request a chunk of a log
target_system : System ID (type:uint8_t)
target_component : Component ID (type:uint8_t)
id : Log id (from LOG_ENTRY reply) (type:uint16_t)
ofs : Offset into the log (type:uint32_t)
count : Number of bytes [bytes] (type:uint32_t)
'''
return MAVLink_log_request_data_message(target_system, target_component, id, ofs, count)
def log_request_data_send(self, target_system, target_component, id, ofs, count, force_mavlink1=False):
'''
Request a chunk of a log
target_system : System ID (type:uint8_t)
target_component : Component ID (type:uint8_t)
id : Log id (from LOG_ENTRY reply) (type:uint16_t)
ofs : Offset into the log (type:uint32_t)
count : Number of bytes [bytes] (type:uint32_t)
'''
return self.send(self.log_request_data_encode(target_system, target_component, id, ofs, count), force_mavlink1=force_mavlink1)
def log_data_encode(self, id, ofs, count, data):
'''
Reply to LOG_REQUEST_DATA
id : Log id (from LOG_ENTRY reply) (type:uint16_t)
ofs : Offset into the log (type:uint32_t)
count : Number of bytes (zero for end of log) [bytes] (type:uint8_t)
data : log data (type:uint8_t)
'''
return MAVLink_log_data_message(id, ofs, count, data)
def log_data_send(self, id, ofs, count, data, force_mavlink1=False):
'''
Reply to LOG_REQUEST_DATA
id : Log id (from LOG_ENTRY reply) (type:uint16_t)
ofs : Offset into the log (type:uint32_t)
count : Number of bytes (zero for end of log) [bytes] (type:uint8_t)
data : log data (type:uint8_t)
'''
return self.send(self.log_data_encode(id, ofs, count, data), force_mavlink1=force_mavlink1)
def log_erase_encode(self, target_system, target_component):
'''
Erase all logs
target_system : System ID (type:uint8_t)
target_component : Component ID (type:uint8_t)
'''
return MAVLink_log_erase_message(target_system, target_component)
def log_erase_send(self, target_system, target_component, force_mavlink1=False):
'''
Erase all logs
target_system : System ID (type:uint8_t)
target_component : Component ID (type:uint8_t)
'''
return self.send(self.log_erase_encode(target_system, target_component), force_mavlink1=force_mavlink1)
def log_request_end_encode(self, target_system, target_component):
'''
Stop log transfer and resume normal logging
target_system : System ID (type:uint8_t)
target_component : Component ID (type:uint8_t)
'''
return MAVLink_log_request_end_message(target_system, target_component)
def log_request_end_send(self, target_system, target_component, force_mavlink1=False):
'''
Stop log transfer and resume normal logging
target_system : System ID (type:uint8_t)
target_component : Component ID (type:uint8_t)
'''
return self.send(self.log_request_end_encode(target_system, target_component), force_mavlink1=force_mavlink1)
def gps_inject_data_encode(self, target_system, target_component, len, data):
'''
Data for injecting into the onboard GPS (used for DGPS)
target_system : System ID (type:uint8_t)
target_component : Component ID (type:uint8_t)
len : Data length [bytes] (type:uint8_t)
data : Raw data (110 is enough for 12 satellites of RTCMv2) (type:uint8_t)
'''
return MAVLink_gps_inject_data_message(target_system, target_component, len, data)
def gps_inject_data_send(self, target_system, target_component, len, data, force_mavlink1=False):
'''
Data for injecting into the onboard GPS (used for DGPS)
target_system : System ID (type:uint8_t)
target_component : Component ID (type:uint8_t)
len : Data length [bytes] (type:uint8_t)
data : Raw data (110 is enough for 12 satellites of RTCMv2) (type:uint8_t)
'''
return self.send(self.gps_inject_data_encode(target_system, target_component, len, data), force_mavlink1=force_mavlink1)
def gps2_raw_encode(self, time_usec, fix_type, lat, lon, alt, eph, epv, vel, cog, satellites_visible, dgps_numch, dgps_age):
'''
Second GPS data.
time_usec : 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. [us] (type:uint64_t)
fix_type : GPS fix type. (type:uint8_t, values:GPS_FIX_TYPE)
lat : Latitude (WGS84) [degE7] (type:int32_t)
lon : Longitude (WGS84) [degE7] (type:int32_t)
alt : Altitude (MSL). Positive for up. [mm] (type:int32_t)
eph : GPS HDOP horizontal dilution of position. If unknown, set to: UINT16_MAX [cm] (type:uint16_t)
epv : GPS VDOP vertical dilution of position. If unknown, set to: UINT16_MAX [cm] (type:uint16_t)
vel : GPS ground speed. If unknown, set to: UINT16_MAX [cm/s] (type:uint16_t)
cog : Course over ground (NOT heading, but direction of movement): 0.0..359.99 degrees. If unknown, set to: UINT16_MAX [cdeg] (type:uint16_t)
satellites_visible : Number of satellites visible. If unknown, set to 255 (type:uint8_t)
dgps_numch : Number of DGPS satellites (type:uint8_t)
dgps_age : Age of DGPS info [ms] (type:uint32_t)
'''
return MAVLink_gps2_raw_message(time_usec, fix_type, lat, lon, alt, eph, epv, vel, cog, satellites_visible, dgps_numch, dgps_age)
def gps2_raw_send(self, time_usec, fix_type, lat, lon, alt, eph, epv, vel, cog, satellites_visible, dgps_numch, dgps_age, force_mavlink1=False):
'''
Second GPS data.
time_usec : 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. [us] (type:uint64_t)
fix_type : GPS fix type. (type:uint8_t, values:GPS_FIX_TYPE)
lat : Latitude (WGS84) [degE7] (type:int32_t)
lon : Longitude (WGS84) [degE7] (type:int32_t)
alt : Altitude (MSL). Positive for up. [mm] (type:int32_t)
eph : GPS HDOP horizontal dilution of position. If unknown, set to: UINT16_MAX [cm] (type:uint16_t)
epv : GPS VDOP vertical dilution of position. If unknown, set to: UINT16_MAX [cm] (type:uint16_t)
vel : GPS ground speed. If unknown, set to: UINT16_MAX [cm/s] (type:uint16_t)
cog : Course over ground (NOT heading, but direction of movement): 0.0..359.99 degrees. If unknown, set to: UINT16_MAX [cdeg] (type:uint16_t)
satellites_visible : Number of satellites visible. If unknown, set to 255 (type:uint8_t)
dgps_numch : Number of DGPS satellites (type:uint8_t)
dgps_age : Age of DGPS info [ms] (type:uint32_t)
'''
return self.send(self.gps2_raw_encode(time_usec, fix_type, lat, lon, alt, eph, epv, vel, cog, satellites_visible, dgps_numch, dgps_age), force_mavlink1=force_mavlink1)
def power_status_encode(self, Vcc, Vservo, flags):
'''
Power supply status
Vcc : 5V rail voltage. [mV] (type:uint16_t)
Vservo : Servo rail voltage. [mV] (type:uint16_t)
flags : Bitmap of power supply status flags. (type:uint16_t, values:MAV_POWER_STATUS)
'''
return MAVLink_power_status_message(Vcc, Vservo, flags)
def power_status_send(self, Vcc, Vservo, flags, force_mavlink1=False):
'''
Power supply status
Vcc : 5V rail voltage. [mV] (type:uint16_t)
Vservo : Servo rail voltage. [mV] (type:uint16_t)
flags : Bitmap of power supply status flags. (type:uint16_t, values:MAV_POWER_STATUS)
'''
return self.send(self.power_status_encode(Vcc, Vservo, flags), force_mavlink1=force_mavlink1)
def serial_control_encode(self, device, flags, timeout, baudrate, count, data):
'''
Control a serial port. This can be used for raw access to an onboard
serial peripheral such as a GPS or telemetry radio. It
is designed to make it possible to update the devices
firmware via MAVLink messages or change the devices
settings. A message with zero bytes can be used to
change just the baudrate.
device : Serial control device type. (type:uint8_t, values:SERIAL_CONTROL_DEV)
flags : Bitmap of serial control flags. (type:uint8_t, values:SERIAL_CONTROL_FLAG)
timeout : Timeout for reply data [ms] (type:uint16_t)
baudrate : Baudrate of transfer. Zero means no change. [bits/s] (type:uint32_t)
count : how many bytes in this transfer [bytes] (type:uint8_t)
data : serial data (type:uint8_t)
'''
return MAVLink_serial_control_message(device, flags, timeout, baudrate, count, data)
def serial_control_send(self, device, flags, timeout, baudrate, count, data, force_mavlink1=False):
'''
Control a serial port. This can be used for raw access to an onboard
serial peripheral such as a GPS or telemetry radio. It
is designed to make it possible to update the devices
firmware via MAVLink messages or change the devices
settings. A message with zero bytes can be used to
change just the baudrate.
device : Serial control device type. (type:uint8_t, values:SERIAL_CONTROL_DEV)
flags : Bitmap of serial control flags. (type:uint8_t, values:SERIAL_CONTROL_FLAG)
timeout : Timeout for reply data [ms] (type:uint16_t)
baudrate : Baudrate of transfer. Zero means no change. [bits/s] (type:uint32_t)
count : how many bytes in this transfer [bytes] (type:uint8_t)
data : serial data (type:uint8_t)
'''
return self.send(self.serial_control_encode(device, flags, timeout, baudrate, count, data), force_mavlink1=force_mavlink1)
def gps_rtk_encode(self, time_last_baseline_ms, rtk_receiver_id, wn, tow, rtk_health, rtk_rate, nsats, baseline_coords_type, baseline_a_mm, baseline_b_mm, baseline_c_mm, accuracy, iar_num_hypotheses):
'''
RTK GPS data. Gives information on the relative baseline calculation
the GPS is reporting
time_last_baseline_ms : Time since boot of last baseline message received. [ms] (type:uint32_t)
rtk_receiver_id : Identification of connected RTK receiver. (type:uint8_t)
wn : GPS Week Number of last baseline (type:uint16_t)
tow : GPS Time of Week of last baseline [ms] (type:uint32_t)
rtk_health : GPS-specific health report for RTK data. (type:uint8_t)
rtk_rate : Rate of baseline messages being received by GPS [Hz] (type:uint8_t)
nsats : Current number of sats used for RTK calculation. (type:uint8_t)
baseline_coords_type : Coordinate system of baseline (type:uint8_t, values:RTK_BASELINE_COORDINATE_SYSTEM)
baseline_a_mm : Current baseline in ECEF x or NED north component. [mm] (type:int32_t)
baseline_b_mm : Current baseline in ECEF y or NED east component. [mm] (type:int32_t)
baseline_c_mm : Current baseline in ECEF z or NED down component. [mm] (type:int32_t)
accuracy : Current estimate of baseline accuracy. (type:uint32_t)
iar_num_hypotheses : Current number of integer ambiguity hypotheses. (type:int32_t)
'''
return MAVLink_gps_rtk_message(time_last_baseline_ms, rtk_receiver_id, wn, tow, rtk_health, rtk_rate, nsats, baseline_coords_type, baseline_a_mm, baseline_b_mm, baseline_c_mm, accuracy, iar_num_hypotheses)
def gps_rtk_send(self, time_last_baseline_ms, rtk_receiver_id, wn, tow, rtk_health, rtk_rate, nsats, baseline_coords_type, baseline_a_mm, baseline_b_mm, baseline_c_mm, accuracy, iar_num_hypotheses, force_mavlink1=False):
'''
RTK GPS data. Gives information on the relative baseline calculation
the GPS is reporting
time_last_baseline_ms : Time since boot of last baseline message received. [ms] (type:uint32_t)
rtk_receiver_id : Identification of connected RTK receiver. (type:uint8_t)
wn : GPS Week Number of last baseline (type:uint16_t)
tow : GPS Time of Week of last baseline [ms] (type:uint32_t)
rtk_health : GPS-specific health report for RTK data. (type:uint8_t)
rtk_rate : Rate of baseline messages being received by GPS [Hz] (type:uint8_t)
nsats : Current number of sats used for RTK calculation. (type:uint8_t)
baseline_coords_type : Coordinate system of baseline (type:uint8_t, values:RTK_BASELINE_COORDINATE_SYSTEM)
baseline_a_mm : Current baseline in ECEF x or NED north component. [mm] (type:int32_t)
baseline_b_mm : Current baseline in ECEF y or NED east component. [mm] (type:int32_t)
baseline_c_mm : Current baseline in ECEF z or NED down component. [mm] (type:int32_t)
accuracy : Current estimate of baseline accuracy. (type:uint32_t)
iar_num_hypotheses : Current number of integer ambiguity hypotheses. (type:int32_t)
'''
return self.send(self.gps_rtk_encode(time_last_baseline_ms, rtk_receiver_id, wn, tow, rtk_health, rtk_rate, nsats, baseline_coords_type, baseline_a_mm, baseline_b_mm, baseline_c_mm, accuracy, iar_num_hypotheses), force_mavlink1=force_mavlink1)
def gps2_rtk_encode(self, time_last_baseline_ms, rtk_receiver_id, wn, tow, rtk_health, rtk_rate, nsats, baseline_coords_type, baseline_a_mm, baseline_b_mm, baseline_c_mm, accuracy, iar_num_hypotheses):
'''
RTK GPS data. Gives information on the relative baseline calculation
the GPS is reporting
time_last_baseline_ms : Time since boot of last baseline message received. [ms] (type:uint32_t)
rtk_receiver_id : Identification of connected RTK receiver. (type:uint8_t)
wn : GPS Week Number of last baseline (type:uint16_t)
tow : GPS Time of Week of last baseline [ms] (type:uint32_t)
rtk_health : GPS-specific health report for RTK data. (type:uint8_t)
rtk_rate : Rate of baseline messages being received by GPS [Hz] (type:uint8_t)
nsats : Current number of sats used for RTK calculation. (type:uint8_t)
baseline_coords_type : Coordinate system of baseline (type:uint8_t, values:RTK_BASELINE_COORDINATE_SYSTEM)
baseline_a_mm : Current baseline in ECEF x or NED north component. [mm] (type:int32_t)
baseline_b_mm : Current baseline in ECEF y or NED east component. [mm] (type:int32_t)
baseline_c_mm : Current baseline in ECEF z or NED down component. [mm] (type:int32_t)
accuracy : Current estimate of baseline accuracy. (type:uint32_t)
iar_num_hypotheses : Current number of integer ambiguity hypotheses. (type:int32_t)
'''
return MAVLink_gps2_rtk_message(time_last_baseline_ms, rtk_receiver_id, wn, tow, rtk_health, rtk_rate, nsats, baseline_coords_type, baseline_a_mm, baseline_b_mm, baseline_c_mm, accuracy, iar_num_hypotheses)
def gps2_rtk_send(self, time_last_baseline_ms, rtk_receiver_id, wn, tow, rtk_health, rtk_rate, nsats, baseline_coords_type, baseline_a_mm, baseline_b_mm, baseline_c_mm, accuracy, iar_num_hypotheses, force_mavlink1=False):
'''
RTK GPS data. Gives information on the relative baseline calculation
the GPS is reporting
time_last_baseline_ms : Time since boot of last baseline message received. [ms] (type:uint32_t)
rtk_receiver_id : Identification of connected RTK receiver. (type:uint8_t)
wn : GPS Week Number of last baseline (type:uint16_t)
tow : GPS Time of Week of last baseline [ms] (type:uint32_t)
rtk_health : GPS-specific health report for RTK data. (type:uint8_t)
rtk_rate : Rate of baseline messages being received by GPS [Hz] (type:uint8_t)
nsats : Current number of sats used for RTK calculation. (type:uint8_t)
baseline_coords_type : Coordinate system of baseline (type:uint8_t, values:RTK_BASELINE_COORDINATE_SYSTEM)
baseline_a_mm : Current baseline in ECEF x or NED north component. [mm] (type:int32_t)
baseline_b_mm : Current baseline in ECEF y or NED east component. [mm] (type:int32_t)
baseline_c_mm : Current baseline in ECEF z or NED down component. [mm] (type:int32_t)
accuracy : Current estimate of baseline accuracy. (type:uint32_t)
iar_num_hypotheses : Current number of integer ambiguity hypotheses. (type:int32_t)
'''
return self.send(self.gps2_rtk_encode(time_last_baseline_ms, rtk_receiver_id, wn, tow, rtk_health, rtk_rate, nsats, baseline_coords_type, baseline_a_mm, baseline_b_mm, baseline_c_mm, accuracy, iar_num_hypotheses), force_mavlink1=force_mavlink1)
def scaled_imu3_encode(self, time_boot_ms, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag):
'''
The RAW IMU readings for 3rd 9DOF sensor setup. This message should
contain the scaled values to the described units
time_boot_ms : Timestamp (time since system boot). [ms] (type:uint32_t)
xacc : X acceleration [mG] (type:int16_t)
yacc : Y acceleration [mG] (type:int16_t)
zacc : Z acceleration [mG] (type:int16_t)
xgyro : Angular speed around X axis [mrad/s] (type:int16_t)
ygyro : Angular speed around Y axis [mrad/s] (type:int16_t)
zgyro : Angular speed around Z axis [mrad/s] (type:int16_t)
xmag : X Magnetic field [mgauss] (type:int16_t)
ymag : Y Magnetic field [mgauss] (type:int16_t)
zmag : Z Magnetic field [mgauss] (type:int16_t)
'''
return MAVLink_scaled_imu3_message(time_boot_ms, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag)
def scaled_imu3_send(self, time_boot_ms, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag, force_mavlink1=False):
'''
The RAW IMU readings for 3rd 9DOF sensor setup. This message should
contain the scaled values to the described units
time_boot_ms : Timestamp (time since system boot). [ms] (type:uint32_t)
xacc : X acceleration [mG] (type:int16_t)
yacc : Y acceleration [mG] (type:int16_t)
zacc : Z acceleration [mG] (type:int16_t)
xgyro : Angular speed around X axis [mrad/s] (type:int16_t)
ygyro : Angular speed around Y axis [mrad/s] (type:int16_t)
zgyro : Angular speed around Z axis [mrad/s] (type:int16_t)
xmag : X Magnetic field [mgauss] (type:int16_t)
ymag : Y Magnetic field [mgauss] (type:int16_t)
zmag : Z Magnetic field [mgauss] (type:int16_t)
'''
return self.send(self.scaled_imu3_encode(time_boot_ms, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag), force_mavlink1=force_mavlink1)
def data_transmission_handshake_encode(self, type, size, width, height, packets, payload, jpg_quality):
'''
Handshake message to initiate, control and stop image streaming when
using the Image Transmission Protocol: https://mavlink
.io/en/services/image_transmission.html.
type : Type of requested/acknowledged data. (type:uint8_t, values:MAVLINK_DATA_STREAM_TYPE)
size : total data size (set on ACK only). [bytes] (type:uint32_t)
width : Width of a matrix or image. (type:uint16_t)
height : Height of a matrix or image. (type:uint16_t)
packets : Number of packets being sent (set on ACK only). (type:uint16_t)
payload : Payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only). [bytes] (type:uint8_t)
jpg_quality : JPEG quality. Values: [1-100]. [%] (type:uint8_t)
'''
return MAVLink_data_transmission_handshake_message(type, size, width, height, packets, payload, jpg_quality)
def data_transmission_handshake_send(self, type, size, width, height, packets, payload, jpg_quality, force_mavlink1=False):
'''
Handshake message to initiate, control and stop image streaming when
using the Image Transmission Protocol: https://mavlink
.io/en/services/image_transmission.html.
type : Type of requested/acknowledged data. (type:uint8_t, values:MAVLINK_DATA_STREAM_TYPE)
size : total data size (set on ACK only). [bytes] (type:uint32_t)
width : Width of a matrix or image. (type:uint16_t)
height : Height of a matrix or image. (type:uint16_t)
packets : Number of packets being sent (set on ACK only). (type:uint16_t)
payload : Payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only). [bytes] (type:uint8_t)
jpg_quality : JPEG quality. Values: [1-100]. [%] (type:uint8_t)
'''
return self.send(self.data_transmission_handshake_encode(type, size, width, height, packets, payload, jpg_quality), force_mavlink1=force_mavlink1)
def encapsulated_data_encode(self, seqnr, data):
'''
Data packet for images sent using the Image Transmission Protocol:
https://mavlink.io/en/services/image_transmission.html
.
seqnr : sequence number (starting with 0 on every transmission) (type:uint16_t)
data : image data bytes (type:uint8_t)
'''
return MAVLink_encapsulated_data_message(seqnr, data)
def encapsulated_data_send(self, seqnr, data, force_mavlink1=False):
'''
Data packet for images sent using the Image Transmission Protocol:
https://mavlink.io/en/services/image_transmission.html
.
seqnr : sequence number (starting with 0 on every transmission) (type:uint16_t)
data : image data bytes (type:uint8_t)
'''
return self.send(self.encapsulated_data_encode(seqnr, data), force_mavlink1=force_mavlink1)
def distance_sensor_encode(self, time_boot_ms, min_distance, max_distance, current_distance, type, id, orientation, covariance):
'''
Distance sensor information for an onboard rangefinder.
time_boot_ms : Timestamp (time since system boot). [ms] (type:uint32_t)
min_distance : Minimum distance the sensor can measure [cm] (type:uint16_t)
max_distance : Maximum distance the sensor can measure [cm] (type:uint16_t)
current_distance : Current distance reading [cm] (type:uint16_t)
type : Type of distance sensor. (type:uint8_t, values:MAV_DISTANCE_SENSOR)
id : Onboard ID of the sensor (type: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 (type:uint8_t, values:MAV_SENSOR_ORIENTATION)
covariance : Measurement variance. Max standard deviation is 6cm. 255 if unknown. [cm^2] (type:uint8_t)
'''
return MAVLink_distance_sensor_message(time_boot_ms, min_distance, max_distance, current_distance, type, id, orientation, covariance)
def distance_sensor_send(self, time_boot_ms, min_distance, max_distance, current_distance, type, id, orientation, covariance, force_mavlink1=False):
'''
Distance sensor information for an onboard rangefinder.
time_boot_ms : Timestamp (time since system boot). [ms] (type:uint32_t)
min_distance : Minimum distance the sensor can measure [cm] (type:uint16_t)
max_distance : Maximum distance the sensor can measure [cm] (type:uint16_t)
current_distance : Current distance reading [cm] (type:uint16_t)
type : Type of distance sensor. (type:uint8_t, values:MAV_DISTANCE_SENSOR)
id : Onboard ID of the sensor (type: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 (type:uint8_t, values:MAV_SENSOR_ORIENTATION)
covariance : Measurement variance. Max standard deviation is 6cm. 255 if unknown. [cm^2] (type:uint8_t)
'''
return self.send(self.distance_sensor_encode(time_boot_ms, min_distance, max_distance, current_distance, type, id, orientation, covariance), force_mavlink1=force_mavlink1)
def terrain_request_encode(self, lat, lon, grid_spacing, mask):
'''
Request for terrain data and terrain status
lat : Latitude of SW corner of first grid [degE7] (type:int32_t)
lon : Longitude of SW corner of first grid [degE7] (type:int32_t)
grid_spacing : Grid spacing [m] (type:uint16_t)
mask : Bitmask of requested 4x4 grids (row major 8x7 array of grids, 56 bits) (type:uint64_t)
'''
return MAVLink_terrain_request_message(lat, lon, grid_spacing, mask)
def terrain_request_send(self, lat, lon, grid_spacing, mask, force_mavlink1=False):
'''
Request for terrain data and terrain status
lat : Latitude of SW corner of first grid [degE7] (type:int32_t)
lon : Longitude of SW corner of first grid [degE7] (type:int32_t)
grid_spacing : Grid spacing [m] (type:uint16_t)
mask : Bitmask of requested 4x4 grids (row major 8x7 array of grids, 56 bits) (type:uint64_t)
'''
return self.send(self.terrain_request_encode(lat, lon, grid_spacing, mask), force_mavlink1=force_mavlink1)
def terrain_data_encode(self, lat, lon, grid_spacing, gridbit, data):
'''
Terrain data sent from GCS. The lat/lon and grid_spacing must be the
same as a lat/lon from a TERRAIN_REQUEST
lat : Latitude of SW corner of first grid [degE7] (type:int32_t)
lon : Longitude of SW corner of first grid [degE7] (type:int32_t)
grid_spacing : Grid spacing [m] (type:uint16_t)
gridbit : bit within the terrain request mask (type:uint8_t)
data : Terrain data MSL [m] (type:int16_t)
'''
return MAVLink_terrain_data_message(lat, lon, grid_spacing, gridbit, data)
def terrain_data_send(self, lat, lon, grid_spacing, gridbit, data, force_mavlink1=False):
'''
Terrain data sent from GCS. The lat/lon and grid_spacing must be the
same as a lat/lon from a TERRAIN_REQUEST
lat : Latitude of SW corner of first grid [degE7] (type:int32_t)
lon : Longitude of SW corner of first grid [degE7] (type:int32_t)
grid_spacing : Grid spacing [m] (type:uint16_t)
gridbit : bit within the terrain request mask (type:uint8_t)
data : Terrain data MSL [m] (type:int16_t)
'''
return self.send(self.terrain_data_encode(lat, lon, grid_spacing, gridbit, data), force_mavlink1=force_mavlink1)
def terrain_check_encode(self, lat, lon):
'''
Request that the vehicle report terrain height at the given location.
Used by GCS to check if vehicle has all terrain data
needed for a mission.
lat : Latitude [degE7] (type:int32_t)
lon : Longitude [degE7] (type:int32_t)
'''
return MAVLink_terrain_check_message(lat, lon)
def terrain_check_send(self, lat, lon, force_mavlink1=False):
'''
Request that the vehicle report terrain height at the given location.
Used by GCS to check if vehicle has all terrain data
needed for a mission.
lat : Latitude [degE7] (type:int32_t)
lon : Longitude [degE7] (type:int32_t)
'''
return self.send(self.terrain_check_encode(lat, lon), force_mavlink1=force_mavlink1)
def terrain_report_encode(self, lat, lon, spacing, terrain_height, current_height, pending, loaded):
'''
Response from a TERRAIN_CHECK request
lat : Latitude [degE7] (type:int32_t)
lon : Longitude [degE7] (type:int32_t)
spacing : grid spacing (zero if terrain at this location unavailable) (type:uint16_t)
terrain_height : Terrain height MSL [m] (type:float)
current_height : Current vehicle height above lat/lon terrain height [m] (type:float)
pending : Number of 4x4 terrain blocks waiting to be received or read from disk (type:uint16_t)
loaded : Number of 4x4 terrain blocks in memory (type:uint16_t)
'''
return MAVLink_terrain_report_message(lat, lon, spacing, terrain_height, current_height, pending, loaded)
def terrain_report_send(self, lat, lon, spacing, terrain_height, current_height, pending, loaded, force_mavlink1=False):
'''
Response from a TERRAIN_CHECK request
lat : Latitude [degE7] (type:int32_t)
lon : Longitude [degE7] (type:int32_t)
spacing : grid spacing (zero if terrain at this location unavailable) (type:uint16_t)
terrain_height : Terrain height MSL [m] (type:float)
current_height : Current vehicle height above lat/lon terrain height [m] (type:float)
pending : Number of 4x4 terrain blocks waiting to be received or read from disk (type:uint16_t)
loaded : Number of 4x4 terrain blocks in memory (type:uint16_t)
'''
return self.send(self.terrain_report_encode(lat, lon, spacing, terrain_height, current_height, pending, loaded), force_mavlink1=force_mavlink1)
def scaled_pressure2_encode(self, time_boot_ms, press_abs, press_diff, temperature):
'''
Barometer readings for 2nd barometer
time_boot_ms : Timestamp (time since system boot). [ms] (type:uint32_t)
press_abs : Absolute pressure [hPa] (type:float)
press_diff : Differential pressure [hPa] (type:float)
temperature : Absolute pressure temperature [cdegC] (type:int16_t)
'''
return MAVLink_scaled_pressure2_message(time_boot_ms, press_abs, press_diff, temperature)
def scaled_pressure2_send(self, time_boot_ms, press_abs, press_diff, temperature, force_mavlink1=False):
'''
Barometer readings for 2nd barometer
time_boot_ms : Timestamp (time since system boot). [ms] (type:uint32_t)
press_abs : Absolute pressure [hPa] (type:float)
press_diff : Differential pressure [hPa] (type:float)
temperature : Absolute pressure temperature [cdegC] (type:int16_t)
'''
return self.send(self.scaled_pressure2_encode(time_boot_ms, press_abs, press_diff, temperature), force_mavlink1=force_mavlink1)
def att_pos_mocap_encode(self, time_usec, q, x, y, z):
'''
Motion capture attitude and position
time_usec : 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. [us] (type:uint64_t)
q : Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) (type:float)
x : X position (NED) [m] (type:float)
y : Y position (NED) [m] (type:float)
z : Z position (NED) [m] (type:float)
'''
return MAVLink_att_pos_mocap_message(time_usec, q, x, y, z)
def att_pos_mocap_send(self, time_usec, q, x, y, z, force_mavlink1=False):
'''
Motion capture attitude and position
time_usec : 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. [us] (type:uint64_t)
q : Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) (type:float)
x : X position (NED) [m] (type:float)
y : Y position (NED) [m] (type:float)
z : Z position (NED) [m] (type:float)
'''
return self.send(self.att_pos_mocap_encode(time_usec, q, x, y, z), force_mavlink1=force_mavlink1)
def set_actuator_control_target_encode(self, time_usec, group_mlx, target_system, target_component, controls):
'''
Set the vehicle attitude and body angular rates.
time_usec : 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. [us] (type:uint64_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. (type:uint8_t)
target_system : System ID (type:uint8_t)
target_component : Component ID (type:uint8_t)
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. (type:float)
'''
return MAVLink_set_actuator_control_target_message(time_usec, group_mlx, target_system, target_component, controls)
def set_actuator_control_target_send(self, time_usec, group_mlx, target_system, target_component, controls, force_mavlink1=False):
'''
Set the vehicle attitude and body angular rates.
time_usec : 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. [us] (type:uint64_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. (type:uint8_t)
target_system : System ID (type:uint8_t)
target_component : Component ID (type:uint8_t)
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. (type:float)
'''
return self.send(self.set_actuator_control_target_encode(time_usec, group_mlx, target_system, target_component, controls), force_mavlink1=force_mavlink1)
def actuator_control_target_encode(self, time_usec, group_mlx, controls):
'''
Set the vehicle attitude and body angular rates.
time_usec : 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. [us] (type:uint64_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. (type:uint8_t)
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. (type:float)
'''
return MAVLink_actuator_control_target_message(time_usec, group_mlx, controls)
def actuator_control_target_send(self, time_usec, group_mlx, controls, force_mavlink1=False):
'''
Set the vehicle attitude and body angular rates.
time_usec : 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. [us] (type:uint64_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. (type:uint8_t)
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. (type:float)
'''
return self.send(self.actuator_control_target_encode(time_usec, group_mlx, controls), force_mavlink1=force_mavlink1)
def altitude_encode(self, time_usec, altitude_monotonic, altitude_amsl, altitude_local, altitude_relative, altitude_terrain, bottom_clearance):
'''
The current system altitude.
time_usec : 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. [us] (type:uint64_t)
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. [m] (type: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 MSL by default and not the WGS84 altitude. [m] (type: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. [m] (type:float)
altitude_relative : This is the altitude above the home position. It resets on each change of the current home position. [m] (type: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. [m] (type: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. [m] (type:float)
'''
return MAVLink_altitude_message(time_usec, altitude_monotonic, altitude_amsl, altitude_local, altitude_relative, altitude_terrain, bottom_clearance)
def altitude_send(self, time_usec, altitude_monotonic, altitude_amsl, altitude_local, altitude_relative, altitude_terrain, bottom_clearance, force_mavlink1=False):
'''
The current system altitude.
time_usec : 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. [us] (type:uint64_t)
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. [m] (type: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 MSL by default and not the WGS84 altitude. [m] (type: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. [m] (type:float)
altitude_relative : This is the altitude above the home position. It resets on each change of the current home position. [m] (type: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. [m] (type: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. [m] (type:float)
'''
return self.send(self.altitude_encode(time_usec, altitude_monotonic, altitude_amsl, altitude_local, altitude_relative, altitude_terrain, bottom_clearance), force_mavlink1=force_mavlink1)
def resource_request_encode(self, request_id, uri_type, uri, transfer_type, storage):
'''
The autopilot is requesting a resource (file, binary, other type of
data)
request_id : Request ID. This ID should be re-used when sending back URI contents (type:uint8_t)
uri_type : The type of requested URI. 0 = a file via URL. 1 = a UAVCAN binary (type:uint8_t)
uri : The requested unique resource identifier (URI). It is not necessarily a straight domain name (depends on the URI type enum) (type:uint8_t)
transfer_type : The way the autopilot wants to receive the URI. 0 = MAVLink FTP. 1 = binary stream. (type:uint8_t)
storage : The storage path the autopilot wants the URI to be stored in. Will only be valid if the transfer_type has a storage associated (e.g. MAVLink FTP). (type:uint8_t)
'''
return MAVLink_resource_request_message(request_id, uri_type, uri, transfer_type, storage)
def resource_request_send(self, request_id, uri_type, uri, transfer_type, storage, force_mavlink1=False):
'''
The autopilot is requesting a resource (file, binary, other type of
data)
request_id : Request ID. This ID should be re-used when sending back URI contents (type:uint8_t)
uri_type : The type of requested URI. 0 = a file via URL. 1 = a UAVCAN binary (type:uint8_t)
uri : The requested unique resource identifier (URI). It is not necessarily a straight domain name (depends on the URI type enum) (type:uint8_t)
transfer_type : The way the autopilot wants to receive the URI. 0 = MAVLink FTP. 1 = binary stream. (type:uint8_t)
storage : The storage path the autopilot wants the URI to be stored in. Will only be valid if the transfer_type has a storage associated (e.g. MAVLink FTP). (type:uint8_t)
'''
return self.send(self.resource_request_encode(request_id, uri_type, uri, transfer_type, storage), force_mavlink1=force_mavlink1)
def scaled_pressure3_encode(self, time_boot_ms, press_abs, press_diff, temperature):
'''
Barometer readings for 3rd barometer
time_boot_ms : Timestamp (time since system boot). [ms] (type:uint32_t)
press_abs : Absolute pressure [hPa] (type:float)
press_diff : Differential pressure [hPa] (type:float)
temperature : Absolute pressure temperature [cdegC] (type:int16_t)
'''
return MAVLink_scaled_pressure3_message(time_boot_ms, press_abs, press_diff, temperature)
def scaled_pressure3_send(self, time_boot_ms, press_abs, press_diff, temperature, force_mavlink1=False):
'''
Barometer readings for 3rd barometer
time_boot_ms : Timestamp (time since system boot). [ms] (type:uint32_t)
press_abs : Absolute pressure [hPa] (type:float)
press_diff : Differential pressure [hPa] (type:float)
temperature : Absolute pressure temperature [cdegC] (type:int16_t)
'''
return self.send(self.scaled_pressure3_encode(time_boot_ms, press_abs, press_diff, temperature), force_mavlink1=force_mavlink1)
def follow_target_encode(self, timestamp, est_capabilities, lat, lon, alt, vel, acc, attitude_q, rates, position_cov, custom_state):
'''
Current motion information from a designated system
timestamp : Timestamp (time since system boot). [ms] (type:uint64_t)
est_capabilities : bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3) (type:uint8_t)
lat : Latitude (WGS84) [degE7] (type:int32_t)
lon : Longitude (WGS84) [degE7] (type:int32_t)
alt : Altitude (MSL) [m] (type:float)
vel : target velocity (0,0,0) for unknown [m/s] (type:float)
acc : linear target acceleration (0,0,0) for unknown [m/s/s] (type:float)
attitude_q : (1 0 0 0 for unknown) (type:float)
rates : (0 0 0 for unknown) (type:float)
position_cov : eph epv (type:float)
custom_state : button states or switches of a tracker device (type:uint64_t)
'''
return MAVLink_follow_target_message(timestamp, est_capabilities, lat, lon, alt, vel, acc, attitude_q, rates, position_cov, custom_state)
def follow_target_send(self, timestamp, est_capabilities, lat, lon, alt, vel, acc, attitude_q, rates, position_cov, custom_state, force_mavlink1=False):
'''
Current motion information from a designated system
timestamp : Timestamp (time since system boot). [ms] (type:uint64_t)
est_capabilities : bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3) (type:uint8_t)
lat : Latitude (WGS84) [degE7] (type:int32_t)
lon : Longitude (WGS84) [degE7] (type:int32_t)
alt : Altitude (MSL) [m] (type:float)
vel : target velocity (0,0,0) for unknown [m/s] (type:float)
acc : linear target acceleration (0,0,0) for unknown [m/s/s] (type:float)
attitude_q : (1 0 0 0 for unknown) (type:float)
rates : (0 0 0 for unknown) (type:float)
position_cov : eph epv (type:float)
custom_state : button states or switches of a tracker device (type:uint64_t)
'''
return self.send(self.follow_target_encode(timestamp, est_capabilities, lat, lon, alt, vel, acc, attitude_q, rates, position_cov, custom_state), force_mavlink1=force_mavlink1)
def control_system_state_encode(self, time_usec, x_acc, y_acc, z_acc, x_vel, y_vel, z_vel, x_pos, y_pos, z_pos, airspeed, vel_variance, pos_variance, q, roll_rate, pitch_rate, yaw_rate):
'''
The smoothed, monotonic system state used to feed the control loops of
the system.
time_usec : 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. [us] (type:uint64_t)
x_acc : X acceleration in body frame [m/s/s] (type:float)
y_acc : Y acceleration in body frame [m/s/s] (type:float)
z_acc : Z acceleration in body frame [m/s/s] (type:float)
x_vel : X velocity in body frame [m/s] (type:float)
y_vel : Y velocity in body frame [m/s] (type:float)
z_vel : Z velocity in body frame [m/s] (type:float)
x_pos : X position in local frame [m] (type:float)
y_pos : Y position in local frame [m] (type:float)
z_pos : Z position in local frame [m] (type:float)
airspeed : Airspeed, set to -1 if unknown [m/s] (type:float)
vel_variance : Variance of body velocity estimate (type:float)
pos_variance : Variance in local position (type:float)
q : The attitude, represented as Quaternion (type:float)
roll_rate : Angular rate in roll axis [rad/s] (type:float)
pitch_rate : Angular rate in pitch axis [rad/s] (type:float)
yaw_rate : Angular rate in yaw axis [rad/s] (type:float)
'''
return MAVLink_control_system_state_message(time_usec, x_acc, y_acc, z_acc, x_vel, y_vel, z_vel, x_pos, y_pos, z_pos, airspeed, vel_variance, pos_variance, q, roll_rate, pitch_rate, yaw_rate)
def control_system_state_send(self, time_usec, x_acc, y_acc, z_acc, x_vel, y_vel, z_vel, x_pos, y_pos, z_pos, airspeed, vel_variance, pos_variance, q, roll_rate, pitch_rate, yaw_rate, force_mavlink1=False):
'''
The smoothed, monotonic system state used to feed the control loops of
the system.
time_usec : 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. [us] (type:uint64_t)
x_acc : X acceleration in body frame [m/s/s] (type:float)
y_acc : Y acceleration in body frame [m/s/s] (type:float)
z_acc : Z acceleration in body frame [m/s/s] (type:float)
x_vel : X velocity in body frame [m/s] (type:float)
y_vel : Y velocity in body frame [m/s] (type:float)
z_vel : Z velocity in body frame [m/s] (type:float)
x_pos : X position in local frame [m] (type:float)
y_pos : Y position in local frame [m] (type:float)
z_pos : Z position in local frame [m] (type:float)
airspeed : Airspeed, set to -1 if unknown [m/s] (type:float)
vel_variance : Variance of body velocity estimate (type:float)
pos_variance : Variance in local position (type:float)
q : The attitude, represented as Quaternion (type:float)
roll_rate : Angular rate in roll axis [rad/s] (type:float)
pitch_rate : Angular rate in pitch axis [rad/s] (type:float)
yaw_rate : Angular rate in yaw axis [rad/s] (type:float)
'''
return self.send(self.control_system_state_encode(time_usec, x_acc, y_acc, z_acc, x_vel, y_vel, z_vel, x_pos, y_pos, z_pos, airspeed, vel_variance, pos_variance, q, roll_rate, pitch_rate, yaw_rate), force_mavlink1=force_mavlink1)
def battery_status_encode(self, id, battery_function, type, temperature, voltages, current_battery, current_consumed, energy_consumed, battery_remaining):
'''
Battery information
id : Battery ID (type:uint8_t)
battery_function : Function of the battery (type:uint8_t, values:MAV_BATTERY_FUNCTION)
type : Type (chemistry) of the battery (type:uint8_t, values:MAV_BATTERY_TYPE)
temperature : Temperature of the battery. INT16_MAX for unknown temperature. [cdegC] (type:int16_t)
voltages : Battery voltage of cells. Cells 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). [mV] (type:uint16_t)
current_battery : Battery current, -1: autopilot does not measure the current [cA] (type:int16_t)
current_consumed : Consumed charge, -1: autopilot does not provide consumption estimate [mAh] (type:int32_t)
energy_consumed : Consumed energy, -1: autopilot does not provide energy consumption estimate [hJ] (type:int32_t)
battery_remaining : Remaining battery energy. Values: [0-100], -1: autopilot does not estimate the remaining battery. [%] (type:int8_t)
'''
return MAVLink_battery_status_message(id, battery_function, type, temperature, voltages, current_battery, current_consumed, energy_consumed, battery_remaining)
def battery_status_send(self, id, battery_function, type, temperature, voltages, current_battery, current_consumed, energy_consumed, battery_remaining, force_mavlink1=False):
'''
Battery information
id : Battery ID (type:uint8_t)
battery_function : Function of the battery (type:uint8_t, values:MAV_BATTERY_FUNCTION)
type : Type (chemistry) of the battery (type:uint8_t, values:MAV_BATTERY_TYPE)
temperature : Temperature of the battery. INT16_MAX for unknown temperature. [cdegC] (type:int16_t)
voltages : Battery voltage of cells. Cells 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). [mV] (type:uint16_t)
current_battery : Battery current, -1: autopilot does not measure the current [cA] (type:int16_t)
current_consumed : Consumed charge, -1: autopilot does not provide consumption estimate [mAh] (type:int32_t)
energy_consumed : Consumed energy, -1: autopilot does not provide energy consumption estimate [hJ] (type:int32_t)
battery_remaining : Remaining battery energy. Values: [0-100], -1: autopilot does not estimate the remaining battery. [%] (type:int8_t)
'''
return self.send(self.battery_status_encode(id, battery_function, type, temperature, voltages, current_battery, current_consumed, energy_consumed, battery_remaining), force_mavlink1=force_mavlink1)
def autopilot_version_encode(self, capabilities, flight_sw_version, middleware_sw_version, os_sw_version, board_version, flight_custom_version, middleware_custom_version, os_custom_version, vendor_id, product_id, uid):
'''
Version and capability of autopilot software. This should be emitted
in response to a
MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES command.
capabilities : Bitmap of capabilities (type:uint64_t, values:MAV_PROTOCOL_CAPABILITY)
flight_sw_version : Firmware version number (type:uint32_t)
middleware_sw_version : Middleware version number (type:uint32_t)
os_sw_version : Operating system version number (type:uint32_t)
board_version : HW / board version (last 8 bytes should be silicon ID, if any) (type:uint32_t)
flight_custom_version : Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases. (type:uint8_t)
middleware_custom_version : Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases. (type:uint8_t)
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. (type:uint8_t)
vendor_id : ID of the board vendor (type:uint16_t)
product_id : ID of the product (type:uint16_t)
uid : UID if provided by hardware (see uid2) (type:uint64_t)
'''
return MAVLink_autopilot_version_message(capabilities, flight_sw_version, middleware_sw_version, os_sw_version, board_version, flight_custom_version, middleware_custom_version, os_custom_version, vendor_id, product_id, uid)
def autopilot_version_send(self, capabilities, flight_sw_version, middleware_sw_version, os_sw_version, board_version, flight_custom_version, middleware_custom_version, os_custom_version, vendor_id, product_id, uid, force_mavlink1=False):
'''
Version and capability of autopilot software. This should be emitted
in response to a
MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES command.
capabilities : Bitmap of capabilities (type:uint64_t, values:MAV_PROTOCOL_CAPABILITY)
flight_sw_version : Firmware version number (type:uint32_t)
middleware_sw_version : Middleware version number (type:uint32_t)
os_sw_version : Operating system version number (type:uint32_t)
board_version : HW / board version (last 8 bytes should be silicon ID, if any) (type:uint32_t)
flight_custom_version : Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases. (type:uint8_t)
middleware_custom_version : Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases. (type:uint8_t)
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. (type:uint8_t)
vendor_id : ID of the board vendor (type:uint16_t)
product_id : ID of the product (type:uint16_t)
uid : UID if provided by hardware (see uid2) (type:uint64_t)
'''
return self.send(self.autopilot_version_encode(capabilities, flight_sw_version, middleware_sw_version, os_sw_version, board_version, flight_custom_version, middleware_custom_version, os_custom_version, vendor_id, product_id, uid), force_mavlink1=force_mavlink1)
def landing_target_encode(self, time_usec, target_num, frame, angle_x, angle_y, distance, size_x, size_y):
'''
The location of a landing target. See:
https://mavlink.io/en/services/landing_target.html
time_usec : 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. [us] (type:uint64_t)
target_num : The ID of the target if multiple targets are present (type:uint8_t)
frame : Coordinate frame used for following fields. (type:uint8_t, values:MAV_FRAME)
angle_x : X-axis angular offset of the target from the center of the image [rad] (type:float)
angle_y : Y-axis angular offset of the target from the center of the image [rad] (type:float)
distance : Distance to the target from the vehicle [m] (type:float)
size_x : Size of target along x-axis [rad] (type:float)
size_y : Size of target along y-axis [rad] (type:float)
'''
return MAVLink_landing_target_message(time_usec, target_num, frame, angle_x, angle_y, distance, size_x, size_y)
def landing_target_send(self, time_usec, target_num, frame, angle_x, angle_y, distance, size_x, size_y, force_mavlink1=False):
'''
The location of a landing target. See:
https://mavlink.io/en/services/landing_target.html
time_usec : 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. [us] (type:uint64_t)
target_num : The ID of the target if multiple targets are present (type:uint8_t)
frame : Coordinate frame used for following fields. (type:uint8_t, values:MAV_FRAME)
angle_x : X-axis angular offset of the target from the center of the image [rad] (type:float)
angle_y : Y-axis angular offset of the target from the center of the image [rad] (type:float)
distance : Distance to the target from the vehicle [m] (type:float)
size_x : Size of target along x-axis [rad] (type:float)
size_y : Size of target along y-axis [rad] (type:float)
'''
return self.send(self.landing_target_encode(time_usec, target_num, frame, angle_x, angle_y, distance, size_x, size_y), force_mavlink1=force_mavlink1)
def fence_status_encode(self, breach_status, breach_count, breach_type, breach_time):
'''
Status of geo-fencing. Sent in extended status stream when fencing
enabled.
breach_status : Breach status (0 if currently inside fence, 1 if outside). (type:uint8_t)
breach_count : Number of fence breaches. (type:uint16_t)
breach_type : Last breach type. (type:uint8_t, values:FENCE_BREACH)
breach_time : Time (since boot) of last breach. [ms] (type:uint32_t)
'''
return MAVLink_fence_status_message(breach_status, breach_count, breach_type, breach_time)
def fence_status_send(self, breach_status, breach_count, breach_type, breach_time, force_mavlink1=False):
'''
Status of geo-fencing. Sent in extended status stream when fencing
enabled.
breach_status : Breach status (0 if currently inside fence, 1 if outside). (type:uint8_t)
breach_count : Number of fence breaches. (type:uint16_t)
breach_type : Last breach type. (type:uint8_t, values:FENCE_BREACH)
breach_time : Time (since boot) of last breach. [ms] (type:uint32_t)
'''
return self.send(self.fence_status_encode(breach_status, breach_count, breach_type, breach_time), force_mavlink1=force_mavlink1)
def estimator_status_encode(self, time_usec, flags, vel_ratio, pos_horiz_ratio, pos_vert_ratio, mag_ratio, hagl_ratio, tas_ratio, pos_horiz_accuracy, pos_vert_accuracy):
'''
Estimator status message including flags, innovation test ratios and
estimated accuracies. The flags message is an integer
bitmask containing information on which EKF outputs
are valid. See the ESTIMATOR_STATUS_FLAGS enum
definition for further information. The innovation
test ratios show the magnitude of the sensor
innovation divided by the innovation check threshold.
Under normal operation the innovation test ratios
should be below 0.5 with occasional values up to 1.0.
Values greater than 1.0 should be rare under normal
operation and indicate that a measurement has been
rejected by the filter. The user should be notified if
an innovation test ratio greater than 1.0 is recorded.
Notifications for values in the range between 0.5 and
1.0 should be optional and controllable by the user.
time_usec : 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. [us] (type:uint64_t)
flags : Bitmap indicating which EKF outputs are valid. (type:uint16_t, values:ESTIMATOR_STATUS_FLAGS)
vel_ratio : Velocity innovation test ratio (type:float)
pos_horiz_ratio : Horizontal position innovation test ratio (type:float)
pos_vert_ratio : Vertical position innovation test ratio (type:float)
mag_ratio : Magnetometer innovation test ratio (type:float)
hagl_ratio : Height above terrain innovation test ratio (type:float)
tas_ratio : True airspeed innovation test ratio (type:float)
pos_horiz_accuracy : Horizontal position 1-STD accuracy relative to the EKF local origin [m] (type:float)
pos_vert_accuracy : Vertical position 1-STD accuracy relative to the EKF local origin [m] (type:float)
'''
return MAVLink_estimator_status_message(time_usec, flags, vel_ratio, pos_horiz_ratio, pos_vert_ratio, mag_ratio, hagl_ratio, tas_ratio, pos_horiz_accuracy, pos_vert_accuracy)
def estimator_status_send(self, time_usec, flags, vel_ratio, pos_horiz_ratio, pos_vert_ratio, mag_ratio, hagl_ratio, tas_ratio, pos_horiz_accuracy, pos_vert_accuracy, force_mavlink1=False):
'''
Estimator status message including flags, innovation test ratios and
estimated accuracies. The flags message is an integer
bitmask containing information on which EKF outputs
are valid. See the ESTIMATOR_STATUS_FLAGS enum
definition for further information. The innovation
test ratios show the magnitude of the sensor
innovation divided by the innovation check threshold.
Under normal operation the innovation test ratios
should be below 0.5 with occasional values up to 1.0.
Values greater than 1.0 should be rare under normal
operation and indicate that a measurement has been
rejected by the filter. The user should be notified if
an innovation test ratio greater than 1.0 is recorded.
Notifications for values in the range between 0.5 and
1.0 should be optional and controllable by the user.
time_usec : 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. [us] (type:uint64_t)
flags : Bitmap indicating which EKF outputs are valid. (type:uint16_t, values:ESTIMATOR_STATUS_FLAGS)
vel_ratio : Velocity innovation test ratio (type:float)
pos_horiz_ratio : Horizontal position innovation test ratio (type:float)
pos_vert_ratio : Vertical position innovation test ratio (type:float)
mag_ratio : Magnetometer innovation test ratio (type:float)
hagl_ratio : Height above terrain innovation test ratio (type:float)
tas_ratio : True airspeed innovation test ratio (type:float)
pos_horiz_accuracy : Horizontal position 1-STD accuracy relative to the EKF local origin [m] (type:float)
pos_vert_accuracy : Vertical position 1-STD accuracy relative to the EKF local origin [m] (type:float)
'''
return self.send(self.estimator_status_encode(time_usec, flags, vel_ratio, pos_horiz_ratio, pos_vert_ratio, mag_ratio, hagl_ratio, tas_ratio, pos_horiz_accuracy, pos_vert_accuracy), force_mavlink1=force_mavlink1)
def wind_cov_encode(self, time_usec, wind_x, wind_y, wind_z, var_horiz, var_vert, wind_alt, horiz_accuracy, vert_accuracy):
'''
Wind covariance estimate from vehicle.
time_usec : 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. [us] (type:uint64_t)
wind_x : Wind in X (NED) direction [m/s] (type:float)
wind_y : Wind in Y (NED) direction [m/s] (type:float)
wind_z : Wind in Z (NED) direction [m/s] (type:float)
var_horiz : Variability of the wind in XY. RMS of a 1 Hz lowpassed wind estimate. [m/s] (type:float)
var_vert : Variability of the wind in Z. RMS of a 1 Hz lowpassed wind estimate. [m/s] (type:float)
wind_alt : Altitude (MSL) that this measurement was taken at [m] (type:float)
horiz_accuracy : Horizontal speed 1-STD accuracy [m] (type:float)
vert_accuracy : Vertical speed 1-STD accuracy [m] (type:float)
'''
return MAVLink_wind_cov_message(time_usec, wind_x, wind_y, wind_z, var_horiz, var_vert, wind_alt, horiz_accuracy, vert_accuracy)
def wind_cov_send(self, time_usec, wind_x, wind_y, wind_z, var_horiz, var_vert, wind_alt, horiz_accuracy, vert_accuracy, force_mavlink1=False):
'''
Wind covariance estimate from vehicle.
time_usec : 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. [us] (type:uint64_t)
wind_x : Wind in X (NED) direction [m/s] (type:float)
wind_y : Wind in Y (NED) direction [m/s] (type:float)
wind_z : Wind in Z (NED) direction [m/s] (type:float)
var_horiz : Variability of the wind in XY. RMS of a 1 Hz lowpassed wind estimate. [m/s] (type:float)
var_vert : Variability of the wind in Z. RMS of a 1 Hz lowpassed wind estimate. [m/s] (type:float)
wind_alt : Altitude (MSL) that this measurement was taken at [m] (type:float)
horiz_accuracy : Horizontal speed 1-STD accuracy [m] (type:float)
vert_accuracy : Vertical speed 1-STD accuracy [m] (type:float)
'''
return self.send(self.wind_cov_encode(time_usec, wind_x, wind_y, wind_z, var_horiz, var_vert, wind_alt, horiz_accuracy, vert_accuracy), force_mavlink1=force_mavlink1)
def gps_input_encode(self, time_usec, gps_id, ignore_flags, time_week_ms, time_week, fix_type, lat, lon, alt, hdop, vdop, vn, ve, vd, speed_accuracy, horiz_accuracy, vert_accuracy, satellites_visible):
'''
GPS sensor input message. This is a raw sensor value sent by the GPS.
This is NOT the global position estimate of the
system.
time_usec : 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. [us] (type:uint64_t)
gps_id : ID of the GPS for multiple GPS inputs (type:uint8_t)
ignore_flags : Bitmap indicating which GPS input flags fields to ignore. All other fields must be provided. (type:uint16_t, values:GPS_INPUT_IGNORE_FLAGS)
time_week_ms : GPS time (from start of GPS week) [ms] (type:uint32_t)
time_week : GPS week number (type:uint16_t)
fix_type : 0-1: no fix, 2: 2D fix, 3: 3D fix. 4: 3D with DGPS. 5: 3D with RTK (type:uint8_t)
lat : Latitude (WGS84) [degE7] (type:int32_t)
lon : Longitude (WGS84) [degE7] (type:int32_t)
alt : Altitude (MSL). Positive for up. [m] (type:float)
hdop : GPS HDOP horizontal dilution of position [m] (type:float)
vdop : GPS VDOP vertical dilution of position [m] (type:float)
vn : GPS velocity in north direction in earth-fixed NED frame [m/s] (type:float)
ve : GPS velocity in east direction in earth-fixed NED frame [m/s] (type:float)
vd : GPS velocity in down direction in earth-fixed NED frame [m/s] (type:float)
speed_accuracy : GPS speed accuracy [m/s] (type:float)
horiz_accuracy : GPS horizontal accuracy [m] (type:float)
vert_accuracy : GPS vertical accuracy [m] (type:float)
satellites_visible : Number of satellites visible. (type:uint8_t)
'''
return MAVLink_gps_input_message(time_usec, gps_id, ignore_flags, time_week_ms, time_week, fix_type, lat, lon, alt, hdop, vdop, vn, ve, vd, speed_accuracy, horiz_accuracy, vert_accuracy, satellites_visible)
def gps_input_send(self, time_usec, gps_id, ignore_flags, time_week_ms, time_week, fix_type, lat, lon, alt, hdop, vdop, vn, ve, vd, speed_accuracy, horiz_accuracy, vert_accuracy, satellites_visible, force_mavlink1=False):
'''
GPS sensor input message. This is a raw sensor value sent by the GPS.
This is NOT the global position estimate of the
system.
time_usec : 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. [us] (type:uint64_t)
gps_id : ID of the GPS for multiple GPS inputs (type:uint8_t)
ignore_flags : Bitmap indicating which GPS input flags fields to ignore. All other fields must be provided. (type:uint16_t, values:GPS_INPUT_IGNORE_FLAGS)
time_week_ms : GPS time (from start of GPS week) [ms] (type:uint32_t)
time_week : GPS week number (type:uint16_t)
fix_type : 0-1: no fix, 2: 2D fix, 3: 3D fix. 4: 3D with DGPS. 5: 3D with RTK (type:uint8_t)
lat : Latitude (WGS84) [degE7] (type:int32_t)
lon : Longitude (WGS84) [degE7] (type:int32_t)
alt : Altitude (MSL). Positive for up. [m] (type:float)
hdop : GPS HDOP horizontal dilution of position [m] (type:float)
vdop : GPS VDOP vertical dilution of position [m] (type:float)
vn : GPS velocity in north direction in earth-fixed NED frame [m/s] (type:float)
ve : GPS velocity in east direction in earth-fixed NED frame [m/s] (type:float)
vd : GPS velocity in down direction in earth-fixed NED frame [m/s] (type:float)
speed_accuracy : GPS speed accuracy [m/s] (type:float)
horiz_accuracy : GPS horizontal accuracy [m] (type:float)
vert_accuracy : GPS vertical accuracy [m] (type:float)
satellites_visible : Number of satellites visible. (type:uint8_t)
'''
return self.send(self.gps_input_encode(time_usec, gps_id, ignore_flags, time_week_ms, time_week, fix_type, lat, lon, alt, hdop, vdop, vn, ve, vd, speed_accuracy, horiz_accuracy, vert_accuracy, satellites_visible), force_mavlink1=force_mavlink1)
def gps_rtcm_data_encode(self, flags, len, data):
'''
RTCM message for injecting into the onboard GPS (used for DGPS)
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. (type:uint8_t)
len : data length [bytes] (type:uint8_t)
data : RTCM message (may be fragmented) (type:uint8_t)
'''
return MAVLink_gps_rtcm_data_message(flags, len, data)
def gps_rtcm_data_send(self, flags, len, data, force_mavlink1=False):
'''
RTCM message for injecting into the onboard GPS (used for DGPS)
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. (type:uint8_t)
len : data length [bytes] (type:uint8_t)
data : RTCM message (may be fragmented) (type:uint8_t)
'''
return self.send(self.gps_rtcm_data_encode(flags, len, data), force_mavlink1=force_mavlink1)
def high_latency_encode(self, base_mode, custom_mode, landed_state, roll, pitch, heading, throttle, heading_sp, latitude, longitude, altitude_amsl, altitude_sp, airspeed, airspeed_sp, groundspeed, climb_rate, gps_nsat, gps_fix_type, battery_remaining, temperature, temperature_air, failsafe, wp_num, wp_distance):
'''
Message appropriate for high latency connections like Iridium
base_mode : Bitmap of enabled system modes. (type:uint8_t, values:MAV_MODE_FLAG)
custom_mode : A bitfield for use for autopilot-specific flags. (type:uint32_t)
landed_state : The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown. (type:uint8_t, values:MAV_LANDED_STATE)
roll : roll [cdeg] (type:int16_t)
pitch : pitch [cdeg] (type:int16_t)
heading : heading [cdeg] (type:uint16_t)
throttle : throttle (percentage) [%] (type:int8_t)
heading_sp : heading setpoint [cdeg] (type:int16_t)
latitude : Latitude [degE7] (type:int32_t)
longitude : Longitude [degE7] (type:int32_t)
altitude_amsl : Altitude above mean sea level [m] (type:int16_t)
altitude_sp : Altitude setpoint relative to the home position [m] (type:int16_t)
airspeed : airspeed [m/s] (type:uint8_t)
airspeed_sp : airspeed setpoint [m/s] (type:uint8_t)
groundspeed : groundspeed [m/s] (type:uint8_t)
climb_rate : climb rate [m/s] (type:int8_t)
gps_nsat : Number of satellites visible. If unknown, set to 255 (type:uint8_t)
gps_fix_type : GPS Fix type. (type:uint8_t, values:GPS_FIX_TYPE)
battery_remaining : Remaining battery (percentage) [%] (type:uint8_t)
temperature : Autopilot temperature (degrees C) [degC] (type:int8_t)
temperature_air : Air temperature (degrees C) from airspeed sensor [degC] (type:int8_t)
failsafe : failsafe (each bit represents a failsafe where 0=ok, 1=failsafe active (bit0:RC, bit1:batt, bit2:GPS, bit3:GCS, bit4:fence) (type:uint8_t)
wp_num : current waypoint number (type:uint8_t)
wp_distance : distance to target [m] (type:uint16_t)
'''
return MAVLink_high_latency_message(base_mode, custom_mode, landed_state, roll, pitch, heading, throttle, heading_sp, latitude, longitude, altitude_amsl, altitude_sp, airspeed, airspeed_sp, groundspeed, climb_rate, gps_nsat, gps_fix_type, battery_remaining, temperature, temperature_air, failsafe, wp_num, wp_distance)
def high_latency_send(self, base_mode, custom_mode, landed_state, roll, pitch, heading, throttle, heading_sp, latitude, longitude, altitude_amsl, altitude_sp, airspeed, airspeed_sp, groundspeed, climb_rate, gps_nsat, gps_fix_type, battery_remaining, temperature, temperature_air, failsafe, wp_num, wp_distance, force_mavlink1=False):
'''
Message appropriate for high latency connections like Iridium
base_mode : Bitmap of enabled system modes. (type:uint8_t, values:MAV_MODE_FLAG)
custom_mode : A bitfield for use for autopilot-specific flags. (type:uint32_t)
landed_state : The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown. (type:uint8_t, values:MAV_LANDED_STATE)
roll : roll [cdeg] (type:int16_t)
pitch : pitch [cdeg] (type:int16_t)
heading : heading [cdeg] (type:uint16_t)
throttle : throttle (percentage) [%] (type:int8_t)
heading_sp : heading setpoint [cdeg] (type:int16_t)
latitude : Latitude [degE7] (type:int32_t)
longitude : Longitude [degE7] (type:int32_t)
altitude_amsl : Altitude above mean sea level [m] (type:int16_t)
altitude_sp : Altitude setpoint relative to the home position [m] (type:int16_t)
airspeed : airspeed [m/s] (type:uint8_t)
airspeed_sp : airspeed setpoint [m/s] (type:uint8_t)
groundspeed : groundspeed [m/s] (type:uint8_t)
climb_rate : climb rate [m/s] (type:int8_t)
gps_nsat : Number of satellites visible. If unknown, set to 255 (type:uint8_t)
gps_fix_type : GPS Fix type. (type:uint8_t, values:GPS_FIX_TYPE)
battery_remaining : Remaining battery (percentage) [%] (type:uint8_t)
temperature : Autopilot temperature (degrees C) [degC] (type:int8_t)
temperature_air : Air temperature (degrees C) from airspeed sensor [degC] (type:int8_t)
failsafe : failsafe (each bit represents a failsafe where 0=ok, 1=failsafe active (bit0:RC, bit1:batt, bit2:GPS, bit3:GCS, bit4:fence) (type:uint8_t)
wp_num : current waypoint number (type:uint8_t)
wp_distance : distance to target [m] (type:uint16_t)
'''
return self.send(self.high_latency_encode(base_mode, custom_mode, landed_state, roll, pitch, heading, throttle, heading_sp, latitude, longitude, altitude_amsl, altitude_sp, airspeed, airspeed_sp, groundspeed, climb_rate, gps_nsat, gps_fix_type, battery_remaining, temperature, temperature_air, failsafe, wp_num, wp_distance), force_mavlink1=force_mavlink1)
def vibration_encode(self, time_usec, vibration_x, vibration_y, vibration_z, clipping_0, clipping_1, clipping_2):
'''
Vibration levels and accelerometer clipping
time_usec : 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. [us] (type:uint64_t)
vibration_x : Vibration levels on X-axis (type:float)
vibration_y : Vibration levels on Y-axis (type:float)
vibration_z : Vibration levels on Z-axis (type:float)
clipping_0 : first accelerometer clipping count (type:uint32_t)
clipping_1 : second accelerometer clipping count (type:uint32_t)
clipping_2 : third accelerometer clipping count (type:uint32_t)
'''
return MAVLink_vibration_message(time_usec, vibration_x, vibration_y, vibration_z, clipping_0, clipping_1, clipping_2)
def vibration_send(self, time_usec, vibration_x, vibration_y, vibration_z, clipping_0, clipping_1, clipping_2, force_mavlink1=False):
'''
Vibration levels and accelerometer clipping
time_usec : 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. [us] (type:uint64_t)
vibration_x : Vibration levels on X-axis (type:float)
vibration_y : Vibration levels on Y-axis (type:float)
vibration_z : Vibration levels on Z-axis (type:float)
clipping_0 : first accelerometer clipping count (type:uint32_t)
clipping_1 : second accelerometer clipping count (type:uint32_t)
clipping_2 : third accelerometer clipping count (type:uint32_t)
'''
return self.send(self.vibration_encode(time_usec, vibration_x, vibration_y, vibration_z, clipping_0, clipping_1, clipping_2), force_mavlink1=force_mavlink1)
def home_position_encode(self, latitude, longitude, altitude, x, y, z, q, approach_x, approach_y, approach_z):
'''
This message can be requested by sending the MAV_CMD_GET_HOME_POSITION
command. The position the system will return to and
land on. The position is set automatically by the
system during the takeoff in case it was not
explicitly set by the operator before or after. The
global and local positions encode the position in the
respective coordinate frames, while the q parameter
encodes the orientation of the surface. Under normal
conditions it describes the heading and terrain slope,
which can be used by the aircraft to adjust the
approach. The approach 3D vector describes the point
to which the system should fly in normal flight mode
and then perform a landing sequence along the vector.
latitude : Latitude (WGS84) [degE7] (type:int32_t)
longitude : Longitude (WGS84) [degE7] (type:int32_t)
altitude : Altitude (MSL). Positive for up. [mm] (type:int32_t)
x : Local X position of this position in the local coordinate frame [m] (type:float)
y : Local Y position of this position in the local coordinate frame [m] (type:float)
z : Local Z position of this position in the local coordinate frame [m] (type:float)
q : World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground (type:float)
approach_x : Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. [m] (type:float)
approach_y : Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. [m] (type:float)
approach_z : Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. [m] (type:float)
'''
return MAVLink_home_position_message(latitude, longitude, altitude, x, y, z, q, approach_x, approach_y, approach_z)
def home_position_send(self, latitude, longitude, altitude, x, y, z, q, approach_x, approach_y, approach_z, force_mavlink1=False):
'''
This message can be requested by sending the MAV_CMD_GET_HOME_POSITION
command. The position the system will return to and
land on. The position is set automatically by the
system during the takeoff in case it was not
explicitly set by the operator before or after. The
global and local positions encode the position in the
respective coordinate frames, while the q parameter
encodes the orientation of the surface. Under normal
conditions it describes the heading and terrain slope,
which can be used by the aircraft to adjust the
approach. The approach 3D vector describes the point
to which the system should fly in normal flight mode
and then perform a landing sequence along the vector.
latitude : Latitude (WGS84) [degE7] (type:int32_t)
longitude : Longitude (WGS84) [degE7] (type:int32_t)
altitude : Altitude (MSL). Positive for up. [mm] (type:int32_t)
x : Local X position of this position in the local coordinate frame [m] (type:float)
y : Local Y position of this position in the local coordinate frame [m] (type:float)
z : Local Z position of this position in the local coordinate frame [m] (type:float)
q : World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground (type:float)
approach_x : Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. [m] (type:float)
approach_y : Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. [m] (type:float)
approach_z : Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. [m] (type:float)
'''
return self.send(self.home_position_encode(latitude, longitude, altitude, x, y, z, q, approach_x, approach_y, approach_z), force_mavlink1=force_mavlink1)
def set_home_position_encode(self, target_system, latitude, longitude, altitude, x, y, z, q, approach_x, approach_y, approach_z):
'''
The position the system will return to and land on. The position is
set automatically by the system during the takeoff in
case it was not explicitly set by the operator before
or after. The global and local positions encode the
position in the respective coordinate frames, while
the q parameter encodes the orientation of the
surface. Under normal conditions it describes the
heading and terrain slope, which can be used by the
aircraft to adjust the approach. The approach 3D
vector describes the point to which the system should
fly in normal flight mode and then perform a landing
sequence along the vector.
target_system : System ID. (type:uint8_t)
latitude : Latitude (WGS84) [degE7] (type:int32_t)
longitude : Longitude (WGS84) [degE7] (type:int32_t)
altitude : Altitude (MSL). Positive for up. [mm] (type:int32_t)
x : Local X position of this position in the local coordinate frame [m] (type:float)
y : Local Y position of this position in the local coordinate frame [m] (type:float)
z : Local Z position of this position in the local coordinate frame [m] (type:float)
q : World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground (type:float)
approach_x : Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. [m] (type:float)
approach_y : Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. [m] (type:float)
approach_z : Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. [m] (type:float)
'''
return MAVLink_set_home_position_message(target_system, latitude, longitude, altitude, x, y, z, q, approach_x, approach_y, approach_z)
def set_home_position_send(self, target_system, latitude, longitude, altitude, x, y, z, q, approach_x, approach_y, approach_z, force_mavlink1=False):
'''
The position the system will return to and land on. The position is
set automatically by the system during the takeoff in
case it was not explicitly set by the operator before
or after. The global and local positions encode the
position in the respective coordinate frames, while
the q parameter encodes the orientation of the
surface. Under normal conditions it describes the
heading and terrain slope, which can be used by the
aircraft to adjust the approach. The approach 3D
vector describes the point to which the system should
fly in normal flight mode and then perform a landing
sequence along the vector.
target_system : System ID. (type:uint8_t)
latitude : Latitude (WGS84) [degE7] (type:int32_t)
longitude : Longitude (WGS84) [degE7] (type:int32_t)
altitude : Altitude (MSL). Positive for up. [mm] (type:int32_t)
x : Local X position of this position in the local coordinate frame [m] (type:float)
y : Local Y position of this position in the local coordinate frame [m] (type:float)
z : Local Z position of this position in the local coordinate frame [m] (type:float)
q : World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground (type:float)
approach_x : Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. [m] (type:float)
approach_y : Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. [m] (type:float)
approach_z : Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. [m] (type:float)
'''
return self.send(self.set_home_position_encode(target_system, latitude, longitude, altitude, x, y, z, q, approach_x, approach_y, approach_z), force_mavlink1=force_mavlink1)
def message_interval_encode(self, message_id, interval_us):
'''
The interval between messages for a particular MAVLink message ID.
This message is the response to the
MAV_CMD_GET_MESSAGE_INTERVAL command. This interface
replaces DATA_STREAM.
message_id : The ID of the requested MAVLink message. v1.0 is limited to 254 messages. (type:uint16_t)
interval_us : The interval between two messages. A value of -1 indicates this stream is disabled, 0 indicates it is not available, > 0 indicates the interval at which it is sent. [us] (type:int32_t)
'''
return MAVLink_message_interval_message(message_id, interval_us)
def message_interval_send(self, message_id, interval_us, force_mavlink1=False):
'''
The interval between messages for a particular MAVLink message ID.
This message is the response to the
MAV_CMD_GET_MESSAGE_INTERVAL command. This interface
replaces DATA_STREAM.
message_id : The ID of the requested MAVLink message. v1.0 is limited to 254 messages. (type:uint16_t)
interval_us : The interval between two messages. A value of -1 indicates this stream is disabled, 0 indicates it is not available, > 0 indicates the interval at which it is sent. [us] (type:int32_t)
'''
return self.send(self.message_interval_encode(message_id, interval_us), force_mavlink1=force_mavlink1)
def extended_sys_state_encode(self, vtol_state, landed_state):
'''
Provides state for additional features
vtol_state : The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration. (type:uint8_t, values:MAV_VTOL_STATE)
landed_state : The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown. (type:uint8_t, values:MAV_LANDED_STATE)
'''
return MAVLink_extended_sys_state_message(vtol_state, landed_state)
def extended_sys_state_send(self, vtol_state, landed_state, force_mavlink1=False):
'''
Provides state for additional features
vtol_state : The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration. (type:uint8_t, values:MAV_VTOL_STATE)
landed_state : The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown. (type:uint8_t, values:MAV_LANDED_STATE)
'''
return self.send(self.extended_sys_state_encode(vtol_state, landed_state), force_mavlink1=force_mavlink1)
def adsb_vehicle_encode(self, ICAO_address, lat, lon, altitude_type, altitude, heading, hor_velocity, ver_velocity, callsign, emitter_type, tslc, flags, squawk):
'''
The location and information of an ADSB vehicle
ICAO_address : ICAO address (type:uint32_t)
lat : Latitude [degE7] (type:int32_t)
lon : Longitude [degE7] (type:int32_t)
altitude_type : ADSB altitude type. (type:uint8_t, values:ADSB_ALTITUDE_TYPE)
altitude : Altitude(ASL) [mm] (type:int32_t)
heading : Course over ground [cdeg] (type:uint16_t)
hor_velocity : The horizontal velocity [cm/s] (type:uint16_t)
ver_velocity : The vertical velocity. Positive is up [cm/s] (type:int16_t)
callsign : The callsign, 8+null (type:char)
emitter_type : ADSB emitter type. (type:uint8_t, values:ADSB_EMITTER_TYPE)
tslc : Time since last communication in seconds [s] (type:uint8_t)
flags : Bitmap to indicate various statuses including valid data fields (type:uint16_t, values:ADSB_FLAGS)
squawk : Squawk code (type:uint16_t)
'''
return MAVLink_adsb_vehicle_message(ICAO_address, lat, lon, altitude_type, altitude, heading, hor_velocity, ver_velocity, callsign, emitter_type, tslc, flags, squawk)
def adsb_vehicle_send(self, ICAO_address, lat, lon, altitude_type, altitude, heading, hor_velocity, ver_velocity, callsign, emitter_type, tslc, flags, squawk, force_mavlink1=False):
'''
The location and information of an ADSB vehicle
ICAO_address : ICAO address (type:uint32_t)
lat : Latitude [degE7] (type:int32_t)
lon : Longitude [degE7] (type:int32_t)
altitude_type : ADSB altitude type. (type:uint8_t, values:ADSB_ALTITUDE_TYPE)
altitude : Altitude(ASL) [mm] (type:int32_t)
heading : Course over ground [cdeg] (type:uint16_t)
hor_velocity : The horizontal velocity [cm/s] (type:uint16_t)
ver_velocity : The vertical velocity. Positive is up [cm/s] (type:int16_t)
callsign : The callsign, 8+null (type:char)
emitter_type : ADSB emitter type. (type:uint8_t, values:ADSB_EMITTER_TYPE)
tslc : Time since last communication in seconds [s] (type:uint8_t)
flags : Bitmap to indicate various statuses including valid data fields (type:uint16_t, values:ADSB_FLAGS)
squawk : Squawk code (type:uint16_t)
'''
return self.send(self.adsb_vehicle_encode(ICAO_address, lat, lon, altitude_type, altitude, heading, hor_velocity, ver_velocity, callsign, emitter_type, tslc, flags, squawk), force_mavlink1=force_mavlink1)
def collision_encode(self, src, id, action, threat_level, time_to_minimum_delta, altitude_minimum_delta, horizontal_minimum_delta):
'''
Information about a potential collision
src : Collision data source (type:uint8_t, values:MAV_COLLISION_SRC)
id : Unique identifier, domain based on src field (type:uint32_t)
action : Action that is being taken to avoid this collision (type:uint8_t, values:MAV_COLLISION_ACTION)
threat_level : How concerned the aircraft is about this collision (type:uint8_t, values:MAV_COLLISION_THREAT_LEVEL)
time_to_minimum_delta : Estimated time until collision occurs [s] (type:float)
altitude_minimum_delta : Closest vertical distance between vehicle and object [m] (type:float)
horizontal_minimum_delta : Closest horizontal distance between vehicle and object [m] (type:float)
'''
return MAVLink_collision_message(src, id, action, threat_level, time_to_minimum_delta, altitude_minimum_delta, horizontal_minimum_delta)
def collision_send(self, src, id, action, threat_level, time_to_minimum_delta, altitude_minimum_delta, horizontal_minimum_delta, force_mavlink1=False):
'''
Information about a potential collision
src : Collision data source (type:uint8_t, values:MAV_COLLISION_SRC)
id : Unique identifier, domain based on src field (type:uint32_t)
action : Action that is being taken to avoid this collision (type:uint8_t, values:MAV_COLLISION_ACTION)
threat_level : How concerned the aircraft is about this collision (type:uint8_t, values:MAV_COLLISION_THREAT_LEVEL)
time_to_minimum_delta : Estimated time until collision occurs [s] (type:float)
altitude_minimum_delta : Closest vertical distance between vehicle and object [m] (type:float)
horizontal_minimum_delta : Closest horizontal distance between vehicle and object [m] (type:float)
'''
return self.send(self.collision_encode(src, id, action, threat_level, time_to_minimum_delta, altitude_minimum_delta, horizontal_minimum_delta), force_mavlink1=force_mavlink1)
def v2_extension_encode(self, target_network, target_system, target_component, message_type, payload):
'''
Message implementing parts of the V2 payload specs in V1 frames for
transitional support.
target_network : Network ID (0 for broadcast) (type:uint8_t)
target_system : System ID (0 for broadcast) (type:uint8_t)
target_component : Component ID (0 for broadcast) (type:uint8_t)
message_type : A code that identifies the software component that understands this message (analogous to USB device classes or mime type strings). If this code is less than 32768, it is considered a 'registered' protocol extension and the corresponding entry should be added to https://github.com/mavlink/mavlink/definition_files/extension_message_ids.xml. Software creators can register blocks of message IDs as needed (useful for GCS specific metadata, etc...). Message_types greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase. (type:uint16_t)
payload : Variable length payload. The length must be encoded in the payload as part of the message_type protocol, e.g. by including the length as payload data, or by terminating the payload data with a non-zero marker. This is required in order to reconstruct zero-terminated payloads that are (or otherwise would be) trimmed by MAVLink 2 empty-byte truncation. The entire content of the payload block is opaque unless you understand the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the MAVLink specification. (type:uint8_t)
'''
return MAVLink_v2_extension_message(target_network, target_system, target_component, message_type, payload)
def v2_extension_send(self, target_network, target_system, target_component, message_type, payload, force_mavlink1=False):
'''
Message implementing parts of the V2 payload specs in V1 frames for
transitional support.
target_network : Network ID (0 for broadcast) (type:uint8_t)
target_system : System ID (0 for broadcast) (type:uint8_t)
target_component : Component ID (0 for broadcast) (type:uint8_t)
message_type : A code that identifies the software component that understands this message (analogous to USB device classes or mime type strings). If this code is less than 32768, it is considered a 'registered' protocol extension and the corresponding entry should be added to https://github.com/mavlink/mavlink/definition_files/extension_message_ids.xml. Software creators can register blocks of message IDs as needed (useful for GCS specific metadata, etc...). Message_types greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase. (type:uint16_t)
payload : Variable length payload. The length must be encoded in the payload as part of the message_type protocol, e.g. by including the length as payload data, or by terminating the payload data with a non-zero marker. This is required in order to reconstruct zero-terminated payloads that are (or otherwise would be) trimmed by MAVLink 2 empty-byte truncation. The entire content of the payload block is opaque unless you understand the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the MAVLink specification. (type:uint8_t)
'''
return self.send(self.v2_extension_encode(target_network, target_system, target_component, message_type, payload), force_mavlink1=force_mavlink1)
def memory_vect_encode(self, address, ver, type, value):
'''
Send raw controller memory. The use of this message is discouraged for
normal packets, but a quite efficient way for testing
new messages and getting experimental debug output.
address : Starting address of the debug variables (type:uint16_t)
ver : Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below (type:uint8_t)
type : Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14 (type:uint8_t)
value : Memory contents at specified address (type:int8_t)
'''
return MAVLink_memory_vect_message(address, ver, type, value)
def memory_vect_send(self, address, ver, type, value, force_mavlink1=False):
'''
Send raw controller memory. The use of this message is discouraged for
normal packets, but a quite efficient way for testing
new messages and getting experimental debug output.
address : Starting address of the debug variables (type:uint16_t)
ver : Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below (type:uint8_t)
type : Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14 (type:uint8_t)
value : Memory contents at specified address (type:int8_t)
'''
return self.send(self.memory_vect_encode(address, ver, type, value), force_mavlink1=force_mavlink1)
def debug_vect_encode(self, name, time_usec, x, y, z):
'''
To debug something using a named 3D vector.
name : Name (type:char)
time_usec : 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. [us] (type:uint64_t)
x : x (type:float)
y : y (type:float)
z : z (type:float)
'''
return MAVLink_debug_vect_message(name, time_usec, x, y, z)
def debug_vect_send(self, name, time_usec, x, y, z, force_mavlink1=False):
'''
To debug something using a named 3D vector.
name : Name (type:char)
time_usec : 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. [us] (type:uint64_t)
x : x (type:float)
y : y (type:float)
z : z (type:float)
'''
return self.send(self.debug_vect_encode(name, time_usec, x, y, z), force_mavlink1=force_mavlink1)
def named_value_float_encode(self, time_boot_ms, name, value):
'''
Send a key-value pair as float. The use of this message is discouraged
for normal packets, but a quite efficient way for
testing new messages and getting experimental debug
output.
time_boot_ms : Timestamp (time since system boot). [ms] (type:uint32_t)
name : Name of the debug variable (type:char)
value : Floating point value (type:float)
'''
return MAVLink_named_value_float_message(time_boot_ms, name, value)
def named_value_float_send(self, time_boot_ms, name, value, force_mavlink1=False):
'''
Send a key-value pair as float. The use of this message is discouraged
for normal packets, but a quite efficient way for
testing new messages and getting experimental debug
output.
time_boot_ms : Timestamp (time since system boot). [ms] (type:uint32_t)
name : Name of the debug variable (type:char)
value : Floating point value (type:float)
'''
return self.send(self.named_value_float_encode(time_boot_ms, name, value), force_mavlink1=force_mavlink1)
def named_value_int_encode(self, time_boot_ms, name, value):
'''
Send a key-value pair as integer. The use of this message is
discouraged for normal packets, but a quite efficient
way for testing new messages and getting experimental
debug output.
time_boot_ms : Timestamp (time since system boot). [ms] (type:uint32_t)
name : Name of the debug variable (type:char)
value : Signed integer value (type:int32_t)
'''
return MAVLink_named_value_int_message(time_boot_ms, name, value)
def named_value_int_send(self, time_boot_ms, name, value, force_mavlink1=False):
'''
Send a key-value pair as integer. The use of this message is
discouraged for normal packets, but a quite efficient
way for testing new messages and getting experimental
debug output.
time_boot_ms : Timestamp (time since system boot). [ms] (type:uint32_t)
name : Name of the debug variable (type:char)
value : Signed integer value (type:int32_t)
'''
return self.send(self.named_value_int_encode(time_boot_ms, name, value), force_mavlink1=force_mavlink1)
def statustext_encode(self, severity, text):
'''
Status text message. These messages are printed in yellow in the COMM
console of QGroundControl. WARNING: They consume quite
some bandwidth, so use only for important status and
error messages. If implemented wisely, these messages
are buffered on the MCU and sent only at a limited
rate (e.g. 10 Hz).
severity : Severity of status. Relies on the definitions within RFC-5424. (type:uint8_t, values:MAV_SEVERITY)
text : Status text message, without null termination character (type:char)
'''
return MAVLink_statustext_message(severity, text)
def statustext_send(self, severity, text, force_mavlink1=False):
'''
Status text message. These messages are printed in yellow in the COMM
console of QGroundControl. WARNING: They consume quite
some bandwidth, so use only for important status and
error messages. If implemented wisely, these messages
are buffered on the MCU and sent only at a limited
rate (e.g. 10 Hz).
severity : Severity of status. Relies on the definitions within RFC-5424. (type:uint8_t, values:MAV_SEVERITY)
text : Status text message, without null termination character (type:char)
'''
return self.send(self.statustext_encode(severity, text), force_mavlink1=force_mavlink1)
def debug_encode(self, time_boot_ms, ind, value):
'''
Send a debug value. The index is used to discriminate between values.
These values show up in the plot of QGroundControl as
DEBUG N.
time_boot_ms : Timestamp (time since system boot). [ms] (type:uint32_t)
ind : index of debug variable (type:uint8_t)
value : DEBUG value (type:float)
'''
return MAVLink_debug_message(time_boot_ms, ind, value)
def debug_send(self, time_boot_ms, ind, value, force_mavlink1=False):
'''
Send a debug value. The index is used to discriminate between values.
These values show up in the plot of QGroundControl as
DEBUG N.
time_boot_ms : Timestamp (time since system boot). [ms] (type:uint32_t)
ind : index of debug variable (type:uint8_t)
value : DEBUG value (type:float)
'''
return self.send(self.debug_encode(time_boot_ms, ind, value), force_mavlink1=force_mavlink1)
| [
"saxo-folatre1129@outlook.jp"
] | saxo-folatre1129@outlook.jp |
084af231761d48ccdf9950ed5fbab1a7a44f86ab | d3efc82dfa61fb82e47c82d52c838b38b076084c | /Autocase_Result/SjSzRZMR/YW_RZMR_SZSJ_150.py | 60204aa1a24e2cc122eacbff5931e061d9482cba | [] | no_license | nantongzyg/xtp_test | 58ce9f328f62a3ea5904e6ed907a169ef2df9258 | ca9ab5cee03d7a2f457a95fb0f4762013caa5f9f | refs/heads/master | 2022-11-30T08:57:45.345460 | 2020-07-30T01:43:30 | 2020-07-30T01:43:30 | 280,388,441 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,334 | py | #!/usr/bin/python
# -*- encoding: utf-8 -*-
import sys
import json
sys.path.append("/home/yhl2/workspace/xtp_test")
from xtp.api.xtp_test_case import xtp_test_case, Api, unittest
from service.ServiceConfig import *
from financing.service.mainService import ParmIni, serviceTest
from financing.service.QueryStkPriceQty import QueryStkPriceQty
from service.log import *
from financing.service.CaseParmInsertMysql import *
from mysql.QueryOrderErrorMsg import queryOrderErrorMsg
reload(sys)
sys.setdefaultencoding('utf-8')
class YW_RZMR_SZSJ_150(xtp_test_case):
# YW_RZMR_SZSJ_150 YW_RZMR_SZSJ_150 YW_RZMR_SZSJ_150 YW_RZMR_SZSJ_150
def test_YW_RZMR_SZSJ_150(self):
title = '对方最优转限价买——错误的价格(价格10亿)'
# 定义当前测试用例的期待值
# 期望状态:初始、未成交、部成、全成、部撤已报、部撤、已报待撤、已撤、废单、撤废、内部撤单
# xtp_ID和cancel_xtpID默认为0,不需要变动
case_goal = {
'期望状态': '全成',
'errorID': 0,
'errorMSG': '',
'是否生成报单': '是',
'是否是撤废': '否',
'xtp_ID': 0,
'cancel_xtpID': 0,
}
logger.warning(title)
# 定义委托参数信息------------------------------------------
# 参数:证券代码、市场、证券类型、证券状态、交易状态、买卖方向(B买S卖)、期望状态、Api
stkparm = QueryStkPriceQty('999999', '2', '0', '2', '0', 'B', case_goal['期望状态'], Api)
# 如果下单参数获取失败,则用例失败
if stkparm['返回结果'] is False:
rs = {
'用例测试结果': stkparm['返回结果'],
'测试错误原因': '获取下单参数失败,' + stkparm['错误原因'],
}
self.assertEqual(rs['用例测试结果'], True)
else:
wt_reqs = {
'business_type': Api.const.XTP_BUSINESS_TYPE['XTP_BUSINESS_TYPE_MARGIN'],
'order_client_id':2,
'market': Api.const.XTP_MARKET_TYPE['XTP_MKT_SZ_A'],
'ticker': stkparm['证券代码'],
'side': Api.const.XTP_SIDE_TYPE['XTP_SIDE_MARGIN_TRADE'],
'position_effect': Api.const.XTP_POSITION_EFFECT_TYPE['XTP_POSITION_EFFECT_INIT'],
'price_type': Api.const.XTP_PRICE_TYPE['XTP_PRICE_REVERSE_BEST_LIMIT'],
'price': 1000000000,
'quantity': 200
}
ParmIni(Api, case_goal['期望状态'], wt_reqs['price_type'])
CaseParmInsertMysql(case_goal, wt_reqs)
rs = serviceTest(Api, case_goal, wt_reqs)
if rs['用例测试结果']:
logger.warning('执行结果为{0}'.format(str(rs['用例测试结果'])))
else:
logger.warning('执行结果为{0},{1},{2}'.format(
str(rs['用例测试结果']), str(rs['用例错误源']),
json.dumps(rs['用例错误原因'], encoding='UTF-8', ensure_ascii=False)))
self.assertEqual(rs['用例测试结果'], True) # 0
if __name__ == '__main__':
unittest.main()
| [
"418033945@qq.com"
] | 418033945@qq.com |
14f37638e65febf11f9114def8c5f318cb8713d6 | 328630193505577e71fdd52aa2b04b5f98ac338b | /src/app.py | e2e866e986b36060d928689c692f69c55f252de4 | [] | no_license | Pawel-Matuszny/flask-crud-app | 310eaf426624168af7c0d40ce87139f9d22d8ef7 | dc2bd44c76a2b56f879d0a6a7d72dae3a86d65c0 | refs/heads/master | 2023-06-30T04:02:19.410600 | 2021-07-30T11:46:43 | 2021-07-30T11:46:43 | 391,044,570 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 8,237 | py | from flask import Flask, jsonify, request, make_response
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
import uuid
from werkzeug.security import generate_password_hash, check_password_hash
import jwt
import datetime
from functools import wraps
import sentry_sdk
from sentry_sdk.integrations.flask import FlaskIntegration
sentry_sdk.init(
dsn="https://233dada331c140fb971a819e5a05bd71@o933564.ingest.sentry.io/5882670",
integrations=[FlaskIntegration()],
traces_sample_rate=1.0
)
import os
env_username = os.environ['DB_USER']
env_password = os.environ['DB_PASS']
env_host = os.environ['DB_HOST']
env_db_name = os.environ['DB_NAME']
env_port = os.environ['DB_PORT']
app = Flask(__name__)
sql_url ='postgresql+psycopg2://%s:%s@%s:%s/%s?sslmode=prefer&sslrootcert=/app/docker/ssl/server-ca.pem&sslcert=/app/docker/ssl/client-cert.pem&sslkey=/app/docker/ssl/client-key.pem' % (env_username, env_password, env_host, env_port, env_db_name)
app.config['SECRET_KEY'] = os.environ['SECRET_KEY']
app.config['SQLALCHEMY_DATABASE_URI'] = sql_url
db = SQLAlchemy(app)
migrate = Migrate(app, db,compare_type=True)
class User(db.Model):
id = db.Column(db.Integer, primary_key=True)
public_id = db.Column(db.String(50), unique=True)
name = db.Column(db.String(50))
password = db.Column(db.String(100))
admin = db.Column(db.Boolean)
class Articles(db.Model):
id = db.Column(db.Integer, primary_key=True)
text = db.Column(db.Text)
date_created = db.Column(db.DateTime, default=datetime.datetime.utcnow())
is_finished = db.Column(db.Boolean)
user_public_id = db.Column(db.String(50))
def token_required(f):
@wraps(f)
def decorated(*args, **kwargs):
token = None
if 'x-access-token' in request.headers:
token = request.headers['x-access-token']
if not token:
return jsonify({'message' : 'Token is missing'}), 401
try:
data = jwt.decode(token, app.config['SECRET_KEY'])
current_user = User.query.filter_by(public_id=data['public_id']).first()
except:
return jsonify({'message' : 'Token is invalid'}), 401
return f(current_user, *args, **kwargs)
return decorated
@app.route("/user", methods=['POST'])
@token_required
def create_user(current_user):
if not current_user.admin:
return jsonify({'message' : 'Cannot perform that function'})
data = request.get_json()
hashed_password = generate_password_hash(data['password'], method='sha256')
new_user = User(public_id=str(uuid.uuid4()), name=data['name'], password=hashed_password, admin=False)
db.session.add(new_user)
db.session.commit()
return jsonify({'message' : 'New user created'})
@app.route('/user/<public_id>', methods=['PUT'])
@token_required
def promote_user(public_id, current_user):
if not current_user.admin:
return jsonify({'message' : 'Cannot perform that function'})
user = User.query.filter_by(public_id=public_id).first()
if not user:
return jsonify({'message' : 'No user found'})
user.admin = True
db.session.commit()
return jsonify({'mesage' : 'The user has been promoted'})
@app.route('/user/<public_id>', methods=['GET'])
@token_required
def get_one_user(public_id, current_user):
if not current_user.admin:
return jsonify({'message' : 'Cannot perform that function'})
user = User.query.filter_by(public_id=public_id).first()
if not user:
return jsonify({'message' : 'No user found'})
user_data = {}
user_data['public_id'] = user.public_id
user_data['name'] = user.name
user_data['password'] = user.password
user_data['admin'] = user.admin
return jsonify({'user' : user_data})
@app.route('/user', methods=['GET'])
@token_required
def get_all_users(current_user):
if not current_user.admin:
return jsonify({'message' : 'Cannot perform that function'})
users = User.query.all()
output = []
for user in users:
user_data = {}
user_data['public_id'] = user.public_id
user_data['name'] = user.name
user_data['password'] = user.password
user_data['admin'] = user.admin
output.append(user_data)
return jsonify({'users' : output})
@app.route('/user/<public_id>', methods=['DELETE'])
@token_required
def delete_user(public_id, current_user):
if not current_user.admin:
return jsonify({'message' : 'Cannot perform that function'})
user = User.query.filter_by(public_id=public_id).first()
if not user:
return jsonify({'message' : 'No user found'})
db.session.delete(user)
db.session.commit()
return jsonify({'mesage' : 'The user has been deleted'})
@app.route('/article', methods=['GET'])
@token_required
def get_all_articles(current_user):
articles = Articles.query.filter_by(user_public_id=current_user.public_id).all()
output = []
for article in articles:
article_data = {}
article_data['id'] = article.id
article_data['text'] = article.text
article_data['is_finished'] = article.is_finished
article_data['date_created'] = article.date_created
output.append(article_data)
return jsonify({'articles' : output})
@app.route('/article/<article_id>', methods=['GET'])
@token_required
def get_one_article(current_user, article_id):
article = Articles.query.filter_by(id=article_id, user_public_id=current_user.public_id).first()
if not article:
return jsonify({'message' : 'No article found'})
article_data = {}
article_data['id'] = article.id
article_data['text'] = article.text
article_data['is_finished'] = article.is_finished
article_data['date_created'] = article.date_created
return jsonify(article_data)
@app.route('/article', methods=['POST'])
@token_required
def create_article(current_user):
data = request.get_json()
new_article = Articles(text=data['text'], is_finished=False, user_public_id=current_user.public_id)
db.session.add(new_article)
db.session.commit()
return jsonify({'message' : "Article created"})
@app.route('/article/<article_id>', methods=['PUT'])
@token_required
def finish_article(current_user, article_id):
article = Articles.query.filter_by(id=article_id, user_public_id=current_user.public_id).first()
if not article:
return jsonify({'message' : 'No article found'})
article.is_finished = True
db.session.commit()
return jsonify({'message' : 'Article has been finished'})
@app.route('/article/<article_id>', methods=['DELETE'])
@token_required
def delete_article(current_user, article_id):
article = Articles.query.filter_by(id=article_id, user_public_id=current_user.public_id).first()
if not article:
return jsonify({'message' : 'No article found'})
db.session.delete(article)
db.session.commit()
return jsonify({'message' : 'Article has been deleted'})
@app.route('/login')
def login():
auth = request.authorization
if not auth or not auth.username or not auth.password:
return make_response('Could not verify', 401, {'WWW-Authenticate' : 'Basic realm="Login required!"'})
user = User.query.filter_by(name=auth.username).first()
if not user:
return make_response('Could not verify', 401, {'WWW-Authenticate' : 'Basic realm="Login required!"'})
if check_password_hash(user.password, auth.password):
token = jwt.encode({'public_id' : user.public_id, 'exp' : datetime.datetime.utcnow() + datetime.timedelta(minutes=int(os.environ['TOKEN_EXPIRATION_TIME_IN_MINUTES']))}, app.config['SECRET_KEY'])
return jsonify({'token' : token.decode('UTF-8')})
return make_response('Could not verify', 401, {'WWW-Authenticate' : 'Basic realm="Login required!"'})
@app.route('/status')
def health_check():
try:
conn = db.engine.connect()
conn.close()
except Exception as e:
return jsonify({'database_status' : 'offline'})
return jsonify({'database_status' : 'online'})
@app.route('/http-health')
def http_health():
return "OK"
if __name__ == "__main__":
app.run() | [
"pm@katarti.io"
] | pm@katarti.io |
46a751943f89d543f81dd8c19df208e00b649bdd | e86c0e71d4a1e5c659026b3f6845dda7c703e420 | /Data Structures/Linked Lists/doubly_linked_list.py | cbcec5c2cc22afb19cc0cc6346a40d9c350786eb | [] | no_license | YashKarnik/Python-Data-Structures-and-Algorithms | 31fd484fcb73a5305275ec2452ba5403565014c3 | 09070581219a5ca9861b145d63285a42f5804b37 | refs/heads/Main | 2023-06-02T12:46:45.234062 | 2021-06-20T20:52:52 | 2021-06-20T20:52:52 | 340,924,382 | 0 | 0 | null | 2021-02-25T19:54:44 | 2021-02-21T14:43:44 | Python | UTF-8 | Python | false | false | 1,499 | py | class Node:
def __init__(self, data=None):
self.data = data
self.next = None
self.prev = None
class DLL:
def __init__(self):
self.head = Node()
def append(self, x):
new_node = Node(x)
if(self.head.data == None):
self.head = new_node
else:
c = self.head
while(c.next != None):
c = c.next
c.next = new_node
new_node.prev = c
def PrintList(self):
c = self.head
while(c != None):
print(c.data)
c = c.next
def InsertIntoSorted(self, x):
new_node = Node(x)
c = self.head
while(c != None and x >= c.data):
c = c.next
if(c == None):
a = self.head
while(a.next != None):
a = a.next
a.next = new_node
new_node.prev = a
elif(c.prev == None):
new_node.next = self.head
self.head.prev = new_node
self.head = new_node
else:
c.prev.next = new_node
new_node.prev = c.prev
new_node.next = c
c.prev = new_node
if __name__ == "__main__":
l1 = DLL()
l1.append(1)
l1.append(2)
l1.append(4)
l1.append(5)
l1.InsertIntoSorted(0)
l1.InsertIntoSorted(3)
l1.InsertIntoSorted(4)
l1.InsertIntoSorted(6)
l1.PrintList()
| [
"55018090+YashKarnik@users.noreply.github.com"
] | 55018090+YashKarnik@users.noreply.github.com |
4bac95965a18f0f6ed8d54cd5350c5180c7b129b | e972ebd59711a786780f4178f5b717fe245fd0a3 | /Python/11thoct-6.py | 08d9abdf498235c0a0ef9b876d6710b56b781b4e | [] | no_license | sai-varshith/make-pull-request | a46ed30803070fc28fd0b70a152779e53f98bcad | 8e1faa342fae423731090d271314cd5b9e23a9db | refs/heads/master | 2023-08-14T11:25:41.460714 | 2021-10-02T05:00:27 | 2021-10-02T05:00:27 | 412,333,564 | 3 | 0 | null | 2021-10-01T05:02:53 | 2021-10-01T05:02:52 | null | UTF-8 | Python | false | false | 314 | py |
def Fibonacci(n):
if n<=0:
print("Incorrect input")
# First Fibonacci number is 0
elif n==1:
return 0
# Second Fibonacci number is 1
elif n==2:
return 1
else:
return Fibonacci(n-1)+Fibonacci(n-2)
n=int(input("enter number of term"))
print(Fibonacci(n))
| [
"tushar2525252@gmail.com"
] | tushar2525252@gmail.com |
5e51e3c095bef0631ef516c25556452ebefe712a | 40175eaab5a644290979510d92e90fac5d24bf14 | /src/yass/augment/__init__.py | d29cb101c3a3b906fc6824e64e0d2e172e33dfcc | [
"Apache-2.0"
] | permissive | paninski-lab/yass | 7877716500340a81be22217df5c3380b4fcc4f0d | b18d13a69946c1fee28fbc1f67215d3a89d892af | refs/heads/master | 2022-10-08T03:33:23.887282 | 2022-09-29T14:23:22 | 2022-09-29T14:23:22 | 108,300,713 | 68 | 25 | Apache-2.0 | 2021-01-08T19:19:45 | 2017-10-25T17:10:51 | Python | UTF-8 | Python | false | false | 51 | py | from yass.augment.run import run
__all__ = ['run'] | [
"jinhyungp.lee@gmail.com"
] | jinhyungp.lee@gmail.com |
7ebaf958ee53b6084d2a254324bd9f469cfd76b0 | 3e79bfd23dd2dbfe3b057ba3a879b4a99ba7f66e | /Pizza Crust.py | 26c764309d50948a0508a59bf32e8db9c741984a | [] | no_license | parhamgh2020/kattis | 1b701d1f768e2337d2477ea12be56399b3ed1003 | 40a0969e347be3df9ab23cbb3fd8272b40ffa16f | refs/heads/main | 2023-03-19T22:51:54.643201 | 2021-03-14T09:30:59 | 2021-03-14T09:30:59 | 347,017,990 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 129 | py | from math import pi
r, c = map(int, input().split())
percentage = ((pi * (r - c) ** 2) / (pi * r ** 2)) * 100
print(percentage)
| [
"parham.ghashghaee@gmail.com"
] | parham.ghashghaee@gmail.com |
070ec4587529830064cb1f09a6002173f4c4b629 | 4569d707a4942d3451f3bbcfebaa8011cc5a128d | /visitcountermacro/0.10/visitcounter/db/db1.py | 757b0f4fd0f6e872268d96b058d57bd53e82efa7 | [] | no_license | woochica/trachacks | 28749b924c897747faa411876a3739edaed4cff4 | 4fcd4aeba81d734654f5d9ec524218b91d54a0e1 | refs/heads/master | 2021-05-30T02:27:50.209657 | 2013-05-24T17:31:23 | 2013-05-24T17:31:23 | 13,418,837 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 254 | py | sql = ['''CREATE TABLE visit (
id integer PRIMARY KEY,
page text,
count integer
);''',
'''INSERT INTO system (name, value) VALUES ('visitcounter_version', 1);''']
def do_upgrade(cursor):
for statement in sql:
cursor.execute(statement)
| [
"Blackhex@7322e99d-02ea-0310-aa39-e9a107903beb"
] | Blackhex@7322e99d-02ea-0310-aa39-e9a107903beb |
1ce8eab6442ed03dd6f60806e1900e36fe0df0d2 | 1670dca534ef4fd7e8d9ca9e6d55b5885e4071f9 | /AlgoExpert/Day2.py | 4117f3dcd99612ad1bd1b4b1307b4ac6c8d06480 | [] | no_license | Tejas1510/Pythonary | 24512a6c5abfee17457397aa37849f3a5a739002 | 55c11f74d9f540bf696acecaa78febecd14d8422 | refs/heads/master | 2022-11-23T23:27:32.219513 | 2020-08-02T17:22:17 | 2020-08-02T17:22:17 | 264,151,076 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 752 | py | #Modification of last Day Question
#Find a triplet that sum to a given value
#Brute Force approach requires o(n^3)
#We will Solve it with the help of hash map in O(n^2) approach
#This question has been asked in multiple times in most of the FANNG Company interview
def Solution(a,TargetSum):
for i in range(0,len(a)-1):
nums={}
current_sum=TargetSum-a[i]
for j in range(1,len(a)):
if(current_sum-a[j] in nums):
return [a[j],a[i],current_sum-a[j]]
else:
nums[a[j]]=True
return -1
t=int(input())
for i in range(t):
n=int(input())
a=list(map(int,input().split()))
TargetSum=int(input())
a=Solution(a,TargetSum)
print(*a)
| [
"noreply@github.com"
] | noreply@github.com |
bb219f4b5d7945d52abc467136cd1614c4bdbee4 | a2908938c39e1c233760eb3666089ad32f32e9dd | /ballGame.py | 9efc44ff435e8739160985091f05fcbc21c1acaf | [] | no_license | ParthSSharma/bouncyBall | 14223e80b4071d2f43581500cb025c0ccf399b28 | 7d7053ddb135dc5de51947881094c0c6c769fb79 | refs/heads/master | 2020-06-28T21:07:27.094894 | 2019-08-03T06:35:03 | 2019-08-03T06:35:03 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,112 | py | import numpy as np
import cv2
from directKeys import click, queryMousePosition
import time
from PIL import ImageGrab
gameCoords = [0, 25, 500, 525]
exitGame = 0
def shootSomeBalls(screen):
global gameCoords, exitGame
state = 1
for y in range(gameCoords[1], gameCoords[3] - 25, 5):
for x in range(gameCoords[0], gameCoords[2], 5):
if(screen[y][x][0] == 255) and (screen[y][x][1] == 0):
click(x + 1, y + 26)
print("Clicked!")
state = 0
break
if(not state):
break
if(y > gameCoords[3] - 31):
exitGame = 1
print("Alright, let's move out!")
while True:
mousePos = queryMousePosition()
if mousePos.x <= 500:
break
print("GO, GO, GO!")
time.sleep(2)
while True:
mousePos = queryMousePosition()
if((gameCoords[0] < mousePos.x < gameCoords[2]) and (gameCoords[1] < mousePos.y < gameCoords[3])):
screen = np.array(ImageGrab.grab(bbox = gameCoords))
shootSomeBalls(screen)
if exitGame:
print("I'm done!")
break
| [
"53370354+ParthTatsuki@users.noreply.github.com"
] | 53370354+ParthTatsuki@users.noreply.github.com |
4ce317d08e1c724135be938452d22fe612cfa189 | 763a9816046bcfec4958ae593cb7cb58696b9dc8 | /rules/rnammer.smk | 981f4e9347324dd8eb8b495a112fdfd35eeffca0 | [] | no_license | davidecarlson/snakemake-trinotate | ad877563668d173e288cdb1b3b4d55a6e95bd432 | 45f7e2f92de144c10be29b47c90e1335f2f6abd7 | refs/heads/master | 2023-02-17T03:38:44.069123 | 2021-01-15T20:29:26 | 2021-01-15T20:29:26 | 280,492,880 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 666 | smk | RNAMMERTRANS=config['RNAMMERTRANS']
RNAMMER=config['RNAMMER']
rule rnammer:
input:
assembly=INPUT + "/{sample}_trinity.Trinity.fasta"
output:
results=RESULTS + "/rnammer/{sample}/{sample}_trinity.Trinity.fasta.rnammer.gff"
threads:
1
params:
wrapper=RNAMMERTRANS + "/RnammerTranscriptome.pl",
rnammer=RNAMMER + "/rnammer",
indir=RESULTS + "/rnammer/{sample}"
log:
RESULTS + "/logs/rnammer/{sample}.rnammer.log"
shell:
"cd {params.indir} && "
"{params.wrapper} --transcriptome {input.assembly} "
"--path_to_rnammer {params.rnammer} 2> {log} "
" && cd -"
| [
"david.carlson@stonybrook.edu"
] | david.carlson@stonybrook.edu |
4fdd0d64d5e0afc3a45079ae2b9ccd03a8bc552d | a6dafde76d4cf3408e61828acb9ba9d6200363ef | /testdir/Students.py | 6dd66075fc942ddb20e1c1bc2351f0749d65998a | [] | no_license | gubanovpm/C01-019_Gubanov_python | b55a3cb2724141450cd5d9e9834b65e711b57426 | 71795854b22e3e713ee16de695e7b7b9aa20d877 | refs/heads/main | 2023-01-31T19:09:50.436433 | 2020-12-13T22:14:45 | 2020-12-13T22:14:45 | 313,232,096 | 2 | 2 | null | null | null | null | UTF-8 | Python | false | false | 487 | py | learners_french = input().split()
pianists = input().split()
swimmers = input().split()
A = set()
B = set()
C = set()
for x in learners_french:
A.add(x)
for x in pianists:
B.add(x)
for x in swimmers:
C.add(x)
D = set()
D = (B.intersection(C)).difference(A)
result = []
for x in D:
result.append(x)
print(*result)
#example
#Savior tywok LimberG
#tywok BryanChen The_Hedgehog
#tywok BryanChen The_Hedgehog
#
#correct answer: BryanChen The_Hedgehog
#my answer:BryanChen The_Hedgehog
| [
"noreply@github.com"
] | noreply@github.com |
956d9fa0e6e3eacbff9d77dab2253bd585bbbf87 | e8d2c1f5d3d508dd9a60238ae0a5db0b584a9454 | /modules/ReplayMemory.py | 7038ddf8d5e9809aeb4e86778b8ba5b2dfd20bad | [] | no_license | WeichangWang195/Improved_3MRL | bc667eb98e186e99b21fbf2d6dfbc163480d5442 | 32a13e9333d3f891f236c76c1447fed523060150 | refs/heads/master | 2023-06-24T04:06:25.578776 | 2021-07-25T21:23:06 | 2021-07-25T21:23:06 | 362,308,498 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 871 | py | import random
from collections import namedtuple
class ReplayMemory(object):
def __init__(self, capacity):
self.capacity = capacity
self.memory = []
self.position = 0
def push(self, item):
"""Saves a transition."""
if len(self.memory) < self.capacity:
self.memory.append(None)
self.memory[self.position] = item
self.position = (self.position + 1) % self.capacity
def sample(self, batch_size):
if len(self.memory) < batch_size:
return self.memory
else:
return random.sample(self.memory, batch_size)
def clear_memory(self):
self.memory = []
self.position = 0
def return_all(self):
return self.memory
def return_len(self):
return len(self.memory)
def __len__(self):
return len(self.memory) | [
"wwang195@hotmail.com"
] | wwang195@hotmail.com |
64969951f65d3112409366d438d7f5d161123c2f | 1bd2d7189d6ec4b6a1289e136098e947f7fd5ca3 | /luisapi/asgi.py | fc869631afe74d2993b99aee7aa39a6ba8db07a3 | [] | no_license | Piotr1103/LUIS-API | 5590357607f903575a89a3eef4139f6b658109f2 | a16c9b6188b7ea86b1ad10bf8c69cdae5777e56b | refs/heads/main | 2023-08-01T17:47:19.157634 | 2021-09-27T11:09:15 | 2021-09-27T11:09:15 | 410,850,313 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 391 | py | """
ASGI config for luisapi project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'luisapi.settings')
application = get_asgi_application()
| [
"manjudamin@gmail.com"
] | manjudamin@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.