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
6a500e168da2f2576a4b62344379d23db199ed27
9e542ad03bdcaf163b0195b647dd3457d9bd65ad
/django-admin
e36921d3d982888833058efd9726d6a2417df756
[]
no_license
avinashsingh3010/my-first-blog
868e736798b0aa2885144f720c597c79ebc02511
7fcbd8e15c6514e849fc0ef9c471f982c0486985
refs/heads/master
2021-01-10T13:21:40.568128
2016-01-26T14:54:37
2016-01-26T14:54:37
50,435,858
0
0
null
null
null
null
UTF-8
Python
false
false
284
#!/home/avinash/myvenv/bin/python3.4 # -*- coding: utf-8 -*- import re import sys from django.core.management import execute_from_command_line if __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) sys.exit(execute_from_command_line())
[ "singh.avinash307@gmail.com" ]
singh.avinash307@gmail.com
4994613de7bb3f0abc0eba02456af7dd3f48de33
52409b1b5be08ddaa85fa3eae131d0d0a2e18848
/기초 알고리즘 100제/6025. 값변환01.py
3d0c8693e1583d67e2d97bdb0f6314f350ed30b5
[]
no_license
colo1211/Algorithm_Python
7cf72fd67157e514adadd2df4b2805e7c26cb0fd
6a3cf918621994cf7c11cc4258991d2bc5af0824
refs/heads/master
2023-06-03T15:57:23.323594
2021-06-22T08:34:15
2021-06-22T08:34:15
368,016,588
1
0
null
null
null
null
UTF-8
Python
false
false
43
py
a,b= map(int,input().split(' ')) print(a+b)
[ "colo1211@naver.com" ]
colo1211@naver.com
3bbc9345e11ffb101dedbb47aed7f4f9a3961734
91d4757faa8d3fbdeb8f52ac32ffab60d1ee6ac1
/snake.py
1e6a87c2586f76e9a94bdbd2d2e58e168f740464
[]
no_license
estebanmho/Snake
bf7d635766d075322f4feddf74cef3a368d1edde
66cd385a4498c16f8fc2fa00edab1b5c7c96312a
refs/heads/main
2023-07-01T04:37:50.875392
2021-07-27T07:44:22
2021-07-27T07:44:22
386,198,453
0
0
null
null
null
null
UTF-8
Python
false
false
1,775
py
from turtle import Turtle, Screen import time UP=90 DOWN=270 RIGHT=0 LEFT=180 STEP_DISTANCE=20 class Snake: def __init__(self): self.snake = [] for i in range(3): self.add_tail((0 - i * 20,0)) self.head = self.snake[0] def move(self,screen): for seg in range(len(self.snake) - 1, -1, -1): # El final no se incluye por eso el -1 if seg != 0: self.snake[seg].goto(self.snake[seg - 1].position()) else: self.head.forward(STEP_DISTANCE) screen.update() time.sleep(0.2) def starting_snake(self): for i in range(3): self.add_tail((0 - i * 20,0)) self.head = self.snake[0] def move_right(self): if self.head.heading()!=LEFT: self.head.setheading(RIGHT) def move_left(self): if self.head.heading()!=RIGHT: self.head.setheading(LEFT) def move_up(self): if self.head.heading()!=DOWN: self.head.setheading(UP) def move_down(self): if self.head.heading()!=UP: self.head.setheading(DOWN) def add_tail(self): if self.snake[len(self.snake)-1].xcor(): print("!") def hide(self): for turtle in self.snake: turtle.hideturtle() def add_tail(self, position): turtle = Turtle(shape="square") turtle.color("White") turtle.penup() turtle.speed("fastest") turtle.setposition(position) self.snake.append(turtle) def reset(self): for segment in self.snake: segment.goto(1000, 1000) self.snake.clear() self.starting_snake() def add_segment(self): self.add_tail(self.snake[-1].position())
[ "esteban.martinez.hoces@alumnos.upm.es" ]
esteban.martinez.hoces@alumnos.upm.es
6f62f8248cf1f8f29498c4d1f9ee04383a26367e
0a33d9c546edfc6f700c5bcff809b21b07950b78
/ex25.py
5d89959348e75e93a0efcb5525e7dd39e634fadd
[]
no_license
Chemistrier/Learn-Python-the-Hard-Way
57660842242322dbd1db0d2d39083360e605f7f3
1126c6205d3acda69635e17d90c4c419dbb77c20
refs/heads/main
2023-08-02T09:29:13.789139
2021-09-25T11:52:08
2021-09-25T11:52:08
397,826,904
0
0
null
null
null
null
UTF-8
Python
false
false
1,057
py
def break_words(stuff): """This function will break up words for us.""" words = stuff.split(' ') return words def sort_words(words): """Sorts the words.""" return sorted(words) def sort_words(words): """Sorts the words.""" return sorted(words) def print_first_word(words): """Prints the first word after popping it off.""" word = words.pop(0) print(word) def print_last_word(words): """Prints the last word after popping it off.""" word = words.pop(-1) print(word) def sort_sentence(sentence): """Takes in a full sentence and returns the sorted words.""" words = break_words(sentence) return sort_words(words) def print_first_and_last(sentence): """Prints the first and last words of the sentence.""" words = break_words(sentence) print_first_word(words) print_last_word(words) def print_first_and_last_sorted(sentence): """Sorts the words then prints the first and last one.""" words = sort_sentence(sentence) print_first_word(words) print_last_word(words)
[ "45254476+Chemistrier@users.noreply.github.com" ]
45254476+Chemistrier@users.noreply.github.com
140680f5e4c08ba3bb216609922f2d8cb5ec35e3
e79c94b62427c0c7d2972cf7a7ef3cc3bf1299d5
/Apps/Venta/api_views.py
69e0df1ea7078a19373781590b00e967ad8732fd
[]
no_license
Ezla/PVenta
21988d805a735b6a83a9bb9dd1e691d357fda23d
e1533d51ea7377cc6774bf26b4b19a31e0e85d8a
refs/heads/master
2021-07-03T08:24:44.278733
2021-06-09T22:31:41
2021-06-09T22:31:41
43,174,685
1
0
null
2021-06-09T22:31:43
2015-09-25T20:46:02
JavaScript
UTF-8
Python
false
false
6,154
py
from decimal import Decimal from django.shortcuts import get_object_or_404 from rest_framework.response import Response from rest_framework import status from rest_framework.views import APIView from .serializers import SalesAccountSerialiser, SalesProductSerialiser, \ SalesCartSerialiser, ChangeProductSerialiser from .models import Discount from .utils import process_cart from Apps.Producto.models import Producto class SearchProductView(APIView): def post(self, request): word = request.data.get('word', str()) try: products = request.session.get('account', list()) query = Producto.objects.get(codigo=word) # Agregamos producto encontrado a la cuenta product_exist = False for product in products: if product.get('code') == query.codigo: product_exist = True new_quantity = Decimal( product.get('quantity')) + Decimal(1) product['quantity'] = new_quantity break if not product_exist: price = query.punitario product = {'code': query.codigo, 'name': query.descripcion, 'with_discount': False, 'price': price, 'price_up': query.punitario, 'price_down': query.pmayoreo, 'quantity': Decimal(1), 'sales_account': None} products.insert(0, product) sales = SalesProductSerialiser(data=products, many=True) if sales.is_valid(): request.session['account'] = sales.data return Response(sales.data, status=status.HTTP_200_OK) else: return Response(sales.errors, status=status.HTTP_400_BAD_REQUEST) except Producto.DoesNotExist: suggestions = self.get_suggestions(word=word) return Response(suggestions, status=status.HTTP_202_ACCEPTED) def get_suggestions(self, word): suggestions = list() if word: query = Producto.objects.filter(descripcion__icontains=word) for product in query: suggestions.append( {'code': product.codigo, 'name': product.descripcion, 'brand': product.marca.marca, 'price': str(product.punitario)}) return suggestions class SalesProductChangeView(APIView): def post(self, request): products = request.session.get('account', list()) change_product = ChangeProductSerialiser(data=request.data) if not change_product.is_valid(): return Response(change_product.errors, status=status.HTTP_400_BAD_REQUEST) code = change_product.validated_data.get('code') quantity = change_product.validated_data.get('quantity') with_discount = change_product.validated_data.get('with_discount') # Actualizamos data product_exists = False for product in products: product_exists = product.get('code') == code if product_exists and quantity >= Decimal(0.5): product['quantity'] = quantity product['with_discount'] = with_discount break elif product_exists: products.remove(product) break # respondemos un 404 si no se encuentra el producto if not product_exists: return Response({'code', 'El producto no esta en el carrito.'}, status=status.HTTP_404_NOT_FOUND) sales = SalesProductSerialiser(data=products, many=True) if sales.is_valid(): request.session['account'] = sales.data return Response(sales.data, status=status.HTTP_200_OK) # respondemos un 400 si la data no es valida return Response(sales.errors, status=status.HTTP_400_BAD_REQUEST) class SalesCartStatusView(APIView): def get(self, request): cart = request.session.get('account', list()) percent_off = request.GET.get('percent_off', 0) subtotal, total, discount = process_cart(cart=cart, percent_off=percent_off) data = {'subtotal': subtotal, 'total': total, 'discount': discount} return Response(data, status=status.HTTP_200_OK) def delete(self, request): request.session['account'] = list() return Response({}, status=status.HTTP_200_OK) class AccountView(APIView): def post(self, request): cart = request.session.get('account', list()) percentage = request.data.get('percent_off') cash = Decimal(request.data.get('cash')) percent_off = get_object_or_404(Discount, percentage=percentage) percentage = percent_off.percentage subtotal, total, discount = process_cart(cart=cart, percent_off=percentage) change_due = cash - total data = {'subtotal': subtotal, 'total': total, 'cash': cash, 'change_due': change_due, 'discount': percent_off.pk} account = SalesAccountSerialiser(data=data) sales = SalesProductSerialiser(data=cart, many=True) if account.is_valid() and sales.is_valid(): # guardamos cuenta sales_account = account.save() cart = sales.data # agregamos la id de la cuenta a los productos en cart for product in cart: product.update({'sales_account': sales_account.pk}) # guardamos productos de la venta new_sales = SalesCartSerialiser(data=cart, many=True) if new_sales.is_valid(): new_sales.save() request.session['account'] = list() return Response(account.data, status=status.HTTP_201_CREATED) return Response(account.errors, status=status.HTTP_400_BAD_REQUEST)
[ "bg_kuriboh@hotmail.com" ]
bg_kuriboh@hotmail.com
069240fe041da4600557e9ba6ab166a4c5a27da8
0c6bd6305cbd128fe7426f66ec9bf4d01fb9b40c
/backend_apps_web_based/flask/RESTful_api_part3/test.py
fe6c099a291d13fe3bef662c606846c898e25092
[]
no_license
yennanliu/web_development
08dbffc549214952f7b02dc29837474b0ad6e980
8dc6b224040b3953999d5e8d4a7f26d8e92ca931
refs/heads/master
2021-05-24T03:12:24.344381
2020-12-30T09:31:15
2020-12-30T09:31:15
72,651,027
1
1
null
null
null
null
UTF-8
Python
false
false
1,281
py
import sys, os, json, requests import pytest, unittest from flask_sqlalchemy import SQLAlchemy # main flask app from app import app db = SQLAlchemy(app) def TestHelloworld(): response = requests.get('http://0.0.0.0:5000/') assert response.status_code == 200 def TestApi(): response = requests.get('http://0.0.0.0:5000/product/api/v1.0/products') print (response) assert response.status_code == 200 class TestDB(unittest.TestCase): # setup and tear down # executed prior to each test def setUp(self): app.config['TESTING'] = True app.config['WTF_CSRF_ENABLED'] = False app.config['DEBUG'] = False app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' + 'database.db' self.app = app.test_client() db.drop_all() db.create_all() self.assertEqual(app.debug, False) # executed after each test def tearDown(self): db.session.remove() db.drop_all() # tests def test_main_page(self): response = self.app.get('/', follow_redirects=True) self.assertEqual(response.status_code, 200) # test models # TODO, will update this when creating DB via db model if __name__ == "__main__": TestHelloworld() TestApi() unittest.main()
[ "f339339@gmail.com" ]
f339339@gmail.com
3852f79d9598f3426deb8dde7be7ad93c215998e
bf3b129fc3e7d7e44d58a1e3fb8e857a523d8871
/test_frcnn.py
01e7f3eae5ea46ab7cf06a8b6ce0858cd9a6aca3
[ "Apache-2.0" ]
permissive
sookmun716/Keras-FRCNN
dc7bc76335cec09fa5466eaaf1e267ad59cf22ea
8e0c129af4f4b179a117f04ce2d6852fa7433454
refs/heads/main
2023-07-19T07:51:56.125523
2021-05-13T08:05:38
2021-05-13T08:05:38
403,980,564
0
0
null
null
null
null
UTF-8
Python
false
false
7,987
py
from __future__ import division import os import cv2 import numpy as np import sys import pickle from optparse import OptionParser import time import tensorflow as tf from keras_frcnn import config from keras import backend as K from keras.layers import Input from keras.models import Model from tensorflow.python.keras.backend import set_session from keras_frcnn import roi_helpers sys.setrecursionlimit(40000) config = tf.ConfigProto() config.gpu_options.allow_growth = True config.log_device_placement = True sess = tf.Session(config=config) set_session(sess) parser = OptionParser() parser.add_option("-p", "--path", dest="test_path", help="Path to test data.") parser.add_option("-n", "--num_rois", type="int", dest="num_rois", help="Number of ROIs per iteration. Higher means more memory use.", default=32) parser.add_option("--config_filename", dest="config_filename", help= "Location to read the metadata related to the training (generated when training).", default="config.pickle") parser.add_option("--network", dest="network", help="Base network to use. Supports vgg or resnet50.", default='resnet50') (options, args) = parser.parse_args() if not options.test_path: # if filename is not given parser.error('Error: path to test data must be specified. Pass --path to command line') config_output_filename = options.config_filename with open(config_output_filename, 'rb') as f_in: C = pickle.load(f_in) if C.network == 'resnet50': import keras_frcnn.resnet as nn elif C.network == 'vgg': import keras_frcnn.vgg as nn # turn off any data augmentation at test time C.use_horizontal_flips = False C.use_vertical_flips = False C.rot_90 = False img_path = options.test_path def format_img_size(img, C): """ formats the image size based on config """ img_min_side = float(C.im_size) (height,width,_) = img.shape if width <= height: ratio = img_min_side/width new_height = int(ratio * height) new_width = int(img_min_side) else: ratio = img_min_side/height new_width = int(ratio * width) new_height = int(img_min_side) img = cv2.resize(img, (new_width, new_height), interpolation=cv2.INTER_CUBIC) return img, ratio def format_img_channels(img, C): """ formats the image channels based on config """ img = img[:, :, (2, 1, 0)] img = img.astype(np.float32) img[:, :, 0] -= C.img_channel_mean[0] img[:, :, 1] -= C.img_channel_mean[1] img[:, :, 2] -= C.img_channel_mean[2] img /= C.img_scaling_factor img = np.transpose(img, (2, 0, 1)) img = np.expand_dims(img, axis=0) return img def format_img(img, C): """ formats an image for model prediction based on config """ img, ratio = format_img_size(img, C) img = format_img_channels(img, C) return img, ratio # Method to transform the coordinates of the bounding box to its original size def get_real_coordinates(ratio, x1, y1, x2, y2): real_x1 = int(round(x1 // ratio)) real_y1 = int(round(y1 // ratio)) real_x2 = int(round(x2 // ratio)) real_y2 = int(round(y2 // ratio)) return (real_x1, real_y1, real_x2 ,real_y2) class_mapping = C.class_mapping if 'bg' not in class_mapping: class_mapping['bg'] = len(class_mapping) class_mapping = {v: k for k, v in class_mapping.items()} print(class_mapping) class_to_color = {class_mapping[v]: np.random.randint(0, 255, 3) for v in class_mapping} C.num_rois = int(options.num_rois) if C.network == 'resnet50': num_features = 1024 elif C.network == 'vgg': num_features = 512 if K.image_data_format() == 'th': input_shape_img = (3, None, None) input_shape_features = (num_features, None, None) else: input_shape_img = (None, None, 3) input_shape_features = (None, None, num_features) img_input = Input(shape=input_shape_img) roi_input = Input(shape=(C.num_rois, 4)) feature_map_input = Input(shape=input_shape_features) # define the base network (resnet here, can be VGG, Inception, etc) shared_layers = nn.nn_base(img_input, trainable=True) # define the RPN, built on the base layers num_anchors = len(C.anchor_box_scales) * len(C.anchor_box_ratios) rpn_layers = nn.rpn(shared_layers, num_anchors) classifier = nn.classifier(feature_map_input, roi_input, C.num_rois, nb_classes=len(class_mapping), trainable=True) model_rpn = Model(img_input, rpn_layers) model_classifier_only = Model([feature_map_input, roi_input], classifier) model_classifier = Model([feature_map_input, roi_input], classifier) print(f'Loading weights from {C.model_path}') model_rpn.load_weights(C.model_path, by_name=True) model_classifier.load_weights(C.model_path, by_name=True) model_rpn.compile(optimizer='sgd', loss='mse') model_classifier.compile(optimizer='sgd', loss='mse') all_imgs = [] classes = {} bbox_threshold = 0.8 visualise = True for idx, img_name in enumerate(sorted(os.listdir(img_path))): if not img_name.lower().endswith(('.bmp', '.jpeg', '.jpg', '.png', '.tif', '.tiff')): continue print(img_name) st = time.time() filepath = os.path.join(img_path,img_name) img = cv2.imread(filepath) X, ratio = format_img(img, C) if K.image_data_format() == 'tf': X = np.transpose(X, (0, 2, 3, 1)) # get the feature maps and output from the RPN [Y1, Y2, F] = model_rpn.predict(X) R = roi_helpers.rpn_to_roi(Y1, Y2, C, K.image_data_format(), overlap_thresh=0.7) # convert from (x1,y1,x2,y2) to (x,y,w,h) R[:, 2] -= R[:, 0] R[:, 3] -= R[:, 1] # apply the spatial pyramid pooling to the proposed regions bboxes = {} probs = {} for jk in range(R.shape[0]//C.num_rois + 1): ROIs = np.expand_dims(R[C.num_rois*jk:C.num_rois*(jk+1), :], axis=0) if ROIs.shape[1] == 0: break if jk == R.shape[0]//C.num_rois: #pad R curr_shape = ROIs.shape target_shape = (curr_shape[0],C.num_rois,curr_shape[2]) ROIs_padded = np.zeros(target_shape).astype(ROIs.dtype) ROIs_padded[:, :curr_shape[1], :] = ROIs ROIs_padded[0, curr_shape[1]:, :] = ROIs[0, 0, :] ROIs = ROIs_padded [P_cls, P_regr] = model_classifier_only.predict([F, ROIs]) for ii in range(P_cls.shape[1]): if np.max(P_cls[0, ii, :]) < bbox_threshold or np.argmax(P_cls[0, ii, :]) == (P_cls.shape[2] - 1): continue cls_name = class_mapping[np.argmax(P_cls[0, ii, :])] if cls_name not in bboxes: bboxes[cls_name] = [] probs[cls_name] = [] (x, y, w, h) = ROIs[0, ii, :] cls_num = np.argmax(P_cls[0, ii, :]) try: (tx, ty, tw, th) = P_regr[0, ii, 4*cls_num:4*(cls_num+1)] tx /= C.classifier_regr_std[0] ty /= C.classifier_regr_std[1] tw /= C.classifier_regr_std[2] th /= C.classifier_regr_std[3] x, y, w, h = roi_helpers.apply_regr(x, y, w, h, tx, ty, tw, th) except: pass bboxes[cls_name].append([C.rpn_stride*x, C.rpn_stride*y, C.rpn_stride*(x+w), C.rpn_stride*(y+h)]) probs[cls_name].append(np.max(P_cls[0, ii, :])) all_dets = [] for key in bboxes: bbox = np.array(bboxes[key]) new_boxes, new_probs = roi_helpers.non_max_suppression_fast(bbox, np.array(probs[key]), overlap_thresh=0.5) for jk in range(new_boxes.shape[0]): (x1, y1, x2, y2) = new_boxes[jk,:] (real_x1, real_y1, real_x2, real_y2) = get_real_coordinates(ratio, x1, y1, x2, y2) cv2.rectangle(img,(real_x1, real_y1), (real_x2, real_y2), (int(class_to_color[key][0]), int(class_to_color[key][1]), int(class_to_color[key][2])),2) textLabel = f'{key}: {int(100*new_probs[jk])}' all_dets.append((key,100*new_probs[jk])) (retval,baseLine) = cv2.getTextSize(textLabel,cv2.FONT_HERSHEY_COMPLEX,1,1) textOrg = (real_x1, real_y1-0) cv2.rectangle(img, (textOrg[0] - 5, textOrg[1]+baseLine - 5), (textOrg[0]+retval[0] + 5, textOrg[1]-retval[1] - 5), (0, 0, 0), 2) cv2.rectangle(img, (textOrg[0] - 5,textOrg[1]+baseLine - 5), (textOrg[0]+retval[0] + 5, textOrg[1]-retval[1] - 5), (255, 255, 255), -1) cv2.putText(img, textLabel, textOrg, cv2.FONT_HERSHEY_DUPLEX, 1, (0, 0, 0), 1) print(f'Elapsed time = {time.time() - st}') print(all_dets) cv2.imwrite('./results_imgs-fp-mappen-test/{}.png'.format(os.path.splitext(str(img_name))[0]),img)
[ "songshunnew@hotmail.com" ]
songshunnew@hotmail.com
98c4fbb1482d0610607b2d758bd95fe01b6182c3
095f35858f26e1b1f456f5462512b1b42c6419da
/venv/Part2/CSV_3.1.py
e74db800d266ba42e22a259f830c8baf96a2b7fa
[]
no_license
rheehot/DataBaseWithPython
9aa456880beea8195b8691854f2cf23f145f142d
1261223a4b64ae8925ec0bc4cfbb7fc5138a302f
refs/heads/master
2023-01-07T21:06:09.750691
2020-11-15T13:44:29
2020-11-15T13:44:29
null
0
0
null
null
null
null
UTF-8
Python
false
false
3,132
py
# CSV 파일을 읽어서, DB Table에 쓰는 예제. (레코드를 리스트 형태로 읽음) import pymysql import csv class DB_Utils: def updateExecutor(self, db, sql, params): conn = pymysql.connect(host='localhost', user='root', password='COYG1995!!', db=db, charset='utf8') try: with conn.cursor() as cursor: cursor.execute(sql, params) conn.commit() except Exception as e: print(e) print(type(e)) finally: conn.close() class DB_Updates: def dropPlayerGK(self): sql = "DROP TABLE IF EXISTS playerGK" params = () util = DB_Utils() util.updateExecutor(db='kleague', sql=sql, params=params) def createPlayerGK(self): sql = '''CREATE TABLE playerGK ( player_id CHAR(7) NOT NULL, player_name VARCHAR(20) NOT NULL, team_id CHAR(3) NOT NULL, e_player_name VARCHAR(40), nickname VARCHAR(30), join_YYYY CHAR(4), position VARCHAR(10), back_no TINYINT, nation VARCHAR(20), birth_date DATE, solar CHAR(1), height SMALLINT, weight SMALLINT, CONSTRAINT pk_player PRIMARY KEY (player_id) )''' params = () util = DB_Utils() util.updateExecutor(db='kleague', sql=sql, params=params) def populatePlayerGK(self, player_id, player_name, team_id, e_player_name, nickname, join_YYYY, position, back_no, nation, birth_date, solar, height, weight): sql = "INSERT INTO playerGK VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)" params = (player_id, player_name, team_id, e_player_name, nickname, join_YYYY, position, back_no, nation, birth_date, solar, height, weight) util = DB_Utils() util.updateExecutor(db='kleague', sql=sql, params=params) ############################################# def readCSV_writeDB_List(): # DB에 PlayerGK 테이블 생성 update = DB_Updates() update.dropPlayerGK() update.createPlayerGK() # CSV 파일을 읽기 모드로 생성, 리스트로 읽음 with open('playerGK.csv', 'r', encoding='utf-8') as f: players = list(csv.reader(f)) # print(players) # print() # PlayerGK 테이블에 레코드 삽입 for rowIDX in range(len(players)): if rowIDX == 0: print(players[rowIDX]) print() continue else: row = players[rowIDX] print(row) if row[9] == '': # 비어 있는 Birthdate 처리 MySQL에서 datetime타입에 ''는 에러 row[9] = None update.populatePlayerGK(*row) readCSV_writeDB_List()
[ "9h0jun1115@gmail.com" ]
9h0jun1115@gmail.com
046137975156944af1713f7c2309711ccc401970
c93a754dae3a31b584b1945a44b1bdea5171c9b7
/ngrams.py
38bf126c314ff92ae547362be194476f8e419b4b
[]
no_license
jdbuysse/oldgrammarscripts
a1f9387743f19a164bbf2d8422c6aa32676c331e
bed6f47991acde8bb78f63db50f72a4af812a32e
refs/heads/master
2020-03-22T22:35:24.689686
2018-07-12T20:13:52
2018-07-12T20:13:52
140,759,587
0
0
null
null
null
null
UTF-8
Python
false
false
525
py
from nltk.corpus import webtext from nltk.collocations import TrigramCollocationFinder from nltk.metrics import TrigramAssocMeasures words = [w.lower() for w in webtext.words('tenderButtons.txt')] bcf = TrigramCollocationFinder.from_words(words) bcf.nbest(TrigramAssocMeasures.likelihood_ratio, 4) ##from nltk.corpus import stopwords ##stopset = set(stopwords.words('english')) ##filter_stops = lambda w: len(w) < 3 or w in stopset ##bcf.apply_word_filter(filter_stops) ##bcf.nbest(BigramAssocMeasures.likelihood_ratio, 4)
[ "jdbuysse@gmail.com" ]
jdbuysse@gmail.com
e119c0f86689c3eaed63d82bfcd0bd47ff934cf6
64f8acc96ce672063bae16083ebc32790f94f451
/main.py
8c7c212d1636b3721abc05b9b1d86a56eb8c2f57
[]
no_license
simonmullaney/Handwritten-digit-recognition-using-compressive-sensing
24c3018b99baddacad72dc66af0d83e0e8901e36
aeb6f28e9c9201219ab0f5c2bbcd3cb8b5efc276
refs/heads/master
2021-01-11T14:23:52.828447
2017-06-22T16:23:43
2017-06-22T16:23:43
81,374,215
1
0
null
null
null
null
UTF-8
Python
false
false
1,137
py
# main.py """ Main file to call methods in mnist_dataset_compress.py and neural_net.py This code has been developed from "Neural networks and deep learning" by Michael Nielsen """ #Libraries import neural_net import mnist_dataset_compress import math import mpmath import numpy as np import scipy from numpy import zeros, arange, random from matplotlib.pyplot import plot, show, figure, title a = 0.5 # learning rate b = 5 # regularisation parameter x=0 num_samples = 396 for x in range(1): #loop for consecutive testing #num_samples = num_samples - 4 mean = 0 sigma = (1/784) A = np.random.normal(mean, sigma, (num_samples,784)) #Load data new_training_data, new_validation_data = mnist_dataset_compress.load_data_wrapper(num_samples , x, A) #Build neural network nueral_net = neural_net.neural_network([num_samples,25,10], cost_function = neural_net.cross_entropy_cost) nueral_net.StochasticGradientDescent(new_training_data, new_validation_data, 30, 10, a,lambda_ = b,classification_data=new_validation_data)
[ "noreply@github.com" ]
noreply@github.com
0b911b0fdffe3d062dd973975f90998b2c1b5d62
c736c048046df0af90e391f22416f3264f9a3bdf
/script.py
f51e1ed24fc012ab2bb1cf3e586ce685ef3112d9
[]
no_license
sbrink00/graphicsFinal
be2aec78eca6a940ffbea99d9046f2cb8c5ee089
e58a5ca243384b8b6b3bca298e69ee38f44f5ae9
refs/heads/master
2022-10-10T08:55:36.537491
2020-06-12T10:53:29
2020-06-12T10:53:29
265,910,164
0
0
null
null
null
null
UTF-8
Python
false
false
12,350
py
from __future__ import print_function import sys import mdl from display import * from matrix import * from draw import * import subprocess import time def dc(ary): return [x if type(x) is not list else dc(x) for x in ary] """======== first_pass( commands ) ========== Checks the commands array for any animation commands (frames, basename, vary) Should set num_frames and basename if the frames or basename commands are present If vary is found, but frames is not, the entire program should exit. If frames is found, but basename is not, set name to some default value, and print out a message with the name being used. ==================== """ def first_pass( commands ): animCommands = ["vary", "frames", "basename", "dcolor_gradient"] animCommands = [x for x in commands if x["op"] in animCommands] if len(animCommands) == 0: return "pic",1,None animKeywords = [x["op"] for x in animCommands] if ("vary" in animKeywords or "basename" in animKeywords or "dcolor_gradient" in animKeywords) and "frames" not in animKeywords: raise Exception("Animation commands present but number of frames not defined.") if ("vary" in animKeywords or "frames" in animKeywords or "dcolor_gradient" in animKeywords) and "basename" not in animKeywords: print("No basename was given so basename set to default: 'pic'.") basename = "pic" if "basename" in animKeywords: for command in animCommands: if command["op"] == "basename": basename = command["args"][0] for command in animCommands: if command["op"] == "frames": num_frames = command["args"][0] return (basename, int(num_frames), animCommands) """======== second_pass( commands ) ========== In order to set the knobs for animation, we need to keep a seaprate value for each knob for each frame. We can do this by using an array of dictionaries. Each array index will correspond to a frame (eg. knobs[0] would be the first frame, knobs[2] would be the 3rd frame and so on). Each index should contain a dictionary of knob values, each key will be a knob name, and each value will be the knob's value for that frame. Go through the command array, and when you find vary, go from knobs[0] to knobs[frames-1] and add (or modify) the dictionary corresponding to the given knob with the appropirate value. ====================""" def second_pass( commands, num_frames, symbols ): varies = [x for x in commands if x["op"] == "vary"] frames = [{} for i in range(num_frames)] knobs = [] for command in varies: knob_name = command["knob"] if knob_name == "dcolor": raise Exception("not a valid name for a knob") knobs.append(knob_name) start_frame = int(command["args"][0]) end_frame = int(command["args"][1]) if end_frame < start_frame: raise Exception("End frame is less than start frame") start_value = float(command["args"][2]) end_value = float(command["args"][3]) for i in range(start_frame, end_frame + 1): percent = 1.0 * (i - start_frame) / (end_frame - start_frame) val = percent * (end_value - start_value) + start_value frames[i][knob_name] = round(val, 4) for frame in frames: for knob in knobs: if knob not in frame: raise Exception("Knob " + knob + " is not defined for all frames.") #SAME IDEA EXCEPT FOR THE DEFAULT COLOR dcolors = [x for x in commands if x["op"] == "dcolor_gradient"] for command in dcolors: args = command["args"] c0 = symbols[args[0]] c1 = symbols[args[1]] start_frame = int(command["args"][2]) end_frame = int(command["args"][3]) if end_frame < start_frame: raise Exception("End frame is less than start frame") for i in range(start_frame, end_frame + 1): percent = 1.0 * (i - start_frame) / (end_frame - start_frame) color = [] for a,b in zip(c0, c1): temp = percent * abs(a - b) val = a + temp if a < b else a - temp color.append(round(val)) frames[i]["dcolor"] = color if not dcolors: temp = None for i in commands: #print(symbols[i["args"][0]]) if i["op"] == "dcolor": temp = symbols[i["args"][0]] temp = [0, 0, 0] if temp == None else temp for i in range(len(frames)): frames[i]["dcolor"] = temp for frame in frames: if "dcolor" not in frame: raise Exception("default color not defined for all frames.") return frames def removeAnim(commands): idx = 0 while idx < len(commands): c = commands[idx]["op"] args = commands[idx]["args"] if c in ["basename", "frames", "vary"]: del commands[idx] idx -= 1 idx += 1 def oneTimeCommands(commands, symbols, dcolor): idx = 0 delay = 3 step_3d = 10 while idx < len(commands): c = commands[idx]["op"] args = commands[idx]["args"] if c == "dcolor": co = symbols[args[0]] dcolor[0],dcolor[1],dcolor[2] = co[0],co[1],co[2] del commands[idx] idx -= 1 elif c in ["color", "constants"]: del commands[idx] idx -= 1 elif c == "delay": delay = int(args[0]) del commands[idx] idx -= 1 elif c == "step_three_d": step_3d = int(args[0]) del commands[idx] idx -= 1 idx += 1 return delay,step_3d def run(filename): """ This function runs an mdl script """ global commands,symbols p = mdl.parseFile(filename) if p: (commands, symbols) = p else: raise Exception("Unable to parse file.") basename, num_frames, animCommands = first_pass(commands) dcolor = [0, 0, 0] if animCommands: knobValues = second_pass(commands, num_frames, symbols) DEFAULT_FONT = "tnr/" delay,step_3d = oneTimeCommands(commands, symbols, dcolor) removeAnim(commands) view = [0, 0, 1]; ambient = [50, 50, 50] light = [[0.5, 0.75, 1], [255, 255, 255]] tmp = new_matrix() ident( tmp ) stack = [ [x[:] for x in tmp] ] #for when there are multiple coordinate systems stacks = [] stacks.append(stack) zbuffer = new_zbuffer() #tmp = [] consts = '' edges = [] polygons = [] words = {} symbols['.white'] = ['constants', {'red': [0.2, 0.5, 0.5], 'green': [0.2, 0.5, 0.5], 'blue': [0.2, 0.5, 0.5]}] symbols["draw_default"] = [0, 0, 0] knobCommands = ["move", "rotate", "scale"] threeDStuffs = ["box", "sphere", "torus"] images = [] start = time.time() for x in range(num_frames): print("Now making frame " + str(x), end='\r') sys.stdout.flush() if num_frames > 1: screen = new_screen(knobValues[x]["dcolor"]) else: screen = new_screen([0, 0, 0]) zbuffer = new_zbuffer() stack = [dc(tmp)] for i,command in enumerate(commands): args = command["args"] c = command["op"] reflect = ".white" if c in knobCommands: knob = command["knob"] if knob != None: val = knobValues[x][knob] args = [arg * val if type(arg) in [int, float] else arg for arg in args] if c in threeDStuffs: const = command["constants"] if const != None: reflect = const if command["cs"] != None: pass if c == "word": words[args[0]] = args[1].replace("S", " ").replace( "N", "\n") elif c == "write": w,xcor,ycor,zcor,size = words[args[0]],int(args[1]),int(args[2]),int(args[3]),12 if command["font"]: f = command["font"] else: f = "tnr/" createWord(xcor, ycor, zcor, w, edges, f, size) matrix_mult(stack[-1], edges) draw_lines(edges, screen, zbuffer, [100, 100, 255]) edges.clear() elif c == "writecentered": w,size = words[args[0]],12 if command["font"]: f = command["font"] else: f = "tnr/" if command["frames"]: s,e = int(command["frames"][0]),int(command["frames"][1]) else: s,e = 0,num_frames if command["color"]: color = command["color"] else: color = "draw_default" if s <= x and x <= e: createWordCentered(w, edges, f, size) matrix_mult(stack[-1], edges) draw_lines(edges, screen, zbuffer, symbols[color]) edges.clear() elif c == "save": save_extension(screen, args[0] + ".png") print("Filename: " + args[0] + ".png") screen.clear() elif c == "delay": delay = int(args[0]) elif c == "line": if command["cs0"] != None: pass if command["cs1"] != None: pass add_edge( edges, float(args[0]), float(args[1]), float(args[2]), float(args[3]), float(args[4]), float(args[5]) ) matrix_mult(stack[-1], edges) draw_lines(edges, screen, zbuffer, color) edges = [] elif c == "curve": pass elif c == "sphere": add_sphere(polygons, float(args[0]), float(args[1]), float(args[2]), float(args[3]), step_3d) matrix_mult(stack[-1], polygons) draw_polygons(polygons, screen, zbuffer, view, ambient, light, symbols, reflect) polygons = [] elif c == "box": add_box(polygons, float(args[0]), float(args[1]), float(args[2]), float(args[3]), float(args[4]), float(args[5])) matrix_mult(stack[-1], polygons) draw_polygons(polygons, screen, zbuffer, view, ambient, light, symbols, reflect) polygons = [] elif c == "torus": const = command["constants"] add_torus(polygons, float(args[0]), float(args[1]), float(args[2]), float(args[3]), float(args[4]), step_3d) matrix_mult(stack[-1], polygons) draw_polygons(polygons, screen, zbuffer, view, ambient, light, symbols, reflect) polygons = [] elif c == "pop": stack.pop() elif c == "push": stack.append(dc(stack[-1])) elif c == "move": if knob != None: pass t = make_translate(float(args[0]), float(args[1]), float(args[2])) matrix_mult(stack[-1], t) stack[-1] = dc(t) elif c == "rotate": theta = float(args[1]) * (math.pi / 180) if args[0] == 'x': t = make_rotX(theta) elif args[0] == 'y': t = make_rotY(theta) else: t = make_rotZ(theta) matrix_mult(stack[-1], t) stack[-1] = dc(t) elif c == "scale": t = make_scale(float(args[0]), float(args[1]), float(args[2])) matrix_mult(stack[-1], t) stack[-1] = dc(t) #it seems like the mdl.py file already does everything I need for constants elif c == "constants": pass #to be coded later elif c == "save_knobs": pass elif c == "tween": pass elif c == "light": pass elif c == "mesh": pass elif c == "basename": pass fname = basename + str(x) + ".png" if num_frames > 1: fname = "anim/" + fname images.append(fname) #I have not fully implemented the add text image feature #so the line below is specific to the gif I am submitting #it will be changed and hopefully added to the mdl.py file #later. #addTextImage(screen, "message.image", (round((XRES - 185) * knobValues[x]["k0"]), 0)) save_extension(screen, fname) if num_frames == 1: return termCommand = ["convert", "-delay", str(delay)] + images + ["movie.gif"] subprocess.run(termCommand) total = round(time.time() - start) m, s = total // 60, total % 60 print("Time to make gif - " + str(m) + ":" + str(s)) print("Gif name: movie.gif")
[ "sbrink00@stuy.edu" ]
sbrink00@stuy.edu
e35602b4e63050a98f36b2620a2b840278beb790
ca7aa979e7059467e158830b76673f5b77a0f5a3
/Python_codes/p02972/s165580953.py
33b7efe88d0ed61cd2af5b945b54fc7bd16ee28d
[]
no_license
Aasthaengg/IBMdataset
7abb6cbcc4fb03ef5ca68ac64ba460c4a64f8901
f33f1c5c3b16d0ea8d1f5a7d479ad288bb3f48d8
refs/heads/main
2023-04-22T10:22:44.763102
2021-05-13T17:27:22
2021-05-13T17:27:22
367,112,348
0
0
null
null
null
null
UTF-8
Python
false
false
590
py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Created: Jul, 13, 2020 08:25:55 by Nobody # $Author$ # $Date$ # $URL$ __giturl__ = "$URL$" from sys import stdin input = stdin.readline def main(): N = int(input()) A = [-1]+list(map(int, input().split())) D = [-1]*(N+1) for i in range(N, 0, -1): if i > int(N/2): D[i] = A[i] else: temp_sum = 0 for j in range(N//i, 1, -1): temp_sum += D[i*j] D[i] = (temp_sum % 2) ^ A[i] print(sum(D[1:])) for i in range(1, N+1): if D[i]: print(i) if(__name__ == '__main__'): main()
[ "66529651+Aastha2104@users.noreply.github.com" ]
66529651+Aastha2104@users.noreply.github.com
983c775589fca76574d429630559d49f76019cd4
7bbfb46c21b8ab4103aab8536da76b7199266022
/db.py
261ed929b8658c895789998c2537577decf5332b
[]
no_license
jcemelanda/DevInVale2015
1c7ef18795735f6d412d62081a7b99e7a5119286
5c9f9b0890cae98cc80d000b91e7736f0004f1a2
refs/heads/master
2020-04-09T13:31:47.998120
2015-05-01T20:47:51
2015-05-01T20:47:51
30,668,659
1
1
null
null
null
null
UTF-8
Python
false
false
1,119
py
# coding: utf-8 import sqlite3 class DB(object): def __init__(self, database): self.connection = None self.database = database self._create_score_table() def _connect(self): self.connection = sqlite3.connect(self.database) def _create_score_table(self): self._connect() with self.connection as con: try: con.execute('CREATE TABLE scores (score INTEGER, player TEXT)') except sqlite3.OperationalError: pass self.connection.close() def save_score(self, score, player): values = (score, player, ) self._connect() with self.connection as con: con.execute("INSERT INTO scores VALUES (?, ?)", values) self.connection.close() def get_scores(self, player): values = (player, ) self._connect() scores = None with self.connection as con: scores = con.execute( "SELECT * FROM scores where player=?", values).fetchmany(size=10) self.connection.close() return scores
[ "satriani-16@hotmail.com" ]
satriani-16@hotmail.com
06f7225f32288306aa9dd68809b6b1999ca3781d
d2ea7a5cb8c8cc0f0a3b3044d5572c0689a8f949
/qoe_uc2_worker.py
5d7e9ba4559c041b2100e079cf1ac1b9a5f00e3a
[ "LicenseRef-scancode-unknown-license-reference", "Apache-2.0" ]
permissive
5g-media/mape-data-importer
77ad2711db98fd4f1b4bae2b9019dca0d9ffe60e
43f6627fb75d66f72f58a88fe783612061793f83
refs/heads/master
2022-04-21T20:39:57.009821
2020-04-16T09:46:44
2020-04-16T09:46:44
256,172,043
0
0
null
null
null
null
UTF-8
Python
false
false
3,217
py
import json import logging.config from kafka import KafkaConsumer from datetime import datetime from influxdb import InfluxDBClient from utils import format_str_timestamp from metric_formatter import format_monitoring_metric_per_source_origin from exceptions import InvalidStrTimestamp, NotValidDatetimeTimestamp, MetricNameNotFound, MetricValueNotFound, \ VimUuidTypeNotSupported, VimTypeNotFound, NsUuidNotFound, NsdUuidNotFound, VnfUuidNotFound, VnfdUuidNotFound, \ VduUuidNotFound from settings import KAFKA_SERVER, KAFKA_CLIENT_ID, KAFKA_API_VERSION, KAFKA_UC2_QOE_TOPIC, LOGGING, \ INFLUX_DATABASES, INFLUX_RETENTION_POLICY, KAFKA_UC2_QOE_GROUP_ID logging.config.dictConfig(LOGGING) logger = logging.getLogger(__name__) def init_kafka_consumer(): # See more: https://kafka-python.readthedocs.io/en/master/apidoc/KafkaConsumer.html consumer = KafkaConsumer(bootstrap_servers=KAFKA_SERVER, client_id=KAFKA_CLIENT_ID, enable_auto_commit=True, api_version=KAFKA_API_VERSION, group_id=KAFKA_UC2_QOE_GROUP_ID) return consumer def init_influx_client(): # See more: http://influxdb-python.readthedocs.io/en/latest/examples.html influx_client = InfluxDBClient(host=INFLUX_DATABASES['default']['HOST'], port=INFLUX_DATABASES['default']['PORT'], username=INFLUX_DATABASES['default']['USERNAME'], password=INFLUX_DATABASES['default']['PASSWORD'], database=INFLUX_DATABASES['default']['NAME'], ) return influx_client def main(): consumer = init_kafka_consumer() consumer.subscribe(pattern=KAFKA_UC2_QOE_TOPIC) influx_client = init_influx_client() # Set retention policy in db influx_client.create_retention_policy(name=INFLUX_RETENTION_POLICY['NAME'], duration=INFLUX_RETENTION_POLICY['DURATION'], replication=INFLUX_RETENTION_POLICY['REPLICATION'], default=True) for msg in consumer: try: monitoring_metrics = list() # Get & decode the message message = json.loads(msg.value.decode('utf-8', 'ignore')) # Format the given timestamp properly timestamp = message['timestamp'] try: float(message['value']) except: continue temp = { "measurement": "qoe_uc2_measurements", "time": timestamp, "tags": { 'vdu_uuid': message['vdu'], "metric": message['metric'] }, "fields": { "value": float(message['value']) } } monitoring_metrics.append(temp) # Insert the record in the db influx_client.write_points(monitoring_metrics) except json.decoder.JSONDecodeError as je: logger.warning("JSONDecodeError: {}".format(je)) except Exception as e: logger.exception(e) continue if __name__ == '__main__': main()
[ "athanasoulisp@gmail.com" ]
athanasoulisp@gmail.com
524f324282a601ddf6a39711fc86e9aa9f688e3f
3cd7fd82a43375802aa25c697864cd2c89f1e782
/code/gits_pr_update.py
970a031961593a62cbee16c568fd0f4251061f82
[ "MIT" ]
permissive
raksha-SE/GITS-test
9a825813ea7fe3edbc4967ee80acf4733a029328
a02eb9f05e6cdcb1ed2485e1a6b9a6561ff214d2
refs/heads/master
2022-12-18T05:36:44.211847
2020-09-21T18:13:21
2020-09-21T18:13:21
297,001,189
0
0
MIT
2020-09-20T04:25:05
2020-09-20T04:25:04
null
UTF-8
Python
false
false
1,276
py
import os import sys import subprocess import argparse def gits_pr_update(args): print(args) print("Hello from GITS command line tools- PR Update") flag = 0 Untracked_file_check = os.popen(git status |grep "Untracked files").read() if(len(Untracked_file_check)!=0): print("Caution u have uncommited changes") flag = 1 #git stash can be implemented at this point print("Note: Please commit uncommited changes. Would you like to continue with PR-udate?") input1 = input("[yes/no]") if flag == 0: upstream_check = os.popen("git remote -vv | grep upstream").read() print(upstream_check) if upstream_check: print("Upstream set") elif not upstream_check and args.upstream: print("Setting upstream") rc = os.popen("git remote add upstream " + args.upstream) print(os.popen("git remote -vv | grep upstream").read()) else: print("Set --upstream") exit() checkout = os.popen("git checkout master").read() upstream_pull = os.popen("git pull upstream master").read() origin_push = os.popen("git push origin master").read() else: print("message")
[ "noreply@github.com" ]
noreply@github.com
57ba84aabc962427d8bb568812dcabaa61ca840a
e705de3a44a7cc922e93c76c3aa6e6108222e538
/problems/0128_longest_consecutive_sequence.py
5e3a863543e3dfb214407f3bf1547862272121e1
[]
no_license
sokazaki/leetcode_solutions
34d4877dc7d13dc80ef067211a316c48c6269eca
42cf52eeef537806c9e3ec7a6e5113c53d0f18a3
refs/heads/master
2021-06-21T22:23:25.403545
2021-02-21T16:47:19
2021-02-21T16:47:19
193,951,202
0
1
null
null
null
null
UTF-8
Python
false
false
826
py
# O(N) Solution with Hashmap import unittest def longestConsecutive(nums): nums = set(nums) res = 0 while nums: first = last = nums.pop() while first-1 in nums: first -= 1 nums.remove(first) while last+1 in nums: last += 1 nums.remove(last) res = max(res, last-first+1) return res class Test(unittest.TestCase): def test_longestConsecutive(self): self.assertEqual(longestConsecutive([100,4,200,1,3,2]), 4) self.assertEqual(longestConsecutive([100,4,200,1,33,2]), 2) self.assertEqual(longestConsecutive([1,44,200,1,3,2]), 3) self.assertEqual(longestConsecutive([]), 0) self.assertEqual(longestConsecutive([100,44,200,11,33,2]), 1) if __name__ == "__main__": unittest.main()
[ "noreply@github.com" ]
noreply@github.com
d59371b4b3f629d0d2aadcc57dae1b9823cea4ff
63ad7bb64afc3a3c1a50e6ce8c7b87eae56e1bfd
/orders/urls.py
b1eea1833627700472c1e5ac8f4a175b183048bd
[]
no_license
hussainsajib/agora_ecom
fb60d92813c86b4e640d61a68370c409169cf402
d0fecdd94821dfb57aadbbcff3548345b3f5d449
refs/heads/master
2023-03-11T10:04:26.280328
2021-02-26T20:54:45
2021-02-26T20:54:45
null
0
0
null
null
null
null
UTF-8
Python
false
false
825
py
from django.urls import path from . import views urlpatterns = [ path('shippers/', views.ShipperList.as_view(), name='shippers'), path('shippers/<uuid:pk>/', views.ShipperDetail.as_view(), name='shipper'), path('orders/', views.OrderList.as_view(), name='orders'), path('orders/<uuid:pk>/', views.OrderDetail.as_view(), name='order'), path('orderlines/', views.OrderlineList.as_view(), name='orderlines'), path('orderlines/<uuid:pk>/', views.OrderlineDetail.as_view(), name='orderline'), path('payments/', views.PaymentList.as_view(), name='payments'), path('payments/<uuid:pk>/', views.PaymentDetail.as_view(), name='payment'), path('promotions/', views.PromotionList.as_view(), name='promotions'), path('promotions/<uuid:pk>/', views.PromotionDetail.as_view(), name='promotion') ]
[ "m.hussainul.islam@gmail.com" ]
m.hussainul.islam@gmail.com
0fe81c1224239423b44bb199c4e0a6e9ea6319bc
e0e92ccea002817ab2b0abe70b48f1e11f5c1810
/code/mother.py
d9317f27839a9a94bd6991ab0c4b4e02f1c430a1
[]
no_license
FransvanHoogstraten/XMPPbot
b22019e73ad3da8691d0be3bf56dd5e7620a3b5d
2965d45b84a53ba89fafbcc8fa5de2a7ba2d9041
refs/heads/master
2020-06-09T06:24:39.692608
2014-05-24T11:27:16
2014-05-24T11:27:16
null
0
0
null
null
null
null
UTF-8
Python
false
false
109
py
#!/usr/bin/python # $Id: xtalk.py,v 1.2 2006/10/06 12:30:42 normanr Exp $ import xtalk x = xtalk() print x
[ "fransvanhoogstraten@gmail.com" ]
fransvanhoogstraten@gmail.com
a8ea718c1bbb96735932df3415268aa4bd5b9077
2f07d79a9cb9aac51ed3889a5e8c9ebd43f7c1c0
/latest/migrations/0002_auto_20180825_0012.py
3fa9369da89307bea9245ab0718ee9d53f18ca45
[]
no_license
techspaceusict/techspace-web
a0e0757cd28163e22c814719e72ba90cf509efa1
8f26c82c661527d4d5183d68bd562256f186092b
refs/heads/master
2022-12-14T09:17:44.986055
2020-06-20T18:49:50
2020-06-20T18:49:50
102,638,580
14
18
null
2022-12-02T08:02:22
2017-09-06T17:32:51
JavaScript
UTF-8
Python
false
false
498
py
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2018-08-24 18:42 from __future__ import unicode_literals import cloudinary.models from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('latest', '0001_initial'), ] operations = [ migrations.AlterField( model_name='latestpost', name='image', field=cloudinary.models.CloudinaryField(max_length=255, verbose_name=b'image'), ), ]
[ "akshatpapnoi1110@gmail.com" ]
akshatpapnoi1110@gmail.com
d6805c37e700f30443e7c9dc8558cd6de173e5f3
aee0fcbae0bf4d64c804850361299ff7cb919231
/channels_demo/channels_demo/settings.py
5f02a6856db1c60aea3aa7c500cdabf2577a1faf
[]
no_license
suyashl13/Django-Mini-Projects
1ca15a6a39ed2101f981a743bc8932fa08a47ef3
0bffa5b5b635263ab84db284f7de8a1058c89818
refs/heads/master
2023-05-04T06:37:41.793681
2021-05-26T15:06:45
2021-05-26T15:06:45
276,897,626
2
0
null
null
null
null
UTF-8
Python
false
false
3,228
py
""" Django settings for channels_demo project. Generated by 'django-admin startproject' using Django 3.1.7. For more information on this file, see https://docs.djangoproject.com/en/3.1/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/3.1/ref/settings/ """ import os from pathlib import Path # 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.1/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = 'df2n#m1!u8u=^=p3_b*hhv_6!u$q3@3itd^=t6s^3n*_o3gm6!' # 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', 'channels', 'integers' ] 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', ] ROOT_URLCONF = 'channels_demo.urls' TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [ BASE_DIR.joinpath('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', ], }, }, ] WSGI_APPLICATION = 'channels_demo.wsgi.application' ASGI_APPLICATION = 'channels_demo.asgi.application' # Database # https://docs.djangoproject.com/en/3.1/ref/settings/#databases DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': BASE_DIR / 'db.sqlite3', } } # Password validation # https://docs.djangoproject.com/en/3.1/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.1/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.1/howto/static-files/ STATIC_URL = '/static/'
[ "suyash.lawand@gmail.com" ]
suyash.lawand@gmail.com
90dfd10d500b640ee62fc6fd0666c4b2d4804062
9fb51c3fc9e3d2b3a4267bc1ecfc826109d0b60d
/test/LaneDetectionTest.py
319478eb6ad1c3e17bce3cff37e2b897ccec2494
[]
no_license
g41903/LaneDetection
6b929dcac664d003851cf4b60eaa124fffe5908d
1cfba5940ff25274147252f1169e737954ad29f4
refs/heads/master
2021-01-19T06:36:54.047242
2016-07-27T16:52:51
2016-07-27T16:52:51
64,326,062
1
2
null
null
null
null
UTF-8
Python
false
false
20,631
py
# ipm.py import numpy as np import cv2 import cv # # focal length # fu = 0.0 # fv = 0.0 # # # optical center # center_u = 0.0 # center_v = 0.0 # # # extrinsic parameters # pitch = 0.0 # yaw = 0.0 # # height of the camera in mm # h = 0.0 # # # ROI (region of interest) # ROILeft = 0 # ROIRight = 0 # ROITop = 0 # ROIBottom = 0 # # # ipm size # ipm_width = 0 # ipm_height = 0 # # # intermediate variables # # sin and cos use radians, not degrees # c1 = 0.0 # c2 = 0.0 # s1 = 0.0 # s2 = 0.0 # # # distances (in the world frame) - to - pixels ratio # ratio_x = 0 # ratio_y = 0 # focal length fu = 750.0 fv = 720.0 # optical center center_u = 658 center_v = 372 # extrinsic parameters pitch = 9.0 yaw = 0 # height of the camera in mm h = 790 # ROI (region of interest) ROILeft = 0 ROIRight = 1100 ROITop = 500 ROIBottom = 719 # ipm size ipm_width = 600 ipm_height = 800 # intermediate variables # sin and cos use radians, not degrees c1 = 1.0 c2 = 1.0 s1 = 1.0 s2 = 1.0 # distances (in the world frame) - to - pixels ratio ratio_x = 10 ratio_y = 10 # transformation of a point from image frame [u v] to world frame [x y] offset_x=0.0 offset_y=0.0 def image2ground(uv): dummy_data = np.array([ -c2 / fu, s1 * s2 / fv, center_u * c2 / fu - center_v * s1 * s2 / fv - c1 * s2, s2 / fu, s1 * c2 / fv, -center_u * s2 / fu - center_v * s1 * c2 / fv - c1 * c2, 0, c1 / fv, -center_v * c1 / fv + s1, 0, -c1 / h / fv, center_v * c1 / h / fv - s1 / h ]) # static cv::Mat transformation_image2ground = cv::Mat(4, 3, CV_32F, dummy_data); # Mat object was needed because C/C++ lacked a standard/native implementation of matrices. # However, numpy's array is a perfect replacement for that functionality. # Hence, the cv2 module accepts numpy.arrays wherever a matrix is # indicated in the docs. transformation_image2ground = dummy_data.reshape((4, 3)) transformation_image2ground=np.asmatrix(transformation_image2ground) # Construct the image frame coordinates # dummy_data2 = [uv.x, uv.y, 1] image_coordinate=np.matrix([[uv[0]],[uv[1]],[1]]) # Find the world frame coordinates world_coordinate = transformation_image2ground * image_coordinate # Normalize the vector # the indexing of matrix elements starts from 0 #?? world_coordinate.at<float>(3, 0); # print(world_coordinate) world_coordinate = world_coordinate / (world_coordinate[3][0]) return (world_coordinate[0][0], world_coordinate[1][0]) # transformation of a point from world frame [x y] to image frame [u v] def ground2image(xy): dummy_data = np.array([ c2 * fu + center_u * c1 * s2, center_u * c1 * c2 - s2 * fu, -center_u * s1, s2 * (center_v * c1 - fv * s1), c2 * (center_v * c1 - fv * s1), -fv * c1 - center_v * s1, c1 * s2, c1 * c2, -s1, c1 * s2, c1 * c2, -s1 ]) transformation_ground2image = dummy_data.reshape(4, 3) # Construct the image frame coordinates dummy_data2 = [xy.x, xy.y, -h] world_coordinate = dummy_data2.reshape((3, 1)) # Find the world frame coordinates image_coordinate = np.multiply( transformation_ground2image, world_coordinate) # Normalize the vector # the indexing of matrix elements starts from 0 image_coordinate = image_coordinate / image_coordinate[3, 0] return (image_coordinate[0, 0], image_coordinate[0, 1]) def ipm2image(uv): x_world = offset_x + u * ratio_x y_world = offset_y + (ipm_height - v) * ratio_y return ground2image((x_world, y_world)) def getIPM(input, ipm_width, ipm_height): # Input Quadilateral or Image plane coordinates imageQuad = np.empty([4, 2]) # World plane coordinates groundQuad = np.empty([4, 2]) # Output Quadilateral ipmQuad = np.empty([4, 2]) # Lambda Matrix lambda_mat = np.empty([3, 3]) # The 4 points that select quadilateral on the input , from top-left in clockwise order # These four pts are the sides of the rect box used as input imageQuad=np.array([[ROILeft,ROITop],[ROIRight,ROITop],[ROIRight,ROIBottom],[ROILeft,ROIBottom]],np.float32) # The world coordinates of the 4 points for i in range(0, 4): groundQuad[i] = image2ground(imageQuad[i]) offset_x = groundQuad[0][0] offset_y = groundQuad[3][1] # float ground_width = (groundQuad[1][0]-groundQuad[0][0]) //top-right.x - top-left.x # float ground_length = (groundQuad[0][1]-groundQuad[4][1]) //top-left.y - bottom-left.y ratio_x = (groundQuad[1][0] - groundQuad[0][0]) / ipm_width ratio_y = (groundQuad[0][1] - groundQuad[3][1]) / ipm_height # Compute coordinates of the bottom two points in the ipm image frame x_bottom_left = (groundQuad[3][0] - groundQuad[0][0]) / ratio_x x_bottom_right = (groundQuad[2][0] - groundQuad[0][0]) / ratio_y # The 4 points where the mapping is to be done , from top-left in # clockwise order ipmQuad=np.array([[0,0],[ipm_width-1,0],[x_bottom_right,ipm_height-1],[x_bottom_left,ipm_height-1]],np.float32) # Get the Perspective Transform Matrix i.e. lambda lambda_mat = cv2.getPerspectiveTransform(imageQuad, ipmQuad) # Apply the Perspective Transform just found to the src image ipm = cv2.warpPerspective(input, lambda_mat, (ipm_width, ipm_height)) return ipm # misc.py # // parameters for white pixel extraction hueMinValue = 0 hueMaxValue = 255 satMinValue = 0 satMaxValue = 15 volMinValue = 240 volMaxValue = 255 lightMinValue = 190 lightMaxValue = 255 # // extraction of white pixels thres_white_init = 0.5 thres_exposure_max = 1500 thres_exposure_min = 1200 # // This function takes an angle in the range [-3*pi, 3*pi] and # // wraps it to the range [-pi, pi]. def wrapTheta(theta): if theta > np.pi: return theta - 2 * np.pi elif theta < -np.pi: return theta + 2 * np.pi return theta # // Construct a new image using only one single channel of the input image # // if color_image is set to 1, create a color image; otherwise a single-channel image is returned. # // 0 - B; 1 - G; 2 - R def getSingleChannel(input, channel, color_image): spl = cv2.split(input) if color_image == 0: return spl[channel] # emptyMat = thresholded channels = np.empty(input.shape) # Only show color blue channel if channel == 0: input[:, :, 1] = 0 input[:, :, 2] = 0 channels = input elif channel == 1: # Only show color green channel input[:, :, 0] = 0 input[:, :, 2] = 0 channels = input else: # Only show colorred channel input[:, :, 0] = 0 input[:, :, 1] = 0 channels = input print "channels:", channels.shape output = channels return output # // Show different channels of an image def showChannels(input): # cv2.imshow("B",getSingleChannel(input,0,True)) #b # cv2.imshow("G",getSingleChannel(input,1,True)) #g # cv2.imshow("R",getSingleChannel(input,2,True)) #r # greyMat = thresholded # greyMat=cv2.cvtColor(input,cv2.COLOR_BGR2GRAY) # cv2.imshow("GREY",greyMat) #grey-scale print "Hello" def edgeDetection(rgb_frame, detect_method, debug_mode): singleChannel = getSingleChannel(rgb_frame, 0, False) # // First apply Gaussian filtering blurred_ipm = cv2.GaussianBlur(singleChannel, (5, 5), 0) cv2.imshow("blurred_ipm:",blurred_ipm) if debug_mode: cv2.imshow('Blurred ipm:', blurred_ipm) # // Edge detection # // adaptive thresholding outperforms canny and other filtering methods max_value = 255 adaptiveMethod = cv2.ADAPTIVE_THRESH_GAUSSIAN_C thresholdType = cv2.THRESH_BINARY_INV blockSize = 11 C = 5 detection_edge=cv2.adaptiveThreshold(blurred_ipm,max_value,adaptiveMethod,thresholdType,blockSize,C) # detection_edge = np.zeros(blurred_ipm.shape, np.uint8) # detection_edge = cv2.adaptiveThreshold( # blurred_ipm, max_value, adaptiveMethod, thresholdType, blockSize, C) if debug_mode: cv2.imshow('Detection edge:', detection_edge) return detection_edge def testShowChannels(): img = cv2.imread( '/Users/g41903/Desktop/MIT/Media Lab/LaneDetection/LaneView.jpg', cv2.CV_8UC1) edgeDetection(img, 0, 0) cv2.waitKey(0) cv2.destroyAllWindows() # showChannels(img) # cv2.waitKey(0) # cv2.imshow("image",img) # testShowChannels() # // Extract white pixels from a RGB image# def extractWhitePixel(rgb_frame,extract_method,debug_mode): if extract_method=='HSV': # Convert BGR to HSV hsv_frame=cv2.cvtColor(rgb_frame,cv2.COLOR_BGR2HSV) # define range of color in HSV min_color=np.array([hueMinValue,satMinValue,volMinValue]) max_color=np.array([hueMaxValue,satMaxValue,volMaxValue]) # Threshold the HSV image to get only specific color threshold_frame = cv2.inRange(hsv_frame, min_color, max_color) return threshold_frame # cv2.imshow('frame',rgb_frame) # cv2.imshow('mask',mask) # cv2.imshow('res',res) elif extract_method=='HLS': # Convert BGR to HLS hls_frame=cv2.cvtColor(rgb_frame,cv2.COLOR_BGR2HLS) # define range of color in HSV min_color=np.array([hueMinValue,satMinValue,volMinValue]) max_color=np.array([hueMaxValue,satMaxValue,volMaxValue]) # Threshold the HSV image to get only specific color mask = cv2.inRange(hls_frame, min_color, max_color) # Bitwise-AND mask and original image res = cv2.bitwise_and(rgb_frame,rgb_frame, mask= mask) cv2.imshow('frame',rgb_frame) cv2.imshow('mask',mask) cv2.imshow('res',res) return res elif extract_method=='ADAPTIVE': # Get a single channel singleChannel=getSingleChannel(rgb_frame,0,False) # Extraction of white pixels minVal,maxVal,minLoc,maxLoc=cv2.minMaxLoc(singleChannel) # min,max=minMaxLoc(singleChannel) thresholded=np.zeros(singleChannel.shape, np.uint8) #adaptive thresholding maxValue=255 thres_count=0 thres_adaptive=thres_white_init thres_upper_bound=1 thres_lower_bound=0 type=cv2.THRESH_BINARY while thres_count<10: thres_count+=1 thresh=min+(max-min)*thres_adaptive thresholded=cv2.threshold(singleChannel,thresh,maxValue,type) s=np.sum(singleChannel,axis=0)/255 if s>thres_exposure_max: thres_lower_bound=thres_adaptive thres_adaptive=(thres_upper_bound+thres_lower_bound)/2 elif s<thres_exposure_min: thres_upper_bound=thres_adaptive thres_adaptive=(thres_upper_bound+thres_lower_bound)/2 else: break return thresholded def testExtractWhitePixel(): # hueMinValue=110 # satMinValue=50 # volMinValue=50 # hueMaxValue=130 # satMaxValue=255 # volMaxValue=255 cap = cv2.VideoCapture(0) while(1): # Take each frame _, frame = cap.read() extractWhitePixel(frame,'HSV',True) k = cv2.waitKey(5) & 0xFF if k == 27: break cv2.destroyAllWindows() # testExtractWhitePixel() # /** @function Dilation */ def Dilation(src,dilation_elem,dilation_size,debug_mode,title): dilation_type=0 if dilation_elem==0: dilation_type=cv2.MORPH_RECT elif dilation_elem==1: dilation_type=cv2.MORPH_CROSS elif dilation_elem==2: dilation_type=cv2.MORPH_ELLIPSE element=cv2.getStructuringElement(dilation_type,(int(2*dilation_size+1),int(2*dilation_size+1))) dilation_dst=0 dilation_dst=cv2.dilate(src,element,iterations=1) if debug_mode: cv2.imshow(title,dilation_dst) return dilation_dst # // TODO: curve fitting # void fitCurve(cv::Mat lane_boundaries, cv::Mat ipm_rgb) # { # std::vector<Point> filtered_points; # int count = 0; # for (int y = 0; y < lane_boundaries.rows; y++) # { # for (int x = 0; x < lane_boundaries.cols; x++) # { # // cout << lane_boundaries.at<uchar>(y, x) << " "; # // In OpenCV, x and y are inverted when trying to access an element # if (lane_boundaries.at<uchar>(y, x) == 255) # { # Point pt(x, y); # filtered_points.push_back(pt); # } # } # } # def fitCurve(lane_boundaries,ipm_rgb): # for y in range(0,lane_boundaries.rows): # for x in range(0,lane_boundaries.cols): # if point # std::vector<double> coefficients = polyFit(filtered_points); # double c1 = coefficients[0]; # double c2 = coefficients[1]; # double c3 = coefficients[2]; # cout << "c1 = " << c1 << "\tc2 = " << c2 << "\tc3 = " << c3 << endl; # // cout << "filtered_points.size() = " << filtered_points.size() << "\tapproxCurve.size() = " << approxCurve.size() << endl; # std::vector<Point> testCurve; # for (int x=0; x<lane_boundaries.cols; x++) # { # int appro_y = c1 + c2 * x + c3 * pow(x, 2); # Point pt(x, appro_y); # // cout << "appro_y = " << appro_y << endl; # testCurve.push_back(pt); # } # Scalar color = Scalar( 255, 0, 0 ); # polylines(ipm_rgb, testCurve, false, color); # imshow("Curve detection", ipm_rgb); # // polylines(ipm_rgb, filtered_points, false, color); # // imshow("check input to curve detection", ipm_rgb); # imshow("lane_boundaries", lane_boundaries); # } # LaneDetectTest.py # // input image size image_width = 1280 image_height = 720 # // Hough transform thres_num_points = 200 # // clustering of lines thres_cluster_delta_angle = 10 thres_cluster_delta_rho = 20 # // if two lanes are parallel and of certain distance, then left and right lanes are both detected. Pick the left one thres_parallel_delta_angle = 3 thres_parallel_delta_rho =150 # // if two lanes are converging. Pick the right one thres_converge_delta_angle = 10 thres_converge_delta_rho = 60 # // method for edge detection detect_method = 10 dilation_white_size = 3 # // method for white pixel extraction extract_method = 'HSV' dilation_element = 0.5 dilation_edge_size = 0.5 # /* # This is the main function for lane detection. It takes an image as input and returns a vector of lines. # Each element in the returned vector contains rho and theta of the detected lane in the ground plane. # rho - the angle between the detected lane and the heading of the robot (i.e., the camera). # theta - the distance from the origin (bottom left of the ground plane) to the detected lane # */ def getLanes(input, isDebug): clusters=np.empty(shape=(2,2),dtype=float) if input.size == 0: print "Error: Input image is empty.Function getLanes(input) aborts." return clusters # Verify size of input images. rows = input.shape[0] cols = input.shape[1] if rows is not image_height and cols is not image_width: print "Warning: forced resizing of input images" size = (image_height, image_width) np.resize(input, size) # Get inverse projection mapping ipm_rgb = getIPM(input, ipm_width, ipm_height) # Edge detection detection_edge = edgeDetection(ipm_rgb, detect_method, False) cv2.imshow('Final Detection Edge: ',detection_edge) dilated_edges=Dilation(detection_edge,dilation_element,dilation_edge_size,isDebug,"Dilated Edges") cv2.imshow('Final dilated edges: ', dilated_edges) # Get white pixels white_pixels = extractWhitePixel(ipm_rgb, extract_method, False) cv2.imshow('Final white pixels: ',white_pixels) # Dilation of the white pixels dilated_white_pixels = Dilation( white_pixels, dilation_element, dilation_white_size, isDebug, "Dilated White Pixels") cv2.imshow('Final dilated white pixels: ', dilated_white_pixels) # dilated_white_pixels=0 # cv2.dilate(white_pixels, dilated_white_pixels, dilation_white_size, isDebug, "Dilated White Pixels") # combine edge detection and white pixel extraction lane_boundaries = cv2.bitwise_and(dilated_white_pixels, dilated_edges) cv2.imshow('Final lane_boundaries: ', lane_boundaries) if isDebug: cv2.imshow("Bitwise and", lane_boundaries) # HoughLines: First parameter, Input image should be a binary image, so # apply threshold or use canny edge detection before finding applying # hough transform. Second and third parameters are \rho and \theta # accuracies respectively. Fourth argument is the threshold, which means # minimum vote it should get for it to be considered as a line. lines = cv2.HoughLines(lane_boundaries, 1, np.pi / 180, thres_num_points) # Result cleanning: make sure the distance rho is always positive. # rho_theta_pairs are list of [rho,theta] generated from the picture rho_theta_pairs = lines[0] for i in range(0, len(rho_theta_pairs)): # if rho in the ith [rho,theta] pairs is smaller than 0 if rho_theta_pairs[i][0] < 0: rho_theta_pairs[i][0] = -rho_theta_pairs[i][0] rho_theta_pairs[i][1] = np.pi + rho_theta_pairs[i][1] # ?? what does wrapTheta means # In case theta is over pi or less then -pi: If the theta is over pi, then it will be deducted by 2pi, if it's less then -pi, it will add up 2pi rho_theta_pairs[i][1] = wrapTheta(rho_theta_pairs[i][1]); # Show results before clustering if True: ipm_duplicate = ipm_rgb for i in range(0, len(rho_theta_pairs)): rho = rho_theta_pairs[i][0] theta = rho_theta_pairs[i][1] a = np.cos(theta) b = np.sin(theta) x0 = a * rho y0 = b * rho pt1 = (cv.Round(x0 + 1000 * (-b)), cv.Round(y0 + 1000 * (a))) pt2 = (cv.Round(x0 - 1000 * (-b)), cv.Round(y0 - 1000 * (a))) img = np.zeros((1280,760,3), np.uint8) cv2.line(img,pt1, pt2, (0, 255, 0), 3) cv2.imshow('Show Line:',img) # print len(lines[0]) # // cluster lines into groups and take averages, in order to remove duplicate segments of the same line # // TODO: need a robust way of distinguishing the left and right lanes num_of_lines = 0 # for i in range(0, len(rho_theta_pairs)): # rho = rho_theta_pairs[i][0] # theta = rho_theta_pairs[i][1] # if isDebug: # print "Now it's debugging" # a = np.cos(theta) # b = np.sin(theta) # custer_found = False # # # Match this line with existing clusters # for j in range(0, len(clusters)): # avg_line = clusters[j] / num_of_lines[j] # avg_rho = avg_line[0] # avg_theta = avg_line[1] # # if abs(rho - avg_rho) < thres_cluster_delta_rho and abs(theta - avg_theta) / np.pi * 180 < thres_cluster_delta_angle: # clusters[j] += lines[i] # num_of_lines[j] += 1 # clusters_found = True # break # if cluster_found: # pass # else: # #?? not sure how does clusters look like and how push_back applied to clusters # # clusters.push_back(lines[i]) # # num_of_lines.push_back(1); # clusters = lines[i] # num_of_lines = 1 # for i in range(0, len(clusters)): # clusters[i] = clusters[i] / num_of_lines[i] # rho = clusters[i][0] # theta = clusters[i][1] # a = np.cos(theta) # b = np.sin(theta) # x0 = a * rho # y0 = b * rho # pt1 = (cv.Round(x0 + 1000 * (-b)), cv.Round(y0 + 1000 * (a))) # pt2 = (cv.Round(x0 - 1000 * (-b)), cv.Round(y0 - 1000 * (a))) # ipm_rgb = cv2.line(pt1, pt2(0, 255, 0), 3) # # if isDebug: # cv2.imshow("Hough Line Transform After Clustering", ipm_rgb) # print len(clusters), "clusters found." # return clusters def testShowChannels(): img = cv2.imread( './LaneView3.jpg', 1) edgeDetection(img, 0, 0) cv2.waitKey(0) cv2.destroyAllWindows() if __name__ == '__main__': input = cv2.imread('../data/LaneView3.jpg', 1) cv2.imshow('Origin input:', input) getLanes(input, True) print("Finished") cv2.waitKey(0) cv2.destroyAllWindows() # testShowChannels()
[ "g41903@gmail.com" ]
g41903@gmail.com
042eb90c4d3065ab75fc8c59d35336f3d37f6d12
cc08f8eb47ef92839ba1cc0d04a7f6be6c06bd45
/Personal/JaipurCity/smart_city/models.py
4edef2ae9219cc2bf12785fae1060189c82a680f
[]
no_license
ProsenjitKumar/PycharmProjects
d90d0e7c2f4adc84e861c12a3fcb9174f15cde17
285692394581441ce7b706afa3b7af9e995f1c55
refs/heads/master
2022-12-13T01:09:55.408985
2019-05-08T02:21:47
2019-05-08T02:21:47
181,052,978
1
1
null
2022-12-08T02:31:17
2019-04-12T17:21:59
null
UTF-8
Python
false
false
2,081
py
from django.contrib.gis.db import models from django.contrib.gis.geos import Point class SmartRestaurant(models.Model): restaurant = models.CharField(max_length=254) rating = models.FloatField() type = models.CharField(max_length=254) cuisines = models.CharField(max_length=254) cost = models.CharField(max_length=254) address = models.CharField(max_length=254) features = models.CharField(max_length=254) latitude = models.FloatField() longitude = models.FloatField() point = models.PointField() created_at = models.DateTimeField(auto_now_add=True) def __str__(self): return self.restaurant class Fort(models.Model): title = models.CharField(max_length=254) rating = models.FloatField() category = models.CharField(max_length=254) descriptio = models.CharField(max_length=254) latitude = models.FloatField() longitude = models.FloatField() point = models.PointField() def __str__(self): return self.title class Hospital55(models.Model): hospital_n = models.CharField(max_length=255) hospital_r = models.FloatField() contact_nu = models.CharField(max_length=255) address = models.CharField(max_length=255) latitude = models.FloatField() longitude = models.FloatField() point = models.PointField() def __str__(self): return self.hospital_n class Market(models.Model): market_nam = models.CharField(max_length=255) rating = models.FloatField() location = models.CharField(max_length=255) latitude = models.FloatField() longitude = models.FloatField() point = models.PointField() def __str__(self): return self.market_nam class PoliceStation(models.Model): police_sta = models.CharField(max_length=255) rating = models.FloatField() contact_nu = models.CharField(max_length=255) address = models.CharField(max_length=255) latitude = models.FloatField() longitude = models.FloatField() point = models.PointField() def __str__(self): return self.police_sta
[ "prosenjitearnkuar@gmail.com" ]
prosenjitearnkuar@gmail.com
302aa7fcfcb70ae7b00bf4454e552a70937189a5
9c741ccdf2ccfd27605eebee7e7010bcfd03785d
/tests/contrib/snowflake/test_snowflake.py
2144dd2507a3f85590229cdd2c2da1c9e8e5f8ca
[ "Apache-2.0", "BSD-3-Clause" ]
permissive
emjohnson20/dd-trace-py
1b7f205250247c69ee19f120e5be07f28923c044
841df919ff9738ed9550b93ef7babb5c321fffd2
refs/heads/master
2023-09-02T13:20:09.458746
2021-11-10T14:35:36
2021-11-10T14:35:36
null
0
0
null
null
null
null
UTF-8
Python
false
false
8,536
py
import contextlib import json import pytest import responses import snowflake.connector from ddtrace import Pin from ddtrace import tracer from ddtrace.contrib.snowflake import patch from ddtrace.contrib.snowflake import unpatch from tests.opentracer.utils import init_tracer from tests.utils import override_config from tests.utils import snapshot if snowflake.connector.VERSION >= (2, 3, 0): req_mock = responses.RequestsMock(target="snowflake.connector.vendored.requests.adapters.HTTPAdapter.send") else: req_mock = responses.RequestsMock(target="snowflake.connector.network.HTTPAdapter.send") SNOWFLAKE_TYPES = { "TEXT": { "type": "TEXT", "name": "current_version", "length": None, "precision": None, "scale": None, "nullable": False, } } def add_snowflake_response( url, method=responses.POST, data=None, success=True, status=200, content_type="application/json" ): body = { "code": status, "success": success, } if data is not None: body["data"] = data return req_mock.add(method, url, body=json.dumps(body), status=status, content_type=content_type) def add_snowflake_query_response(rowtype, rows, total=None): if total is None: total = len(rows) data = { "queryResponseFormat": "json", "rowtype": [SNOWFLAKE_TYPES[t] for t in rowtype], "rowset": rows, "total": total, } add_snowflake_response(url="https://mock-account.snowflakecomputing.com:443/queries/v1/query-request", data=data) @contextlib.contextmanager def _client(): patch() with req_mock: add_snowflake_response( "https://mock-account.snowflakecomputing.com:443/session/v1/login-request", data={ "token": "mock-token", "masterToken": "mock-master-token", "id_token": "mock-id-token", "sessionId": "mock-session-id", "sessionInfo": { "databaseName": "mock-db-name", "schemaName": "mock-schema-name", "warehouseName": "mock-warehouse-name", "roleName": "mock-role-name", }, }, ) ctx = snowflake.connector.connect(user="mock-user", password="mock-password", account="mock-account") try: yield ctx finally: ctx.close() unpatch() @pytest.fixture def client(): with _client() as ctx: yield ctx @contextlib.contextmanager def ot_trace(): ot = init_tracer("snowflake_svc", tracer) with ot.start_active_span("snowflake_op"): yield @snapshot() @req_mock.activate def test_snowflake_fetchone(client): add_snowflake_query_response( rowtype=["TEXT"], rows=[("4.30.2",)], ) with client.cursor() as cur: res = cur.execute("select current_version();") assert res == cur assert cur.fetchone() == ("4.30.2",) @snapshot() @req_mock.activate def test_snowflake_settings_override(client): add_snowflake_query_response( rowtype=["TEXT"], rows=[("4.30.2",)], ) with override_config("snowflake", dict(service="my-snowflake-svc")): with client.cursor() as cur: res = cur.execute("select current_version();") assert res == cur assert cur.fetchone() == ("4.30.2",) @snapshot() @req_mock.activate def test_snowflake_analytics_with_rate(client): add_snowflake_query_response( rowtype=["TEXT"], rows=[("4.30.2",)], ) with override_config("snowflake", dict(analytics_enabled=True, analytics_sample_rate=0.5)): with client.cursor() as cur: res = cur.execute("select current_version();") assert res == cur assert cur.fetchone() == ("4.30.2",) @snapshot() @req_mock.activate def test_snowflake_analytics_without_rate(client): add_snowflake_query_response( rowtype=["TEXT"], rows=[("4.30.2",)], ) with override_config("snowflake", dict(analytics_enabled=True)): with client.cursor() as cur: res = cur.execute("select current_version();") assert res == cur assert cur.fetchone() == ("4.30.2",) @snapshot() def test_snowflake_service_env(run_python_code_in_subprocess, monkeypatch): monkeypatch.setenv("DD_SNOWFLAKE_SERVICE", "env-svc") out, err, status, pid = run_python_code_in_subprocess( """ from tests.contrib.snowflake.test_snowflake import _client, add_snowflake_query_response, req_mock with _client() as c: with req_mock: add_snowflake_query_response( rowtype=["TEXT"], rows=[("4.30.2",)], ) with c.cursor() as cur: res = cur.execute("select current_version();") assert res == cur assert cur.fetchone() == ("4.30.2",) """ ) assert status == 0, (out, err) @snapshot() @req_mock.activate def test_snowflake_pin_override(client): add_snowflake_query_response( rowtype=["TEXT"], rows=[("4.30.2",)], ) Pin(service="pin-sv", tags={"custom": "tag"}).onto(client) with client.cursor() as cur: res = cur.execute("select current_version();") assert res == cur assert cur.fetchone() == ("4.30.2",) @snapshot() @req_mock.activate def test_snowflake_commit(client): add_snowflake_query_response(rowtype=[], rows=[]) client.commit() @snapshot() @req_mock.activate def test_snowflake_rollback(client): add_snowflake_query_response(rowtype=[], rows=[]) client.rollback() @snapshot() @req_mock.activate def test_snowflake_fetchall(client): add_snowflake_query_response( rowtype=["TEXT"], rows=[("4.30.2",)], ) with client.cursor() as cur: res = cur.execute("select current_version();") assert res == cur assert cur.fetchall() == [("4.30.2",)] @snapshot() @req_mock.activate def test_snowflake_fetchall_multiple_rows(client): add_snowflake_query_response( rowtype=["TEXT", "TEXT"], rows=[("1a", "1b"), ("2a", "2b")], ) with client.cursor() as cur: res = cur.execute("select a, b from t;") assert res == cur assert cur.fetchall() == [ ("1a", "1b"), ("2a", "2b"), ] @snapshot() @req_mock.activate def test_snowflake_executemany_insert(client): add_snowflake_query_response( rowtype=[], rows=[], total=2, ) with client.cursor() as cur: res = cur.executemany( "insert into t (a, b) values (%s, %s);", [ ("1a", "1b"), ("2a", "2b"), ], ) assert res == cur assert res.rowcount == 2 @snapshot() @req_mock.activate def test_snowflake_ot_fetchone(client): add_snowflake_query_response( rowtype=["TEXT"], rows=[("4.30.2",)], ) with ot_trace(): with client.cursor() as cur: res = cur.execute("select current_version();") assert res == cur assert cur.fetchone() == ("4.30.2",) @snapshot() @req_mock.activate def test_snowflake_ot_fetchall(client): add_snowflake_query_response( rowtype=["TEXT"], rows=[("4.30.2",)], ) with ot_trace(): with client.cursor() as cur: res = cur.execute("select current_version();") assert res == cur assert cur.fetchall() == [("4.30.2",)] @snapshot() @req_mock.activate def test_snowflake_ot_fetchall_multiple_rows(client): add_snowflake_query_response( rowtype=["TEXT", "TEXT"], rows=[("1a", "1b"), ("2a", "2b")], ) with ot_trace(): with client.cursor() as cur: res = cur.execute("select a, b from t;") assert res == cur assert cur.fetchall() == [ ("1a", "1b"), ("2a", "2b"), ] @snapshot() @req_mock.activate def test_snowflake_ot_executemany_insert(client): add_snowflake_query_response( rowtype=[], rows=[], total=2, ) with ot_trace(): with client.cursor() as cur: res = cur.executemany( "insert into t (a, b) values (%s, %s);", [ ("1a", "1b"), ("2a", "2b"), ], ) assert res == cur assert res.rowcount == 2
[ "noreply@github.com" ]
noreply@github.com
06a59e43096e806dd20c21c29f851772da55e59a
e2a0d262b5a3c26a30ed02c78cb905363df9241c
/com/11_class2.py
2d657a02b7bdf2f9b0f1bb5a9fc78a3329a1a38c
[]
no_license
Kyeongrok/python_selinium
75b158f0c46aa5d2b7b627dd4a6775c3c6ab66ef
233c90b3294949813cc910a8b0b2f5fed7df80a9
refs/heads/master
2020-04-01T03:35:06.925347
2018-10-27T05:03:51
2018-10-27T05:03:51
152,827,717
0
0
null
null
null
null
UTF-8
Python
false
false
389
py
class people(): name = "kyeongrok" def sayHello(self): print("hello") def leftHand(self): print("i'm left hand") def rightHand(self): print("i'm right hand") def setName(self, name): self.name = name kyeongrok = people() kyeongrok.setName("iu") print(kyeongrok.name) kyeongrok.sayHello() kyeongrok.leftHand() kyeongrok.rightHand()
[ "kyeongrok.kim@okiconcession.com" ]
kyeongrok.kim@okiconcession.com
01ab7bf6b8931b83ac0808ec3bb65b4eecca8aec
68ac9e26abc4f1e43ecd9a2621b244100eb77e4d
/node.py
5362b80b1b7da65ad15732d6fee1edccd637a361
[]
no_license
PeterNerlich/search_parser
21f4901931ad17ddfa70011348f50bbcf9d1866b
39127dab14ca71e3d95a04e6c98815fc0f59d5f9
refs/heads/master
2023-06-24T04:44:17.607602
2021-07-26T03:15:24
2021-07-26T03:15:24
387,742,318
0
0
null
null
null
null
UTF-8
Python
false
false
1,786
py
from token import tok_name from search_parser.search_tokenize import TokenInfo def short_token(tok: TokenInfo) -> str: s = tok.string if s == '' or s.isspace(): return tok_name[tok.type] else: return repr(s) def alt_repr(x) -> str: if isinstance(x, TokenInfo): return short_token(x) else: return repr(x) def pretty(x, indent=0, indent_step=2) -> str: if isinstance(x, TokenInfo): return short_token(x) elif isinstance(x, Node): return x.pretty(indent=indent, indent_step=indent_step) elif isinstance(x, list): tmp = [pretty(el, indent=indent+1, indent_step=indent_step) for el in x] if any([isinstance(el, Node) for el in x]) or any([len(el.split("\n")) > 1 for el in tmp]): return "[\n{}{}\n{}]".format(' '*(indent+1)*indent_step, ",\n{}".format(' '*(indent+1)*indent_step).join(tmp), ' '*indent*indent_step) else: return "[{}]".format(', '.join(tmp)) else: return "\n{}".format(' '*indent*indent_step).join(repr(x).split("\n")) class Node: def __init__(self, type, children): self.type = type self.children = children def __repr__(self): return f"Node({self.type}, [{', '.join(map(alt_repr, self.children))}])" #return "Node({}, [\n{}\n])".format(self.type, ",\n".join(map(lambda x: ' '+x, map(alt_repr, self.children)))) #return self.pretty() def pretty(self, indent=0, indent_step=2): return "Node({}, {})".format(self.type, pretty(self.children, indent=indent, indent_step=indent_step)) def __eq__(self, other): if not isinstance(other, Node): return NotImplemented return self.type == other.type and self.children == other.children
[ "peter.nerlich+dev@googlemail.com" ]
peter.nerlich+dev@googlemail.com
4f5811d5affb7d56c9f5f07b0bd0e6594c5882cd
1b127c73255a64f6341b5cdc7e563aeeff866199
/algorithm-friday/case-converter.py
cdcef192f4fb634ca5cf1103e0f74c39e14c6427
[]
no_license
manuscriptmastr/digitalcrafts
af0ab3d1edb2c74950c8c4b84ad3a30304b44641
08a6987a38e9a0fbe2f1b48d8975e7882e0e08fc
refs/heads/master
2021-04-27T09:35:23.689504
2018-04-21T19:08:05
2018-04-21T19:08:05
122,505,626
0
0
null
2018-04-16T20:30:12
2018-02-22T16:38:46
JavaScript
UTF-8
Python
false
false
792
py
def caseConvert(str, conversionType): strArray = str.split(' ') print(strArray) if conversionType == 'camelCase': print('this is camelCase: ') convertedStr = strArray[0].lower() for i in range(1, len(strArray)): convertedStr+=strArray[i].capitalize() elif conversionType == 'snake_case': print('this is snakecase: ') # for i in range(1, len(strArray)): convertedStr = '_'.join(strArray).lower() return convertedStr str = "This is just a test" user_inp = raw_input("make a selection '1' for camelCase, '2' for snakecase: ") # print (type(user_inp))# was checking the type of variable if user_inp == '1': print (caseConvert(str, 'camelCase')) elif user_inp == '2': print (caseConvert(str, 'snake_case')) else: print ('Oops, try again')
[ "joshua@bluefishds.com" ]
joshua@bluefishds.com
4dc955342c28aac7a9bf9c2f0272ce450110998e
eb9f655206c43c12b497c667ba56a0d358b6bc3a
/python/testData/formatter/indentInComprehensions.py
7e88b6b3d3bd6218119837995f02a78b214acc0d
[ "Apache-2.0" ]
permissive
JetBrains/intellij-community
2ed226e200ecc17c037dcddd4a006de56cd43941
05dbd4575d01a213f3f4d69aa4968473f2536142
refs/heads/master
2023-09-03T17:06:37.560889
2023-09-03T11:51:00
2023-09-03T12:12:27
2,489,216
16,288
6,635
Apache-2.0
2023-09-12T07:41:58
2011-09-30T13:33:05
null
UTF-8
Python
false
false
31
py
attrs = [e.attr for e in items]
[ "yole@jetbrains.com" ]
yole@jetbrains.com
6902ebb6c877af91134200d3c24fdc44308f79c2
ca8838da8b2b841eec3ad631e85a136643156dde
/MyGeoDataProject/geoload.py
748d1903ecb37f2ae4c62738b8aa984b3cdad805
[]
no_license
TopFlankerKiller/GeoCoding-Python-
f1a0687e5feb8dcf404c14bedf23d02beca33207
fd631bd4e0378e3351312dc03ac65bb4537ef00a
refs/heads/master
2021-03-08T19:34:12.671803
2016-05-17T15:14:59
2016-05-17T15:14:59
59,030,188
1
0
null
null
null
null
UTF-8
Python
false
false
1,575
py
import urllib import sqlite3 import json import time import ssl serviceurl = "http://maps.googleapis.com/maps/api/geocode/json?" scontext = None conn = sqlite3.connect('mygeodata.sqlite') cur = conn.cursor() cur.execute(''' CREATE TABLE IF NOT EXISTS Locations (destination TEXT, geodata TEXT)''') #This is the table with my destinations fh = open("destinations.data") count = 0 for line in fh: if count > 200 : break destination = line.strip() print '' cur.execute("SELECT geodata FROM Locations WHERE destination= ?", (buffer(destination), )) try: data = cur.fetchone()[0] print "Found in database ",destination continue except: pass print 'Resolving', destination url = serviceurl + urllib.urlencode({"sensor":"false", "address": destination}) print 'Retrieving', url uh = urllib.urlopen(url) data = uh.read() print 'Retrieved',len(data),'characters',data[:20].replace('\n',' ') count = count + 1 try: js = json.loads(str(data)) # print js # We print in case unicode causes an error except: continue if 'status' not in js or (js['status'] != 'OK' and js['status'] != 'ZERO_RESULTS') : print '==== Failure To Retrieve ====' print data break cur.execute('''INSERT INTO Locations (destination, geodata) VALUES ( ?, ? )''', ( buffer(destination),buffer(data) ) ) conn.commit() time.sleep(1) print "Run geodump.py to read the data from the database so you can visualize it on a map."
[ "topal14@hotmail.com" ]
topal14@hotmail.com
e6d16507892693a1ec49b7b01513ce515a0c9225
994ff1e5559b591d91a09f4c06c84537eee453b1
/example/symbols.py
009d5aa1b8c172f7e4e402d587d1ba51201268c9
[ "BSD-2-Clause" ]
permissive
dropbox/plyj
b5a37310efc58c4e2f72fd1f90f9d1002666ffb6
8c59a576a5b35085fbd70e6c28c82aefdd7168db
refs/heads/master
2023-07-31T15:22:18.770283
2017-03-01T01:00:03
2017-03-01T01:00:06
63,818,506
6
5
null
2016-07-20T22:17:32
2016-07-20T22:17:31
null
UTF-8
Python
false
false
2,057
py
#!/usr/bin/env python2 import sys import plyj.parser import plyj.model as m p = plyj.parser.Parser() tree = p.parse_file(sys.argv[1]) print('declared types:') for type_decl in tree.type_declarations: print(type_decl.name) if type_decl.extends is not None: print(' -> extending ' + type_decl.extends.name.value) if len(type_decl.implements) is not 0: print(' -> implementing ' + ', '.join([type.name.value for type in type_decl.implements])) print print('fields:') for field_decl in [decl for decl in type_decl.body if type(decl) is m.FieldDeclaration]: for var_decl in field_decl.variable_declarators: if type(field_decl.type) is str: type_name = field_decl.type else: type_name = field_decl.type.name.value print(' ' + type_name + ' ' + var_decl.variable.name) print print('methods:') for method_decl in [decl for decl in type_decl.body if type(decl) is m.MethodDeclaration]: param_strings = [] for param in method_decl.parameters: if type(param.type) is str: param_strings.append(param.type + ' ' + param.variable.name) else: param_strings.append(param.type.name.value + ' ' + param.variable.name) print(' ' + method_decl.name + '(' + ', '.join(param_strings) + ')') if method_decl.body is not None: for statement in method_decl.body: # note that this misses variables in inner blocks such as for loops # see symbols_visitor.py for a better way of handling this if type(statement) is m.VariableDeclaration: for var_decl in statement.variable_declarators: if type(statement.type) is str: type_name = statement.type else: type_name = statement.type.name.value print(' ' + type_name + ' ' + var_decl.variable.name)
[ "werner_hahn@gmx.com" ]
werner_hahn@gmx.com
828ddd9b11c31db79e3679d61bdcfd8ff092f648
08615d46baa6d2c33f837445fd0dd48d8fb183a3
/Simple Addition/add.py
f58870bd135719a688fb2f8277b1fbb353d3a1df
[]
no_license
syafiq/kattis
34c94ab6945eab5b0583ebeba98da5452365e51f
7c29b7aa91556f903903e1194c29f0efbaeb635c
refs/heads/master
2020-04-01T04:06:09.409969
2016-10-26T10:45:22
2016-10-26T10:45:22
71,081,429
0
2
null
null
null
null
UTF-8
Python
false
false
152
py
import sys # main program if __name__ == '__main__': vals = sys.stdin.read() inx = [a for a in vals.split("\n")] print int(inx[0])+int(inx[1])
[ "noreply@github.com" ]
noreply@github.com
4b208c47d8b238082b1f0e0926b8ca03994e7acb
50a20e25c1cb7ac05b0d7eb05bf174973a866a4b
/Day20/Day20.py
a80a573319bf5001f8c8df8dc3bb1248856c81d2
[]
no_license
bakkerjangert/AoC_2016
1733b15bbb762d9fff0c986e33d404c5b7148591
3ccafab3f6d8b8efb4bf7de0549e22a4bd4de527
refs/heads/master
2023-02-04T06:09:32.862621
2020-12-18T14:39:00
2020-12-18T14:39:00
322,620,456
0
0
null
null
null
null
UTF-8
Python
false
false
956
py
import numpy as np import pylab as plt with open('input.txt') as f: lines = f.read().splitlines() start = [] end = [] for line in lines: start.append(int(line.split('-')[0])) end.append(int(line.split('-')[1])) # for i in range(len(start)): # print(start[i], '-', end[i]) ips = np.array([start, end]) ips = ips.transpose() ips = np.sort(ips, axis=0) # print(ips) # print(len(ips[:,0])) i = 0 while i + 1 < len(ips[:, 0]): print(f'{ips[i + 1, 0]} < {ips[i, 1]} < {ips[i + 1, 1]}') if ips[i + 1, 0] <= ips[i, 1] <= ips[i + 1, 1]: ips[i, 1] = ips[i + 1, 1] ips = np.delete(ips, i + 1, 0) elif ips[i + 1, 1] <= ips[i, 1]: ips = np.delete(ips, i + 1, 0) else: i += 1 print(ips) print(len(ips[:,0])) print(f'the answer to part 1 is {ips[0, 1] + 1}') #part b count = 0 for i in range(len(ips[:,0]) - 1): count += (ips[i + 1, 0] - ips[i, 1] - 1) print(f'the answer to part 2 is {count}')
[ "gert-jan.bakker@rhdhv.com" ]
gert-jan.bakker@rhdhv.com
c10776661e8ee1d2cc480264d4b48f43d7c8ca71
06e22e5e253fec09afc9504d7b201518936d84b3
/python/common/converter.py
0196904eb8e52300a652848eb50e907386ee75be
[]
no_license
RaamN/Web-Crawler
168a32deb1e276f10868eef7666e4cb340529148
9b41fcf269d28c64ce8c57df7a360f780fc18fe2
refs/heads/master
2021-01-01T16:43:43.168844
2019-12-04T19:56:23
2019-12-04T19:56:23
97,902,742
0
0
null
null
null
null
UTF-8
Python
false
false
3,817
py
from common.recursive_dictionary import RecursiveDictionary import uuid class _container(object): pass def get_type(obj): # both iteratable/dictionary + object type is messed up. Won't work. try: if hasattr(obj, "__dependent_type__"): return "dependent" if dict in type(obj).mro(): return "dictionary" if hasattr(obj, "__iter__"): #print obj return "collection" if len(set([float, int, str, unicode, type(None)]).intersection(set(type(obj).mro()))) > 0: return "primitive" if hasattr(obj, "__dict__"): return "object" except TypeError, e: return "unknown" return "unknown" def create_jsondict(obj): obj_dict = RecursiveDictionary() if hasattr(obj.__class__, "__dimensions__"): for dimension in obj.__class__.__dimensions__: if dimension._primarykey: try: primkey = getattr(obj, dimension._name) if not primkey: setattr(obj, dimension._name, str(uuid.uuid4())) except AttributeError: setattr(obj, dimension._name, str(uuid.uuid4())) try: obj_dict[dimension._name] = create_jsondict(getattr(obj, dimension._name)) except AttributeError: obj_dict[dimension._name] = None return obj_dict else: tp_marker = get_type(obj) if tp_marker == "primitive": return obj elif tp_marker == "dictionary": return RecursiveDictionary([(create_jsondict(k), create_jsondict(v)) for k, v in obj.items()]) elif tp_marker == "collection": return obj.__class__([create_jsondict(item) for item in obj]) elif tp_marker == "object": return RecursiveDictionary(obj.__dict__) def create_tracking_obj(tp, objjson, universemap, start_track_ref, extra = True): obj = create_complex_obj(tp, objjson, universemap, extra) if obj: obj.__start_tracking__ = start_track_ref return obj def create_complex_obj(tp, objjson, universemap, extra = True): #print "In create_complex_object %s %s" %(str(tp), objjson) obj = _container() obj.__class__ = tp obj.__start_tracking__ = False if not objjson: return objjson all_attribs = set(objjson.keys()) for dimension in tp.__dimensions__: if dimension._name in objjson: all_attribs.remove(dimension._name) if hasattr(dimension._type, "__dependent_type__"): primarykey = str(objjson[tp.__primarykey__._name]) if hasattr(dimension._type, "__realname__") and dimension._type.__realname__ in universemap and primarykey in universemap[dimension._type.__realname__]: setattr(obj, dimension._name, universemap[dimension._type.__realname__][primarykey]) else: setattr(obj, dimension._name, create_tracking_obj(dimension._type, objjson[dimension._name], universemap, True)) else: setattr(obj, dimension._name, create_obj(dimension._type, objjson[dimension._name])) if extra: for extra_attrib in all_attribs: setattr(obj, extra_attrib, objjson[extra_attrib]) return obj def create_obj(tp, objjson): try: category = get_type(objjson) if category == "primitive": return objjson elif category == "collection" or category == "dictionary": return objjson obj = _container() obj.__dict__ = objjson obj.__class__ = tp return obj except: print "Failed to create PCC object from JSON. Obj: %s\n tp: %s" % ( str(objjson), str(tp)) raise
[ "rnachiap@uci.edu" ]
rnachiap@uci.edu
7d6112f173be2b434f9779490f1979f1d893a056
01d92ca39cd4836aaef67e2efcf88a44671c7213
/code_pack_19/basic_logger_2.py
360836d78049880cad49c8acca8c494b507ccf7d
[]
no_license
manuelpereira292/py3_bootcamp
247f411b80f09c46aeeba90a96e6a5d3fd329f2c
1988553394cb993db82c39993ed397e497bd5ae8
refs/heads/master
2022-08-20T02:25:51.265204
2020-05-15T22:26:27
2020-05-15T22:26:27
263,367,513
1
0
null
null
null
null
UTF-8
Python
false
false
383
py
import logging logging.basicConfig(filename="code_pack_19/sample1.log", level=logging.INFO) log = logging.getLogger("ex") try: raise RuntimeError except RuntimeError: log.exception("Error!") # Let's use our file reading knowledge to # read the log file with open("code_pack_19/sample1.log") as file_handler: for line in file_handler: print(line)
[ "manuelpereira292@gmail.com" ]
manuelpereira292@gmail.com
adc306eabb7dbc0bfdb65f42a941a06a2541d9b8
fbdd18eac2c5a3163f0a4154daf3e89ddef0507d
/day3/start/12_random.py
703da11b1752801f5ef6c90fd8594635d546c62e
[]
no_license
techsharif/python_training_2021
562d891e40fe2410cebcdad841eb407fb40b7871
246dddc1c4dae683df4b006fe96a5a117d1aeaf6
refs/heads/master
2023-02-27T12:11:23.541408
2021-02-10T10:03:48
2021-02-10T10:03:48
333,330,902
0
0
null
null
null
null
UTF-8
Python
false
false
77
py
import random print(random.random()) # 0.125 print(random.randint(0,9)) # 5
[ "sharif.cse.hstu@gmail.com" ]
sharif.cse.hstu@gmail.com
5a58a787ab85afbf656093287cdf31bb5fd3798e
a6e4a6f0a73d24a6ba957277899adbd9b84bd594
/sdk/python/pulumi_azure_native/network/get_hub_virtual_network_connection.py
a68415eeb18718c1b8b9c127daf3badcdf55b420
[ "BSD-3-Clause", "Apache-2.0" ]
permissive
MisinformedDNA/pulumi-azure-native
9cbd75306e9c8f92abc25be3f73c113cb93865e9
de974fd984f7e98649951dbe80b4fc0603d03356
refs/heads/master
2023-03-24T22:02:03.842935
2021-03-08T21:16:19
2021-03-08T21:16:19
null
0
0
null
null
null
null
UTF-8
Python
false
false
7,803
py
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union from .. import _utilities, _tables from . import outputs __all__ = [ 'GetHubVirtualNetworkConnectionResult', 'AwaitableGetHubVirtualNetworkConnectionResult', 'get_hub_virtual_network_connection', ] @pulumi.output_type class GetHubVirtualNetworkConnectionResult: """ HubVirtualNetworkConnection Resource. """ def __init__(__self__, allow_hub_to_remote_vnet_transit=None, allow_remote_vnet_to_use_hub_vnet_gateways=None, enable_internet_security=None, etag=None, id=None, name=None, provisioning_state=None, remote_virtual_network=None, routing_configuration=None): if allow_hub_to_remote_vnet_transit and not isinstance(allow_hub_to_remote_vnet_transit, bool): raise TypeError("Expected argument 'allow_hub_to_remote_vnet_transit' to be a bool") pulumi.set(__self__, "allow_hub_to_remote_vnet_transit", allow_hub_to_remote_vnet_transit) if allow_remote_vnet_to_use_hub_vnet_gateways and not isinstance(allow_remote_vnet_to_use_hub_vnet_gateways, bool): raise TypeError("Expected argument 'allow_remote_vnet_to_use_hub_vnet_gateways' to be a bool") pulumi.set(__self__, "allow_remote_vnet_to_use_hub_vnet_gateways", allow_remote_vnet_to_use_hub_vnet_gateways) if enable_internet_security and not isinstance(enable_internet_security, bool): raise TypeError("Expected argument 'enable_internet_security' to be a bool") pulumi.set(__self__, "enable_internet_security", enable_internet_security) if etag and not isinstance(etag, str): raise TypeError("Expected argument 'etag' to be a str") pulumi.set(__self__, "etag", etag) if id and not isinstance(id, str): raise TypeError("Expected argument 'id' to be a str") pulumi.set(__self__, "id", id) if name and not isinstance(name, str): raise TypeError("Expected argument 'name' to be a str") pulumi.set(__self__, "name", name) if provisioning_state and not isinstance(provisioning_state, str): raise TypeError("Expected argument 'provisioning_state' to be a str") pulumi.set(__self__, "provisioning_state", provisioning_state) if remote_virtual_network and not isinstance(remote_virtual_network, dict): raise TypeError("Expected argument 'remote_virtual_network' to be a dict") pulumi.set(__self__, "remote_virtual_network", remote_virtual_network) if routing_configuration and not isinstance(routing_configuration, dict): raise TypeError("Expected argument 'routing_configuration' to be a dict") pulumi.set(__self__, "routing_configuration", routing_configuration) @property @pulumi.getter(name="allowHubToRemoteVnetTransit") def allow_hub_to_remote_vnet_transit(self) -> Optional[bool]: """ Deprecated: VirtualHub to RemoteVnet transit to enabled or not. """ return pulumi.get(self, "allow_hub_to_remote_vnet_transit") @property @pulumi.getter(name="allowRemoteVnetToUseHubVnetGateways") def allow_remote_vnet_to_use_hub_vnet_gateways(self) -> Optional[bool]: """ Deprecated: Allow RemoteVnet to use Virtual Hub's gateways. """ return pulumi.get(self, "allow_remote_vnet_to_use_hub_vnet_gateways") @property @pulumi.getter(name="enableInternetSecurity") def enable_internet_security(self) -> Optional[bool]: """ Enable internet security. """ return pulumi.get(self, "enable_internet_security") @property @pulumi.getter def etag(self) -> str: """ A unique read-only string that changes whenever the resource is updated. """ return pulumi.get(self, "etag") @property @pulumi.getter def id(self) -> Optional[str]: """ Resource ID. """ return pulumi.get(self, "id") @property @pulumi.getter def name(self) -> Optional[str]: """ The name of the resource that is unique within a resource group. This name can be used to access the resource. """ return pulumi.get(self, "name") @property @pulumi.getter(name="provisioningState") def provisioning_state(self) -> str: """ The provisioning state of the hub virtual network connection resource. """ return pulumi.get(self, "provisioning_state") @property @pulumi.getter(name="remoteVirtualNetwork") def remote_virtual_network(self) -> Optional['outputs.SubResourceResponse']: """ Reference to the remote virtual network. """ return pulumi.get(self, "remote_virtual_network") @property @pulumi.getter(name="routingConfiguration") def routing_configuration(self) -> Optional['outputs.RoutingConfigurationResponse']: """ The Routing Configuration indicating the associated and propagated route tables on this connection. """ return pulumi.get(self, "routing_configuration") class AwaitableGetHubVirtualNetworkConnectionResult(GetHubVirtualNetworkConnectionResult): # pylint: disable=using-constant-test def __await__(self): if False: yield self return GetHubVirtualNetworkConnectionResult( allow_hub_to_remote_vnet_transit=self.allow_hub_to_remote_vnet_transit, allow_remote_vnet_to_use_hub_vnet_gateways=self.allow_remote_vnet_to_use_hub_vnet_gateways, enable_internet_security=self.enable_internet_security, etag=self.etag, id=self.id, name=self.name, provisioning_state=self.provisioning_state, remote_virtual_network=self.remote_virtual_network, routing_configuration=self.routing_configuration) def get_hub_virtual_network_connection(connection_name: Optional[str] = None, resource_group_name: Optional[str] = None, virtual_hub_name: Optional[str] = None, opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetHubVirtualNetworkConnectionResult: """ HubVirtualNetworkConnection Resource. API Version: 2020-11-01. :param str connection_name: The name of the vpn connection. :param str resource_group_name: The resource group name of the VirtualHub. :param str virtual_hub_name: The name of the VirtualHub. """ __args__ = dict() __args__['connectionName'] = connection_name __args__['resourceGroupName'] = resource_group_name __args__['virtualHubName'] = virtual_hub_name if opts is None: opts = pulumi.InvokeOptions() if opts.version is None: opts.version = _utilities.get_version() __ret__ = pulumi.runtime.invoke('azure-native:network:getHubVirtualNetworkConnection', __args__, opts=opts, typ=GetHubVirtualNetworkConnectionResult).value return AwaitableGetHubVirtualNetworkConnectionResult( allow_hub_to_remote_vnet_transit=__ret__.allow_hub_to_remote_vnet_transit, allow_remote_vnet_to_use_hub_vnet_gateways=__ret__.allow_remote_vnet_to_use_hub_vnet_gateways, enable_internet_security=__ret__.enable_internet_security, etag=__ret__.etag, id=__ret__.id, name=__ret__.name, provisioning_state=__ret__.provisioning_state, remote_virtual_network=__ret__.remote_virtual_network, routing_configuration=__ret__.routing_configuration)
[ "noreply@github.com" ]
noreply@github.com
71e10b0fa9854fb3dbb5c2d8ca87aae1ee0cb3e5
63d49eb2d9232adab8c69fe232abb1d52fa6c2ad
/novelWeb02/spiders/NovelSpider.py
9a68de29f07230371d2d251275e0deb6b725b5c7
[]
no_license
liuwenbin2012159/novelWeb02
e7756e7a68fbc95db52c97b329cb891ef7822490
a276fe163c71d617464c95e72668c0810bcc40b4
refs/heads/master
2020-03-10T17:53:54.592815
2018-05-26T15:32:40
2018-05-26T15:32:40
129,511,534
0
0
null
null
null
null
UTF-8
Python
false
false
3,974
py
import logging from scrapy import Selector from scrapy_redis.spiders import RedisSpider import scrapy_redis from scrapy.http import Request from novelWeb02.items import * class NovelSpider(RedisSpider): start_urls = [] logging.getLogger("requests").setLevel(logging.WARNING) # name = "novelSpider" # allowed_domains = ["dmoz.org"] redis_key = "novelSpider:56_urls" # # start_urls = [ # "http://www.kushubao.com/1000/" # ] for i in range(10000): urlList = "http://www.kushubao.com/" + str(i) + "/"; start_urls.append(urlList); # start_urls = [ # "http://www.dmoz.org/Computers/Programming/Languages/Python/Books/", # "http://www.dmoz.org/Computers/Programming/Languages/Python/Resources/" # ] def start_requests(self): for url in self.start_urls: print("url=============" + url) yield Request(url=url, callback=self.parse) # def __init__(self, *args, **kwargs): # domain = kwargs.pop('domain', '') # self.allowed_domains = filter(None, domain.split(',')) # super(NovelSpider, self).__init__(*args, **kwargs) # self.url = "http://www.kushubao.com/1000/" def parse(self, response): selector = Selector(response) novelInfoItem = NovelInfoItem(); # ID = re.findall('weibo\.cn/(\d+)', response.url)[0] novelInfoItem['novelTitle'] = selector.xpath('//div[@class="entry-single"]/h1/text()').extract()[0] novelInfoItem['author'] = str( selector.xpath('//div[@class="des"]/p/span/b[1]/following::text()[1]')[0].extract()).replace('\xa0', '').replace( ' ', ''); novelInfoItem['updateStatus'] = str( selector.xpath('//div[@class="des"]/p/span/b[2]/following::text()[1]')[0].extract()).replace('\xa0', '').replace( ' ', ''); novelInfoItem['lasterChapterName'] = selector.xpath('//div[@class="des"]/p/a/text()').extract()[0] novelInfoItem['lasterChapterURL'] = str(selector.xpath('//div[@class="des"]/p/a/@href').extract()).replace( '\\r', '').replace('\\n', '').replace('\'', '').replace('[', '').replace(']', '') novelInfoItem['type'] = str(selector.xpath('//div[@class="des"]/p[2]/text()').extract()).replace('\\', '').replace( '\'', '').replace('[', '').replace(']', '') print(novelInfoItem['lasterChapterURL']) novelInfoItem['novelDesc'] = selector.xpath('//div[@class="des"]/p[5]/text()').extract()[0] yield novelInfoItem # chapterURLLiAry = selector.xpath('//div[@id="xslist"]/ul/li') chapterURL = selector.xpath('//div[@id="xslist"]/ul/li/a/@href').extract() for i in chapterURL: joinURL = ''.join(str(i).replace('\\r', '').replace('\\n', '').split()) chapterID = str(joinURL).replace('http://www.kushubao.com/', '').replace('/', '') yield Request(url=joinURL, meta={'novelID': novelInfoItem._values['novelID'], 'chapterID': chapterID}, callback=self.parseContent, dont_filter=True) def parseContent(self, response): selector = Selector(response) nove_content_item = NoveContentItem() nove_content_item['chapterID'] = response.meta['chapterID'] nove_content_item['novelID'] = response.meta['novelID'] nove_content_item['chapterContent'] = ''.join(selector.xpath('//div[@id="booktext"]/text()').extract()) nove_content_item['chapterName'] = selector.xpath('//div[@class="entry-single"]/h1/text()').extract()[0] item = yield nove_content_item pass
[ "liumo@163.com" ]
liumo@163.com
316c6f696121e8eb21ad87bd9966d1689f929134
37cfcdfa3b8f1499f5899d2dfa2a48504a690abd
/test/functional/p2p_disconnect_ban.py
1886e64fb2499ff15b887e636597f96dd7018069
[ "MIT" ]
permissive
CJwon-98/Pyeongtaekcoin
28acc53280be34b69c986198021724181eeb7d4d
45a81933a98a7487f11e57e6e9315efe740a297e
refs/heads/master
2023-08-17T11:18:24.401724
2021-10-14T04:32:55
2021-10-14T04:32:55
411,525,736
0
0
null
null
null
null
UTF-8
Python
false
false
5,354
py
#!/usr/bin/env python3 # Copyright (c) 2014-2018 The Pyeongtaekcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test node disconnect and ban behavior""" import time from test_framework.test_framework import PyeongtaekcoinTestFramework from test_framework.util import ( assert_equal, assert_raises_rpc_error, connect_nodes_bi, wait_until, ) class DisconnectBanTest(PyeongtaekcoinTestFramework): def set_test_params(self): self.num_nodes = 2 def run_test(self): self.log.info("Test setban and listbanned RPCs") self.log.info("setban: successfully ban single IP address") assert_equal(len(self.nodes[1].getpeerinfo()), 2) # node1 should have 2 connections to node0 at this point self.nodes[1].setban(subnet="127.0.0.1", command="add") wait_until(lambda: len(self.nodes[1].getpeerinfo()) == 0, timeout=10) assert_equal(len(self.nodes[1].getpeerinfo()), 0) # all nodes must be disconnected at this point assert_equal(len(self.nodes[1].listbanned()), 1) self.log.info("clearbanned: successfully clear ban list") self.nodes[1].clearbanned() assert_equal(len(self.nodes[1].listbanned()), 0) self.nodes[1].setban("127.0.0.0/24", "add") self.log.info("setban: fail to ban an already banned subnet") assert_equal(len(self.nodes[1].listbanned()), 1) assert_raises_rpc_error(-23, "IP/Subnet already banned", self.nodes[1].setban, "127.0.0.1", "add") self.log.info("setban: fail to ban an invalid subnet") assert_raises_rpc_error(-30, "Error: Invalid IP/Subnet", self.nodes[1].setban, "127.0.0.1/42", "add") assert_equal(len(self.nodes[1].listbanned()), 1) # still only one banned ip because 127.0.0.1 is within the range of 127.0.0.0/24 self.log.info("setban remove: fail to unban a non-banned subnet") assert_raises_rpc_error(-30, "Error: Unban failed", self.nodes[1].setban, "127.0.0.1", "remove") assert_equal(len(self.nodes[1].listbanned()), 1) self.log.info("setban remove: successfully unban subnet") self.nodes[1].setban("127.0.0.0/24", "remove") assert_equal(len(self.nodes[1].listbanned()), 0) self.nodes[1].clearbanned() assert_equal(len(self.nodes[1].listbanned()), 0) self.log.info("setban: test persistence across node restart") self.nodes[1].setban("127.0.0.0/32", "add") self.nodes[1].setban("127.0.0.0/24", "add") # Set the mocktime so we can control when bans expire old_time = int(time.time()) self.nodes[1].setmocktime(old_time) self.nodes[1].setban("192.168.0.1", "add", 1) # ban for 1 seconds self.nodes[1].setban("2001:4d48:ac57:400:cacf:e9ff:fe1d:9c63/19", "add", 1000) # ban for 1000 seconds listBeforeShutdown = self.nodes[1].listbanned() assert_equal("192.168.0.1/32", listBeforeShutdown[2]['address']) # Move time forward by 3 seconds so the third ban has expired self.nodes[1].setmocktime(old_time + 3) assert_equal(len(self.nodes[1].listbanned()), 3) self.stop_node(1) self.start_node(1) listAfterShutdown = self.nodes[1].listbanned() assert_equal("127.0.0.0/24", listAfterShutdown[0]['address']) assert_equal("127.0.0.0/32", listAfterShutdown[1]['address']) assert_equal("/19" in listAfterShutdown[2]['address'], True) # Clear ban lists self.nodes[1].clearbanned() connect_nodes_bi(self.nodes, 0, 1) self.log.info("Test disconnectnode RPCs") self.log.info("disconnectnode: fail to disconnect when calling with address and nodeid") address1 = self.nodes[0].getpeerinfo()[0]['addr'] node1 = self.nodes[0].getpeerinfo()[0]['addr'] assert_raises_rpc_error(-32602, "Only one of address and nodeid should be provided.", self.nodes[0].disconnectnode, address=address1, nodeid=node1) self.log.info("disconnectnode: fail to disconnect when calling with junk address") assert_raises_rpc_error(-29, "Node not found in connected nodes", self.nodes[0].disconnectnode, address="221B Baker Street") self.log.info("disconnectnode: successfully disconnect node by address") address1 = self.nodes[0].getpeerinfo()[0]['addr'] self.nodes[0].disconnectnode(address=address1) wait_until(lambda: len(self.nodes[0].getpeerinfo()) == 1, timeout=10) assert not [node for node in self.nodes[0].getpeerinfo() if node['addr'] == address1] self.log.info("disconnectnode: successfully reconnect node") connect_nodes_bi(self.nodes, 0, 1) # reconnect the node assert_equal(len(self.nodes[0].getpeerinfo()), 2) assert [node for node in self.nodes[0].getpeerinfo() if node['addr'] == address1] self.log.info("disconnectnode: successfully disconnect node by node id") id1 = self.nodes[0].getpeerinfo()[0]['id'] self.nodes[0].disconnectnode(nodeid=id1) wait_until(lambda: len(self.nodes[0].getpeerinfo()) == 1, timeout=10) assert not [node for node in self.nodes[0].getpeerinfo() if node['id'] == id1] if __name__ == '__main__': DisconnectBanTest().main()
[ "cjone98692996@gmail.com" ]
cjone98692996@gmail.com
6f136cc6daa5a8670845de0e72b5aa253d75137b
de5dc978e0a5b9fc4ecbbdd00c1cebe57c465775
/wso2_apim_storeclient/models/__init__.py
5c4b27271173e651942c4c622035cbca741cb8fe
[]
no_license
junetigerlee/python-wso2-apim-storeclient
8c3502dfd039eca0093c218cb6ac1183c050edb5
60c84988a2417a0104aaa53ed082902012d6247d
refs/heads/master
2021-01-01T16:12:12.197633
2017-07-25T06:21:21
2017-07-25T06:21:21
97,787,392
0
0
null
null
null
null
UTF-8
Python
false
false
2,500
py
# coding: utf-8 """ WSO2 API Manager - Store This specifies a **RESTful API** for WSO2 **API Manager** - Store. Please see [full swagger definition](https://raw.githubusercontent.com/wso2/carbon-apimgt/v6.0.4/components/apimgt/org.wso2.carbon.apimgt.rest.api.store/src/main/resources/store-api.yaml) of the API which is written using [swagger 2.0](http://swagger.io/) specification. OpenAPI spec version: 0.11.0 Contact: architecture@wso2.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import # import models into model package from .api import API from .api_info import APIInfo from .api_info_object_with_basic_api_details_ import APIInfoObjectWithBasicAPIDetails_ from .api_list import APIList from .api_object import APIObject from .api_object_business_information import APIObjectBusinessInformation from .api_object_endpoint_ur_ls import APIObjectEndpointURLs from .api_object_environment_ur_ls import APIObjectEnvironmentURLs from .application import Application from .application_1 import Application1 from .application_2 import Application2 from .application_3 import Application3 from .application_info import ApplicationInfo from .application_info_object_with_basic_application_details import ApplicationInfoObjectWithBasicApplicationDetails from .application_key import ApplicationKey from .application_key_details import ApplicationKeyDetails from .application_key_generate_request import ApplicationKeyGenerateRequest from .application_key_generation_request_object import ApplicationKeyGenerationRequestObject from .application_list import ApplicationList from .description_of_individual_errors_that_may_have_occurred_during_a_request_ import DescriptionOfIndividualErrorsThatMayHaveOccurredDuringARequest_ from .document import Document from .document_1 import Document1 from .document_list import DocumentList from .error import Error from .error_list_item import ErrorListItem from .error_object_returned_with_4_xx_http_status import ErrorObjectReturnedWith4XXHTTPStatus from .subscription import Subscription from .subscription_1 import Subscription1 from .subscription_2 import Subscription2 from .subscription_list import SubscriptionList from .tag import Tag from .tag_1 import Tag1 from .tag_list import TagList from .tier import Tier from .tier_1 import Tier1 from .tier_list import TierList from .token import Token from .token_details_for_invoking_ap_is import TokenDetailsForInvokingAPIs
[ "junetigerlee@gmail.com" ]
junetigerlee@gmail.com
d79e89cb39936866fa1bd8cece56bcf23e7dd51b
b3ec1af8c6e5b5017dc03cadc4c9880d9dac7c71
/code/src/ble_hr.py
f9aedb4c48003eb64727d634f0bd1870a363bfd4
[]
no_license
NSLog0/Open-Cycling-Computer
4e46d009aec209ac3efcde479bc87f6b3cd2efa6
cb42b35a54006c00a71cc37dea874348cc878e35
refs/heads/master
2020-03-22T08:54:15.101577
2018-06-29T14:01:23
2018-06-29T14:03:40
null
0
0
null
null
null
null
UTF-8
Python
false
false
7,577
py
#! /usr/bin/python ## @package ble_hr # BLE heart rate sensor handling module. from bluepy.btle import AssignedNumbers from bluepy.btle import BTLEException from bluepy.btle import DefaultDelegate from bluepy.btle import Peripheral import logging import threading import time ## Class for handling BLE heart rate sensor class ble_hr(Peripheral, threading.Thread): # FIXME - replace with proper service & characteristic scan HR_HANDLE = 0x000f # FIXME - explain HR_ENABLE_HR = "10" # FIXME - explain, try "01" is fails ## @var WAIT_TIME # Time of waiting for notifications in seconds WAIT_TIME = 1 ## @var EXCEPTION_WAIT_TIME # Time of waiting after an exception has been raiesed or connection lost EXCEPTION_WAIT_TIME = 10 def __init__(self, addr): ## @var l # System logger handle self.l = logging.getLogger('system') self.l.debug('[BLE_HR] WAIT_TIME {}'.format(self.WAIT_TIME)) ## @var connected # Indicates if sensor is currently connected self.connected = False self.state = 0 ## @var heart_rate # Measured heart rate self.heart_rate = 0 ## @var time_stamp # Time stamp of the measurement, initially set by the constructor to "now", later overridden by time stamp of the notification with measurement. self.time_stamp = time.time() self.l.info('[BLE_HR] State = {}'.format(self.state)) threading.Thread.__init__(self) ## @var addr # Address of the heart rate sensor self.addr = addr self.l.info('[BLE_HR] Connecting to {}'.format(addr)) self.state = 1 self.l.info('[BLE_HR] State = {}'.format(self.state)) Peripheral.__init__(self, addr, addrType='random') self.connected = True self.state = 2 self.l.info('[BLE_HR] State = {}'.format(self.state)) ## @var name # Name of the heart rate sensor self.name = self.get_device_name() self.l.info('[BLE_HR] Connected to {}'.format(self.name)) self.l.debug('[BLE_HR] Setting notification handler') self.delegate = HR_Delegate() self.l.debug('[BLE_HR] Setting delegate') self.withDelegate(self.delegate) self.l.debug('[BLE_HR] Enabling notifications') self.set_notifications() def set_notifications(self, enable=True): # Enable/disable notifications self.l.debug('[BLE_HR] Set notifications {}'.format(enable)) try: self.writeCharacteristic(self.HR_HANDLE, self.HR_ENABLE_HR, enable) except BTLEException, e: if str(e) == "Helper not started (did you call connect()?)": self.l.error('[BLE_HR] Set notifications failed: {}'.format(e)) else: self.l.critical( '[BLE_HR] Set notifications failed with uncontrolled error: {}'.format(e)) raise def get_device_name(self): c = self.getCharacteristics(uuid=AssignedNumbers.deviceName) name = c[0].read() self.l.debug('[BLE_HR] Device name: {}'.format(name)) return name def get_battery_level(self): b = self.getCharacteristics(uuid=AssignedNumbers.batteryLevel) level = ord(b[0].read()) self.l.debug('[BLE_HR] Battery lavel: {}'.format(level)) return level def get_state(self): return self.state def run(self): while self.connected: try: if self.waitForNotifications(self.WAIT_TIME): self.heart_rate = self.delegate.heart_rate self.time_stamp = self.delegate.time_stamp except BTLEException, e: if str(e) == 'Device disconnected': self.l.info('[BLE_HR] Device disconnected: {}'.format(self.name)) self.connected = False self.state = 0 self.l.debug('[BLE_HR] State = {}'.format(self.state)) # We don't want to call waitForNotifications and fail too often time.sleep(self.EXCEPTION_WAIT_TIME) else: raise except AttributeError, e: if str(e) == "'NoneType' object has no attribute 'poll'": self.l.debug('[BLE_HR] btle raised AttributeError exception {}'.format(e)) # We don't want to call waitForNotifications and fail too often time.sleep(self.EXCEPTION_WAIT_TIME) else: raise def get_data(self): r = dict(name=self.name, addr=self.addr, state=self.state, time_stamp=self.time_stamp, heart_rate=self.heart_rate) return r def __del__(self): self.stop() def stop(self): self.l.debug('[BLE_HR] Stop called') if self.connected: self.connected = False time.sleep(1) self.l.debug('[BLE_HR] Disabling notifications') self.set_notifications(enable=False) self.l.debug('[BLE_HR] Disconnecting..') self.disconnect() self.state = 0 self.l.debug('[BLE_HR] State = {}'.format(self.state)) self.l.info('[BLE_HR] {} disconnected'.format(self.name)) ## Class for handling BLE notifications from heart rate sensor class HR_Delegate(DefaultDelegate): def __init__(self): self.l = logging.getLogger('system') self.l.debug('[BLE_HR] Delegate __init__') DefaultDelegate.__init__(self) self.heart_rate = 0 self.time_stamp = time.time() def handleNotification(self, cHandle, data): self.l.debug('[BLE_HR] Delegate: Notification received. Handle: {}'.format(hex(cHandle))) # Heart Rate Measurement from BLE standard # https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.characteristic.heart_rate_measurement.xml # https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.characteristic.heart_rate_control_point.xml&u=org.bluetooth.characteristic.heart_rate_control_point.xml # self.time_stamp = time.time() i = 0 data_b = {} for b in data: data_b[i] = ord(b) i += 1 HR_VALUE_FORMAT = 0b00000001 # 0 UINT8, 1 UINT16 # 0 Heart Rate Value Format is set to UINT8. Units: beats per minute (bpm) # 1 Heart Rate Value Format is set to UINT16. Units: beats per minute (bpm) # SENSOR_CONTACT_STATUS = 0b00000110 # 0 Sensor Contact feature is not supported in the current connection # 1 Sensor Contact feature is not supported in the current connection # 2 Sensor Contact feature is supported, but contact is not detected # 3 Sensor Contact feature is supported and contact is detected # ENERGY_EXPENDED_STATUS = 0b00001000 # 0 Energy Expended field is not present # 1 Energy Expended field is present. Units: kilo Joules # RR_INTERVAL = 0b000100000 # 0 RR-Interval values are not present. # 1 One or more RR-Interval values are present. if data_b[0] & HR_VALUE_FORMAT: # UINT16 # print ('HR: {}'.format(0xff * data_b[2] + data_b[1])) self.heart_rate = 0xff * data_b[2] + data_b[1] else: # UINT8 # print ('HR: {}'.format(data_b[1])) self.heart_rate = data_b[1]
[ "przemo@firszt.eu" ]
przemo@firszt.eu
118884ad3346cd2d5b03f42e56f835bd3db83271
9644b66abf97b661caa36447a52ff09736915395
/EulerPy/problem.py
8bf9cd9ebc42f65079608069b67d9f322aa5cd8d
[ "MIT" ]
permissive
programmer-util/EulerPy
8439da0068083761871e64acc21ba6ddb8c95bb6
a2d150eefe1cc8c8d971dad009299f97db1f65e2
refs/heads/master
2021-01-16T18:12:05.067204
2014-07-23T00:28:38
2014-07-23T00:28:38
null
0
0
null
null
null
null
UTF-8
Python
false
false
2,761
py
# -*- coding: utf-8 -*- import os import sys import glob import linecache import click class Problem(object): def __init__(self, problem_number): self.num = problem_number @property def filename(self, width=3): """Returns filename padded with leading zeros""" return '{0:0{w}d}.py'.format(self.num, w=width) def suf_name(self, suffix, width=3): """Returns filename with a suffix padded with leading zeros""" return '{0:0{w}d}{1}.py'.format(self.num, '-' + suffix, w=width) @property def iglob(self): """Returns a glob iterator for files belonging to a given problem""" return glob.iglob('{0:03d}*.py'.format(self.num)) @property def solution(self): """Returns the answer to a given problem""" num = self.num eulerDir = os.path.dirname(__file__) solutionsFile = os.path.join(eulerDir, 'solutions.txt') line = linecache.getline(solutionsFile, num) try: answer = line.split('. ')[1].strip() except IndexError: answer = None if answer: return answer else: msg = 'Answer for problem %i not found in solutions.txt.' % num click.secho(msg, fg='red') click.echo('If you have an answer, consider submitting a pull ' 'request to EulerPy on GitHub.') sys.exit(1) @property def text(self): """Parses problems.txt and returns problem text""" def problem_iter(problem_num): eulerDir = os.path.dirname(__file__) problemFile = os.path.join(eulerDir, 'problems.txt') with open(problemFile) as file: problemText = False lastLine = '' for line in file: if line.strip() == 'Problem %i' % problem_num: problemText = True if problemText: if line == lastLine == '\n': break else: yield line[:-1] lastLine = line problemLines = [line for line in problem_iter(self.num)] if problemLines: # First three lines are the problem number, the divider line, # and a newline, so don't include them in the returned string return '\n'.join(problemLines[3:]) else: msg = 'Problem %i not found in problems.txt.' % self.num click.secho(msg, fg='red') click.echo('If this problem exists on Project Euler, consider ' 'submitting a pull request to EulerPy on GitHub.') sys.exit(1)
[ "me@kevinyap.ca" ]
me@kevinyap.ca
379846869770f9f89d6795dbe0488b8a14b3397c
15fe288d5f8983a6c185cd0bcb7e0deac97efb62
/modelfile/model_dram24.py
fe46dea74db4b17cc21b9066ee8771c50f4ced49
[]
no_license
oyucube/traffic
98955cd37e1b64bed752c94e3e0f442afbd7fadd
6f4bc3873281b6c8cce91a904836f887947de0f2
refs/heads/master
2020-03-20T12:56:52.718451
2019-02-08T05:56:13
2019-02-08T05:56:13
137,444,617
0
0
null
null
null
null
UTF-8
Python
false
false
5,642
py
# -*- coding: utf-8 -*- """ Created on Wed Oct 26 04:46:24 2016 @author: oyu """ import chainer.functions as F from chainer import Variable import chainer.links as L from env import xp from modelfile.model_dram import BASE import make_sampled_image import math class SAF(BASE): def __init__(self, n_units=256, n_out=0, img_size=112, var=0.18, wvar=0, n_step=2, gpu_id=-1): super(BASE, self).__init__( # the size of the inputs to each layer will be inferred # glimpse network # 切り取られた画像を処理する部分 位置情報 (glimpse loc)と画像特徴量の積を出力 # in 256 * 256 * 3 # # 24 * 24 -> 12 * 12 -> 6 * 6 -> 1 # pool pool full cnn_1_1=L.Convolution2D(3, 32, 3, pad=1), cnn_1_2=L.Convolution2D(32, 32, 3, pad=1), cnn_2_1=L.Convolution2D(32, 64, 3, pad=1), cnn_2_2=L.Convolution2D(64, 64, 3, pad=1), cnn_3_1=L.Convolution2D(64, 64, 3, pad=1), cnn_3_2=L.Convolution2D(64, 64, 3, pad=1), full_1=L.Linear(3 * 3 * 64, 256), # full_2=L.Linear(None, 10), glimpse_loc=L.Linear(2, 256), norm_1_1=L.BatchNormalization(32), norm_1_2=L.BatchNormalization(32), norm_2_1=L.BatchNormalization(64), norm_2_2=L.BatchNormalization(64), norm_3_1=L.BatchNormalization(64), norm_3_2=L.BatchNormalization(64), norm_f1=L.BatchNormalization(256), # 記憶を用いるLSTM部分 rnn_1=L.LSTM(n_units, n_units), rnn_2=L.LSTM(n_units, n_units), # 注意領域を選択するネットワーク attention_loc=L.Linear(n_units, 2), # 入力画像を処理するネットワーク # 256 * 256 -> 64 * 64 -> 32 * 32 -> 16 * 16 # pool context_cnn_1=L.Convolution2D(3, 64, 3, pad=1), context_cnn_2=L.Convolution2D(64, 64, 3, pad=1), context_cnn_3=L.Convolution2D(64, 128, 3, pad=1), context_cnn_4=L.Convolution2D(128, 128, 3, pad=1), context_cnn_5=L.Convolution2D(128, 128, 3, pad=1), context_full=L.Linear(16 * 16 * 128, n_units), l_norm_cc1=L.BatchNormalization(64), l_norm_cc2=L.BatchNormalization(64), l_norm_cc3=L.BatchNormalization(128), l_norm_cc4=L.BatchNormalization(128), l_norm_cc5=L.BatchNormalization(128), # baseline network 強化学習の期待値を学習し、バイアスbとする baseline=L.Linear(n_units, 1), class_full=L.Linear(n_units, n_out) ) # # img parameter # if gpu_id == 0: self.use_gpu = True else: self.use_gpu = False self.img_size = img_size self.gsize = 24 self.train = True self.var = var if wvar == 0: self.vars = var else: self.vars = wvar self.n_unit = n_units self.num_class = n_out # r determine the rate of position self.r = 0.5 self.r_recognize = 1.0 self.n_step = n_step def make_img(self, x, l, num_lm, random=0): s = xp.log10(xp.ones((1, 1)) * self.gsize / self.img_size) + 1 sm = xp.repeat(s, num_lm, axis=0) if random == 0: lm = Variable(xp.clip(l.data, 0, 1)) else: eps = xp.random.normal(0, 1, size=l.data.shape).astype(xp.float32) lm = xp.clip(l.data + eps * xp.sqrt(self.vars), 0, 1) lm = Variable(lm.astype(xp.float32)) if self.use_gpu: xm = make_sampled_image.generate_xm_rgb_gpu(lm.data, sm, x, num_lm, g_size=self.gsize) else: xm = make_sampled_image.generate_xm_rgb(lm.data, sm, x, num_lm, g_size=self.gsize) return xm, lm def first_forward(self, x, num_lm): self.rnn_1(Variable(xp.zeros((num_lm, self.n_unit)).astype(xp.float32))) h2 = F.relu(self.l_norm_cc1(self.context_cnn_1(F.average_pooling_2d(x, 4, stride=4)))) h3 = F.relu(self.l_norm_cc2(self.context_cnn_2(h2))) h4 = F.relu(self.l_norm_cc3(self.context_cnn_3(F.max_pooling_2d(h3, 2, stride=2)))) h5 = F.relu(self.l_norm_cc4(self.context_cnn_4(h4))) h6 = F.relu(self.l_norm_cc5(self.context_cnn_5(h5))) h7 = F.relu(self.context_full(F.max_pooling_2d(h6, 2, stride=2))) h8 = F.relu(self.rnn_2(h7)) l = F.sigmoid(self.attention_loc(h8)) b = F.sigmoid(self.baseline(Variable(h8.data))) return l, b def recurrent_forward(self, xm, lm): hgl = F.relu(self.glimpse_loc(lm)) h = self.glimpse_forward(xm) hr1 = F.relu(self.rnn_1(hgl * h)) hr2 = F.relu(self.rnn_2(hr1)) l = F.sigmoid(self.attention_loc(hr2)) y = F.softmax(self.class_full(hr1)) b = F.sigmoid(self.baseline(Variable(hr2.data))) return l, y, b def glimpse_forward(self, x): h = F.relu(self.norm_1_1(self.cnn_1_1(x))) h = F.relu(self.norm_1_2(F.max_pooling_2d(self.cnn_1_2(h), 2, stride=2))) h = F.relu(self.norm_2_1(self.cnn_2_1(h))) h = F.relu(self.norm_2_2(F.max_pooling_2d(self.cnn_2_2(h), 2, stride=2))) h = F.relu(self.norm_3_1(self.cnn_3_1(h))) h = F.relu(self.norm_3_2(F.max_pooling_2d(self.cnn_3_2(h), 2, stride=2))) h = F.relu(self.norm_f1(self.full_1(h))) return h def set_b(self): self.b_log = 0
[ "y-murata@ist.osaka-u.ac.jp" ]
y-murata@ist.osaka-u.ac.jp
effb9a8226ac5b93a6db35b1fd6185aa8e0f08ae
365b6c93436a44a07f4481f24e7ee85c0b6e2b94
/dnh/consumer.py
123c5f361c6e64c5853272cc248ea28be2b8fe84
[]
no_license
bopopescu/designate-notifications-handlers
42dbf2aa00e7c89cb087d84d89dc1263cd7d5ab7
5db7c1da7daca89dbcec24a31dc5053dbbb0f7bd
refs/heads/master
2022-11-26T06:07:12.494777
2013-12-05T22:26:10
2013-12-05T22:26:10
282,113,581
0
0
null
2020-07-24T03:30:01
2020-07-24T03:30:00
null
UTF-8
Python
false
false
3,479
py
# Copyright (C) 2013 eNovance SAS <licensing@enovance.com> # # Author: Artom Lifshitz <artom.lifshitz@enovance.com> # # 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 kombu import mixins import kombu import signal import logging from oslo.config import cfg from stevedore import named LOG = logging.getLogger(__name__) cfg.CONF.register_opts([ cfg.BoolOpt('debug', default=False, required=True), ]) CFG_GRP = 'consumer' cfg.CONF.register_group( cfg.OptGroup(name=CFG_GRP, title='Configuration for notifications consumer') ) cfg.CONF.register_opts([ cfg.StrOpt('host', default='localhost', required=True), cfg.IntOpt('port', default=5672, required=True), cfg.StrOpt('exchange', default='designate', required=True), cfg.StrOpt('queue', default='notifications.info', required=True), cfg.ListOpt('handlers', required=True), ], group=CFG_GRP) SIGNALS = dict((k, v) for v, k in signal.__dict__.iteritems() if v.startswith('SIG')) class Consumer(mixins.ConsumerMixin): def __init__(self): self.handlers = named.NamedExtensionManager( namespace='dnh.handler', names=cfg.CONF[CFG_GRP].handlers, invoke_on_load=True) # Some handlers may have required options. They're loaded by stevedore # after the initial config parsing, so we reparse the config file here # to make sure handlers get all their (required) options parsed. cfg.CONF() self.connection = kombu.Connection( 'amqp://%s:%d' % (cfg.CONF[CFG_GRP].host, cfg.CONF[CFG_GRP].port)) signal.signal(signal.SIGTERM, self.on_signal_stop) signal.signal(signal.SIGINT, self.on_signal_stop) def on_signal_stop(self, signum, frame): LOG.info('Caught %s, stopping' % SIGNALS[signum]) self.should_stop = True def on_connection_error(self, exc, interval): # self.should_stop only has an effect if the connection is already # established. If the kombu is retrying the connection, # self.should_stop # has no effect, so we need to override # ConsumerMixin's on_connection_error to raise an exception if self.should_stop: raise else: LOG.warn('Broker connection error: %r. ' 'Trying again in %s seconds.', exc, interval) def get_consumers(self, Consumer, channel): exchange = kombu.Exchange(cfg.CONF[CFG_GRP].exchange, type='topic', durable=False) queue = kombu.Queue(cfg.CONF[CFG_GRP].queue, exchange=exchange, channel=channel, durable=False) return [ kombu.Consumer(channel, queue, callbacks=[self.on_message]) ] def on_message(self, body, message): def handle(ext, body): return (ext.name, ext.obj.handle(body)) self.handlers.map(handle, body) message.ack()
[ "artom.lifshitz@enovance.com" ]
artom.lifshitz@enovance.com
cb98bfc6916ec999360431323b0978cd822e9b71
d136fbc5a98651702c62368fd7f7e7cb267c2a71
/assignment.py.py
bdb3cd7dcf2991badecd89b6aae01b32a50e3086
[]
no_license
manzartoflo/atdp-textile
dca72285e964937c964dd4b284c13c036c439faf
bd7de038c92d186214b3282f1029e3f976de3c00
refs/heads/master
2020-06-16T07:09:34.971453
2019-07-11T16:41:55
2019-07-11T16:41:55
195,509,143
0
0
null
null
null
null
UTF-8
Python
false
false
2,963
py
# -*- coding: utf-8 -*- """ Created on Tue Jul 9 23:31:49 2019 @author: Lenovo """ import requests from bs4 import BeautifulSoup as soup from selenium import webdriver import time import csv import re with open('atdp.csv', 'a', encoding='utf-8') as csvFile: writer = csv.writer(csvFile) headers = ['company_name','Email','Website','Contact'] writer.writerow(headers) filename="a.csv" f=open(filename,"w",encoding="utf-8") headers="company_name,Email,Website,Contact\n" f.write(headers) url = "https://www.atdp-textiles.org/member-list/" prefs = { "translate_whitelists": {"fr":"en"}, "translate":{"enabled":"true"} } options = webdriver.ChromeOptions() options.add_experimental_option('prefs', prefs) driver_location = r"C:\Users\Lenovo\Documents\chromedriver" wb = webdriver.Chrome(driver_location, chrome_options=options) wb.get(url) time.sleep(1) for i in range(46): first = int(i*1000) second = int(first + 1000) #print(first, second) time.sleep(0.5) wb.execute_script("window.scrollTo("+str(first)+", "+str(second)+")") html = wb.execute_script('return document.documentElement.outerHTML') page_soup = soup(html, features="html.parser") table=page_soup.findAll('table') print(len(table)) for t in range(0,25): a=table[t].findAll('tr') print('rows=') print(len(a)) for j in range(1,len(a)): tds=a[j].findAll('td') #print(len(tds)) if ((len(tds))==5): company_name=tds[1].text #company_name = translator.translate(company_name).text #print(company_name) company_name = " ".join(re.findall("[a-zA-Z]+", company_name)) print(company_name) detail=[] adress=[] Website='NaN' Email='NaN' contact=tds[2].findAll('p') for p in contact: detail.append(p.getText()) #print(detail) for m in range(0,len(detail)): if('@' in detail[m]): Email=detail[m] elif('www' in detail[m]): Website=detail[m] else: adress.append(detail[m]) numbers=tds[3].text.replace(',','|').replace('\n','').replace(' ','') #numbers = translator.translate(numbers).text print(numbers) #print(company_name) print(Email) print(Website) f.write(company_name+","+Email.replace(',','|')+","+Website+","+numbers+"\n") with open('atdp.csv', 'a', encoding='utf-8') as csvFile: writer = csv.writer(csvFile) headers = [company_name,Email.replace(',','|'),Website,numbers.replace('"','|')] writer.writerow(headers) csvFile.close() f.close()
[ "manzar.toflo@gmail.com" ]
manzar.toflo@gmail.com
98697225e835037618221274549d17e44739d9f0
b31e7898aa5131125f243eaff973049b17e08512
/.venv/lib/python3.10/site-packages/anyio/_core/_signals.py
8ea54af86c4be12340de02dc2a6f7eba387e0d98
[]
no_license
ramsred/MyProjects
f2978eeda3d73421daf0da9f2d012caef6c3ccda
a7f90ef1ecfbc7517be61e71286bd14405985de5
refs/heads/master
2023-07-09T03:19:17.683705
2023-07-02T19:30:19
2023-07-02T19:30:19
71,980,729
0
0
null
null
null
null
UTF-8
Python
false
false
863
py
from __future__ import annotations from typing import AsyncIterator from ._compat import DeprecatedAsyncContextManager from ._eventloop import get_asynclib def open_signal_receiver( *signals: int, ) -> DeprecatedAsyncContextManager[AsyncIterator[int]]: """ Start receiving operating system signals. :param signals: signals to receive (e.g. ``signal.SIGINT``) :return: an asynchronous context manager for an asynchronous iterator which yields signal numbers .. warning:: Windows does not support signals natively so it is best to avoid relying on this in cross-platform applications. .. warning:: On asyncio, this permanently replaces any previous signal handler for the given signals, as set via :meth:`~asyncio.loop.add_signal_handler`. """ return get_asynclib().open_signal_receiver(*signals)
[ "venkataramireddy534@gmail.com" ]
venkataramireddy534@gmail.com
44ff53b69d4d158f8be3d8611ddd30531b4e38dc
df7aa2eb2f0f1944f4099ef0e4377a3981b8afc5
/pl_bolts/models/gans/pix2pix/components.py
c67cf691c8d9e5dafa2ffc3efe4283ff70c68cf5
[ "Apache-2.0", "LicenseRef-scancode-proprietary-license" ]
permissive
lavoiems/lightning-bolts
b8b84c4fe25608ff2290426c61772860a2256f8c
208e92ba3dcdbc029afd37e09ec9461fbcf3f293
refs/heads/master
2023-09-01T23:50:08.634388
2021-11-08T18:38:26
2021-11-08T18:38:26
426,646,437
0
0
Apache-2.0
2021-11-10T14:09:52
2021-11-10T14:09:52
null
UTF-8
Python
false
false
4,602
py
import torch from torch import nn class UpSampleConv(nn.Module): def __init__( self, in_channels, out_channels, kernel=4, strides=2, padding=1, activation=True, batchnorm=True, dropout=False ): super().__init__() self.activation = activation self.batchnorm = batchnorm self.dropout = dropout self.deconv = nn.ConvTranspose2d(in_channels, out_channels, kernel, strides, padding) if batchnorm: self.bn = nn.BatchNorm2d(out_channels) if activation: self.act = nn.ReLU(True) if dropout: self.drop = nn.Dropout2d(0.5) def forward(self, x): x = self.deconv(x) if self.batchnorm: x = self.bn(x) if self.dropout: x = self.drop(x) return x class DownSampleConv(nn.Module): def __init__(self, in_channels, out_channels, kernel=4, strides=2, padding=1, activation=True, batchnorm=True): """Paper details: - C64-C128-C256-C512-C512-C512-C512-C512 - All convolutions are 4×4 spatial filters applied with stride 2 - Convolutions in the encoder downsample by a factor of 2 """ super().__init__() self.activation = activation self.batchnorm = batchnorm self.conv = nn.Conv2d(in_channels, out_channels, kernel, strides, padding) if batchnorm: self.bn = nn.BatchNorm2d(out_channels) if activation: self.act = nn.LeakyReLU(0.2) def forward(self, x): x = self.conv(x) if self.batchnorm: x = self.bn(x) if self.activation: x = self.act(x) return x class Generator(nn.Module): def __init__(self, in_channels, out_channels): """Paper details: - Encoder: C64-C128-C256-C512-C512-C512-C512-C512 - All convolutions are 4×4 spatial filters applied with stride 2 - Convolutions in the encoder downsample by a factor of 2 - Decoder: CD512-CD1024-CD1024-C1024-C1024-C512 -C256-C128 """ super().__init__() # encoder/donwsample convs self.encoders = [ DownSampleConv(in_channels, 64, batchnorm=False), # bs x 64 x 128 x 128 DownSampleConv(64, 128), # bs x 128 x 64 x 64 DownSampleConv(128, 256), # bs x 256 x 32 x 32 DownSampleConv(256, 512), # bs x 512 x 16 x 16 DownSampleConv(512, 512), # bs x 512 x 8 x 8 DownSampleConv(512, 512), # bs x 512 x 4 x 4 DownSampleConv(512, 512), # bs x 512 x 2 x 2 DownSampleConv(512, 512, batchnorm=False), # bs x 512 x 1 x 1 ] # decoder/upsample convs self.decoders = [ UpSampleConv(512, 512, dropout=True), # bs x 512 x 2 x 2 UpSampleConv(1024, 512, dropout=True), # bs x 512 x 4 x 4 UpSampleConv(1024, 512, dropout=True), # bs x 512 x 8 x 8 UpSampleConv(1024, 512), # bs x 512 x 16 x 16 UpSampleConv(1024, 256), # bs x 256 x 32 x 32 UpSampleConv(512, 128), # bs x 128 x 64 x 64 UpSampleConv(256, 64), # bs x 64 x 128 x 128 ] self.decoder_channels = [512, 512, 512, 512, 256, 128, 64] self.final_conv = nn.ConvTranspose2d(64, out_channels, kernel_size=4, stride=2, padding=1) self.tanh = nn.Tanh() self.encoders = nn.ModuleList(self.encoders) self.decoders = nn.ModuleList(self.decoders) def forward(self, x): skips_cons = [] for encoder in self.encoders: x = encoder(x) skips_cons.append(x) skips_cons = list(reversed(skips_cons[:-1])) decoders = self.decoders[:-1] for decoder, skip in zip(decoders, skips_cons): x = decoder(x) # print(x.shape, skip.shape) x = torch.cat((x, skip), axis=1) x = self.decoders[-1](x) # print(x.shape) x = self.final_conv(x) return self.tanh(x) class PatchGAN(nn.Module): def __init__(self, input_channels): super().__init__() self.d1 = DownSampleConv(input_channels, 64, batchnorm=False) self.d2 = DownSampleConv(64, 128) self.d3 = DownSampleConv(128, 256) self.d4 = DownSampleConv(256, 512) self.final = nn.Conv2d(512, 1, kernel_size=1) def forward(self, x, y): x = torch.cat([x, y], axis=1) x0 = self.d1(x) x1 = self.d2(x0) x2 = self.d3(x1) x3 = self.d4(x2) xn = self.final(x3) return xn
[ "noreply@github.com" ]
noreply@github.com
b8a190c7d9eb684df1e4de6a0cd214d974178610
9cd151c7ed1379514d05a9dcb2d4a47f52ae7b7c
/src/project/Utilities.py
c0e71c0dc6442b563ee3baeefb2abc01081abc91
[]
no_license
COSC-4372-6370-MedicalImaging/FinalProject
a9fe1bf0d1cb6ec698dd447f687d0c8cb7569cb9
791d6effaf251a35be754fb39c2c4e67e7d36450
refs/heads/master
2023-01-18T23:47:06.700222
2020-11-23T16:54:34
2020-11-23T16:54:34
315,013,004
0
0
null
null
null
null
UTF-8
Python
false
false
1,300
py
import cv2 import numpy as np def loadImage(image_path): image = None return image def loadMatrix(filename): matrix = None return matrix def saveImage(filename, image): return True def saveMatrix(filename, matrix): return True # map input image to values from 0 to 255" def normalizeImage(image): normalized = None return normalized # Remember: the DFT its a decomposition of signals # To be able to save it as an image you must convert it. def writableDFT(dft_image): converted = None return converted # Use openCV to display your image" # Remember: normalize binary masks and convert FFT matrices to be able to see and save them" def displayImage(image): cv2.namedWindow("Image") cv2.imshow("Image", image) cv2.waitKey() cv2.destroyAllWindows() def getDFT(image): return None # Confert from fft matrix to an image" def getImage(dft_img): return None # Both input values must be raw values" def applyMask(image_dft, mask): return image_dft * mask def signalToNoise(): return False #[Provide] Use this function to acomplish a good final image def post_process_image(image): a = np.min(image) b = np.max(image) k = 255 image = (image - a) * (k / (b - a)) return image.astype('uint8')
[ "c3m.cmm@gmail.com" ]
c3m.cmm@gmail.com
570bc08e2531a3c60bc6778ff86427b795d3d936
9e610e88158b973a2129cb794176dc1a9b0b6bfd
/juicer/util/jinja2_custom.py
535940968e98e01641d04d94dbc96fd93dc925e3
[]
no_license
eubr-bigsea/juicer
8735b3aefcf66a5207364270e7ee9ec809b94ad4
4714187a6cb8ca7d1e09d8eae4cf4898ae7dcc58
refs/heads/master
2023-08-31T07:01:52.091443
2023-08-14T21:45:03
2023-08-14T21:56:48
68,124,762
6
8
null
2023-08-01T01:21:18
2016-09-13T16:09:11
Python
UTF-8
Python
false
false
903
py
# -*- coding: utf-8 -*- from jinja2 import nodes from jinja2.ext import Extension import autopep8 class AutoPep8Extension(Extension): # a set of names that trigger the extension. tags = {'autopep8'} def __init__(self, environment): super(AutoPep8Extension, self).__init__(environment) # add the defaults to the environment environment.extend() def parse(self, parser): lineno = next(parser.stream).lineno body = parser.parse_statements(['name:endautopep8'], drop_needle=True) args = [] result = nodes.CallBlock(self.call_method('_format_support', args), [], [], body).set_lineno(lineno) return result @staticmethod def _format_support(caller): options = autopep8.parse_args(['--max-line-length', '81', '-']) return autopep8.fix_code(caller(), options=options)
[ "waltersf@gmail.com" ]
waltersf@gmail.com
9d40f78eda782f7c941d4efd9812316dc3de15cb
7cbfe2050cfa2b52e96984f0d8b98b629b48e0c2
/eventex/urls.py
4d6982d5071acc502775827f657c98c8fc667cee
[]
no_license
rubensfunke/wttd
7e113f931712c0aed827cbe751a52da4d4bff00e
bdc4a5514212a22e6c948bf886b8773e361f9406
refs/heads/master
2020-04-17T22:44:09.549522
2017-06-02T18:20:58
2017-06-02T18:20:58
67,041,294
0
0
null
null
null
null
UTF-8
Python
false
false
1,035
py
"""eventex URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.10/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-based views 1. Add an import: from other_app.views import Home 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') Including another URLconf 1. Import the include() function: from django.conf.urls import url, include 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) """ from django.conf.urls import url from django.contrib import admin # importe explicitamente o modulo da view e passe a funcao view como parametro para a funcao url() from eventex.core import views as eventex_views from eventex.subscriptions.views import subscribe urlpatterns = [ url(r'^$', eventex_views.home), url(r'^admin/', admin.site.urls), url(r'^inscricao/$', subscribe), ]
[ "desenv.estag@dif10.cmc.pr.gov.br" ]
desenv.estag@dif10.cmc.pr.gov.br
f20fd2bafe52ea95dc8e9a682545c1e25ddef966
8235896ca2e7c63277f0fa328c9983d7db7c539e
/my_new_env/lib/python2.7/site-packages/lxml/html/clean.py
142a904091369d1e867c6fcf2b992f7459837cb3
[]
no_license
tal42levy/scripts
2461d28ae89171b74d9e38189c59baf997e71501
20938a490b49693d96c4b572e149b0a940ac4614
refs/heads/master
2020-06-01T18:31:53.231295
2012-11-13T07:46:38
2012-11-13T07:46:38
null
0
0
null
null
null
null
UTF-8
Python
false
false
25,129
py
"""A cleanup tool for HTML. Removes unwanted tags and content. See the `Cleaner` class for details. """ import re import copy try: from urlparse import urlsplit except ImportError: # Python 3 from urllib.parse import urlsplit from lxml import etree from lxml.html import defs from lxml.html import fromstring, tostring, XHTML_NAMESPACE from lxml.html import xhtml_to_html, _transform_result try: unichr except NameError: # Python 3 unichr = chr try: unicode except NameError: # Python 3 unicode = str try: bytes except NameError: # Python < 2.6 bytes = str try: basestring except NameError: basestring = (str, bytes) __all__ = ['clean_html', 'clean', 'Cleaner', 'autolink', 'autolink_html', 'word_break', 'word_break_html'] # Look at http://code.sixapart.com/trac/livejournal/browser/trunk/cgi-bin/cleanhtml.pl # Particularly the CSS cleaning; most of the tag cleaning is integrated now # I have multiple kinds of schemes searched; but should schemes be # whitelisted instead? # max height? # remove images? Also in CSS? background attribute? # Some way to whitelist object, iframe, etc (e.g., if you want to # allow *just* embedded YouTube movies) # Log what was deleted and why? # style="behavior: ..." might be bad in IE? # Should we have something for just <meta http-equiv>? That's the worst of the # metas. # UTF-7 detections? Example: # <HEAD><META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=UTF-7"> </HEAD>+ADw-SCRIPT+AD4-alert('XSS');+ADw-/SCRIPT+AD4- # you don't always have to have the charset set, if the page has no charset # and there's UTF7-like code in it. # Look at these tests: http://htmlpurifier.org/live/smoketests/xssAttacks.php # This is an IE-specific construct you can have in a stylesheet to # run some Javascript: _css_javascript_re = re.compile( r'expression\s*\(.*?\)', re.S|re.I) # Do I have to worry about @\nimport? _css_import_re = re.compile( r'@\s*import', re.I) # All kinds of schemes besides just javascript: that can cause # execution: _javascript_scheme_re = re.compile( r'\s*(?:javascript|jscript|livescript|vbscript|data|about|mocha):', re.I) _substitute_whitespace = re.compile(r'\s+').sub # FIXME: should data: be blocked? # FIXME: check against: http://msdn2.microsoft.com/en-us/library/ms537512.aspx _conditional_comment_re = re.compile( r'\[if[\s\n\r]+.*?][\s\n\r]*>', re.I|re.S) _find_styled_elements = etree.XPath( "descendant-or-self::*[@style]") _find_external_links = etree.XPath( ("descendant-or-self::a [normalize-space(@href) and substring(normalize-space(@href),1,1) != '#'] |" "descendant-or-self::x:a[normalize-space(@href) and substring(normalize-space(@href),1,1) != '#']"), namespaces={'x':XHTML_NAMESPACE}) class Cleaner(object): """ Instances cleans the document of each of the possible offending elements. The cleaning is controlled by attributes; you can override attributes in a subclass, or set them in the constructor. ``scripts``: Removes any ``<script>`` tags. ``javascript``: Removes any Javascript, like an ``onclick`` attribute. ``comments``: Removes any comments. ``style``: Removes any style tags or attributes. ``links``: Removes any ``<link>`` tags ``meta``: Removes any ``<meta>`` tags ``page_structure``: Structural parts of a page: ``<head>``, ``<html>``, ``<title>``. ``processing_instructions``: Removes any processing instructions. ``embedded``: Removes any embedded objects (flash, iframes) ``frames``: Removes any frame-related tags ``forms``: Removes any form tags ``annoying_tags``: Tags that aren't *wrong*, but are annoying. ``<blink>`` and ``<marquee>`` ``remove_tags``: A list of tags to remove. Only the tags will be removed, their content will get pulled up into the parent tag. ``kill_tags``: A list of tags to kill. Killing also removes the tag's content, i.e. the whole subtree, not just the tag itself. ``allow_tags``: A list of tags to include (default include all). ``remove_unknown_tags``: Remove any tags that aren't standard parts of HTML. ``safe_attrs_only``: If true, only include 'safe' attributes (specifically the list from `feedparser <http://feedparser.org/docs/html-sanitization.html>`_). ``add_nofollow``: If true, then any <a> tags will have ``rel="nofollow"`` added to them. ``host_whitelist``: A list or set of hosts that you can use for embedded content (for content like ``<object>``, ``<link rel="stylesheet">``, etc). You can also implement/override the method ``allow_embedded_url(el, url)`` or ``allow_element(el)`` to implement more complex rules for what can be embedded. Anything that passes this test will be shown, regardless of the value of (for instance) ``embedded``. Note that this parameter might not work as intended if you do not make the links absolute before doing the cleaning. ``whitelist_tags``: A set of tags that can be included with ``host_whitelist``. The default is ``iframe`` and ``embed``; you may wish to include other tags like ``script``, or you may want to implement ``allow_embedded_url`` for more control. Set to None to include all tags. This modifies the document *in place*. """ scripts = True javascript = True comments = True style = False links = True meta = True page_structure = True processing_instructions = True embedded = True frames = True forms = True annoying_tags = True remove_tags = None allow_tags = None kill_tags = None remove_unknown_tags = True safe_attrs_only = True add_nofollow = False host_whitelist = () whitelist_tags = set(['iframe', 'embed']) def __init__(self, **kw): for name, value in kw.items(): if not hasattr(self, name): raise TypeError( "Unknown parameter: %s=%r" % (name, value)) setattr(self, name, value) # Used to lookup the primary URL for a given tag that is up for # removal: _tag_link_attrs = dict( script='src', link='href', # From: http://java.sun.com/j2se/1.4.2/docs/guide/misc/applet.html # From what I can tell, both attributes can contain a link: applet=['code', 'object'], iframe='src', embed='src', layer='src', # FIXME: there doesn't really seem like a general way to figure out what # links an <object> tag uses; links often go in <param> tags with values # that we don't really know. You'd have to have knowledge about specific # kinds of plugins (probably keyed off classid), and match against those. ##object=?, # FIXME: not looking at the action currently, because it is more complex # than than -- if you keep the form, you should keep the form controls. ##form='action', a='href', ) def __call__(self, doc): """ Cleans the document. """ if hasattr(doc, 'getroot'): # ElementTree instance, instead of an element doc = doc.getroot() # convert XHTML to HTML xhtml_to_html(doc) # Normalize a case that IE treats <image> like <img>, and that # can confuse either this step or later steps. for el in doc.iter('image'): el.tag = 'img' if not self.comments: # Of course, if we were going to kill comments anyway, we don't # need to worry about this self.kill_conditional_comments(doc) kill_tags = set(self.kill_tags or ()) remove_tags = set(self.remove_tags or ()) allow_tags = set(self.allow_tags or ()) if self.scripts: kill_tags.add('script') if self.safe_attrs_only: safe_attrs = set(defs.safe_attrs) for el in doc.iter(): attrib = el.attrib for aname in attrib.keys(): if aname not in safe_attrs: del attrib[aname] if self.javascript: if not self.safe_attrs_only: # safe_attrs handles events attributes itself for el in doc.iter(): attrib = el.attrib for aname in attrib.keys(): if aname.startswith('on'): del attrib[aname] doc.rewrite_links(self._remove_javascript_link, resolve_base_href=False) if not self.style: # If we're deleting style then we don't have to remove JS links # from styles, otherwise... for el in _find_styled_elements(doc): old = el.get('style') new = _css_javascript_re.sub('', old) new = _css_import_re.sub('', old) if self._has_sneaky_javascript(new): # Something tricky is going on... del el.attrib['style'] elif new != old: el.set('style', new) for el in list(doc.iter('style')): if el.get('type', '').lower().strip() == 'text/javascript': el.drop_tree() continue old = el.text or '' new = _css_javascript_re.sub('', old) # The imported CSS can do anything; we just can't allow: new = _css_import_re.sub('', old) if self._has_sneaky_javascript(new): # Something tricky is going on... el.text = '/* deleted */' elif new != old: el.text = new if self.comments or self.processing_instructions: # FIXME: why either? I feel like there's some obscure reason # because you can put PIs in comments...? But I've already # forgotten it kill_tags.add(etree.Comment) if self.processing_instructions: kill_tags.add(etree.ProcessingInstruction) if self.style: kill_tags.add('style') etree.strip_attributes(doc, 'style') if self.links: kill_tags.add('link') elif self.style or self.javascript: # We must get rid of included stylesheets if Javascript is not # allowed, as you can put Javascript in them for el in list(doc.iter('link')): if 'stylesheet' in el.get('rel', '').lower(): # Note this kills alternate stylesheets as well el.drop_tree() if self.meta: kill_tags.add('meta') if self.page_structure: remove_tags.update(('head', 'html', 'title')) if self.embedded: # FIXME: is <layer> really embedded? # We should get rid of any <param> tags not inside <applet>; # These are not really valid anyway. for el in list(doc.iter('param')): found_parent = False parent = el.getparent() while parent is not None and parent.tag not in ('applet', 'object'): parent = parent.getparent() if parent is None: el.drop_tree() kill_tags.update(('applet',)) # The alternate contents that are in an iframe are a good fallback: remove_tags.update(('iframe', 'embed', 'layer', 'object', 'param')) if self.frames: # FIXME: ideally we should look at the frame links, but # generally frames don't mix properly with an HTML # fragment anyway. kill_tags.update(defs.frame_tags) if self.forms: remove_tags.add('form') kill_tags.update(('button', 'input', 'select', 'textarea')) if self.annoying_tags: remove_tags.update(('blink', 'marquee')) _remove = [] _kill = [] for el in doc.iter(): if el.tag in kill_tags: if self.allow_element(el): continue _kill.append(el) elif el.tag in remove_tags: if self.allow_element(el): continue _remove.append(el) if _remove and _remove[0] == doc: # We have to drop the parent-most tag, which we can't # do. Instead we'll rewrite it: el = _remove.pop(0) el.tag = 'div' el.attrib.clear() elif _kill and _kill[0] == doc: # We have to drop the parent-most element, which we can't # do. Instead we'll clear it: el = _kill.pop(0) if el.tag != 'html': el.tag = 'div' el.clear() _kill.reverse() # start with innermost tags for el in _kill: el.drop_tree() for el in _remove: el.drop_tag() allow_tags = self.allow_tags if self.remove_unknown_tags: if allow_tags: raise ValueError( "It does not make sense to pass in both allow_tags and remove_unknown_tags") allow_tags = set(defs.tags) if allow_tags: bad = [] for el in doc.iter(): if el.tag not in allow_tags: bad.append(el) if bad: if bad[0] is doc: el = bad.pop(0) el.tag = 'div' el.attrib.clear() for el in bad: el.drop_tag() if self.add_nofollow: for el in _find_external_links(doc): if not self.allow_follow(el): el.set('rel', 'nofollow') def allow_follow(self, anchor): """ Override to suppress rel="nofollow" on some anchors. """ return False def allow_element(self, el): if el.tag not in self._tag_link_attrs: return False attr = self._tag_link_attrs[el.tag] if isinstance(attr, (list, tuple)): for one_attr in attr: url = el.get(one_attr) if not url: return False if not self.allow_embedded_url(el, url): return False return True else: url = el.get(attr) if not url: return False return self.allow_embedded_url(el, url) def allow_embedded_url(self, el, url): if (self.whitelist_tags is not None and el.tag not in self.whitelist_tags): return False scheme, netloc, path, query, fragment = urlsplit(url) netloc = netloc.lower().split(':', 1)[0] if scheme not in ('http', 'https'): return False if netloc in self.host_whitelist: return True return False def kill_conditional_comments(self, doc): """ IE conditional comments basically embed HTML that the parser doesn't normally see. We can't allow anything like that, so we'll kill any comments that could be conditional. """ bad = [] self._kill_elements( doc, lambda el: _conditional_comment_re.search(el.text), etree.Comment) def _kill_elements(self, doc, condition, iterate=None): bad = [] for el in doc.iter(iterate): if condition(el): bad.append(el) for el in bad: el.drop_tree() def _remove_javascript_link(self, link): # links like "j a v a s c r i p t:" might be interpreted in IE new = _substitute_whitespace('', link) if _javascript_scheme_re.search(new): # FIXME: should this be None to delete? return '' return link _substitute_comments = re.compile(r'/\*.*?\*/', re.S).sub def _has_sneaky_javascript(self, style): """ Depending on the browser, stuff like ``e x p r e s s i o n(...)`` can get interpreted, or ``expre/* stuff */ssion(...)``. This checks for attempt to do stuff like this. Typically the response will be to kill the entire style; if you have just a bit of Javascript in the style another rule will catch that and remove only the Javascript from the style; this catches more sneaky attempts. """ style = self._substitute_comments('', style) style = style.replace('\\', '') style = _substitute_whitespace('', style) style = style.lower() if 'javascript:' in style: return True if 'expression(' in style: return True return False def clean_html(self, html): result_type = type(html) if isinstance(html, basestring): doc = fromstring(html) else: doc = copy.deepcopy(html) self(doc) return _transform_result(result_type, doc) clean = Cleaner() clean_html = clean.clean_html ############################################################ ## Autolinking ############################################################ _link_regexes = [ re.compile(r'(?P<body>https?://(?P<host>[a-z0-9._-]+)(?:/[/\-_.,a-z0-9%&?;=~]*)?(?:\([/\-_.,a-z0-9%&?;=~]*\))?)', re.I), # This is conservative, but autolinking can be a bit conservative: re.compile(r'mailto:(?P<body>[a-z0-9._-]+@(?P<host>[a-z0-9_._]+[a-z]))', re.I), ] _avoid_elements = ['textarea', 'pre', 'code', 'head', 'select', 'a'] _avoid_hosts = [ re.compile(r'^localhost', re.I), re.compile(r'\bexample\.(?:com|org|net)$', re.I), re.compile(r'^127\.0\.0\.1$'), ] _avoid_classes = ['nolink'] def autolink(el, link_regexes=_link_regexes, avoid_elements=_avoid_elements, avoid_hosts=_avoid_hosts, avoid_classes=_avoid_classes): """ Turn any URLs into links. It will search for links identified by the given regular expressions (by default mailto and http(s) links). It won't link text in an element in avoid_elements, or an element with a class in avoid_classes. It won't link to anything with a host that matches one of the regular expressions in avoid_hosts (default localhost and 127.0.0.1). If you pass in an element, the element's tail will not be substituted, only the contents of the element. """ if el.tag in avoid_elements: return class_name = el.get('class') if class_name: class_name = class_name.split() for match_class in avoid_classes: if match_class in class_name: return for child in list(el): autolink(child, link_regexes=link_regexes, avoid_elements=avoid_elements, avoid_hosts=avoid_hosts, avoid_classes=avoid_classes) if child.tail: text, tail_children = _link_text( child.tail, link_regexes, avoid_hosts, factory=el.makeelement) if tail_children: child.tail = text index = el.index(child) el[index+1:index+1] = tail_children if el.text: text, pre_children = _link_text( el.text, link_regexes, avoid_hosts, factory=el.makeelement) if pre_children: el.text = text el[:0] = pre_children def _link_text(text, link_regexes, avoid_hosts, factory): leading_text = '' links = [] last_pos = 0 while 1: best_match, best_pos = None, None for regex in link_regexes: regex_pos = last_pos while 1: match = regex.search(text, pos=regex_pos) if match is None: break host = match.group('host') for host_regex in avoid_hosts: if host_regex.search(host): regex_pos = match.end() break else: break if match is None: continue if best_pos is None or match.start() < best_pos: best_match = match best_pos = match.start() if best_match is None: # No more matches if links: assert not links[-1].tail links[-1].tail = text else: assert not leading_text leading_text = text break link = best_match.group(0) end = best_match.end() if link.endswith('.') or link.endswith(','): # These punctuation marks shouldn't end a link end -= 1 link = link[:-1] prev_text = text[:best_match.start()] if links: assert not links[-1].tail links[-1].tail = prev_text else: assert not leading_text leading_text = prev_text anchor = factory('a') anchor.set('href', link) body = best_match.group('body') if not body: body = link if body.endswith('.') or body.endswith(','): body = body[:-1] anchor.text = body links.append(anchor) text = text[end:] return leading_text, links def autolink_html(html, *args, **kw): result_type = type(html) if isinstance(html, basestring): doc = fromstring(html) else: doc = copy.deepcopy(html) autolink(doc, *args, **kw) return _transform_result(result_type, doc) autolink_html.__doc__ = autolink.__doc__ ############################################################ ## Word wrapping ############################################################ _avoid_word_break_elements = ['pre', 'textarea', 'code'] _avoid_word_break_classes = ['nobreak'] def word_break(el, max_width=40, avoid_elements=_avoid_word_break_elements, avoid_classes=_avoid_word_break_classes, break_character=unichr(0x200b)): """ Breaks any long words found in the body of the text (not attributes). Doesn't effect any of the tags in avoid_elements, by default ``<textarea>`` and ``<pre>`` Breaks words by inserting &#8203;, which is a unicode character for Zero Width Space character. This generally takes up no space in rendering, but does copy as a space, and in monospace contexts usually takes up space. See http://www.cs.tut.fi/~jkorpela/html/nobr.html for a discussion """ # Character suggestion of &#8203 comes from: # http://www.cs.tut.fi/~jkorpela/html/nobr.html if el.tag in _avoid_word_break_elements: return class_name = el.get('class') if class_name: dont_break = False class_name = class_name.split() for avoid in avoid_classes: if avoid in class_name: dont_break = True break if dont_break: return if el.text: el.text = _break_text(el.text, max_width, break_character) for child in el: word_break(child, max_width=max_width, avoid_elements=avoid_elements, avoid_classes=avoid_classes, break_character=break_character) if child.tail: child.tail = _break_text(child.tail, max_width, break_character) def word_break_html(html, *args, **kw): result_type = type(html) doc = fromstring(html) word_break(doc, *args, **kw) return _transform_result(result_type, doc) def _break_text(text, max_width, break_character): words = text.split() for word in words: if len(word) > max_width: replacement = _insert_break(word, max_width, break_character) text = text.replace(word, replacement) return text _break_prefer_re = re.compile(r'[^a-z]', re.I) def _insert_break(word, width, break_character): orig_word = word result = '' while len(word) > width: start = word[:width] breaks = list(_break_prefer_re.finditer(start)) if breaks: last_break = breaks[-1] # Only walk back up to 10 characters to find a nice break: if last_break.end() > width-10: # FIXME: should the break character be at the end of the # chunk, or the beginning of the next chunk? start = word[:last_break.end()] result += start + break_character word = word[len(start):] result += word return result
[ "tallevy@usc.edu" ]
tallevy@usc.edu
2e746a05f694bd11df7583c791fd56c5a10f3472
cc9493d2bedbd051be026d300379243b7567b188
/venv/Scripts/pip3-script.py
20fe2d72a36c510951a477cdea7a796c6335bfa9
[]
no_license
yenyen5566/selenium
dc65e34a48b3c1dc9ae2cf07ecf7144c0614cdb2
dcfdffb672879f6e4b5d997a0360fd0eca0993a9
refs/heads/master
2022-12-13T03:40:55.799151
2019-05-29T01:57:44
2019-05-29T02:21:05
188,998,777
0
0
null
2022-12-08T05:11:05
2019-05-28T09:35:45
Python
UTF-8
Python
false
false
418
py
#!C:\Users\edwardyen\PycharmProjects\selenium\venv\Scripts\python.exe # EASY-INSTALL-ENTRY-SCRIPT: 'pip==19.0.3','console_scripts','pip3' __requires__ = 'pip==19.0.3' import re import sys from pkg_resources import load_entry_point if __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) sys.exit( load_entry_point('pip==19.0.3', 'console_scripts', 'pip3')() )
[ "edward18325@gmail.com" ]
edward18325@gmail.com
fde8f7637af1083e389908304d5f527598d3171b
d349bd90a5325f42c77e884e60078f5220565a71
/waterlinked_gps/scripts/math_helpers.py
e9fde0946a557eedd84dc2f9aaa1e8b0b881d86d
[ "Apache-2.0" ]
permissive
FletcherFT/bluerov2
54a3507652dbfc53e5a694b32813188d2bf05d71
c416fc8530aac2b0ac52626001308d780347d639
refs/heads/master
2021-06-21T08:53:07.095082
2021-05-17T11:39:28
2021-05-17T11:39:28
211,705,368
10
7
null
2019-09-29T18:11:45
2019-09-29T18:11:44
null
UTF-8
Python
false
false
222
py
from math import * def sind(x): return sin(x*pi / 180.0) def cosd(x): return cos(x*pi/180.0) def tand(x): return tan(x*pi/180.0) def deg2rad(x): return x*pi/180.0 def rad2deg(x): return x*180.0/pi
[ "fletcherthompsonx@gmail.com" ]
fletcherthompsonx@gmail.com
ba1956f67fab73f122a5b6ff81d0096134b45646
7c1b0dafe601c3c8fa3c2cc3cf02698eee87577f
/python_code/deep_neural_networks_for_youtube_recommendations/tfrecords_methods/read_sparse_tfrecords_1.py
3ead6b86185dbd0afc6dc49d19e15a9b4cdc279d
[]
no_license
Cedarmo/deep_neural_networks_for_youtube_recommendations
8e52939d648b15b1d21a34b753390d9985608564
fe312fd54b8783a82e792b32f0f57998f0296a01
refs/heads/master
2020-09-25T23:57:38.382406
2020-04-14T11:58:07
2020-04-14T11:58:07
255,596,249
7
0
null
null
null
null
UTF-8
Python
false
false
1,551
py
import tensorflow as tf def parse_fn(example): example_fmt = { "embedding_average": tf.FixedLenFeature([8], tf.float32), "index": tf.FixedLenFeature([], tf.int64), "value": tf.FixedLenFeature([], tf.float32), "size": tf.FixedLenFeature([], tf.int64) } parsed = tf.parse_single_example(example, example_fmt) sparse_tensor = tf.SparseTensor([[parsed["index"]]], [parsed["value"]], [parsed["size"]]) # 这种方法读取稀疏向量在有的平台可能不行 return parsed["embedding_average"], tf.sparse_tensor_to_dense(sparse_tensor) if __name__ == "__main__": files = tf.data.Dataset.list_files('D:\Pycharm\PycharmProjects\deep_neural_networks_for_youtube_recommendations\\tfrecords_methods\\tfrecords\data1.tfrecords', shuffle=True) data_set = files.apply( tf.contrib.data.parallel_interleave( lambda filename: tf.data.TFRecordDataset(filename), cycle_length=15)) data_set = data_set.repeat(1) data_set = data_set.map(map_func=parse_fn, num_parallel_calls=15) data_set = data_set.prefetch(buffer_size=30) data_set = data_set.batch(batch_size=15) iterator = data_set.make_one_shot_iterator() embedding, one_hot = iterator.get_next() with tf.Session() as sess: for i in range(5): embedding_result, one_hot_result = sess.run([embedding, one_hot]) print("第{}批:".format(i), end=" ") print("embedding是:", embedding_result, end=" ") print("one_hot是:", one_hot_result)
[ "yqisong1992@163.com" ]
yqisong1992@163.com
8ddd6776163ac3e893faaeb8720ebbbd8050f11d
eddd9d863af372398a880ee8c655163fc08f5cc3
/myproject/myproject/settings.py
8ce57115deb1bc604a6373423ab48eed1b3f4a80
[]
no_license
architvashist/testing
3f2fceb9cbd21db8b82ca9e4caf22ed77cdf7c86
1b5e0235f46a0639fb0eb2565e5f67de10a853cf
refs/heads/master
2022-12-04T12:28:39.678054
2020-08-28T20:01:35
2020-08-28T20:01:35
291,131,817
0
0
null
null
null
null
UTF-8
Python
false
false
3,097
py
""" Django settings for myproject project. Generated by 'django-admin startproject' using Django 3.1. For more information on this file, see https://docs.djangoproject.com/en/3.1/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/3.1/ref/settings/ """ from pathlib import Path # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = Path(__file__).resolve(strict=True).parent.parent # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = 'm7*@zifym)=$od@oeg2)b5^a&we6ud1y=hwh*+7tvv4s3o*r_=' # 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', 'first_app', ] 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', ] ROOT_URLCONF = 'myproject.urls' TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [], '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', ], }, }, ] WSGI_APPLICATION = 'myproject.wsgi.application' # Database # https://docs.djangoproject.com/en/3.1/ref/settings/#databases DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': BASE_DIR / 'db.sqlite3', } } # Password validation # https://docs.djangoproject.com/en/3.1/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.1/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.1/howto/static-files/ STATIC_URL = '/static/'
[ "architvashist@live.in" ]
architvashist@live.in
baa70b530ef1e1da07fc29dfb1682599e5324464
a4968baf57946133fadc507809194de0c98d8635
/if_gpio_led3.py
e32e1308aba591d7c612c560944f84f97192d407
[]
no_license
UedaTakeyuki/slider
7f997790cbe5e494b0375f899fa0a93f84cadd14
59c90b65a343d8e26ef55062d7182ffb7a12c819
refs/heads/master
2020-04-10T22:43:17.049369
2018-09-04T02:11:22
2018-09-04T02:11:22
62,211,902
6
0
null
null
null
null
UTF-8
Python
false
false
1,150
py
# coding:utf-8 Copy Right Atelier Grenouille © 2015 - import subprocess import importlib import led import traceback import sys import getrpimodel # RPi 3 は LED1(赤LED)を操作できない pi3 = True if getrpimodel.model() == "3 Model B" else False l = led.LED() l.use(0) # green pi3 or l.use(1) # red l.off(0) pi3 or l.off(1) l_status = False def get_gpio(): p = subprocess.call(gpio_str, stdout=subprocess.PIPE, shell=True) return p.stdout.readline().strip() def wait(pin): global l while True: try: print "waiting..." gpio_str = 'gpio wfi '+str(pin)+ ' rising' p = subprocess.call(gpio_str, shell=True) l.on(0) pi3 or l.on(1) print "on" gpio_str = 'gpio wfi '+str(pin)+ ' falling' p = subprocess.call(gpio_str, shell=True) l.off(0) pi3 or l.off(1) print "off" except: info=sys.exc_info() print "Unexpected error:"+ traceback.format_exc(info[0]) print traceback.format_exc(info[1]) print traceback.format_exc(info[2]) if __name__ == '__main__': pin = 23 if (len(sys.argv) == 2): pin = int(sys.argv[1]) print wait(pin)
[ "ueda@latelierdueda.com" ]
ueda@latelierdueda.com
c724f9e60544ef5b2e831d6eb3592bd5b2079db6
972c9f77851d6adc155b07361a9abae6491a659c
/highlighter.py
afe628ca18bbb1759610d74db5488d88eeb9ab4d
[]
no_license
sameer55chauhan/text_editor
e7bf3f9a3a4eb692e33195233eb176cc9660a239
9d05c7df6bdaf20a75ec520f3231a95abf288272
refs/heads/master
2021-01-01T02:34:35.176072
2020-02-08T15:04:12
2020-02-08T15:04:12
239,143,090
0
0
null
null
null
null
UTF-8
Python
false
false
4,281
py
import tkinter as tk import yaml class Highlighter: def __init__(self, text_widget, syntax_file): self.text_widget = text_widget self.syntax_file = syntax_file # self.categories = None self.numbers_color = 'blue' self.strings_color = 'red' self.keywords = ['True', 'False', 'def', 'for', 'while', 'import', 'if', 'else', 'elif'] self.disallowed_previous_chars = ['_', '-', '.'] self.parse_syntax_file() self.text_widget.bind('<KeyRelease>', self.on_key_release) # self.tag_configure('keyword', foreground=self.keyword_color) # self.tag_configure('number', foregound=self.numbers_color) # self.text_widget.bind('<KeyRelease>', self.on_key_release) def on_key_release(self, event=None): self.highlight() def highlight(self, event=None): length = tk.IntVar() for category in self.categories: matches = self.categories[category]['matches'] for keyword in matches: start = 1.0 keyword = keyword + '[^A-Za-z_-]' idx = self.text_widget.search(keyword, start, stopindex=tk.END, count=length, regexp=1) while idx: char_match_found = int(str(idx).split('.')[1]) line_match_found = int(str(idx).split('.')[0]) if char_match_found > 0: previous_char_index = str(line_match_found) + '.' + str(char_match_found - 1) previous_char = self.text_widget.get(previous_char_index, previous_char_index + '+1c') if previous_char.isalnum() or previous_char in self.disallowed_previous_chars: end = f'{idx}+{length.get() - 1}c' start = end idx = self.text_widget.search(keyword, start, stopindex=tk.END, regexp=1) else: end = f'{idx}+{length.get() - 1}c' self.text_widget.tag_add(category, idx, end) start = end idx = self.text_widget.search(keyword, start, stopindex=tk.END, regexp=1) else: end = f'{idx}+{length.get() - 1}c' self.text_widget.tag_add(category, idx, end) start = end idx = self.text_widget.search(keyword, start, stopindex=tk.END, regexp=1) self.highlight_regex(r'(\d)+[.]?(\d)*', 'number') self.highlight_regex(r'[\'][^\']*[\']', 'string') self.highlight_regex(r'[\"][^\']*[\"]', 'string') def highlight_regex(self, regex, tag): length = tk.IntVar() start = 1.0 idx = self.text_widget.search(regex, start, stopindex=tk.END, regexp=1, count=length) while idx: end = f'{idx}+{length.get()}c' self.text_widget.tag_add(tag, idx, end) start = end idx = self.text_widget.search(regex, start, stopindex=tk.END, regexp=1, count=length) def parse_syntax_file(self): with open(self.syntax_file, 'r') as stream: try: config = yaml.load(stream) # print(config) except yaml.YAMLError as e: print(e) return self.categories = config['categories'] self.numbers_color = config['numbers']['color'] self.strings_color = config['strings']['color'] self.configure_tags() def configure_tags(self): for category in self.categories.keys(): color = self.categories[category]['color'] self.text_widget.tag_configure(category, foreground=color) self.text_widget.tag_configure('number', foreground=self.numbers_color) self.text_widget.tag_configure('string', foreground=self.strings_color) def force_highlight(self): self.highlight() def clear_highlight(self): for category in self.categories: self.text_widget.tag_remove(category, 1.0, tk.END) if __name__ == '__main__': w = tk.Tk() t = tk.Text(w) h = Highlighter(t, 'languages/python.yaml') w.mainloop()
[ "noreply@github.com" ]
noreply@github.com
84581f935a5eec53e4a6d85fa7ab76d43afe30a6
985793649de3cb282fbce83fec3fb941b47226bf
/Software/Preliminary code/LX-16A/lx_setup.py
1754b0aee9309d6978b76e73c3f86b5d9c270a02
[ "MIT" ]
permissive
sichunx10/OpenDoggo
00969cb2d7a3712ffefd5a703d987cb334081bee
6b0057d2423b28561407e8828e82cb9f509d0352
refs/heads/main
2023-04-24T03:59:33.022573
2021-05-15T19:40:36
2021-05-15T19:40:36
367,697,964
0
0
null
null
null
null
UTF-8
Python
false
false
1,806
py
import sys, time import serial import lewansoul_lx16a #SERIAL_PORT = '/dev/ttyUSB0' # For Linux SERIAL_PORT = 'COM8' # For Windows (find port in Device Manager -> Ports) ctrl = lewansoul_lx16a.ServoController( serial.Serial(SERIAL_PORT, 115200, timeout=1), ) def servo_info(id): print("Servo id: {}".format(id)) print("Position: {}".format(ctrl.get_position(id))) print("Temperature: {}".format(ctrl.get_temperature(id))) if __name__ == '__main__': args = sys.argv[1:] args_num = len(args) if args_num == 0: try: id = ctrl.get_servo_id() if id != 255: servo_info(id) except: print('Error!') elif args[0] == 'info': servo_info(int(args[1])) elif args[0] == 'assign' and args_num == 3: ctrl.set_servo_id(int(args[1]), int(args[2])) elif args[0] == 'test' and args_num == 2: id = int(args[1]) ctrl.move(id, 0, 500) time.sleep(1) ctrl.move(id, 1000, 500) time.sleep(1) ctrl.move(id, 500, 500) elif args[0] == 'set_pos' and args_num == 3: ctrl.move(int(args[1]), int(args[2]), 500) elif args[0] == 'reset' and args_num == 2: id = int(args[1]) ctrl.set_servo_id(id, 1) ctrl.set_position_offset(id, 0) ctrl.save_position_offset(id) elif args[0] == 'scan': print("Found servo ids:") for i in range(1, 255): try: ctrl.get_position(i, 0.01) print(i) except: pass else: print("\ Usage:\n\ python lx_setup.py info 1\n\ python lx_setup.py assign 1 10\n\ python lx_setup.py test 1\n\ python lx_setup.py set_pos 1 500\n\ python lx_setup.py reset 1\n\ python lx_setup.py scan\n")
[ "sichunx10@users.noreply.github.com" ]
sichunx10@users.noreply.github.com
cf49845dcba0d0b385f3319bce27828d59e5b7fc
3a0c0b876b0e91edd96d82cf957ac167d28e9f5a
/game_env/Battleroom.py
ed952e4ecb5c9cb5af53e34439a65b2e1b344d7e
[]
no_license
JayDBee/HackOR-Project
5e5d88947f6cc49aca7cdeec046e4a7c33bf22ab
4be02ebe3811de6b00253260ce69072ef46b8aff
refs/heads/main
2023-03-31T00:40:06.667093
2021-03-28T20:44:15
2021-03-28T20:44:15
351,891,943
1
0
null
null
null
null
UTF-8
Python
false
false
1,186
py
import Objects_and_stuff import pygame from pygame.locals import ( K_UP, K_DOWN, K_LEFT, K_RIGHT, K_ESCAPE, K_z, K_x, ) running = True screen = pygame.display.set_mode((Objects_and_stuff.main_room.length, Objects_and_stuff.main_room.width)) select = 0 HP = 100 EHP = 100 while running: screen.fill((Objects_and_stuff.main_room.r, Objects_and_stuff.main_room.g, Objects_and_stuff.main_room.b)) for event in pygame.event.get(): if event.type == pygame.QUIT: running = False if event.type == pygame.KEYDOWN: if select <= 2: if event.key == K_LEFT: select = select + 1 elif select >= 0: if event.key == K_RIGHT: select = select - 1 elif event.key == K_x: if select == 0: print("you got away") elif select == 1: HP = HP + 10 HP = HP - 5 print("you were healed") elif select == 2: EHP = EHP - 20 HP = HP - 10 print("Attack!")
[ "79239855+JayDBee@users.noreply.github.com" ]
79239855+JayDBee@users.noreply.github.com
2ba8af9a37d1b2976828cea090385da648a31a6a
45cb74f15ebf96b431e5689e554fcdc42062ee08
/4-magnet_particles/solution.py
2c864f0e918fe8e2abfb2ca11901b3067432a85e
[]
no_license
acu192/codewars
d296bc95fd067f0059045494fc445f62f95c060a
905c5397461976335dbcf6a5bb0ffb6b359a29c0
refs/heads/master
2021-01-23T03:52:58.009582
2017-08-04T05:03:06
2017-08-04T05:03:06
86,128,943
0
0
null
null
null
null
UTF-8
Python
false
false
746
py
""" https://www.codewars.com/kata/magnet-particules-in-boxes """ from math import pow def doubles(maxk, maxn): return sum(sum(pow(n+1, -2*k) for n in range(1, maxn+1))/k for k in range(1, maxk+1)) def assertFuzzyEquals(actual, expected, msg=""): merr = 1e-6 inrange = abs(actual - expected) <= merr if (inrange == False): msg = "At 1e-6: Expected value must be {:0.6f} but got {:0.6f}" msg = msg.format(expected, actual) return msg return True print assertFuzzyEquals(doubles(1, 10), 0.5580321939764581) print assertFuzzyEquals(doubles(10, 1000), 0.6921486500921933) print assertFuzzyEquals(doubles(10, 10000), 0.6930471674194457) print assertFuzzyEquals(doubles(20, 10000), 0.6930471955575918)
[ "ryan@rhobota.com" ]
ryan@rhobota.com
e78649e5c08756d7f0bd2c588219d7302dd0f4e2
df716b2868b289a7e264f8d2b0ded52fff38d7fc
/plaso/parsers/sqlite_plugins/safari.py
22bb6098cb41d93825e091cb3aafa5f5caee31fd
[ "Apache-2.0" ]
permissive
ir4n6/plaso
7dd3cebb92de53cc4866ae650d41c255027cf80a
010f9cbdfc82e21ed6658657fd09a7b44115c464
refs/heads/master
2021-04-25T05:50:45.963652
2018-03-08T15:11:58
2018-03-08T15:11:58
122,255,666
0
0
Apache-2.0
2018-02-20T21:00:50
2018-02-20T21:00:50
null
UTF-8
Python
false
false
5,409
py
# -*- coding: utf-8 -*- """Parser for the Safari History files. The Safari History is stored in SQLite database files named History.db """ from __future__ import unicode_literals from dfdatetime import cocoa_time as dfdatetime_cocoa_time from plaso.containers import events from plaso.containers import time_events from plaso.lib import definitions from plaso.parsers import sqlite from plaso.parsers.sqlite_plugins import interface class SafariHistoryPageVisitedEventData(events.EventData): """Safari history event data. Attributes: title (str): title of the webpage visited. url (str): URL visited. host(str): hostname of the server. visit_count (int): number of times the website was visited. was_http_non_get (bool): True if the webpage was visited using a non-GET HTTP request. """ DATA_TYPE = 'safari:history:visit_sqlite' def __init__(self): """Initializes event data.""" super(SafariHistoryPageVisitedEventData, self).__init__(data_type=self.DATA_TYPE) self.title = None self.url = None self.visit_count = None self.host = None self.was_http_non_get = None self.visit_redirect_source = None class SafariHistoryPluginSqlite(interface.SQLitePlugin): """Parse Safari History Files. Safari history file is stored in a SQLite database file named History.db """ NAME = 'safari_history' DESCRIPTION = 'Parser for Safari history SQLite database files.' QUERIES = [ (('SELECT history_items.id, history_items.url, history_items.visit' '_count, history_visits.id AS visit_id, history_visits.history_item,' 'history_visits.visit_time, history_visits.redirect_destination, ' 'history_visits.title, history_visits.http_non_get, ' 'history_visits.redirect_source ' 'FROM history_items, history_visits ' 'WHERE history_items.id = history_visits.history_item ' 'ORDER BY history_visits.visit_time'), 'ParsePageVisitRow') ] REQUIRED_TABLES = frozenset(['history_items', 'history_visits']) SCHEMAS = [{ 'history_client_versions': ( 'CREATE TABLE history_client_versions (client_version INTEGER ' 'PRIMARY KEY,last_seen REAL NOT NULL)'), 'history_event_listeners': ( 'CREATE TABLE history_event_listeners (listener_name TEXT PRIMARY ' 'KEY NOT NULL UNIQUE,last_seen REAL NOT NULL)'), 'history_events': ( 'CREATE TABLE history_events (id INTEGER PRIMARY KEY ' 'AUTOINCREMENT,event_type TEXT NOT NULL,event_time REAL NOT ' 'NULL,pending_listeners TEXT NOT NULL,value BLOB)'), 'history_items': ( 'CREATE TABLE history_items (id INTEGER PRIMARY KEY ' 'AUTOINCREMENT,url TEXT NOT NULL UNIQUE,domain_expansion TEXT ' 'NULL,visit_count INTEGER NOT NULL,daily_visit_counts BLOB NOT ' 'NULL,weekly_visit_counts BLOB NULL,autocomplete_triggers BLOB ' 'NULL,should_recompute_derived_visit_counts INTEGER NOT ' 'NULL,visit_count_score INTEGER NOT NULL)'), 'history_tombstones': ( 'CREATE TABLE history_tombstones (id INTEGER PRIMARY KEY ' 'AUTOINCREMENT,start_time REAL NOT NULL,end_time REAL NOT NULL,url ' 'TEXT,generation INTEGER NOT NULL DEFAULT 0)'), 'history_visits': ( 'CREATE TABLE history_visits (id INTEGER PRIMARY KEY ' 'AUTOINCREMENT,history_item INTEGER NOT NULL REFERENCES ' 'history_items(id) ON DELETE CASCADE,visit_time REAL NOT NULL,title ' 'TEXT NULL,load_successful BOOLEAN NOT NULL DEFAULT 1,http_non_get ' 'BOOLEAN NOT NULL DEFAULT 0,synthesized BOOLEAN NOT NULL DEFAULT ' '0,redirect_source INTEGER NULL UNIQUE REFERENCES ' 'history_visits(id) ON DELETE CASCADE,redirect_destination INTEGER ' 'NULL UNIQUE REFERENCES history_visits(id) ON DELETE CASCADE,origin ' 'INTEGER NOT NULL DEFAULT 0,generation INTEGER NOT NULL DEFAULT ' '0,attributes INTEGER NOT NULL DEFAULT 0,score INTEGER NOT NULL ' 'DEFAULT 0)'), 'metadata': ( 'CREATE TABLE metadata (key TEXT NOT NULL UNIQUE, value)')}] def ParsePageVisitRow(self, parser_mediator, query, row, **unused_kwargs): """Parses a visited row. Args: parser_mediator (ParserMediator): mediates interactions between parsers and other components, such as storage and dfvfs. query (str): query that created the row. row (sqlite3.Row): row. """ query_hash = hash(query) was_http_non_get = self._GetRowValue(query_hash, row, 'http_non_get') event_data = SafariHistoryPageVisitedEventData() event_data.offset = self._GetRowValue(query_hash, row, 'id') event_data.query = query event_data.title = self._GetRowValue(query_hash, row, 'title') event_data.url = self._GetRowValue(query_hash, row, 'url') event_data.visit_count = self._GetRowValue(query_hash, row, 'visit_count') event_data.was_http_non_get = bool(was_http_non_get) timestamp = self._GetRowValue(query_hash, row, 'visit_time') date_time = dfdatetime_cocoa_time.CocoaTime(timestamp=timestamp) event = time_events.DateTimeValuesEvent( date_time, definitions.TIME_DESCRIPTION_LAST_VISITED) parser_mediator.ProduceEventWithEventData(event, event_data) sqlite.SQLiteParser.RegisterPlugin(SafariHistoryPluginSqlite)
[ "onager@deerpie.com" ]
onager@deerpie.com
2af7b855a643821f4ddf03bac9ca90fe10ce3dbc
868615e1bd9d5025a10666c0464f863451ef574a
/pyladies_django_workshop/settings.py
8dea85857aa59719674160234fe9a93441959a99
[]
no_license
nbozoglu/pyladies-django-workshop
828ada4c40308d764c6af293a5e406fc1533c9f0
e61f716b8cb9a7c49431765accd2b4e920ba57b4
refs/heads/master
2021-01-15T20:38:29.687555
2015-03-17T19:28:09
2015-03-17T22:08:20
null
0
0
null
null
null
null
UTF-8
Python
false
false
3,214
py
""" Django settings for pyladies_django_workshop project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) import os BASE_DIR = os.path.dirname(os.path.dirname(__file__)) # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = 'u-i^q400q!_q)93w+mt(8!9%h64_*lntc%1lo5&kfdzopf2ns!' # SECURITY WARNING: don't run with debug turned on in production! DEBUG = os.environ.get('DEBUG', True) TEMPLATE_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', 'debug_toolbar', 'rest_framework', 'compressor', ) MIDDLEWARE_CLASSES = ( 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', ) ROOT_URLCONF = 'pyladies_django_workshop.urls' WSGI_APPLICATION = 'pyladies_django_workshop.wsgi.application' # Database # https://docs.djangoproject.com/en/1.6/ref/settings/#databases import dj_database_url DATABASES = { 'default': dj_database_url.config( default='sqlite:///' + os.path.join(BASE_DIR, 'db.sqlite3') ) } # Internationalization # https://docs.djangoproject.com/en/1.6/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/1.6/howto/static-files/ STATIC_URL = '/static/' STATIC_ROOT = 'staticfiles' STATICFILES_DIRS = ( os.path.join(BASE_DIR, 'static'), ) STATICFILES_FINDERS = ( 'django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder', 'compressor.finders.CompressorFinder', ) COMPRESS_ENABLED = os.environ.get('COMPRESS_ENABLED', False) TEMPLATE_DIRS = ( os.path.join(BASE_DIR, 'templates'), ) REST_FRAMEWORK = { 'DEFAULT_AUTHENTICATION_CLASSES': ( 'rest_framework.authentication.SessionAuthentication', ), 'DEFAULT_RENDERER_CLASSES': ( 'rest_framework.renderers.BrowsableAPIRenderer', 'rest_framework.renderers.TemplateHTMLRenderer', 'rest_framework.renderers.JSONRenderer', ) } # Honor the 'X-Forwarded-Proto' header for request.is_secure() SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https') # Allow all host headers ALLOWED_HOSTS = ['*'] DEBUG_TOOLBAR_CONFIG = { 'SHOW_TOOLBAR': False, 'INSERT_BEFORE': '<!-- Debug Toolbar -->', }
[ "eleyine@gmail.com" ]
eleyine@gmail.com
aa31d2274c9ea171da4620dea8d4819399fee092
8c834212f9b74489afe0eae38513d209aac3f904
/uchicagoldrclientmodules/ldr_staging_stagingHash.py
d6cb4f4c671621cfb435066d45a7184318e21ea6
[]
no_license
uchicago-library/uchicagoldr-client-bin
ddf68d0873d4eac7c8a374a4460ef762a0a24e07
136062782ac7df03fb6bf122941950c2d52d11f9
refs/heads/master
2021-01-10T02:03:38.831625
2015-12-15T02:24:29
2015-12-15T02:24:29
48,051,820
0
0
null
null
null
null
UTF-8
Python
false
false
7,506
py
#!/usr/bin/python3 # Default package imports begin # from argparse import ArgumentParser from os import _exit from os.path import split, exists, join # Default package imports end # # Third party package imports begin # # Third party package imports end # # Local package imports begin # from uchicagoldrLogging.loggers import MasterLogger from uchicagoldrLogging.handlers import DefaultTermHandler, DebugTermHandler, \ DefaultFileHandler, DebugFileHandler, DefaultTermHandlerAtLevel,\ DefaultFileHandlerAtLevel from uchicagoldrLogging.filters import UserAndIPFilter from uchicagoldr.batch import Batch from uchicagoldrStaging.validation.validateBase import ValidateBase from uchicagoldrStaging.population.readExistingFixityLog import \ ReadExistingFixityLog from uchicagoldrStaging.population.writeFixityLog import WriteFixityLog # Local package imports end # # Header info begins # __author__ = "Brian Balsamo" __copyright__ = "Copyright 2015, The University of Chicago" __version__ = "0.0.2" __maintainer__ = "Brian Balsamo" __email__ = "balsamo@uchicago.edu" __status__ = "Development" # Header info ends # """ This module generates fixity information for files being moved into staging. It generates fixity information as the files appear in library disk-space. """ # Functions begin # # Functions end # def main(): # Master log instantiation begins # global masterLog masterLog = MasterLogger() # Master log instantiation ends # # Application specific log instantation begins # global logger logger = masterLog.getChild(__name__) f = UserAndIPFilter() termHandler = DefaultTermHandler() logger.addHandler(termHandler) logger.addFilter(f) # Application specific log instantation ends # # Parser instantiation begins # parser = ArgumentParser(description="[A brief description of the utility]", epilog="Copyright University of Chicago; " + "written by "+__author__ + " "+__email__) parser.add_argument("-v", help="See the version of this program", action="version", version=__version__) # let the user decide the verbosity level of logging statements # -b sets it to INFO so warnings, errors and generic informative statements # will be logged parser.add_argument( '-b', '--verbosity', help="set logging verbosity " + "(DEBUG,INFO,WARN,ERROR,CRITICAL)", nargs='?', const='INFO' ) # -d is debugging so anything you want to use a debugger gets logged if you # use this level parser.add_argument( '-d', '--debugging', help="set debugging logging", action='store_true' ) # optionally save the log to a file. # Set a location or use the default constant parser.add_argument( '-l', '--log_loc', help="save logging to a file", dest="log_loc", ) parser.add_argument( "dest_root", help="Enter the destination root path", action='store' ) parser.add_argument( "containing_folder", help="The name of the containing folder on disk " + "(prefix+number)", action='store' ) parser.add_argument( "--rehash", help="Disregard any existing previously generated " + "hashes, recreate them on this run", action="store_true" ) try: args = parser.parse_args() except SystemExit: logger.critical("ENDS: Command line argument parsing failed.") exit(1) # Begin argument post processing, if required # if args.verbosity and args.verbosity not in ['DEBUG', 'INFO', 'WARN', 'ERROR', 'CRITICAL']: logger.critical("You did not pass a valid argument to the verbosity \ flag! Valid arguments include: \ 'DEBUG','INFO','WARN','ERROR', and 'CRITICAL'") return(1) if args.log_loc: if not exists(split(args.log_loc)[0]): logger.critical("The specified log location does not exist!") return(1) # End argument post processing # # Begin user specified log instantiation, if required # if args.log_loc: fileHandler = DefaultFileHandler(args.log_loc) logger.addHandler(fileHandler) if args.verbosity: logger.removeHandler(termHandler) termHandler = DefaultTermHandlerAtLevel(args.verbosity) logger.addHandler(termHandler) if args.log_loc: logger.removeHandler(fileHandler) fileHandler = DefaultFileHandlerAtLevel(args.log_loc, args.verbosity) logger.addHandler(fileHandler) if args.debugging: logger.removeHandler(termHandler) termHandler = DebugTermHandler() logger.addHandler(termHandler) if args.log_loc: logger.removeHandler(fileHandler) fileHandler = DebugFileHandler(args.log_loc) logger.addHandler(fileHandler) # End user specified log instantiation # try: logger.info("BEGINS") # Begin module code # validation = ValidateBase(args.dest_root) if validation[0] == True: stageRoot = join(*validation[1:]) else: logger.critical("ENDS: Your staging root appears to not be valid!") exit(1) destinationAdminRoot = join(stageRoot, 'admin/') destinationDataRoot = join(stageRoot, 'data/') containing_folder = args.containing_folder destinationAdminFolder = join(destinationAdminRoot, containing_folder) destinationDataFolder = join(destinationDataRoot, containing_folder) stagingDebugLog = DebugFileHandler( join(destinationAdminFolder, 'log.txt') ) logger.addHandler(stagingDebugLog) logger.debug("Creating batch from moved files.") movedFiles = Batch(destinationDataFolder, directory=destinationDataFolder) logger.info("Hashing copied files.") existingHashes = None if args.rehash: logger.info( "Rehash argument passed. Not reading existing hashes." ) if not args.rehash and exists( join(destinationAdminFolder, 'fixityOnDisk.txt') ): existingHashes = ReadExistingFixityLog(join(destinationAdminFolder, 'fixityOnDisk.txt') ) WriteFixityLog( join(destinationAdminFolder, 'fixityOnDisk.txt'), movedFiles, existingHashes=existingHashes ) # End module code # logger.info("ENDS: COMPLETE") return 0 except KeyboardInterrupt: logger.error("ENDS: Program aborted manually") return 131 except Exception as e: logger.critical("ENDS: Exception ("+str(e)+")") return 1 if __name__ == "__main__": _exit(main())
[ "tdanstrom@uchicago.edu" ]
tdanstrom@uchicago.edu
80408feb60b9231d806b7c2eca95f935cdfb4a57
a4fcf1dc0f9e59e650e3463efc4551abbcf1003b
/type.py
cf183ba892d5dacea746a4cc7a167fe8a40773c4
[]
no_license
tomoya-1010/python-training
14e5c1f530359d3f942df93d46fd4dd9223396fd
3eb91bde69e8751a75b65c8ad36865625ca20169
refs/heads/master
2023-07-04T13:08:40.604841
2021-08-08T15:07:46
2021-08-08T15:07:46
365,253,109
0
0
null
null
null
null
UTF-8
Python
false
false
892
py
#type関数は引数で指定したオブジェクトのクラスを返す。 class Sample (): pass s = Sample() s_type = type(s) print(s_type) class Sample1(): """ 適当なクラス """ pass class Sample2(Sample1): """ Sample1を親とするクラス """ pass obj1 = Sample1() # Sample1型のオブジェクトを生成する obj2 = Sample2() # Sample2型のオブジェクトを生成する # Typeを使用した場合、Sample2型はSample1型とはみなされない print(type(obj1) == Sample1) # True print(type(obj1) == Sample2) # False print(type(obj2) == Sample1) # False print(type(obj2) == Sample2) # True # isinstanceを使用した場合、Sample2型はSample1型とみなされる print(isinstance(obj1, Sample1)) # True print(isinstance(obj1, Sample2)) # False print(isinstance(obj2, Sample1)) # True print(isinstance(obj2, Sample2)) # True
[ "tomoya.nakayama.ph@gmail.com" ]
tomoya.nakayama.ph@gmail.com
5ba7735b6021d689b062a0762bcc9c07461fb075
6dd77c2b3b41b9df200756036a3673aa86e5e8ca
/Python/main.py
554699886bed3ce526787471e0dee14cb1e6c9da
[]
no_license
michal1domanski/Praca_inz
2c3492a41514f053c3331c5695e8425e900efdae
abe905476c74358c826b2b41bca0dff9dfb66964
refs/heads/master
2023-04-17T10:04:00.565093
2020-11-28T02:23:12
2020-11-28T02:23:12
271,671,277
0
0
null
null
null
null
UTF-8
Python
false
false
1,627
py
from checkers_bot import Bot from checkers_pygame import Plansza, Gra import pygame import pygame_menu CZERWONY = (255, 0, 0) NIEBIESKI = (0, 0, 255) max_depth = 4 def menu(): pygame.init() surface = pygame.display.set_mode((600, 400)) menu = pygame_menu.Menu(400, 600, "Witamy", theme=pygame_menu.themes.THEME_DARK) menu.add_selector("Poziom Trudności: ",[("Łatwy", 1), ("Średni", 2), ("Trudny", 3), ("Mistrz", 4)], onchange=set_difficulty) menu.add_button("1 Gracz", start_game) menu.add_button("2 Graczy", two_player) menu.add_button("Wyjście", pygame_menu.events.EXIT) menu.mainloop(surface) def set_difficulty(difficulty, value): if value == 1: max_depth = 0 elif value == 2: max_depth = 1 elif value == 3: max_depth = 2 elif value == 4: max_depth = 3 def start_game(): if __name__ == "__main__": main(max_depth) def two_player(): game = Gra() game.main() def main(max_depth): plansza = Plansza() game = Gra() bot = Bot(max_depth) env = None licznik_rund = 1 print_value = True while True: bot_move = [] # if żeby wartości wyświetlały sie raz na turę if game.tura == CZERWONY: print(f"################ Turn red #{licznik_rund} #####################") if licznik_rund == 0: bot_move = bot.move(plansza.stworz_plansze(), game.koniec_gry()) else: bot_move = bot.move(env, game.koniec_gry()) licznik_rund += 1 print_value = True elif game.tura == NIEBIESKI and print_value == True: print(f"################ Turn blue #{licznik_rund} #####################") print_value = False licznik_rund += 1 env = game.action(bot_move) menu()
[ "michal.domanski22@gmail.com" ]
michal.domanski22@gmail.com
26d9cfa10eac41cfcee4883afb3f3344863a66a3
9b56240f5d0a7f787518085eb2945727c60c4e5e
/DjangoAPI/settings.py
bca2b60d33d55d4741f057e02989d5a8ad51481e
[]
no_license
Gruning/DjangoAPI
920a399e58b814849a4b116e8e3c8c5f3004502a
aeab34e3a0cd2e6be176b7cc4d22e4fb4ad75bff
refs/heads/master
2023-01-24T06:55:49.432324
2020-11-23T23:02:41
2020-11-23T23:02:41
315,436,738
0
0
null
null
null
null
UTF-8
Python
false
false
3,129
py
""" Django settings for DjangoAPI project. Generated by 'django-admin startproject' using Django 3.0. For more information on this file, see https://docs.djangoproject.com/en/3.0/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/3.0/ref/settings/ """ import os # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = 'i(43)u@upm9gum!!)$7sd9^$8wbt16@*6z&6neppni3fiaf+#d' # 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', 'rest_framework', 'MyAPI' ] 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', ] ROOT_URLCONF = 'DjangoAPI.urls' TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [], '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', ], }, }, ] WSGI_APPLICATION = 'DjangoAPI.wsgi.application' # Database # https://docs.djangoproject.com/en/3.0/ref/settings/#databases DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), } } # Password validation # https://docs.djangoproject.com/en/3.0/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.0/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.0/howto/static-files/ STATIC_URL = '/static/'
[ "alberto.gruning.zen@gmail.com" ]
alberto.gruning.zen@gmail.com
40f34e2b13d2dbd43ddbbdfaace14b75eac30a92
e56214188faae8ebfb36a463e34fc8324935b3c2
/test/test_boot_pxe_ref.py
b14fd7196b588ad8b507fa7ab35924a40ec22fa7
[ "Apache-2.0" ]
permissive
CiscoUcs/intersight-python
866d6c63e0cb8c33440771efd93541d679bb1ecc
a92fccb1c8df4332ba1f05a0e784efbb4f2efdc4
refs/heads/master
2021-11-07T12:54:41.888973
2021-10-25T16:15:50
2021-10-25T16:15:50
115,440,875
25
18
Apache-2.0
2020-03-02T16:19:49
2017-12-26T17:14:03
Python
UTF-8
Python
false
false
1,851
py
# coding: utf-8 """ Cisco Intersight Cisco Intersight is a management platform delivered as a service with embedded analytics for your Cisco and 3rd party IT infrastructure. This platform offers an intelligent level of management that enables IT organizations to analyze, simplify, and automate their environments in more advanced ways than the prior generations of tools. Cisco Intersight provides an integrated and intuitive management experience for resources in the traditional data center as well as at the edge. With flexible deployment options to address complex security needs, getting started with Intersight is quick and easy. Cisco Intersight has deep integration with Cisco UCS and HyperFlex systems allowing for remote deployment, configuration, and ongoing maintenance. The model-based deployment works for a single system in a remote location or hundreds of systems in a data center and enables rapid, standardized configuration and deployment. It also streamlines maintaining those systems whether you are working with small or very large configurations. # noqa: E501 The version of the OpenAPI document: 1.0.9-1295 Contact: intersight@cisco.com Generated by: https://openapi-generator.tech """ from __future__ import absolute_import import unittest import intersight from intersight.models.boot_pxe_ref import BootPxeRef # noqa: E501 from intersight.rest import ApiException class TestBootPxeRef(unittest.TestCase): """BootPxeRef unit test stubs""" def setUp(self): pass def tearDown(self): pass def testBootPxeRef(self): """Test BootPxeRef""" # FIXME: construct object with mandatory attributes with example values # model = intersight.models.boot_pxe_ref.BootPxeRef() # noqa: E501 pass if __name__ == '__main__': unittest.main()
[ "ucs-build@github.com" ]
ucs-build@github.com
b02950d3f7be17cb2494c4f1c7da78ce7e16ad39
4d200e1f225455c58e0dd89db587a29411f86245
/venv/Lib/site-packages/openmdao/components/tests/test_ks_comp.py
54350a75b335c227b0f75ed0c882dbd166d9b70d
[]
no_license
ManojDjs/Heart-rate-estimation
df0be78edbc70cc75c006c6f87c8169200de84e0
d9e89fe017f1131d554599c248247f73bb9b534d
refs/heads/main
2023-05-09T10:58:37.614351
2021-06-01T11:12:45
2021-06-01T11:12:45
371,493,498
1
0
null
null
null
null
UTF-8
Python
false
false
11,252
py
""" Test the KSFunction component. """ import unittest import numpy as np try: import matplotlib.pyplot as plt plt.switch_backend('Agg') except ImportError: plt = None import openmdao.api as om from openmdao.test_suite.components.simple_comps import DoubleArrayComp from openmdao.test_suite.test_examples.beam_optimization.multipoint_beam_stress import MultipointBeamGroup from openmdao.utils.assert_utils import assert_near_equal class TestKSFunction(unittest.TestCase): def test_basic_ks(self): prob = om.Problem() model = prob.model model.add_subsystem('px', om.IndepVarComp(name="x", val=np.ones((2, )))) model.add_subsystem('comp', DoubleArrayComp()) model.add_subsystem('ks', om.KSComp(width=2)) model.connect('px.x', 'comp.x1') model.connect('comp.y2', 'ks.g') model.add_design_var('px.x') model.add_objective('comp.y1') model.add_constraint('ks.KS', upper=0.0) prob.setup() prob.run_driver() assert_near_equal(max(prob['comp.y2']), prob['ks.KS'][0]) def test_bad_units(self): with self.assertRaises(ValueError) as ctx: om.KSComp(units='wtfu') self.assertEqual(str(ctx.exception), "The units 'wtfu' are invalid.") def test_vectorized(self): prob = om.Problem() model = prob.model x = np.zeros((3, 5)) x[0, :] = np.array([3.0, 5.0, 11.0, 13.0, 17.0]) x[1, :] = np.array([13.0, 11.0, 5.0, 17.0, 3.0])*2 x[2, :] = np.array([11.0, 3.0, 17.0, 5.0, 13.0])*3 model.add_subsystem('ks', om.KSComp(width=5, vec_size=3)) model.add_design_var('ks.g') model.add_constraint('ks.KS', upper=0.0) prob.setup() prob.set_val('ks.g', x) prob.run_driver() assert_near_equal(prob.get_val('ks.KS', indices=0), 17.0) assert_near_equal(prob.get_val('ks.KS', indices=1), 34.0) assert_near_equal(prob.get_val('ks.KS', indices=2), 51.0) prob.model.ks._no_check_partials = False # override skipping of check_partials partials = prob.check_partials(includes=['ks'], out_stream=None) for (of, wrt) in partials['ks']: assert_near_equal(partials['ks'][of, wrt]['abs error'][0], 0.0, 1e-6) def test_partials_no_compute(self): prob = om.Problem() model = prob.model model.add_subsystem('px', om.IndepVarComp('x', val=np.array([5.0, 4.0]))) ks_comp = model.add_subsystem('ks', om.KSComp(width=2)) model.connect('px.x', 'ks.g') prob.setup() prob.run_driver() # compute partials with the current model inputs inputs = { 'g': prob['ks.g'] } partials = {} ks_comp.compute_partials(inputs, partials) assert_near_equal(partials[('KS', 'g')], np.array([1., 0.]), 1e-6) # swap inputs and call compute partials again, without calling compute inputs['g'][0][0] = 4 inputs['g'][0][1] = 5 ks_comp.compute_partials(inputs, partials) assert_near_equal(partials[('KS', 'g')], np.array([0., 1.]), 1e-6) def test_beam_stress(self): E = 1. L = 1. b = 0.1 volume = 0.01 max_bending = 100.0 num_cp = 5 num_elements = 25 num_load_cases = 2 prob = om.Problem(model=MultipointBeamGroup(E=E, L=L, b=b, volume=volume, max_bending = max_bending, num_elements=num_elements, num_cp=num_cp, num_load_cases=num_load_cases)) prob.driver = om.ScipyOptimizeDriver() prob.driver.options['optimizer'] = 'SLSQP' prob.driver.options['tol'] = 1e-9 prob.driver.options['disp'] = False prob.setup(mode='rev') prob.run_driver() stress0 = prob['parallel.sub_0.stress_comp.stress_0'] stress1 = prob['parallel.sub_0.stress_comp.stress_1'] # Test that the maximum constraint prior to aggregation is close to "active". assert_near_equal(max(stress0), 100.0, tolerance=5e-2) assert_near_equal(max(stress1), 100.0, tolerance=5e-2) # Test that no original constraint is violated. self.assertTrue(np.all(stress0 < 100.0)) self.assertTrue(np.all(stress1 < 100.0)) def test_beam_stress_ks_add_constraint(self): E = 1. L = 1. b = 0.1 volume = 0.01 max_bending = 100.0 num_cp = 5 num_elements = 25 num_load_cases = 2 prob = om.Problem(model=MultipointBeamGroup(E=E, L=L, b=b, volume=volume, max_bending = max_bending, num_elements=num_elements, num_cp=num_cp, num_load_cases=num_load_cases, ks_add_constraint=True)) prob.driver = om.ScipyOptimizeDriver() prob.driver.options['optimizer'] = 'SLSQP' prob.driver.options['tol'] = 1e-9 prob.driver.options['disp'] = False prob.setup(mode='rev') prob.run_driver() stress0 = prob['parallel.sub_0.stress_comp.stress_0'] stress1 = prob['parallel.sub_0.stress_comp.stress_1'] # Test that the the maximum constraint prior to aggregation is close to "active". assert_near_equal(max(stress0), 100.0, tolerance=5e-2) assert_near_equal(max(stress1), 100.0, tolerance=5e-2) # Test that no original constraint is violated. self.assertTrue(np.all(stress0 < 100.0)) self.assertTrue(np.all(stress1 < 100.0)) def test_upper(self): prob = om.Problem() model = prob.model model.add_subsystem('comp', om.ExecComp('y = 3.0*x', x=np.zeros((2, )), y=np.zeros((2, )))) model.add_subsystem('ks', om.KSComp(width=2)) model.connect('comp.y', 'ks.g') model.ks.options['upper'] = 16.0 prob.setup() prob.set_val('comp.x', np.array([5.0, 4.0])) prob.run_model() assert_near_equal(prob.get_val('ks.KS', indices=0), -1.0) def test_lower_flag(self): prob = om.Problem() model = prob.model model.add_subsystem('comp', om.ExecComp('y = 3.0*x', x=np.zeros((2, )), y=np.zeros((2, )))) model.add_subsystem('ks', om.KSComp(width=2)) model.connect('comp.y', 'ks.g') model.ks.options['lower_flag'] = True prob.setup() prob.set_val('comp.x', np.array([5.0, 4.0])) prob.run_model() assert_near_equal(prob.get_val('ks.KS', indices=0), -12.0) class TestKSFunctionFeatures(unittest.TestCase): def test_basic(self): import numpy as np import openmdao.api as om prob = om.Problem() model = prob.model model.add_subsystem('comp', om.ExecComp('y = 3.0*x', x=np.zeros((2, )), y=np.zeros((2, ))), promotes_inputs=['x']) model.add_subsystem('ks', om.KSComp(width=2)) model.connect('comp.y', 'ks.g') prob.setup() prob.set_val('x', np.array([5.0, 4.0])) prob.run_model() assert_near_equal(prob.get_val('ks.KS'), [[15.0]]) def test_vectorized(self): import numpy as np import openmdao.api as om prob = om.Problem() model = prob.model model.add_subsystem('comp', om.ExecComp('y = 3.0*x', x=np.zeros((2, 2)), y=np.zeros((2, 2))), promotes_inputs=['x']) model.add_subsystem('ks', om.KSComp(width=2, vec_size=2)) model.connect('comp.y', 'ks.g') prob.setup() prob.set_val('x', np.array([[5.0, 4.0], [10.0, 8.0]])) prob.run_model() assert_near_equal(prob.get_val('ks.KS'), np.array([[15], [30]])) def test_upper(self): import numpy as np import openmdao.api as om prob = om.Problem() model = prob.model model.add_subsystem('comp', om.ExecComp('y = 3.0*x', x=np.zeros((2, )), y=np.zeros((2, ))), promotes_inputs=['x']) model.add_subsystem('ks', om.KSComp(width=2)) model.connect('comp.y', 'ks.g') model.ks.options['upper'] = 16.0 prob.setup() prob.set_val('x', np.array([5.0, 4.0])) prob.run_model() assert_near_equal(prob['ks.KS'], np.array([[-1.0]])) def test_lower_flag(self): import numpy as np import openmdao.api as om prob = om.Problem() model = prob.model model.add_subsystem('comp', om.ExecComp('y = 3.0*x', x=np.zeros((2, )), y=np.zeros((2, ))), promotes_inputs=['x']) model.add_subsystem('ks', om.KSComp(width=2)) model.connect('comp.y', 'ks.g') model.ks.options['lower_flag'] = True prob.setup() prob.set_val('x', np.array([5.0, 4.0])) prob.run_model() assert_near_equal(prob.get_val('ks.KS'), [[-12.0]]) @unittest.skipIf(not plt, "requires matplotlib") def test_add_constraint(self): import numpy as np import openmdao.api as om import matplotlib.pyplot as plt n = 50 prob = om.Problem() model = prob.model prob.driver = om.ScipyOptimizeDriver() model.add_subsystem('comp', om.ExecComp('y = -3.0*x**2 + k', x=np.zeros((n, )), y=np.zeros((n, )), k=0.0), promotes_inputs=['x', 'k']) model.add_subsystem('ks', om.KSComp(width=n, upper=4.0, add_constraint=True)) model.add_design_var('k', lower=-10, upper=10) model.add_objective('k', scaler=-1) model.connect('comp.y', 'ks.g') prob.setup() prob.set_val('x', np.linspace(-np.pi/2, np.pi/2, n)) prob.set_val('k', 5.) prob.run_driver() self.assertTrue(max(prob.get_val('comp.y')) <= 4.0) fig, ax = plt.subplots() x = prob.get_val('x') y = prob.get_val('comp.y') ax.plot(x, y, 'r.') ax.plot(x, 4.0*np.ones_like(x), 'k--') ax.set_xlabel('x') ax.set_ylabel('y') ax.grid(True) ax.text(-0.25, 0, f"k = {prob.get_val('k')[0]:6.3f}") plt.show() def test_units(self): import openmdao.api as om from openmdao.utils.units import convert_units n = 10 model = om.Group() model.add_subsystem('ks', om.KSComp(width=n, units='m'), promotes_inputs=[('g', 'x')]) model.set_input_defaults('x', range(n), units='ft') prob = om.Problem(model=model) prob.setup() prob.run_model() assert_near_equal(prob.get_val('ks.KS', indices=0), np.amax(prob.get_val('x')), tolerance=1e-8) if __name__ == "__main__": unittest.main()
[ "djsmanoj0000@gmail.com" ]
djsmanoj0000@gmail.com
53b5bdffbad15e8d3b30c234be201c7e2a150e4d
d0c63b8f8ffe8fd961899de80c8f36635a93b6d5
/mysite/urls.py
0a9b991c3798c56e83d119577af710ba1663775a
[]
no_license
juhyun99/my-first-blog
fa39e90e3a1fa4bf5195cd4c7d02897018a50784
270ea634935c180e967bf2592787f4f85f22b1c9
refs/heads/master
2023-06-24T21:24:27.393924
2023-06-13T13:18:01
2023-06-13T13:18:01
258,571,849
0
0
null
null
null
null
UTF-8
Python
false
false
1,134
py
"""mysite URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.0/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 from django.conf import settings from django.conf.urls.static import static from rest_framework.authtoken.views import obtain_auth_token urlpatterns = [ path('admin/', admin.site.urls), path('', include('blog.urls')), path('api-token-auth/', obtain_auth_token), ] urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
[ "juhyun1002@khu.ac.kr" ]
juhyun1002@khu.ac.kr
cd2532340a41511f54565d952db8a3d8f0242397
bedb44b4f80ab709d4cebeeefa6eae307e1a376f
/misc/local.py
06def0294f06bd523ba81732c5dbf35ae68947c2
[]
no_license
baodongli/exercise
bdf7562813ad8ded5da912f30e90258294b6934f
ffcddd30acefe037a7dcd6ba77ff150350a2c9b8
refs/heads/master
2021-07-15T17:09:03.807447
2020-05-27T20:01:34
2020-05-27T20:01:34
156,718,664
0
0
null
null
null
null
UTF-8
Python
false
false
730
py
import gevent from gevent.event import Event import werkzeug.local # import pdb; pdb.set_trace() LOCAL = werkzeug.local.Local() eve = {} def task(name, value): LOCAL.value = value for _ in range(20): eve[name].wait() del eve[name] eve[name] = Event() LOCAL.value += 10 print("Task: %s, value: %s" % (name, LOCAL.value)) if __name__ == "__main__": eve['task1'] = Event() gevent.spawn(task, "task1", 100) eve['task2'] = Event() gevent.spawn(task, "task2", 200) LOCAL.value = 1000 for _ in range(20): eve['task1'].set() eve['task2'].set() LOCAL.value += 10 print("Task: main, value: %s" % LOCAL.value) gevent.sleep(2)
[ "Robert.Li2@emc.com" ]
Robert.Li2@emc.com
62babd634f08ee217fbd72eb3f4e5d26d5e29a4f
88e0efa078c65b734bff3623cc1a275ecc20b032
/Vorlagen/Hauptprogramm.py
ffa0fc97fd435f299f52a7e4d3e907f7a5d69ed8
[ "Unlicense" ]
permissive
tommy010101/Python_Pygame-Zero
ea631257c7d1a89c67e7c627cabfb2f8da2dc49c
6a0634017422a8b9a706e1f9935d5ddb6ce1e59b
refs/heads/main
2023-08-01T11:35:23.312956
2021-09-25T08:49:34
2021-09-25T08:49:34
null
0
0
null
null
null
null
UTF-8
Python
false
false
1,066
py
import pgzrun # Beispiel: from figur import Figur # Das Spielfeld WIDTH=800 HEIGHT=600 TITLE = "Ein Spiel" class Spiel: def __init__(self): self.aktiv = False # Figuren erzeugen # Beispiel: self.figur = Figur(10,20) def start(self): self.aktiv = True def stopp(self): self.aktiv = False def zeichne_spielfeld(self): pass # Beispiel: farbe = (163, 232, 254) # Beispiel: screen.draw.filled_rect(Rect(0, 0, WIDTH, HEIGHT), farbe) def zeichne_figur(self): pass # Beispiel: self.figur.draw() def draw(self): self.zeichne_spielfeld() self.zeichne_figur() def update(self): # Start-Taste nur abfragen, wenn das Spiel nicht aktiv ist if not self.aktiv and keyboard.s: # neues Spiel starten self.start() # Wenn das Spiel nicht aktiv ist, hier abbrechen if not self.aktiv: return spiel = Spiel() def update(): spiel.update() def draw(): spiel.draw() pgzrun.go()
[ "der.hobbyelektroniker@gmail.com" ]
der.hobbyelektroniker@gmail.com
0a8d6b547e400a711ed0eee606444ae39c1f0080
7ee89b154e61ca26ea7ecf5998bf8f5329579ff9
/controllers/fit_mollie_controller.py
646cb1414b771dc77adec0a687e75d8b3d298942
[]
no_license
FundamentIT/fit_payment_mollie
f73fd0760bc71d833f7a588f02c503401a29e351
e6c689999d35f6cc206eed28e6f6dd5abc848daf
refs/heads/master
2020-08-21T15:19:21.722336
2019-11-14T07:55:53
2019-11-14T07:55:53
216,187,908
0
0
null
null
null
null
UTF-8
Python
false
false
16,466
py
# -*- coding: utf-8 -*- import json import logging import requests import werkzeug import pprint import locale import decimal import datetime from psycopg2.psycopg1 import cursor from odoo import http, SUPERUSER_ID, fields, _ from odoo.http import request, Response from odoo.exceptions import ValidationError from ...payment_mollie_official.controllers import main from odoo.addons.website_sale.controllers import main as website_sale_main _logger = logging.getLogger(__name__) class FitMollieController(main.MollieController): _notify_url = '/payment/mollie/notify/' _redirect_url = '/payment/mollie/redirect/' _cancel_url = '/payment/mollie/cancel/' _subscription_url = '/payment/mollie/subscription/' @http.route('/accept_mollie_incasso', type='json', auth='public', website=True, csrf=False) def accept_mollie_incasso(self, **kw): sale_order_id = kw.get('sale_order_id') is_accepted = kw.get('is_accepted') sale_order = request.env['sale.order'].sudo().browse(int(sale_order_id)) if sale_order: sale_order.write({"mollie_incasso_accept": is_accepted}) _logger.debug('FIT_MOLLIE: received Mollie accept incasso for order: %s, accepted: %s', sale_order_id,is_accepted) @http.route([ '/payment/mollie/notify'], type='http', auth='none', methods=['GET']) def mollie_notify(self, **post): cr, uid, context = request.cr, SUPERUSER_ID, request.context request.env['payment.transaction'].sudo().form_feedback(post, 'mollie') return werkzeug.utils.redirect("/shop/payment/validate") @http.route([ '/payment/mollie/redirect'], type='http', auth="none", methods=['GET']) def mollie_redirect(self, **post): _logger.info('FIT_MOLLIE: received Mollie redirect') cr, uid, context = request.cr, SUPERUSER_ID, request.context request.env['payment.transaction'].sudo().form_feedback(post, 'mollie') return werkzeug.utils.redirect("/shop/payment/validate") @http.route([ '/payment/mollie/cancel'], type='http', auth="none", methods=['GET']) def mollie_cancel(self, **post): cr, uid, context = request.cr, SUPERUSER_ID, request.context request.env['payment.transaction'].sudo().form_feedback(post, 'mollie') return werkzeug.utils.redirect("/shop/payment/validate") @http.route([ '/payment/mollie/intermediate'], type='http', auth="none", methods=['POST'], csrf=False) def mollie_intermediate(self, **post): _logger.info('FIT_MOLLIE: received Mollie intermediate: %s', post) acquirer = request.env['payment.acquirer'].browse(int(post['Key'])) url = post['URL'] + "payments" headers = {'content-type': 'application/json', 'Authorization': 'Bearer ' + acquirer._get_mollie_api_keys(acquirer.environment)['mollie_api_key']} base_url = post['BaseUrl'] orderid = post['OrderId'] description = post['Description'] currency = post['Currency'] amount = post['Amount'] language = post['Language'] name = post['Name'] email = post['Email'] zip = post['Zip'] address = post['Address'] town = post['Town'] country = post['Country'] phone = post['Phone'] is_contract = False product = None res_partner = None payment_transaction = request.env['payment.transaction'].sudo().search([('reference', '=', orderid)]) if payment_transaction: sale_order = payment_transaction.sale_order_id res_partner = sale_order.partner_id for order_line in sale_order.order_line: for product_id in order_line.product_id: is_contract = product_id.is_contract _logger.info('FIT Mollie: found product, is contract: %s', is_contract) if is_contract: mollie_customer_id = self._get_customer_id(acquirer, res_partner) url = "https://api.mollie.com/v2/payments" payload = { "description": "Mandaat Automatische Incasso %s" % description, "amount": { "currency": "EUR", "value": "{:0,.2f}".format(decimal.Decimal(str(amount))) }, "customerId": mollie_customer_id, "sequenceType": "first", "redirectUrl": "%s%s?iscontract=%s&reference=%s" % (base_url, self._redirect_url, is_contract, orderid), } else: payload = { "description": description, "amount": amount, # "webhookUrl": base_url + self._notify_url, "redirectUrl": "%s%s?iscontract=%s&reference=%s" % (base_url, self._redirect_url, is_contract, orderid), "metadata": { "order_id": orderid, "customer": { "locale": language, "currency": currency, "last_name": name, "address1": address, "zip_code": zip, "city": town, "country": country, "phone": phone, "email": email } } } mollie_response = requests.post( url, data=json.dumps(payload), headers=headers).json() _logger.debug('FIT MOLLIE: intermediate Mollie response: %s', mollie_response) if mollie_response["status"] == 410: _logger.error('FIT MOLLIE: invalid customer ID %s, clear customer id and redirect to payment to restart validation', mollie_customer_id) res_partner.mollie_customer_id = '' return werkzeug.utils.redirect("/shop/payment") if mollie_response["status"] == "open": payment_tx = request.env['payment.transaction'].sudo().search([('reference', '=', orderid)]) if not payment_tx or len(payment_tx) > 1: error_msg = ('received data for reference %s') % (pprint.pformat(orderid)) if not payment_tx: error_msg += ('; no order found') else: error_msg += ('; multiple order found') _logger.info(error_msg) raise ValidationError(error_msg) payment_tx.write({"acquirer_reference": mollie_response["id"]}) if is_contract: payment_url = mollie_response["_links"]["checkout"]["href"] else: payment_url = mollie_response["links"]["paymentUrl"] return werkzeug.utils.redirect(payment_url) return werkzeug.utils.redirect("/") @http.route([ '/payment/mollie/subscription'], type='http', auth="none", methods=['POST'], csrf=False) def mollie_subscription(self, **post): cr, uid, context = request.cr, SUPERUSER_ID, request.context _logger.info('FIT MOLLIE: Retrieved Mollie Subscription update: %s', post) acquirer = request.env['payment.acquirer'].search([('provider', '=', 'mollie')], limit=1) mollie_api_key = acquirer._get_mollie_api_keys(acquirer.environment)['mollie_api_key'] url = "https://api.mollie.com/v2/payments/%s" % (post['id']) payload = {} headers = {'content-type': 'application/json', 'Authorization': 'Bearer ' + mollie_api_key} mollie_response = requests.get( url, data=json.dumps(payload), headers=headers).json() _logger.info('FIT MOLLIE: Result Mollie Subscription Payment: %s', mollie_response) contract_id = post["contract_id"] account_journal = request.env['account.journal'].sudo().browse(int(acquirer.journal_id)) if mollie_response["status"] == "paid": contract = request.env['account.analytic.account'].sudo().search([("id", '=', contract_id)], limit=1)#, order='date_invoice asc' for account_invoice_id in sorted(contract.account_invoice_ids, reverse=True): _logger.info('FIT MOLLIE: Handle invoice %s fom contract %s', account_invoice_id.id, contract_id) account_invoice = request.env['account.invoice'].sudo().browse(int(account_invoice_id.id)) if account_invoice.state == 'draft': account_invoice.sudo().action_invoice_open() _logger.info('FIT MOLLIE: Set invoice %s state to "Open"', account_invoice.display_name) if account_invoice.state == 'open': account_invoice.sudo().pay_and_reconcile(account_journal) _logger.info('FIT MOLLIE: Set invoice %s state to "Paid"', account_invoice.display_name) break _logger.info('FIT MOLLIE: Result Mollie Subscription payment status: %s', mollie_response) return Response("[]", status=200) def _get_customer_id(self, acquirer, partner): _logger.info('Checking Mollie customer ID for partner %s', partner.name) if not partner.mollie_customer_id: url = 'https://api.mollie.com/v2/customers' headers = {'content-type': 'application/json', 'Authorization': 'Bearer ' + acquirer._get_mollie_api_keys(acquirer.environment)['mollie_api_key']} payload = { "name": partner.name, "email": partner.email } mollie_response = requests.post( url, data=json.dumps(payload), headers=headers).json() partner.mollie_customer_id = mollie_response["id"] return partner.mollie_customer_id class FitWebsiteSale(website_sale_main.WebsiteSale): # Set Valid/invalid flag to show/hide warning @http.route(['/shop/cart'], type='http', auth="public", website=True) def cart(self, **post): order = request.website.sale_get_order() valid_contract_amount = self._is_valid_contract_amount(order) valid_product = self._is_valid_products(order) active_contract = self._is_active_contract(order) contains_contract = self._contains_contract(order) subscription_accepted = order.mollie_incasso_accept if order: from_currency = order.company_id.currency_id to_currency = order.pricelist_id.currency_id compute_currency = lambda price: from_currency.compute(price, to_currency) else: compute_currency = lambda price: price values = { 'website_sale_order': order, 'compute_currency': compute_currency, 'suggested_products': [], 'valid_contract_amount': valid_contract_amount, 'valid_product': valid_product, 'active_contract': active_contract, 'contains_contract': contains_contract, 'subscription_accepted': subscription_accepted, } if order: _order = order if not request.env.context.get('pricelist'): _order = order.with_context(pricelist=order.pricelist_id.id) values['suggested_products'] = _order._cart_accessories() if post.get('type') == 'popover': return request.render("website_sale.cart_popover", values) if post.get('code_not_available'): values['code_not_available'] = post.get('code_not_available') return request.render("website_sale.cart", values) # fallback to "/shop/cart" if order not valid @http.route(['/shop/checkout'], type='http', auth="public", website=True) def checkout(self, **post): order = request.website.sale_get_order() valid_contract_amount = self._is_valid_contract_amount(order) valid_product = self._is_valid_products(order) active_contract = self._is_active_contract(order) subscription_accepted = order.mollie_incasso_accept if not subscription_accepted or not valid_contract_amount or not valid_product or active_contract: return request.redirect("/shop/cart") else: redirection = self.checkout_redirection(order) if redirection: return redirection if order.partner_id.id == request.website.user_id.sudo().partner_id.id: return request.redirect('/shop/address') for f in self._get_mandatory_billing_fields(): if not order.partner_id[f]: return request.redirect('/shop/address?partner_id=%d' % order.partner_id.id) values = self.checkout_values(**post) # Avoid useless rendering if called in ajax if post.get('xhr'): return 'ok' return request.render("website_sale.checkout", values) def _is_active_contract(self, order): contract_end_date = 'Unknown' contract_active = False current_date = datetime.datetime.strptime(fields.Date.today(), '%Y-%m-%d') contracts_found = request.env['account.analytic.account'].sudo().search([('recurring_invoices', '=', True), ('partner_id', '=', order.partner_id.id)]) for contract_found in contracts_found: if not contract_found.date_end: contract_end_date = datetime.datetime.strptime(fields.Date.today(), '%Y-%m-%d') else: contract_end_date = datetime.datetime.strptime(contract_found.date_end, '%Y-%m-%d') contract_active = current_date <= contract_end_date _logger.info('FIT Mollie: cart check active contract: %s, for contract end date: %s and today: %s', contract_active, contract_end_date, current_date) return contract_active def _is_valid_contract_amount(self, order): is_valid_contract_amount = True if order: for order_line in order.order_line: for product_id in order_line.product_id: if product_id.is_contract: if order_line.product_uom_qty > 1: is_valid_contract_amount = False _logger.info('FIT Mollie: cart check is valid contract amount = %s', is_valid_contract_amount) return is_valid_contract_amount def _is_valid_products(self, order): contains_contract = False contains_other = False if order: for order_line in order.order_line: for product_id in order_line.product_id: if product_id.is_contract: contains_contract = True else: contains_other = True _logger.info('FIT Mollie: cart check is valid product, contains contract: %s, contains other: %s', contains_contract, contains_other) if contains_contract and contains_other: return False return True def _contains_contract(self, order): contains_contract = False if order: for order_line in order.order_line: for product_id in order_line.product_id: if product_id.is_contract: contains_contract = True _logger.info('FIT Mollie: cart check, contains contract: %s', contains_contract) return contains_contract def _check_cart(self, order): contains_contract = False contains_contract_multiple = False contains_other = False if order: for order_line in order.order_line: for product_id in order_line.product_id: if product_id.is_contract: contains_contract = True if order_line.product_uom_qty > 1: contains_contract_multiple = True else: contains_other = True _logger.info('FIT Mollie: cart checkout found contract product: %s, multiple contract product: %s, and found other: %s', contains_contract, contains_contract_multiple, contains_other) if contains_contract and contains_other: return False elif contains_contract and contains_contract_multiple: return False else: return True
[ "thijs@fundament.it" ]
thijs@fundament.it
69a4b84e569bc6eb927b4104ad9d6cc974aae864
c916ec78d17c907f136b945c8b3496f5b4c60611
/Functions/q10.py
bc4b886cea44fd25423fd7f3f7d4772671f22bc8
[]
no_license
Sandesh-Thapa/Assignment-I-Data-Types-and-Functions
69cd20158aa5da4cac860beb5c7cb81714594821
73ce000956dea3a1383d318ab381edfb413aa397
refs/heads/main
2023-01-20T05:43:05.055041
2020-11-30T05:55:49
2020-11-30T05:55:49
316,120,006
0
0
null
null
null
null
UTF-8
Python
false
false
366
py
# Write a Python program to print the even numbers from a given list def even_list(list1): result = [] for i in list1: if i % 2 == 0: result.append(i) return result list = [] n = int(input('Enter number of items: ')) for i in range(0,n): num = int(input(f'Enter {i+1}th number: ')) list.append(num) print(even_list(list))
[ "sandeshthapa426@gmail.com" ]
sandeshthapa426@gmail.com
0b80a524d9546370b5bc9f255310199f66b0cdc1
40eab4d2fd15f9cab509918b315f9b6dc91d80b2
/NJExportIPATool.py
6034d70187a678b3bb2d372fa3453cb327845cc8
[]
no_license
nijiehaha/NJExportIPATool
47659eb4818eb9e140c93c8457099b3b94104faf
80b224ecb06fe0d0ef5511c2940761b37f1a853c
refs/heads/master
2021-06-04T14:34:34.827504
2020-09-30T08:50:35
2020-09-30T08:50:35
138,830,151
4
0
null
null
null
null
UTF-8
Python
false
false
2,602
py
#! /usr/bin/env python3 import os #################### 用户配置 ################### # 渠道 channel = '' # 项目路径 projectPath = '' # 项目bundleID projectBundleID = '' # provisioningfile provisioningName = '' # Certificatefile CertificateName = '' # 项目名称 projectName = '' # 打包路径 IpaSavePath = '' # exportOptionPlist文件路径 此项可选填 exportOptionPlistPath = '' ################# 配置以上参数 #################### # 生成的Archive文件的路径 archivePath = IpaSavePath + '/' + projectName # 创建plist文件 def createPlist(): global exportOptionPlistPath if exportOptionPlistPath == '': print('####正在创建plist文件####') os.system("echo '<?xml version='1.0' encoding='UTF-8'?><!DOCTYPE plist PUBLIC '-//Apple//DTD PLIST 1.0//EN' 'http://www.apple.com/DTDs/PropertyList-1.0.dtd'><plist version='1.0'><dict/></plist>' > exportOption.plist") os.system("plutil -lint exportOption.plist") # os.system("plutil -insert compileBitcode -bool 'NO' exportOption.plist") os.system("plutil -insert method -string %s exportOption.plist" % channel) os.system("plutil -insert provisioningProfiles -json '{\"%s\":\"%s\"}' exportOption.plist" % (projectBundleID, provisioningName)) os.system("plutil -insert signingCertificate -string 'iPhone Distribution' exportOption.plist") os.system("plutil -insert signingStyle -string 'manual' exportOption.plist") os.system("plutil -insert stripSwiftSymbols -bool 'YES' exportOption.plist") os.system("plutil -insert teamID -string %s exportOption.plist" % CertificateName) os.system("plutil -insert uploadSymbols -bool 'YES' exportOption.plist") exportOptionPlistPath = projectPath + '/' + 'exportOption.plist' print(exportOptionPlistPath) # 确定打包样式 def makeSureConfiguration(): res = input('###是否要打包Debug版本,如果是请输入1###\n') if res == '1' : return 'Debug' return 'Release' # 生成archive文件 def makeArchive(str): print(str) os.system('xcodebuild archive -workspace %s.xcworkspace -scheme %s -configuration %s -archivePath %s'%(projectName,projectName,str,archivePath)) # 生成iPa包 def makeIpa(): os.system('xcodebuild -exportArchive -archivePath %s.xcarchive -exportPath %s -exportOptionsPlist %s'%(archivePath,IpaSavePath,exportOptionPlistPath)) # 自动打包 def automaticPack(): createPlist() con = makeSureConfiguration() makeArchive(con) makeIpa() print('打包成功!') automaticPack()
[ "noreply@github.com" ]
noreply@github.com
a323096e6b7bd55f5063ce02e8880ffba43feb9e
aed0016db7f4d22e7d66e6fddb7bf4ef68a3c692
/neural_sp/bin/args_lm.py
451d32dd41cc03cd73b2501e5b1c8b81a479d483
[]
no_license
thanhkm/neural_sp
6a5575111c83d1fdd97edec21f90fe647965cb69
1a5a5ed54f4cb79436007593dbd0d782b246a0c7
refs/heads/master
2020-12-26T23:22:56.964151
2020-01-15T23:40:22
2020-01-15T23:40:22
null
0
0
null
null
null
null
UTF-8
Python
false
false
11,678
py
#! /usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright 2018 Kyoto University (Hirofumi Inaguma) # Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0) """Args option for the LM task.""" import configargparse from distutils.util import strtobool def parse(): parser = configargparse.ArgumentParser( config_file_parser_class=configargparse.YAMLConfigFileParser, formatter_class=configargparse.ArgumentDefaultsHelpFormatter) parser.add('--config', is_config_file=True, help='config file path') # general parser.add_argument('--corpus', type=str, help='corpus name') parser.add_argument('--n_gpus', type=int, default=1, help='number of GPUs (0 indicates CPU)') parser.add_argument('--model_save_dir', type=str, default=False, help='directory to save a model') parser.add_argument('--resume', type=str, default=False, nargs='?', help='model path to resume training') parser.add_argument('--job_name', type=str, default=False, help='job name') parser.add_argument('--stdout', type=strtobool, default=False, help='print to standard output') parser.add_argument('--recog_stdout', type=strtobool, default=False, help='print to standard output during evaluation') # dataset parser.add_argument('--train_set', type=str, help='tsv file path for the training set') parser.add_argument('--dev_set', type=str, help='tsv file path for the development set') parser.add_argument('--eval_sets', type=str, default=[], nargs='+', help='tsv file paths for the evaluation sets') parser.add_argument('--nlsyms', type=str, default=False, nargs='?', help='non-linguistic symbols file path') parser.add_argument('--dict', type=str, help='dictionary file path') parser.add_argument('--unit', type=str, default='word', choices=['word', 'wp', 'char', 'word_char'], help='output unit') parser.add_argument('--wp_model', type=str, default=False, nargs='?', help='wordpiece model path') # features parser.add_argument('--min_n_tokens', type=int, default=1, help='minimum number of input tokens') parser.add_argument('--dynamic_batching', type=strtobool, default=False, help='') # topology parser.add_argument('--lm_type', type=str, default='lstm', choices=['lstm', 'gru', 'gated_conv_custom', 'gated_conv_8', 'gated_conv_8B', 'gated_conv_9', 'gated_conv_13', 'gated_conv_14', 'gated_conv_14B', 'transformer'], help='type of language model') parser.add_argument('--kernel_size', type=int, default=4, help='kernel size for GatedConvLM') parser.add_argument('--n_units', type=int, default=1024, help='number of units in each layer') parser.add_argument('--n_projs', type=int, default=0, help='number of units in the projection layer') parser.add_argument('--n_layers', type=int, default=5, help='number of layers') parser.add_argument('--emb_dim', type=int, default=1024, help='number of dimensions in the embedding layer') parser.add_argument('--n_units_null_context', type=int, default=0, nargs='?', help='') parser.add_argument('--tie_embedding', type=strtobool, default=False, nargs='?', help='tie input and output embedding') parser.add_argument('--residual', type=strtobool, default=False, nargs='?', help='') parser.add_argument('--use_glu', type=strtobool, default=False, nargs='?', help='use Gated Linear Unit (GLU) for fully-connected layers') # optimization parser.add_argument('--batch_size', type=int, default=256, help='mini-batch size') parser.add_argument('--bptt', type=int, default=100, help='BPTT length') parser.add_argument('--optimizer', type=str, default='adam', choices=['adam', 'adadelta', 'adagrad', 'sgd', 'momentum', 'nesterov', 'noam'], help='type of optimizer') parser.add_argument('--n_epochs', type=int, default=50, help='number of epochs to train the model') parser.add_argument('--convert_to_sgd_epoch', type=int, default=20, help='epoch to converto to SGD fine-tuning') parser.add_argument('--print_step', type=int, default=100, help='print log per this value') parser.add_argument('--lr', type=float, default=1e-3, help='initial learning rate') parser.add_argument('--lr_factor', type=float, default=10.0, help='factor of learning rate for Transformer') parser.add_argument('--eps', type=float, default=1e-6, help='epsilon parameter for Adadelta optimizer') parser.add_argument('--lr_decay_type', type=str, default='always', choices=['always', 'metric', 'warmup'], help='type of learning rate decay') parser.add_argument('--lr_decay_start_epoch', type=int, default=10, help='epoch to start to decay learning rate') parser.add_argument('--lr_decay_rate', type=float, default=0.9, help='decay rate of learning rate') parser.add_argument('--lr_decay_patient_n_epochs', type=int, default=0, help='number of epochs to tolerate learning rate decay when validation perfomance is not improved') parser.add_argument('--early_stop_patient_n_epochs', type=int, default=5, help='number of epochs to tolerate stopping training when validation perfomance is not improved') parser.add_argument('--sort_stop_epoch', type=int, default=10000, help='epoch to stop soring utterances by length') parser.add_argument('--eval_start_epoch', type=int, default=1, help='first epoch to start evalaution') parser.add_argument('--warmup_start_lr', type=float, default=0, help='initial learning rate for learning rate warm up') parser.add_argument('--warmup_n_steps', type=int, default=0, help='number of steps to warm up learing rate') parser.add_argument('--accum_grad_n_steps', type=int, default=1, help='total number of steps to accumulate gradients') # initialization parser.add_argument('--param_init', type=float, default=0.1, help='') parser.add_argument('--rec_weight_orthogonal', type=strtobool, default=False, help='') parser.add_argument('--pretrained_model', type=str, default=False, nargs='?', help='') # regularization parser.add_argument('--clip_grad_norm', type=float, default=5.0, help='') parser.add_argument('--dropout_in', type=float, default=0.0, help='dropout probability for the input embedding layer') parser.add_argument('--dropout_hidden', type=float, default=0.0, help='dropout probability for the hidden layers') parser.add_argument('--dropout_out', type=float, default=0.0, help='dropout probability for the output layer') parser.add_argument('--dropout_att', type=float, default=0.1, help='dropout probability for the attention weights (for Transformer)') parser.add_argument('--weight_decay', type=float, default=1e-6, help='') parser.add_argument('--lsm_prob', type=float, default=0.0, help='probability of label smoothing') parser.add_argument('--logits_temp', type=float, default=1.0, help='') parser.add_argument('--backward', type=strtobool, default=False, nargs='?', help='') parser.add_argument('--adaptive_softmax', type=strtobool, default=False, help='use adaptive softmax') # transformer parser.add_argument('--transformer_d_model', type=int, default=256, help='number of units in self-attention layers in Transformer') parser.add_argument('--transformer_d_ff', type=int, default=2048, help='number of units in feed-forward fully-conncected layers in Transformer') parser.add_argument('--transformer_attn_type', type=str, default='scaled_dot', choices=['scaled_dot', 'add', 'average'], help='type of attention for Transformer') parser.add_argument('--transformer_n_heads', type=int, default=4, help='number of heads in the attention layer for Transformer') parser.add_argument('--transformer_pe_type', type=str, default='add', choices=['add', 'concat', 'learned_add', 'learned_concat', 'none'], help='type of positional encoding') parser.add_argument('--transformer_layer_norm_eps', type=float, default=1e-12, help='epsilon value for layer narmalization') parser.add_argument('--transformer_ffn_activation', type=str, default='relu', choices=['relu', 'gelu', 'gelu_accurate', 'glu'], help='nonlinear activation for position wise feed-forward layer') parser.add_argument('--transformer_param_init', type=str, default='xavier_uniform', choices=['xavier_uniform', 'pytorch'], help='parameter initializatin for Transformer') # contextualization parser.add_argument('--shuffle', type=strtobool, default=False, nargs='?', help='shuffle utterances per epoch') parser.add_argument('--serialize', type=strtobool, default=False, nargs='?', help='serialize text according to onset in dialogue') # evaluation parameters parser.add_argument('--recog_sets', type=str, default=[], nargs='+', help='tsv file paths for the evaluation sets') parser.add_argument('--recog_model', type=str, default=False, nargs='+', help='model path') parser.add_argument('--recog_dir', type=str, default=False, help='directory to save decoding results') parser.add_argument('--recog_batch_size', type=int, default=1, help='size of mini-batch in evaluation') parser.add_argument('--recog_n_average', type=int, default=5, help='number of models for the model averaging of Transformer') # cache parameters parser.add_argument('--recog_n_caches', type=int, default=0, help='number of tokens for cache') parser.add_argument('--recog_cache_theta', type=float, default=0.2, help='theta paramter for cache') parser.add_argument('--recog_cache_lambda', type=float, default=0.2, help='lambda paramter for cache') args = parser.parse_args() # args, _ = parser.parse_known_args(parser) return args
[ "hiro.mhbc@gmail.com" ]
hiro.mhbc@gmail.com
ec359d94c54049b8b6f3db5b6474d5ff133111d4
1b9d054a5c21e4d044cfc9e8502c899d107cb24c
/main/views.py
09c9a9e1306c8e5df4fa77dd7e4450e530d54d70
[]
no_license
caesar84mx/perfosap
75d1cb7f0c5b06d9a6ec188fc6166a678a7d4664
2c086bee381cb0f3246ce9de4f8fc1f94ad49b5d
refs/heads/master
2021-08-30T18:11:01.577571
2017-12-17T23:30:19
2017-12-17T23:30:19
113,800,208
0
0
null
null
null
null
UTF-8
Python
false
false
136
py
from django.shortcuts import render # Create your views here. def index(request): return render(request, 'static_page/index.html')
[ "dymnov.dm@gmail.com" ]
dymnov.dm@gmail.com
706a6e0e3eadc051f77cc3776ed9e746309a0916
362449a36bdd4960f3d90b9b364e1e422cc146eb
/ms/config/__init__.py
f897f51a1707d3175c8f8def3b08e663d99614d8
[]
no_license
edcilo/flask_example
23456d28dfb59fed9d50c35220cc91e1e272e80f
ee1d87f9cfd836f63db8bdfefed177d85283ecf0
refs/heads/main
2023-08-23T05:57:04.393584
2021-10-04T22:39:59
2021-10-04T22:39:59
409,757,769
0
0
null
2021-10-04T22:39:59
2021-09-23T22:13:29
Python
UTF-8
Python
false
false
88
py
from ms import app from .app_config import app_config app.config.update(**app_config)
[ "edcilop@gmail.com" ]
edcilop@gmail.com
7178b2e9d26d445a2122a1d4f731b76c8ee83375
23ee477d86581def925beb441f3ffa4f512c8f2d
/sr1.py
5dce7462640268fd5840b96bf500ad390f562358
[]
no_license
SebastianAGC/Graficas-por-computadora-Lesson-1
9fdbd74e2032b85cf1eddcc52cd625b32f533509
2af847832810574a60fc88b36e6b3e477c6f1f08
refs/heads/master
2020-05-04T03:47:15.530017
2019-04-01T21:56:17
2019-04-01T21:56:17
178,953,135
0
0
null
null
null
null
UTF-8
Python
false
false
1,038
py
from Bitmap import * screen = None viewPort = {"x": 0, "y": 0, "width": 0, "heigth": 0} blue = color(0, 0, 255) red = color(255, 0, 0) green = color(0, 255, 0) colorStandard = 255 def glInit(): pass def glCreateWindow(width, heigth): global screen screen = Bitmap(width, heigth) def glViewPort(x, y, width, heigth): global viewPort viewPort["x"] = x viewPort["y"] = y viewPort["width"] = width viewPort["heigth"] = heigth def glClear(): screen.clear() def glClearColor(r, g, b): screen.color = color(r, g, b) #Recibe parametros entre -1 y 1 def glVertex(x, y): global viewPort global screen newX = int((x + 1) * (viewPort["width"] / 2) + viewPort["x"]) newY = int((y + 1) * (viewPort["heigth"] / 2) + viewPort["y"]) screen.point(newX, newY, screen.currentColor) def glColor(r, g, b): r = int(r * colorStandard) g = int(g * colorStandard) b = int(b * colorStandard) screen.currentColor = color(r, g, b) def glFinish(): screen.write('out.bmp')
[ "sebastian28.gc@gmail.com" ]
sebastian28.gc@gmail.com
805ac30029896cb4216131c094b637c999ababf1
5f7f89b77b88793723044c9ad9d575d22b9dbee4
/test_multiple_inheritance.py
688ca5c09366c8e46c1925cf07ee2891e733b3db
[]
no_license
chaingng/flask_v1_sampler
3bd0da41d2612c401f2e98b9604c1f4d9db721ac
4192dbc1a87f1fd79eaa98440b84635e99e349a7
refs/heads/master
2022-08-03T14:19:58.396773
2020-05-25T13:10:02
2020-05-25T13:10:02
266,781,067
1
0
null
null
null
null
UTF-8
Python
false
false
556
py
def test_multiple_inheritance(): app = flask.Flask(__name__) class GetView(flask.views.MethodView): def get(self): return 'GET' class DeleteView(flask.views.MethodView): def delete(self): return 'DELETE' class GetDeleteView(GetView, DeleteView): pass app.add_url_rule('/', view_func=GetDeleteView.as_view('index')) c = app.test_client() assert c.get('/').data == b'GET' assert c.delete('/').data == b'DELETE' assert sorted(GetDeleteView.methods) == ['DELETE', 'GET']
[ "chngng0103@gmail.com" ]
chngng0103@gmail.com
3ba66f0eed8ec2ff6be93418deccfcb8dd27c404
ece0d321e48f182832252b23db1df0c21b78f20c
/engine/2.80/scripts/addons/rigify/rigs/limbs/rear_paw.py
74974bb632ee3d0b20de7f3eac7555dbf09bb20a
[ "Unlicense", "GPL-3.0-only", "Font-exception-2.0", "GPL-3.0-or-later", "Apache-2.0", "LicenseRef-scancode-public-domain", "LicenseRef-scancode-unknown-license-reference", "LicenseRef-scancode-public-domain-disclaimer", "Bitstream-Vera", "LicenseRef-scancode-blender-2010", "LGPL-2.1-or-later", ...
permissive
byteinc/Phasor
47d4e48a52fa562dfa1a2dbe493f8ec9e94625b9
f7d23a489c2b4bcc3c1961ac955926484ff8b8d9
refs/heads/master
2022-10-25T17:05:01.585032
2019-03-16T19:24:22
2019-03-16T19:24:22
175,723,233
3
1
Unlicense
2022-10-21T07:02:37
2019-03-15T00:58:08
Python
UTF-8
Python
false
false
13,123
py
import bpy from .paw import Rig as pawRig from .paw import parameters_ui from .paw import add_parameters IMPLEMENTATION = True # Include and set True if Rig is just an implementation for a wrapper class # add_parameters and parameters_ui are unused for implementation classes class Rig(pawRig): def __init__(self, obj, bone_name, params): super(Rig, self).__init__(obj, bone_name, params) def create_sample(obj): # generated by rigify.utils.write_metarig bpy.ops.object.mode_set(mode='EDIT') arm = obj.data bones = {} bone = arm.edit_bones.new('thigh.L') bone.head[:] = 0.0291, 0.1181, 0.2460 bone.tail[:] = 0.0293, 0.1107, 0.1682 bone.roll = 3.1383 bone.use_connect = False bones['thigh.L'] = bone.name bone = arm.edit_bones.new('shin.L') bone.head[:] = 0.0293, 0.1107, 0.1682 bone.tail[:] = 0.0293, 0.1684, 0.1073 bone.roll = 3.1416 bone.use_connect = True bone.parent = arm.edit_bones[bones['thigh.L']] bones['shin.L'] = bone.name bone = arm.edit_bones.new('foot.L') bone.head[:] = 0.0293, 0.1684, 0.1073 bone.tail[:] = 0.0293, 0.1530, 0.0167 bone.roll = 3.1416 bone.use_connect = True bone.parent = arm.edit_bones[bones['shin.L']] bones['foot.L'] = bone.name bone = arm.edit_bones.new('r_toe.L') bone.head[:] = 0.0293, 0.1530, 0.0167 bone.tail[:] = 0.0293, 0.1224, 0.0167 bone.roll = 0.0000 bone.use_connect = True bone.parent = arm.edit_bones[bones['foot.L']] bones['r_toe.L'] = bone.name bone = arm.edit_bones.new('r_palm.001.L') bone.head[:] = 0.0220, 0.1457, 0.0123 bone.tail[:] = 0.0215, 0.1401, 0.0123 bone.roll = 0.0014 bone.use_connect = False bone.parent = arm.edit_bones[bones['r_toe.L']] bones['r_palm.001.L'] = bone.name bone = arm.edit_bones.new('r_palm.002.L') bone.head[:] = 0.0297, 0.1458, 0.0123 bone.tail[:] = 0.0311, 0.1393, 0.0123 bone.roll = -0.0005 bone.use_connect = False bone.parent = arm.edit_bones[bones['r_toe.L']] bones['r_palm.002.L'] = bone.name bone = arm.edit_bones.new('r_palm.003.L') bone.head[:] = 0.0363, 0.1473, 0.0123 bone.tail[:] = 0.0376, 0.1407, 0.0123 bone.roll = 0.0000 bone.use_connect = False bone.parent = arm.edit_bones[bones['r_toe.L']] bones['r_palm.003.L'] = bone.name bone = arm.edit_bones.new('r_palm.004.L') bone.head[:] = 0.0449, 0.1501, 0.0123 bone.tail[:] = 0.0466, 0.1479, 0.0123 bone.roll = -0.0004 bone.use_connect = False bone.parent = arm.edit_bones[bones['r_toe.L']] bones['r_palm.004.L'] = bone.name bone = arm.edit_bones.new('r_index.001.L') bone.head[:] = 0.0215, 0.1367, 0.0087 bone.tail[:] = 0.0217, 0.1325, 0.0070 bone.roll = -0.3427 bone.use_connect = False bone.parent = arm.edit_bones[bones['r_palm.001.L']] bones['r_index.001.L'] = bone.name bone = arm.edit_bones.new('r_middle.001.L') bone.head[:] = 0.0311, 0.1358, 0.0117 bone.tail[:] = 0.0324, 0.1297, 0.0092 bone.roll = -1.0029 bone.use_connect = False bone.parent = arm.edit_bones[bones['r_palm.002.L']] bones['r_middle.001.L'] = bone.name bone = arm.edit_bones.new('r_ring.001.L') bone.head[:] = 0.0376, 0.1372, 0.0117 bone.tail[:] = 0.0389, 0.1311, 0.0092 bone.roll = -1.0029 bone.use_connect = False bone.parent = arm.edit_bones[bones['r_palm.003.L']] bones['r_ring.001.L'] = bone.name bone = arm.edit_bones.new('r_pinky.001.L') bone.head[:] = 0.0466, 0.1444, 0.0083 bone.tail[:] = 0.0476, 0.1412, 0.0074 bone.roll = -1.7551 bone.use_connect = False bone.parent = arm.edit_bones[bones['r_palm.004.L']] bones['r_pinky.001.L'] = bone.name bone = arm.edit_bones.new('r_index.002.L') bone.head[:] = 0.0217, 0.1325, 0.0070 bone.tail[:] = 0.0221, 0.1271, 0.0038 bone.roll = -0.2465 bone.use_connect = True bone.parent = arm.edit_bones[bones['r_index.001.L']] bones['r_index.002.L'] = bone.name bone = arm.edit_bones.new('r_middle.002.L') bone.head[:] = 0.0324, 0.1297, 0.0092 bone.tail[:] = 0.0343, 0.1210, 0.0039 bone.roll = -0.7479 bone.use_connect = True bone.parent = arm.edit_bones[bones['r_middle.001.L']] bones['r_middle.002.L'] = bone.name bone = arm.edit_bones.new('r_ring.002.L') bone.head[:] = 0.0389, 0.1311, 0.0092 bone.tail[:] = 0.0407, 0.1229, 0.0042 bone.roll = -0.7479 bone.use_connect = True bone.parent = arm.edit_bones[bones['r_ring.001.L']] bones['r_ring.002.L'] = bone.name bone = arm.edit_bones.new('r_pinky.002.L') bone.head[:] = 0.0476, 0.1412, 0.0074 bone.tail[:] = 0.0494, 0.1351, 0.0032 bone.roll = -0.8965 bone.use_connect = True bone.parent = arm.edit_bones[bones['r_pinky.001.L']] bones['r_pinky.002.L'] = bone.name bpy.ops.object.mode_set(mode='OBJECT') pbone = obj.pose.bones[bones['thigh.L']] pbone.rigify_type = 'limbs.super_limb' pbone.lock_location = (False, False, False) pbone.lock_rotation = (False, False, False) pbone.lock_rotation_w = False pbone.lock_scale = (False, False, False) pbone.rotation_mode = 'QUATERNION' try: pbone.rigify_parameters.limb_type = "paw" except AttributeError: pass try: pbone.rigify_parameters.fk_layers = [False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] except AttributeError: pass try: pbone.rigify_parameters.tweak_layers = [False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] except AttributeError: pass try: pbone.rigify_parameters.segments = 2 except AttributeError: pass pbone = obj.pose.bones[bones['shin.L']] pbone.rigify_type = '' pbone.lock_location = (False, False, False) pbone.lock_rotation = (False, False, False) pbone.lock_rotation_w = False pbone.lock_scale = (False, False, False) pbone.rotation_mode = 'QUATERNION' pbone = obj.pose.bones[bones['foot.L']] pbone.rigify_type = '' pbone.lock_location = (False, False, False) pbone.lock_rotation = (False, False, False) pbone.lock_rotation_w = False pbone.lock_scale = (False, False, False) pbone.rotation_mode = 'QUATERNION' pbone = obj.pose.bones[bones['r_toe.L']] pbone.rigify_type = '' pbone.lock_location = (False, False, False) pbone.lock_rotation = (False, False, False) pbone.lock_rotation_w = False pbone.lock_scale = (False, False, False) pbone.rotation_mode = 'QUATERNION' pbone = obj.pose.bones[bones['r_palm.001.L']] pbone.rigify_type = 'limbs.super_palm' pbone.lock_location = (False, False, False) pbone.lock_rotation = (False, False, False) pbone.lock_rotation_w = False pbone.lock_scale = (False, False, False) pbone.rotation_mode = 'QUATERNION' pbone = obj.pose.bones[bones['r_palm.002.L']] pbone.rigify_type = '' pbone.lock_location = (False, False, False) pbone.lock_rotation = (False, False, False) pbone.lock_rotation_w = False pbone.lock_scale = (False, False, False) pbone.rotation_mode = 'QUATERNION' pbone = obj.pose.bones[bones['r_palm.003.L']] pbone.rigify_type = '' pbone.lock_location = (False, False, False) pbone.lock_rotation = (False, False, False) pbone.lock_rotation_w = False pbone.lock_scale = (False, False, False) pbone.rotation_mode = 'QUATERNION' pbone = obj.pose.bones[bones['r_palm.004.L']] pbone.rigify_type = 'limbs.super_palm' pbone.lock_location = (False, False, False) pbone.lock_rotation = (False, False, False) pbone.lock_rotation_w = False pbone.lock_scale = (False, False, False) pbone.rotation_mode = 'QUATERNION' pbone = obj.pose.bones[bones['r_index.001.L']] pbone.rigify_type = 'limbs.simple_tentacle' pbone.lock_location = (False, False, False) pbone.lock_rotation = (False, False, False) pbone.lock_rotation_w = False pbone.lock_scale = (False, False, False) pbone.rotation_mode = 'QUATERNION' try: pbone.rigify_parameters.tweak_layers = [False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] except AttributeError: pass pbone = obj.pose.bones[bones['r_middle.001.L']] pbone.rigify_type = 'limbs.simple_tentacle' pbone.lock_location = (False, False, False) pbone.lock_rotation = (False, False, False) pbone.lock_rotation_w = False pbone.lock_scale = (False, False, False) pbone.rotation_mode = 'QUATERNION' try: pbone.rigify_parameters.tweak_layers = [False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] except AttributeError: pass pbone = obj.pose.bones[bones['r_ring.001.L']] pbone.rigify_type = 'limbs.simple_tentacle' pbone.lock_location = (False, False, False) pbone.lock_rotation = (False, False, False) pbone.lock_rotation_w = False pbone.lock_scale = (False, False, False) pbone.rotation_mode = 'QUATERNION' try: pbone.rigify_parameters.tweak_layers = [False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] except AttributeError: pass pbone = obj.pose.bones[bones['r_pinky.001.L']] pbone.rigify_type = 'limbs.simple_tentacle' pbone.lock_location = (False, False, False) pbone.lock_rotation = (False, False, False) pbone.lock_rotation_w = False pbone.lock_scale = (False, False, False) pbone.rotation_mode = 'QUATERNION' try: pbone.rigify_parameters.tweak_layers = [False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] except AttributeError: pass pbone = obj.pose.bones[bones['r_index.002.L']] pbone.rigify_type = '' pbone.lock_location = (False, False, False) pbone.lock_rotation = (False, False, False) pbone.lock_rotation_w = False pbone.lock_scale = (False, False, False) pbone.rotation_mode = 'QUATERNION' pbone = obj.pose.bones[bones['r_middle.002.L']] pbone.rigify_type = '' pbone.lock_location = (False, False, False) pbone.lock_rotation = (False, False, False) pbone.lock_rotation_w = False pbone.lock_scale = (False, False, False) pbone.rotation_mode = 'QUATERNION' pbone = obj.pose.bones[bones['r_ring.002.L']] pbone.rigify_type = '' pbone.lock_location = (False, False, False) pbone.lock_rotation = (False, False, False) pbone.lock_rotation_w = False pbone.lock_scale = (False, False, False) pbone.rotation_mode = 'QUATERNION' pbone = obj.pose.bones[bones['r_pinky.002.L']] pbone.rigify_type = '' pbone.lock_location = (False, False, False) pbone.lock_rotation = (False, False, False) pbone.lock_rotation_w = False pbone.lock_scale = (False, False, False) pbone.rotation_mode = 'QUATERNION' bpy.ops.object.mode_set(mode='EDIT') for bone in arm.edit_bones: bone.select = False bone.select_head = False bone.select_tail = False for b in bones: bone = arm.edit_bones[bones[b]] bone.select = True bone.select_head = True bone.select_tail = True arm.edit_bones.active = bone for eb in arm.edit_bones: if ('thigh' in eb.name) or ('shin' in eb.name) or ('foot' in eb.name) or ('toe' in eb.name): eb.layers = (False, False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False) else: eb.layers = (False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False) arm.layers = (False, False, False, False, False, True, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False) if __name__ == "__main__": create_sample(bpy.context.active_object)
[ "admin@irradiate.net" ]
admin@irradiate.net
39b25d8e29cb9e471281598f8a0a1165d686802a
cd614e86420cd43836e7f146752f5ad7da836194
/downloads/resources.py
5c97341ae0e3486deb59915c73b5bb59ef15e4fc
[]
no_license
tianyouzhu/you
37a112f037694b655de1b7ca9912069a7895247a
4c3f6fd212da2911c926817e96178250138ea192
refs/heads/master
2021-05-14T10:19:21.854773
2018-01-05T06:45:26
2018-01-05T06:45:26
116,349,771
0
1
null
2018-01-05T10:44:58
2018-01-05T06:19:32
JavaScript
UTF-8
Python
false
false
7,907
py
# -*- coding: utf-8 -*- from tastypie.resources import Resource from django.conf.urls import url from django.core.servers.basehttp import FileWrapper from yottaweb.apps.basic.resources import MyBasicAuthentication from yottaweb.apps.basic.resources import ContributeErrorData from yottaweb.apps.backend.resources import BackendRequest from yottaweb.apps.variable.resources import MyVariable import os from django.http import HttpResponse import mimetypes from django.http import StreamingHttpResponse from django.http import Http404 from django.utils.http import urlquote import logging import time import json __author__ = 'wangqiushi' err_data = ContributeErrorData() audit_logger = logging.getLogger('yottaweb.audit') class DownloadsResource(Resource): # Just like a Django ``Form`` or ``Model``, we're defining all the # fields we're going to handle with the API here. class Meta: resource_name = 'downloads' always_return_data = True include_resource_uri = False def prepend_urls(self): return [ url(r"^(?P<resource_name>%s)/list/$" % self._meta.resource_name, self.wrap_view('download_list'), name="api_download"), url(r"^(?P<resource_name>%s)/logs_download/(?P<fid>[\u4e00-\u9fa5\w\d_\.\-\\\/]+)/$" % self._meta.resource_name, self.wrap_view('logs_download'), name="api_download"), url(r"^(?P<resource_name>%s)/del/$" % self._meta.resource_name, self.wrap_view('delete_download'), name="api_download"), url(r"^(?P<resource_name>%s)/(?P<fid>[\w\d_.\-@]+)/$" % self._meta.resource_name, self.wrap_view('csv_download'), name="api_download"), ] def csv_download(self, request, **kwargs): self.method_check(request, allowed=['get']) data = [] dummy_data = {} my_auth = MyBasicAuthentication() es_check = my_auth.is_authenticated(request, **kwargs) if es_check: file_name = kwargs['fid'] root_path = os.getcwd() my_var = MyVariable() data_path = my_var.get_var('path', 'data_path') tmp_path = data_path + "yottaweb_tmp/" + es_check["d"] + "/" + es_check["u"] + "/" filename = tmp_path + file_name wrapper = FileWrapper(file(filename)) resp = HttpResponse(wrapper, content_type='text/plain') # resp = self.create_response(request, wrapper) resp['Content-Length'] = os.path.getsize(filename) resp['Content-Encoding'] = 'utf-8' resp['Content-Disposition'] = 'attachment;filename=%s' % file_name else: data = err_data.build_error({}, "auth error!") data["location"] = "/auth/login/" dummy_data = data bundle = self.build_bundle(obj=dummy_data, data=dummy_data, request=request) response_data = bundle resp = self.create_response(request, response_data) return resp def logs_download(self, request, **kwargs): self.method_check(request, allowed=['get']) data = [] dummy_data = {} my_auth = MyBasicAuthentication() es_check = my_auth.is_authenticated(request, **kwargs) if es_check: domain = es_check['d'] user_id = es_check['i'] file_name = kwargs['fid'] base_file_name = os.path.basename(file_name) to_log = { "timestamp": time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()), "action": "download", "module": "download", "user_name": es_check["u"], "user_id": es_check["i"], "domain": es_check["d"], "target": base_file_name, "result": "success" } pathArr = file_name.split('/') if domain == pathArr[-3] and user_id == int(pathArr[-2]): file_name = '/' + file_name chunk_size = 8192 resp = StreamingHttpResponse(FileWrapper(open(file_name, 'rb'), chunk_size), content_type=mimetypes.guess_type(file_name)[0]) resp['Content-Length'] = os.path.getsize(file_name) resp['Content-Encoding'] = 'utf-8' ua = request.META.get('HTTP_USER_AGENT', '') if ua and self.detectIE(ua): resp['Content-Disposition'] = "attachment; filename=" + urlquote(base_file_name) else: resp['Content-Disposition'] = "attachment; filename={0}".format(base_file_name.encode('utf8')) audit_logger.info(json.dumps(to_log)) else: to_log["result"] = "error" to_log["msg"] = "domain or user_id does not match" audit_logger.info(json.dumps(to_log)) raise Http404 else: data = err_data.build_error({}, "auth error!") data["location"] = "/auth/login/" dummy_data = data response_data = self.build_bundle(obj=dummy_data, data=dummy_data, request=request) resp = self.create_response(request, response_data) return resp def delete_download(self, request, **kwargs): self.method_check(request, allowed=['post']) post_data = request.POST file_name = post_data.get("file_name", "") my_auth = MyBasicAuthentication() es_check = my_auth.is_authenticated(request, **kwargs) dummy_data = {} if es_check: param = { 'token': es_check['t'], 'operator': es_check['u'], 'file_name': file_name } res = BackendRequest.delete_download(param) if res['result']: dummy_data["status"] = "1" else: dummy_data = err_data.build_error(res) else: data = err_data.build_error({}, "auth error!") data["location"] = "/auth/login/" dummy_data = data bundle = self.build_bundle(obj=dummy_data, data=dummy_data, request=request) response_data = bundle resp = self.create_response(request, response_data) return resp def download_list(self, request, **kwargs): self.method_check(request, allowed=['get']) dummy_data = {} my_auth = MyBasicAuthentication() es_check = my_auth.is_authenticated(request, **kwargs) if es_check: param = { 'token': es_check['t'], 'operator': es_check['u'], 'category': 'download' } res = BackendRequest.get_job_list(param) print res try: if res["rc"] == 0: print res if res["jobs"]: dummy_data["status"] = "1" dummy_data["list"] = res["jobs"] else: dummy_data = err_data.build_error_new(error_code=res.get("rc", "1"), msg=res.get("error", ""), origin="spl") except Exception, e: dummy_data = err_data.build_error_new(res.get("rc", "1")) else: data = err_data.build_error_new(error_code="2", param={"location": "/auth/login/"}) dummy_data = data response_data = self.build_bundle(obj=dummy_data, data=dummy_data, request=request) return self.create_response(request, response_data) def detectIE(self, ua): # IE 10 or older msie = ua.find('MSIE ') if msie > 0: return True # IE 11 trident = ua.find('Trident/') if trident > 0: return True # Edge (IE 12+) edge = ua.find('Edge/') if edge > 0: return True return False
[ "718669269@qq.com" ]
718669269@qq.com
79bdd49ffe23533940e356f1c22e548a0f21a771
0f25422ea9af848bb753d6b4b94d3d22d441eada
/plresolution.py
0eb46ed2e9453cab87da35fd552ea678f04159f8
[ "MIT" ]
permissive
priyansha147/Solve-CSP-using-CNF-Resolution
d1e339c0a39d4861d83010dbc46e566a3acbc3cc
58717c23b8a7613516d153735b7c8c3e791584b4
refs/heads/master
2021-01-22T20:44:55.403979
2017-03-17T20:54:20
2017-03-17T20:54:20
85,352,688
0
0
null
null
null
null
UTF-8
Python
false
false
3,253
py
import copy def pl_resolve(ci, cj): citemp = copy.deepcopy(ci) cjtemp = copy.deepcopy(cj) print citemp, cjtemp clauses = [] flag = 0 for i in ci: for j in cj: if i == "~" + j or j == "~" + i: flag = 1 del citemp[citemp.index(i)] del cjtemp[cjtemp.index(j)] clauses.append(sorted(citemp + cjtemp)) return clauses, flag return clauses, flag def pl_resolution(cnf): new_cnf = set() cnt = 0 while True: n = len(cnf) pairs = [(cnf[i], cnf[j]) for i in range(n) for j in range(i + 1, n)] for (ci, cj) in pairs: resolvents, flag = pl_resolve(ci, cj) print "R : " ,resolvents if flag == 1: for x in resolvents: if not x: return False else : continue new_cnf = new_cnf.union(set(tuple(row) for row in resolvents)) print "Union : ", new_cnf if new_cnf.issubset(set(tuple(row) for row in cnf)): return True for c in new_cnf: c = list(c) #print type(c) #print "C " , c if c not in cnf: cnf.append(c) print "CNF : ", cnf print len(cnf) def generate_cnf(): cnf = [] for m in range(1, M + 1): clause = [] for n in range(1, N+1): clause.append("X" + str([m, n])) for ni in range(n+1, N+1): clauseneg = [] clauseneg.append("~X" + str([m, n])) clauseneg.append("~X" + str([m, ni])) cnf.append(clauseneg) cnf.append(clause) for x in range(1, M+1): for y in range(1, M+1): if R[x][y] == 1: for n in range(1, N+1): clause = [] clause.append("~X" + str([x, n])) clause.append("X" + str([y, n])) cnf.append(clause) clause = [] clause.append("X" + str([x, n])) clause.append("~X" + str([y, n])) cnf.append(clause) for x in range(1, M+1): for y in range(1, M+1): if R[x][y] == -1: for n in range(1, N+1): clause = [] clause.append("~X" + str([x, n])) clause.append("~X" + str([y, n])) cnf.append(clause) print cnf print len(cnf) print pl_resolution(cnf) fo = open("input.txt", "r") inputList = fo.readlines() line1 = [] for word in inputList[0].split(" "): line1.append(int(word)) M = line1[0] #Number of guests N = line1[1] #Number of tables R = [[]] for x in range(0,M): inner = [[]] for y in range(0,M): inner.append(0) R.append(inner) for val in range(1,len(inputList)): b = inputList[val].split(" ") if b[2] == "F" or b[2] == "F\n": R[int(b[0])][int(b[1])] = 1 else: R[int(b[0])][int(b[1])] = -1 print R generate_cnf()
[ "noreply@github.com" ]
noreply@github.com
27af43c2fd6bbd823323415af19c855c3bcf4f67
6f515ce3664bf34974b755db4f7843f24a4d74a7
/robinson/book.py
6c1638e0e041e82bfa2e0e0321cf6184492b408e
[ "MIT" ]
permissive
byztxt/librobinson
dff3438dcc0e4624386ac3c04a936ca5b823a9c4
9acac9fbea409a767e020ff7e39018e43b0f6470
refs/heads/master
2021-07-10T06:18:58.642175
2021-07-03T16:35:45
2021-07-03T16:35:45
90,252,927
7
1
null
null
null
null
UTF-8
Python
false
false
13,709
py
import string import sys from verse import * from chapter import * from variant import * from kind import * import word from booknames import * myverseletters = ["a", "b", "c", "d", "e", "f", "g"] verse_re = re.compile(r'\(?(\d+):(\d+)\)?') class Book: def __init__(self, filename, encoding): self.filename = filename self.parse_filename(filename) self.chapter = 0 self.ch = 0 self.vs = 0 self.verse = -1 self.chapters = [] self.verses = [] self.verse_dict = {} self.variant = variant_none self.encoding = encoding def parse_filename(self, filename): path_ingridients = filename.split("/") bk = path_ingridients[-1].split(".")[0].upper() self.OLB_bookname = bk try: (self.bookname, self.booknumber) = OLB2More[bk] except: print "Unknown bookname: '%s'" % bk sys.exit() def read(self, start_monad, read_what): self.start_monad = start_monad self.chapter_first_monad = start_monad self.end_monad = start_monad - 1 f = self.open_file() lines = f.readlines() f.close() self.parse_lines(lines, read_what) return self.end_monad def read_linear(self, start_monad): self.start_monad = start_monad self.chapter_first_monad = start_monad self.end_monad = start_monad - 1 f = self.open_file() lines = f.readlines() f.close() self.parse_lines_linear(lines) return self.end_monad def parse_lines_linear(self, lines): for line in lines: line = line.replace("\r", "").replace("\n", "") myarr = line.split(" ") mybook = myarr[0] mychapterverse = myarr[1] mysurface = myarr[2] mytag = myarr[3] mystrongs = myarr[4] strongslemma = "" ANLEXlemma = "" if len(myarr) > 5: whatamIdoing = kStrongs strongslemmas = [] ANLEXlemmas = [] for mystr in myarr[5:]: if mystr == "!": whatamIdoing = kANLEX else: if whatamIdoing == kStrongs: strongslemmas.append(mystr) else: ANLEXlemmas.append(mystr) strongslemma = " ".join(strongslemmas) ANLEXlemma = " ".join(ANLEXlemmas) self.process_linear_verse(mychapterverse) self.process_linear_word(mysurface, mytag, mystrongs, strongslemma, ANLEXlemma) self.parseChapter(self.chapter, self.end_monad) def process_linear_verse(self, mychapterverse): myarr = mychapterverse[0:mychapterverse.find(".")].split(":") mychapter = int(myarr[0]) myverse = int(myarr[1]) chapter_end = self.end_monad self.end_monad += 1 if self.chapter != mychapter: if self.chapter <> 0: self.parseChapter(self.chapter, chapter_end) self.chapter = mychapter if self.verse != myverse: self.verse = myverse verse = Verse([], self.bookname, self.booknumber, self.encoding) verse.chapter = mychapter verse.verse = myverse verse.first_monad = self.end_monad verse.last_monad = self.end_monad self.verses.append(verse) def process_linear_word(self, mysurface, mytag, mystrongs, strongslemma, ANLEXlemma): w = word.Word(self.end_monad, variant_none, self.encoding) w.surface = mysurface w.accented_surface = mysurface w.parsing = mytag w.Strongs1 = mystrongs w.strongslemma = strongslemma w.ANLEXlemma = ANLEXlemma self.verses[-1].words.append(w) self.verses[-1].last_monad = self.end_monad def open_file(self): f = open(self.filename, "r") return f def parse_lines(self, lines, read_what): all = "\n".join(lines) if self.OLB_bookname == "MT": # Occurs in ByzParsed Matthew all = all.replace("23:13 (23:14)", "23:13").replace("23:14 (23:13)", "23:14") elif self.OLB_bookname == "RE": # Revelation 17:8 was treated as it was because Dr. Robinson # uses Online Bible for DOS himself, and # OLB for DOS has a limit on how many words can be in a verse. # This one is just particularly long, and breaks the barrier # on OLB for DOS. # All other (ch:vs) should probably be ignored. all = all.replace("(17:8)", "$@!@$").replace("17:8", "").replace("$@!@$", " 17:8 ") words = [] mystack = [] chvs = "" for w in all.split(): if recognize(w) in [kind_verse, kind_parens]: chvs = w if w == "M5:": mystack.append(":M5") elif w == "M6:": mystack.append(":M6") elif w == "VAR:": mystack.append(":END") elif w in [":M5", ":M6", ":END"]: end_of_stack = mystack[-1] mystack = mystack[:-1] if w != end_of_stack: print "UP310: %s end_of_stack = '%s', w = '%s', line_words = %s" % (self.bookname, end_of_stack, w, line_words) # # NOTE: They are not balanced in the text, # so let's not try... # raise "Error! M5/M6/VAR-END not balanced..." pass else: if len(mystack) == 0: words.append(w) else: pass overall_text = " ".join(words) if text_variant_strongs_parsing_re.search(overall_text) != None: overall_text = text_variant_strongs_parsing_re.sub(r'| \1\3 | \2\3 | ', overall_text) if text_strongs_varparsing_varparsing_re.search(overall_text) != None: overall_text = text_strongs_varparsing_varparsing_re.sub(r'| \1\2 | \1\3 | ', overall_text) if text_strongs_vartext_varstrongs_parsing.search(overall_text) != None: overall_text = text_strongs_vartext_varstrongs_parsing.sub(r'| \1 \3 | \2 \3 | ', overall_text) # In Romans 16:27 of WH, we find the line ends with "{HEB}|". # We need this to be "{HEB} |". overall_text = overall_text.replace("}|", "} |") words = [] for wd in overall_text.split(): if wd == "|": if self.variant == variant_none: self.variant = variant_first elif self.variant == variant_first: self.variant = variant_second elif self.variant == variant_second: self.variant = variant_none else: raise Exception("Error: Unknown self.variant: %s" % self.variant) elif recognize(wd) == kind_parens: # Remove parens altogether pass else: if self.variant == variant_none: words.append(wd) elif self.variant == variant_first: if read_what == reader.read_first_variant_only: words.append(wd) else: pass elif self.variant == variant_second: if read_what == reader.read_second_variant_only: words.append(wd) else: pass else: raise Exception("Error: Unknown variant: %s" % self.variant) verses = [] # List of lists of strings for wd in words: if recognize(wd) == kind_verse: (ch,vs) = verse_re.findall(wd)[0] verses.append([]) self.ch = ch self.vs = vs verses[-1].append(wd) else: verses[-1].append(wd) LAST_VERSE_INDEX = len(verses) - 1 for index in xrange(0, len(verses)): bIsLastVerseOfBook = index == LAST_VERSE_INDEX self.parseVerse(verses[index], self.end_monad + 1, bIsLastVerseOfBook, read_what) def parseVerse(self, verse_lines, first_monad, is_last_verse_of_book, read_what): verse = Verse(verse_lines, self.bookname, self.booknumber, self.encoding) self.verses.append(verse) chapter_end = self.end_monad self.end_monad = verse.parse(first_monad) chapter = verse.chapter if is_last_verse_of_book: chapter_end = self.end_monad self.parseChapter(self.chapter, chapter_end) elif self.chapter <> chapter: if self.chapter <> 0: self.parseChapter(self.chapter, chapter_end) self.chapter = chapter def parseChapter(self, chapter, chapter_end_monad): ch = Chapter(self.chapter_first_monad, chapter_end_monad, chapter, self.bookname) self.chapters.append(ch) self.chapter_first_monad = chapter_end_monad + 1 def writeVersesMQL(self, f, bUseOldStyle): if not bUseOldStyle: print >>f, "CREATE OBJECTS WITH OBJECT TYPE [Verse]" for v in self.verses: v.writeMQL(f, bUseOldStyle) if not bUseOldStyle: print >>f, "GO" print >>f, "" def writeWordsMQL(self, f, bUseOldStyle): if not bUseOldStyle: print >>f, "CREATE OBJECTS WITH OBJECT TYPE [Word]" for v in self.verses: v.writeWordsMQL(f, bUseOldStyle) if not bUseOldStyle: print >>f, "GO" print >>f, "" def writeChaptersMQL(self, f, bUseOldStyle): if not bUseOldStyle: print >>f, "CREATE OBJECTS WITH OBJECT TYPE [Chapter]" for ch in self.chapters: ch.writeMQL(f, bUseOldStyle) if not bUseOldStyle: print >>f, "GO" print >>f, "" def writeBookMQL(self, f, bUseOldStyle): print >>f, "CREATE OBJECT" print >>f, "FROM MONADS = {", self.start_monad, "-", self.end_monad, "}" print >>f, "[Book" print >>f, " book:=" + self.bookname + ";" print >>f, "]" print >>f, "GO" print >>f, "" def writeMQL(self, f, bUseOldStyle): if not bUseOldStyle: print >>f, "BEGIN TRANSACTION GO" self.writeBookMQL(f, bUseOldStyle) self.writeChaptersMQL(f, bUseOldStyle) self.writeVersesMQL(f, bUseOldStyle) self.writeWordsMQL(f, bUseOldStyle) if not bUseOldStyle: print >>f, "COMMIT TRANSACTION GO" def writeSFM(self, f, cur_monad): for v in self.verses: cur_monad = v.writeSFM(f, cur_monad) return cur_monad def getWords(self): result = [] for v in self.verses: result.extend(v.getWords()) return result def addToVerseDict(self, myverse): ref = myverse.getRef() try: self.verse_dict[ref] except KeyError: self.verse_dict[ref] = [] self.verse_dict[ref].append(myverse) def addVersesToVerseDict(self): for v in self.verses: self.addToVerseDict(v) def getVersesByRef(self, ref): try: return self.verse_dict[ref] except KeyError: return None def applyLemma(self, mapping, lemma_kind): words = self.getWords() for w in words: w.applyLemma(mapping, lemma_kind) def getVerseCopy(self, whverse): ref = whverse.getRef() mylist = self.verse_dict[ref] if len(mylist) == 0: raise Exception("Error: On ref %s: mylist is empty" % ref) elif len(mylist) == 1: return "" else: index = 0 for v in mylist: if v is whverse: return myverseletters[index] index += 1 raise Exception("Error: On ref %s: whverse is not in list!" % ref) def write_MORPH_style(self, filename, encodingStyle): f = open(filename, "w") for whverse in self.verses: whverse.write_MORPH_style(f, self.getVerseCopy(whverse), encodingStyle) f.close() def write_subset_MORPH_style(self, f, word_predicate, manualanalyses, encodingStyle): for whverse in self.verses: whverse.write_subset_MORPH_style(f, self.getVerseCopy(whverse), word_predicate, manualanalyses, encodingStyle) def write_StrippedLinear(self, filename): self.addVersesToVerseDict() f = open(filename, "w") for whverse in self.verses: whverse.write_StrippedLinear(f, self.getVerseCopy(whverse)) f.close() def write_WHLinear(self, f): self.addVersesToVerseDict() for whverse in self.verses: whverse.write_WHLinear(f, self.getVerseCopy(whverse)) def write_Linear(self, filename): self.addVersesToVerseDict() f = open(filename, "w") for whverse in self.verses: whverse.write_Linear(f, self.getVerseCopy(whverse)) f.close() def apply_predicate(self, pred, extra): for verse in self.verses: verse.apply_predicate(self.OLB_bookname, pred, extra)
[ "ulrikp@scripturesys.com" ]
ulrikp@scripturesys.com
057418d9203386866b6b7fbc6ffe76f306489dcc
bddc40a97f92fafb8cbbbfdbdfe6774996578bb0
/exercicioLista_funcoes/ex12.py
ee26987f60bcef8d32b6fc9a3cf3d93898187be6
[]
no_license
andrehmiguel/treinamento
8f83041bd51387dd3e5cafed09c4bb0a08d0e375
ed18e6a8cfba0baaa68757c12893c62a0938a67e
refs/heads/main
2023-01-31T13:15:58.113392
2020-12-16T02:47:44
2020-12-16T02:47:44
317,631,214
0
0
null
null
null
null
UTF-8
Python
false
false
680
py
# 12. Embaralha palavra . Construa uma função que receba uma string como parâmetro e # devolva outra string com os carateres embaralhados. Por exemplo: se função # receber a palavra python , pode retornar npthyo , ophtyn ou qualquer outra # combinação possível, de forma aleatória. Padronize em sua função que todos os # caracteres serão devolvidos em caixa alta ou caixa baixa, independentemente de # como foram digitados. from random import shuffle def embaralha(palavra): lista = list(palavra) shuffle(lista) lista = ''.join(lista) print(lista.upper()) palavra = input('Insira uma palavra ou frase para embaralhar: ').strip() embaralha(palavra)
[ "andrehmiguel@outlook.com" ]
andrehmiguel@outlook.com
305b085aea7fc9a1b2e6b0fdabaab2af23f5aa86
facbe99cec567f5594684f1dac3165492bf0e015
/outdated/tmxconverter/tmx_converter.py
ac1ba1d7b4fbb78e41c226ba7c11095024bce2e3
[]
no_license
wushin/evol-tools
a00d14d99afd9e97dca1f9c8b68de59fdb42d093
357ae6673aae16f4f8bbddf9c70d0f6c3fc389db
refs/heads/master
2016-09-05T15:57:28.714888
2015-03-02T07:18:27
2015-03-02T07:18:27
30,341,513
0
0
null
null
null
null
UTF-8
Python
false
false
13,246
py
#!/usr/bin/env python # -*- encoding: utf-8 -*- ## tmx_converter.py - Extract walkmap, warp, and spawn information from maps. ## ## Copyright © 2012 Ben Longbons <b.r.longbons@gmail.com> ## ## This file is part of The Mana World ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 2 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program. If not, see <http://www.gnu.org/licenses/>. from __future__ import print_function import sys import os import posixpath import struct import xml.sax import base64 import zlib dump_all = False # wall of text # lower case versions of everything except 'spawn' and 'warp' other_object_types = set([ 'particle_effect', 'npc', # not interpreted by client 'script', # for ManaServ 'fixme', # flag for things that didn't have a type before ]) # Somebody has put ManaServ fields in our data! other_spawn_fields = ( 'spawn_rate', ) other_warp_fields = ( ) TILESIZE = 32 SEPARATOR = '|' MESSAGE = 'This file is generated automatically. All manually changes will be removed when running the Converter.' CLIENT_MAPS = 'maps' SERVER_WLK = 'data' SERVER_NPCS = 'npc' NPC_MOBS = '_mobs.txt' NPC_WARPS = '_warps.txt' NPC_IMPORTS = '_import.txt' NPC_MASTER_IMPORTS = NPC_IMPORTS class State(object): pass State.INITIAL = State() State.LAYER = State() State.DATA = State() State.FINAL = State() class Object(object): __slots__ = ( 'name', #'map', 'x', 'y', 'w', 'h', ) class Mob(Object): __slots__ = ( 'monster_id', 'max_beings', 'ea_spawn', 'ea_death', ) + other_spawn_fields def __init__(self): self.max_beings = 1 self.ea_spawn = 0 self.ea_death = 0 class Warp(Object): __slots__ = ( 'dest_map', 'dest_x', 'dest_y', ) + other_warp_fields class ContentHandler(xml.sax.ContentHandler): __slots__ = ( 'locator', # keeps track of location in document 'out', # open file handle to .wlk 'state', # state of collision info 'tilesets', # first gid of each tileset 'buffer', # characters within a section 'encoding', # encoding of layer data 'compression', # compression of layer data 'width', # width of the collision layer 'height', # height of the collision layer 'base', # base name of current map 'npc_dir', # world/map/npc/<base> 'mobs', # open file to _mobs.txt 'warps', # open file to _warps.txt 'imports', # open file to _import.txt 'name', # name property of the current map 'object', # stores properties of the latest <object> tag 'mob_ids', # set of all mob types that spawn here 'collision_fgid', # first gid in collision tileset ) def __init__(self, out, npc_dir, mobs, warps, imports): xml.sax.ContentHandler.__init__(self) self.locator = None self.out = open(out, 'w') self.state = State.INITIAL self.tilesets = set([0]) # consider the null tile as its own tileset self.buffer = bytearray() self.encoding = None self.compression = None self.width = None self.height = None self.base = posixpath.basename(npc_dir) self.npc_dir = npc_dir self.mobs = mobs self.warps = warps self.imports = imports self.object = None self.mob_ids = set() self.collision_fgid = 0 def setDocumentLocator(self, loc): self.locator = loc # this method randomly cuts in the middle of a line; thus funky logic def characters(self, s): if not s.strip(): return if self.state is State.DATA: self.buffer += s.encode('ascii') def startDocument(self): pass def startElement(self, name, attr): if dump_all: attrs = ' '.join('%s="%s"' % (k,v) for k,v in attr.items()) if attrs: print('<%s %s>' % (name, attrs)) else: print('<%s>' % name) if self.state is State.INITIAL: if name == u'property' and attr[u'name'].lower() == u'name': self.name = attr[u'value'] self.mobs.write('// %s\n' % MESSAGE) self.mobs.write('// %s mobs\n\n' % self.name) self.warps.write('// %s\n' % MESSAGE) self.warps.write('// %s warps\n\n' % self.name) if name == u'tileset': self.tilesets.add(int(attr[u'firstgid'])) if attr.get(u'name','').lower().startswith(u'collision'): self.collision_fgid = int(attr[u'firstgid']) if name == u'layer' and attr[u'name'].lower().startswith(u'collision'): self.width = int(attr[u'width']) self.height = int(attr[u'height']) self.out.write(struct.pack('<HH', self.width, self.height)) self.state = State.LAYER elif self.state is State.LAYER: if name == u'layer': self.collision_lgid = int(attr[u'firstgid'])-1 if name == u'data': if attr.get(u'encoding','') not in (u'', u'csv', u'base64', u'xml'): print('Bad encoding:', attr.get(u'encoding','')) return self.encoding = attr.get(u'encoding','') if attr.get(u'compression','') not in (u'', u'none', u'zlib', u'gzip'): print('Bad compression:', attr.get(u'compression','')) return self.compression = attr.get(u'compression','') self.state = State.DATA elif self.state is State.DATA: if name == u'tile': gid = int(attr.get(u'gid')) if gid <> 0: self.out.write(chr(int(attr.get(u'gid',0)) - self.collision_fgid)) else: self.out.write(chr(0)) elif self.state is State.FINAL: if name == u'object': if attr.get(u'type') == None: return obj_type = attr[u'type'].lower() x = int(attr[u'x']) / TILESIZE; y = int(attr[u'y']) / TILESIZE; w = int(attr.get(u'width', 0)) / TILESIZE; h = int(attr.get(u'height', 0)) / TILESIZE; # I'm not sure exactly what the w/h shrinking is for, # I just copied it out of the old converter. # I know that the x += w/2 is to get centers, though. if obj_type == 'spawn': self.object = Mob() if w > 1: w -= 1 if h > 1: h -= 1 x += w/2 y += h/2 elif obj_type == 'warp': self.object = Warp() x += w/2 y += h/2 w -= 2 h -= 2 else: if obj_type not in other_object_types: print('Unknown object type:', obj_type, file=sys.stderr) self.object = None return obj = self.object obj.x = x obj.y = y obj.w = w obj.h = h obj.name = attr[u'name'] elif name == u'property': obj = self.object if obj is None: return key = attr[u'name'].lower() value = attr[u'value'] # Not true due to defaulting #assert not hasattr(obj, key) try: value = int(value) except ValueError: pass setattr(obj, key, value) def add_warp_line(self, line): self.warps.write(line) def endElement(self, name): if dump_all: print('</%s>' % name) if name == u'object': obj = self.object if isinstance(obj, Mob): if not hasattr(obj, u'max_beings') or not hasattr(obj, u'ea_spawn') or not hasattr(obj, u'ea_death'): return mob_id = obj.monster_id if mob_id < 1000: mob_id += 1002 self.mob_ids.add(mob_id) self.mobs.write( SEPARATOR.join([ '%s.gat,%d,%d,%d,%d' % (self.base, obj.x, obj.y, obj.w, obj.h), 'monster', obj.name, '%d,%d,%d,%d,Mob%s::On%d\n' % (mob_id, obj.max_beings, obj.ea_spawn, obj.ea_death, self.base, mob_id), ]) ) elif isinstance(obj, Warp): if not hasattr(obj, u'dest_map') or not hasattr(obj, u'dest_x') or not hasattr(obj, u'dest_y'): return self.warps.write( SEPARATOR.join([ '%s.gat,%d,%d' % (self.base, obj.x, obj.y), 'warp', obj.name, '%d,%d,%s.gat,%d,%d\n' % (obj.w, obj.h, obj.dest_map, obj.dest_x / 32, obj.dest_y / 32), ]) ) if name == u'data': if self.state is State.DATA: if self.encoding == u'csv': for x in self.buffer.split(','): if x <> 0: self.out.write(chr(int(x) - self.collision_fgid)) else: self.out.write(chr(0)) elif self.encoding == u'base64': data = base64.b64decode(str(self.buffer)) if self.compression == u'zlib': data = zlib.decompress(data) elif self.compression == u'gzip': data = zlib.decompressobj().decompress('x\x9c' + data[10:-8]) for i in range(self.width*self.height): gid = int(struct.unpack('<I',data[i*4:i*4+4])[0]) if gid <> 0: self.out.write(chr(gid - self.collision_fgid)) else: self.out.write(chr(0)) self.state = State.FINAL def endDocument(self): self.mobs.write('\n\n%s.gat,0,0,0|script|Mob%s|-1,{\n' % (self.base, self.base)) for mob_id in sorted(self.mob_ids): self.mobs.write('On%d:\n set @mobID, %d;\n callfunc "MobPoints";\n end;\n\n' % (mob_id, mob_id)) self.mobs.write(' end;\n}\n') self.imports.write('// Map %s: %s\n' % (self.base, self.name)) self.imports.write('// %s\n' % MESSAGE) self.imports.write('map: %s.gat\n' % self.base) npcs = os.listdir(self.npc_dir) npcs.sort() for x in npcs: if x == NPC_IMPORTS: continue if x.startswith('.'): continue if x.endswith('.txt'): self.imports.write('npc: %s\n' % posixpath.join(SERVER_NPCS, self.base, x)) pass def main(argv): _, client_data, server_data = argv tmx_dir = posixpath.join(client_data, CLIENT_MAPS) wlk_dir = posixpath.join(server_data, SERVER_WLK) npc_dir = posixpath.join(server_data, SERVER_NPCS) npc_master = [] for arg in os.listdir(tmx_dir): base, ext = posixpath.splitext(arg) if ext == '.tmx': tmx = posixpath.join(tmx_dir, arg) wlk = posixpath.join(wlk_dir, base + '.wlk') this_map_npc_dir = posixpath.join(npc_dir, base) os.path.isdir(this_map_npc_dir) or os.mkdir(this_map_npc_dir) print('Converting %s to %s' % (tmx, wlk)) with open(posixpath.join(this_map_npc_dir, NPC_MOBS), 'w') as mobs: with open(posixpath.join(this_map_npc_dir, NPC_WARPS), 'w') as warps: with open(posixpath.join(this_map_npc_dir, NPC_IMPORTS), 'w') as imports: xml.sax.parse(tmx, ContentHandler(wlk, this_map_npc_dir, mobs, warps, imports)) npc_master.append('import: %s\n' % posixpath.join(SERVER_NPCS, base, NPC_IMPORTS)) with open(posixpath.join(npc_dir, NPC_MASTER_IMPORTS), 'w') as out: out.write('// %s\n\n' % MESSAGE) npc_master.sort() for line in npc_master: out.write(line) if __name__ == '__main__': main(sys.argv)
[ "reidyaro@gmail.com" ]
reidyaro@gmail.com
760fca7069b4c7a199b99b11039f29ba0852d614
a02200ad85d910028a835d238cc4997a375ea51a
/examples/verifier/src/client.py
24e1d4b2f442e338b3487b793c34332fda877847
[ "Python-2.0", "MIT" ]
permissive
Mafroz/pact-python
f35864f8ac9880f356a44409fcf0e8dcc626d852
d4072ed7c3b9d9a1e91feb6eaafdfa71b1129624
refs/heads/master
2022-11-19T04:42:50.688077
2020-07-16T12:31:18
2020-07-16T12:31:18
null
0
0
null
null
null
null
UTF-8
Python
false
false
436
py
import requests class UserClient(object): """ Our Client app """ def __init__(self, base_uri): self.base_uri = base_uri def get_user(self, user_name): """Fetch a user object by user_name from the server.""" uri = self.base_uri + '/users/' + user_name response = requests.get(uri, verify=False) if response.status_code == 404: return None return response.json()
[ "elliottmurray@gmail.com" ]
elliottmurray@gmail.com
93a505b770010b32dabd0f8de4288b2109e92206
4e6dcb09ac3dc0bb71daa14cbeab057dd0ebf439
/public_data/migrations/0004_migrate_data_20190508.py
97f1b690cd3633c74a0e058b7964c18d269bc6d6
[ "MIT" ]
permissive
madprime/open-humans
8bfbbab06fbc5aa18242c0ab479da662c0a067a6
a2e3bf3b95d7fcfb2cdffe3a42f86cb6e09674e4
refs/heads/master
2021-09-26T14:20:20.404380
2020-07-16T20:54:51
2020-07-16T20:54:51
118,983,936
2
0
MIT
2018-12-19T04:34:15
2018-01-26T00:24:12
Python
UTF-8
Python
false
false
1,674
py
import re from django.db import migrations def add_project_member(apps, schema_editor): # Using historical versions as recommended for RunPython PublicDataAccess = apps.get_model("public_data", "PublicDataAccess") DataRequestProjectMember = apps.get_model( "private_sharing", "DataRequestProjectMember" ) DataRequestProject = apps.get_model("private_sharing", "DataRequestProject") db_alias = schema_editor.connection.alias def id_label_to_project(id_label): match = re.match(r"direct-sharing-(?P<id>\d+)", id_label) if match: project = DataRequestProject.objects.using(db_alias).get( id=int(match.group("id")) ) return project for pda in PublicDataAccess.objects.using(db_alias).filter(project_membership=None): project = id_label_to_project(pda.data_source) drpm = DataRequestProjectMember.objects.using(db_alias).get( project=project, member=pda.participant.member ) pda.project_membership = drpm pda.save() def set_data_source(apps, schema_editor): # Using historical versions as recommended for RunPython PublicDataAccess = apps.get_model("public_data", "PublicDataAccess") db_alias = schema_editor.connection.alias for pda in PublicDataAccess.objects.using(db_alias).filter(data_source=None): pda.data_source = "direct-sharing-{}".format(pda.project_membership.project.id) pda.save() class Migration(migrations.Migration): dependencies = [("public_data", "0003_auto_20190508_2341")] operations = [migrations.RunPython(add_project_member, set_data_source)]
[ "mad-github@printf.net" ]
mad-github@printf.net
abd5f1d47d424c48879e81354ee767f0ea7dca2f
1621268ca344adae53a7880c26253e0c32aa2b99
/Minimiza/Minimiza.py
ad1c395ab910f1083969a2a2b165f11f348001c8
[ "BSD-2-Clause" ]
permissive
k4t0mono/regex-to-code
414f4ee77999eeaba9ec24af4621cc92faa2122a
51e4864b51179ca624de05bafc71c102193d8090
refs/heads/master
2020-03-08T21:36:19.660943
2018-04-17T17:08:15
2018-04-17T17:08:15
128,410,025
0
1
BSD-2-Clause
2018-04-16T22:49:20
2018-04-06T15:04:56
Python
UTF-8
Python
false
false
655
py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from Minimiza.Estruturas import Automato import sys def Minimiza(args): #~ if(len(sys.argv) != 4): #~ print("Modo de execucao: ") #~ print("python Main.py <arquivoEntrada> <arquivoTabela> <arquivoNovoAutomato>") #~ else: entrada= args[0] tabela = "FODACE" minimizado = args[1] #~ minimizado = sys.argv[3] a = Automato(entrada) a.minimiza(tabela, minimizado) print("Arquivo de entrada: " + entrada) print("Arquivo com a tabela de minimizacao: " + minimizado) #~ print("Arquivo com o automato minimizado: " + sys.argv[3]) a.novoAutomato()
[ "arthucruz@hotmail.com" ]
arthucruz@hotmail.com
e0df8ad5a39893b498b03f95307e010de3baf42c
bff9ad91d3304b85f77a56878d5960d16eb76731
/tornado_exaple.py
60dce663957db2011e9d75bcaf01c6705d97d2a5
[]
no_license
cherrydocker/TestCI
5f6be24644e488cc1808e78fa3b7194608ccdc43
487eddddb748f57f2a0ffec8097eb71d26af2290
refs/heads/master
2016-08-07T11:26:55.619044
2015-06-19T09:44:52
2015-06-19T09:44:52
37,650,341
0
0
null
null
null
null
UTF-8
Python
false
false
321
py
import tornado.ioloop import tornado.web class MainHandler(tornado.web.RequestHandler): def get(self): self.write("Hello, world") application = tornado.web.Application([ (r"/", MainHandler), ]) if __name__ == "__main__": application.listen(8888) tornado.ioloop.IOLoop.instance().start()
[ "cherryskyj@gmial.com" ]
cherryskyj@gmial.com
938ec58068b336e3a878035a0fe6e58e451e118c
f47da21943f600644f81a46c050a6083d4f60201
/experiment3/processing/per_position_analysis.py
82025e0dbf5a6e433518acc2823917dde3399a3d
[]
no_license
Stautis/detecting-inosine-master-thesis
9163320282b068cacba6236accaf41252265c729
accae8af4f5d538da7d56a4e521157d0cdbb3d3d
refs/heads/main
2023-07-09T01:02:16.624191
2021-08-10T19:39:18
2021-08-10T19:39:18
null
0
0
null
null
null
null
UTF-8
Python
false
false
5,748
py
import csv import pandas as pd import os ################################################################################ # # This script simply prepares the data gathered by the fast5_processing.py # script for further analysis. The formatting here is conducive to further # position-by-position analysis of each of the 9-base segments. # ################################################################################ path = "/export/valenfs/data/processed_data/MinION/inosine_project/20201016_max_DNA_Inosine/third_analysis/4_fast5_analysis/construct4/perfs/third_pos_data_out.csv" cm = "wc -l" cmd = " ".join([cm,path]) stream = os.popen(cmd) output = stream.read() lines = int(output.split(" ")[0]) file = open(path) read_csv = csv.reader(file, delimiter=",") curr_read = "" perfect = [] #first = pd.DataFrame({"id": [], "base": [], "current_avg": [], "current_stdev":[], "dwell":[]}) #['0', '001e5f4f-afcb-4c20-a96d-3c11325b0d68', 'G', '56.895743991794255', '3.2241089110144263', '30.0'] first = pd.DataFrame({"id": [], "base": [], "current_avg": [], "current_stdev":[], "dwell":[]}) second = pd.DataFrame({"id": [], "base": [], "current_avg": [], "current_stdev":[], "dwell":[]}) third = pd.DataFrame({"id": [], "base": [], "current_avg": [], "current_stdev":[], "dwell":[]}) fourth = pd.DataFrame({"id": [], "base": [], "current_avg": [], "current_stdev":[], "dwell":[]}) fifth = pd.DataFrame({"id": [], "base": [], "current_avg": [], "current_stdev":[], "dwell":[]}) sixth = pd.DataFrame({"id": [], "base": [], "current_avg": [], "current_stdev":[], "dwell":[]}) seventh = pd.DataFrame({"id": [], "base": [], "current_avg": [], "current_stdev":[], "dwell":[]}) eight = pd.DataFrame({"id": [], "base": [], "current_avg": [], "current_stdev":[], "dwell":[]}) ninth = pd.DataFrame({"id": [], "base": [], "current_avg": [], "current_stdev":[], "dwell":[]}) read = [] #pd.DataFrame({"id": [], "base": [], "current_avg": [], "current_stdev":[], "dwell":[]}) print(lines,"to read") for index, row in enumerate(read_csv): if index == 0: continue #if index == 29: # print(first) # print(fifth) # print(ninth) # exit() #if index == 50: #print(len(perfect)) #print(first) #print(ninth) #print(fifth) if index%1000==0: print(index,"out of",lines) if curr_read != row[1]: #new read if read != [] and count == 9: #print("here with", curr_read) perfect.append(read) newFirst = {"id":read[0][1],"base":read[0][2],"current_avg":read[0][3],"current_stdev":read[0][4],"dwell":read[0][5]} first = first.append(newFirst,ignore_index=True) second = second.append({"id":read[1][1],"base":read[1][2],"current_avg":read[1][3],"current_stdev":read[1][4],"dwell":read[1][5]},ignore_index=True) third = third.append({"id":read[2][1],"base":read[2][2],"current_avg":read[2][3],"current_stdev":read[2][4],"dwell":read[2][5]},ignore_index=True) fourth = fourth.append({"id":read[3][1],"base":read[3][2],"current_avg":read[3][3],"current_stdev":read[3][4],"dwell":read[3][5]},ignore_index=True) fifth = fifth.append({"id":read[4][1],"base":read[4][2],"current_avg":read[4][3],"current_stdev":read[4][4],"dwell":read[4][5]},ignore_index=True) sixth = sixth.append({"id":read[5][1],"base":read[5][2],"current_avg":read[5][3],"current_stdev":read[5][4],"dwell":read[5][5]},ignore_index=True) seventh = seventh.append({"id":read[6][1],"base":read[6][2],"current_avg":read[6][3],"current_stdev":read[6][4],"dwell":read[6][5]},ignore_index=True) eight = eight.append({"id":read[7][1],"base":read[7][2],"current_avg":read[7][3],"current_stdev":read[7][4],"dwell":read[7][5]},ignore_index=True) ninth = ninth.append({"id":read[8][1],"base":read[8][2],"current_avg":read[8][3],"current_stdev":read[8][4],"dwell":read[8][5]},ignore_index=True) count = 1 #print("here with", row[1],"count is",count) curr_read = row[1] read = [row] elif curr_read == row[1]: count+=1 #print("here with", row[1],"count is",count) read.append(row) #if count == 9: #print("Successful read") print("\nwriting all to file.\n") first.to_csv("/export/valenfs/data/processed_data/MinION/inosine_project/20201016_max_DNA_Inosine/third_analysis/4_fast5_analysis/further_analysis/construct4/thirdPos/firstData.csv") second.to_csv("/export/valenfs/data/processed_data/MinION/inosine_project/20201016_max_DNA_Inosine/third_analysis/4_fast5_analysis/further_analysis/construct4/thirdPos/secondData.csv") third.to_csv("/export/valenfs/data/processed_data/MinION/inosine_project/20201016_max_DNA_Inosine/third_analysis/4_fast5_analysis/further_analysis/construct4/thirdPos/thirdData.csv") fourth.to_csv("/export/valenfs/data/processed_data/MinION/inosine_project/20201016_max_DNA_Inosine/third_analysis/4_fast5_analysis/further_analysis/construct4/thirdPos/fourthData.csv") fifth.to_csv("/export/valenfs/data/processed_data/MinION/inosine_project/20201016_max_DNA_Inosine/third_analysis/4_fast5_analysis/further_analysis/construct4/thirdPos/fifthData.csv") sixth.to_csv("/export/valenfs/data/processed_data/MinION/inosine_project/20201016_max_DNA_Inosine/third_analysis/4_fast5_analysis/further_analysis/construct4/thirdPos/sixthData.csv") seventh.to_csv("/export/valenfs/data/processed_data/MinION/inosine_project/20201016_max_DNA_Inosine/third_analysis/4_fast5_analysis/further_analysis/construct4/thirdPos/seventhData.csv") eight.to_csv("/export/valenfs/data/processed_data/MinION/inosine_project/20201016_max_DNA_Inosine/third_analysis/4_fast5_analysis/further_analysis/construct4/thirdPos/eightData.csv") ninth.to_csv("/export/valenfs/data/processed_data/MinION/inosine_project/20201016_max_DNA_Inosine/third_analysis/4_fast5_analysis/further_analysis/construct4/thirdPos/ninthData.csv") print("\ndone.\n")
[ "noreply@github.com" ]
noreply@github.com
4c3c0468f63cea5bff5bb6f7efcfb911f37463bf
d8fae39bcfdff1974c5fecd96ed156c4db80e280
/tensorflow/core/function/capture/capture_container.py
fc8bae0ddc34784edcf9c98d1fb7b1b3ad30d7d4
[ "LicenseRef-scancode-generic-cla", "Apache-2.0", "BSD-2-Clause" ]
permissive
enowy/tensorflow
d2834bda2ff35995637acc55321fc00113d212c1
b4276073ea8e3bd51229c0726f052f79d8dd239d
refs/heads/master
2023-04-11T02:02:19.956400
2023-03-23T09:06:17
2023-03-23T09:10:43
62,356,730
0
0
null
2016-07-01T02:38:38
2016-07-01T02:38:38
null
UTF-8
Python
false
false
11,537
py
# Copyright 2022 The TensorFlow Authors. 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. # ============================================================================== """FuncGraph and related functionality.""" import collections as py_collections import dataclasses import functools import inspect from typing import Any, Callable, Hashable, Mapping, Union from tensorflow.core.function import trace_type from tensorflow.python import pywrap_tfe from tensorflow.python.eager import context from tensorflow.python.framework import dtypes from tensorflow.python.framework import ops from tensorflow.python.framework import type_spec from tensorflow.python.types import core from tensorflow.python.util import nest from tensorflow.python.util import object_identity _EAGER_CONST_THRESHOLD = 128 @dataclasses.dataclass(frozen=True) class CaptureContainer(): """A container for both by-reference and by-value captures. external: Used to record the tensor external to the func_graph. For by-value captures, it would be the original tensor. For by-reference captures, it would be the lambda function, which will be called later to get the capture's runtime value. internal: An internal placeholder for the capture, or a constant tensor. The external value of the capture will be fed to this internal placeholder when executing the func_graph as a side input. idf: A Hashable identifier for the capture. is_by_ref: A bool indicates if the capture is call by reference or value. This flag will determine how `CaptureContainer.internal` is used. """ external: Any internal: core.Tensor idf: Hashable is_by_ref: bool = False class CachedCaptureDict(py_collections.OrderedDict): """A dict like container for captures with cached tuples.""" def __init__(self, *args, **kwargs): self._tuple_cache = [] super().__init__(*args, **kwargs) def _recompute_tuple_cache(self): self._tuple_cache = [( c.external, c.internal) for c in self.values()] def pop(self, key, default=None): if key in self.keys(): ret = super().pop(key, default) self._recompute_tuple_cache() return ret else: return default def __setitem__(self, key, value): assert isinstance(value, CaptureContainer) if key in self.keys(): super().__setitem__(key, value) self._recompute_tuple_cache() else: super().__setitem__(key, value) self._tuple_cache.append((value.external, value.internal)) def __delitem__(self, key): super().__delitem__(key) self._recompute_tuple_cache() def clear(self): self._tuple_cache = [] super().clear() @property def tuple_cache(self): return self._tuple_cache class FunctionCaptures(object): """A container for all capture usages within FuncGraph.""" def __init__(self): # Dict that maps capture identifier -> CaptureContainer self._by_ref = py_collections.OrderedDict() self._by_val = CachedCaptureDict() # Set of external ops on which the graph has a control dependency self.control = object_identity.ObjectIdentitySet() def capture_by_value( self, graph: "FuncGraph", tensor: core.Tensor, name: str = None ) -> core.Tensor: """Captures `tensor` if it's external to this graph. If `tensor` is from a different graph, returns a placeholder for it. `tensor` and the placeholder will appear in self.captures, and the placeholder will appear in self.inputs. Multiple calls to this method with the same `tensor` argument will return the same placeholder. If `tensor` is from this graph, returns `tensor`. Args: graph: The FuncGraph that captures this tensor. tensor: Tensor. May be from this FuncGraph or a different graph. name: Optional name if a placeholder is created. Returns: Tensor from this FuncGraph. Raises: InaccessibleTensorError: if any tensors are accessed in a manner that bypasses the mechanisms required for the data dependencies to be correctly wired. """ if isinstance(tensor, core.Value): if name is None: # A unique (within the program execution) integer. name = str(pywrap_tfe.TFE_Py_UID()) # Small EagerTensors are captured with Const ops if (tensor.dtype in dtypes.TF_VALUE_DTYPES and functools.reduce(lambda a, b: a*b, tensor.shape, 1) <= _EAGER_CONST_THRESHOLD): capture = self.by_val_captures.get(id(tensor)) if capture is None: graph_const = tensor._capture_as_const(name) # pylint: disable=protected-access if graph_const is None: # Some eager tensors, e.g. parallel tensors, are not convertible to # a single constant. We'll use a placeholder for this case. graph_const = self._create_placeholder_helper(graph, tensor, name) self.add_or_replace(tensor, graph_const, id(tensor), False) graph.inputs.append(graph_const) else: graph_const = capture.internal graph_const._record_tape(tensor) # pylint: disable=protected-access return graph_const # Large EagerTensors and resources are captured with Placeholder ops return self._create_placeholder_helper(graph, tensor, name) if tensor.graph is not graph: graph._validate_in_scope(tensor) # pylint: disable=protected-access if name is None: name = tensor.op.name # cond/while graphs override _capture_helper() so cannot call # self.create_placeholder_helper() here directly. return graph._capture_helper(tensor, name) # pylint: disable=protected-access return tensor def add_or_replace( self, value: Any, placeholder: core.Tensor, idf: Hashable, is_by_ref: bool = False): """Replace a already exsiting capture, otherwise add it.""" capture = CaptureContainer(value, placeholder, idf, is_by_ref) if is_by_ref: self._by_ref[idf] = capture else: self._by_val[idf] = capture return capture def pop(self, idf: Hashable, is_by_ref: bool = False) -> Union[core.Tensor, None]: if is_by_ref: return self._by_ref.pop(idf, None) else: return self._by_val.pop(idf, None) def reset_captures(self, tensors, placeholders): """Set the captures with the provided list of captures & placeholder.""" self._by_val = CachedCaptureDict() for external, internal in zip(tensors, placeholders): idf = id(external) c = CaptureContainer(external, internal, idf) self._by_val[idf] = c def capture_by_ref(self, lam: Callable[[], Any], idf: Hashable = None): """Create a by-referece capture if not exists.""" # check if the capture exist in self._by_ref if idf is not None and idf in self._by_ref: capture = self._by_ref[idf] return capture.internal if idf is None: idf = len(self._by_ref) if context.executing_eagerly(): return lam() placeholder = self._create_capture_placeholder(lam) capture = CaptureContainer(lam, placeholder, idf, is_by_ref=True) self._by_ref[idf] = capture return capture.internal def merge_by_ref_with(self, other: "FunctionCaptures"): """Add by-ref captures from `other` to `self` if not exist.""" assert isinstance(other, FunctionCaptures) for key, capture in other.by_ref_captures.items(): if key not in self._by_ref: self._by_ref[key] = capture def get_by_ref_snapshot(self) -> Mapping[Hashable, Any]: """Get a snapshot of current values of by-ref captures.""" snapshot = {} for key, capture in self._by_ref.items(): func = capture.external snapshot[key] = func() return snapshot def _create_placeholder_helper( self, graph: "FuncGraph", tensor: core.Tensor, name: str): """A helper function to create capture placeholder.""" capture = self._by_val.get(id(tensor)) if capture is None: tracing_ctx = trace_type.InternalTracingContext() spec = trace_type.from_value(tensor, tracing_ctx) spec._name = name # pylint: disable=protected-access if isinstance(tensor, core.Value) and tensor.is_packed: composite_device_name = tensor.device else: composite_device_name = None placeholder_ctx = trace_type.InternalPlaceholderContext( graph, with_none_control_dependencies=True, composite_device_name=composite_device_name) placeholder_ctx._spec_id_to_handledata = ( # pylint: disable=protected-access tracing_ctx.get_handledata_mapping() ) placeholder = spec.placeholder_value(placeholder_ctx) self.add_or_replace(tensor, placeholder, id(tensor), False) graph.inputs.append(placeholder) else: placeholder = capture.internal placeholder._record_tape(tensor) # pylint: disable=protected-access return placeholder # TODO(panzf): Use FunctionType/TraceType to create placeholder here. def _create_capture_placeholder(self, func: Callable[[], Any]) -> ...: """Create placeholder if the input is tensor.""" values_nest = func() values_flat = nest.flatten(values_nest) # Return values in flat format. It consists of placeholders and non-tensor # values. return_flat = [] tensor_spec_flat = [] # Create return_flat and replace tensors with None. Later, each None is # replaced again by corresponding placeholders for value in values_flat: if isinstance(value, core.Tensor): return_flat.append(None) tensor_spec_flat.append(type_spec.type_spec_from_value(value)) elif isinstance(value, set) or isinstance(value, frozenset): raise NotImplementedError( (f"Side input returned by '{inspect.getsource(func).strip()}' " f"has element of {type(value)} type, which is currently not " "supported by tf.function.")) else: return_flat.append(value) if tensor_spec_flat: def tensor_func(): values = nest.flatten(func()) return [value for value in values if isinstance(value, core.Tensor)] # TODO(panzf): remove get_default_graph after moving # capture_call_time_value to this class. graph = ops.get_default_graph() placeholder_flat = graph.capture_call_time_value( tensor_func, tensor_spec_flat) # replace None that represents tensors with placehoders flat_ptr = 0 for idx, item in enumerate(return_flat): if item is None: return_flat[idx] = placeholder_flat[flat_ptr] flat_ptr += 1 return_nest = nest.pack_sequence_as(values_nest, return_flat) return return_nest @property def by_ref_captures(self): return self._by_ref @property def by_val_captures(self): return self._by_val @property def by_val_capture_tuples(self): return self._by_val.tuple_cache
[ "gardener@tensorflow.org" ]
gardener@tensorflow.org
03b7471fa66a93b6df009f3a053bc78e732024dc
bc0a71321b5fccd6f4c13ec0c76062ca6ed18fe6
/venv/Scripts/easy_install-3.7-script.py
b20fd7c6960e5728be1e0867a8f1cd2e4d88f890
[]
no_license
liangxioa/indev
fc95b567d8ddc97f7c80abaf86aa2fdae91bced1
334f126be5a6aebf6637c4b341e89a229c62f9cc
refs/heads/master
2020-08-08T17:48:53.867256
2019-10-12T00:46:58
2019-10-12T00:46:58
213,644,553
0
0
null
null
null
null
UTF-8
Python
false
false
435
py
#!C:\python\indev\venv\Scripts\python.exe # EASY-INSTALL-ENTRY-SCRIPT: 'setuptools==40.8.0','console_scripts','easy_install-3.7' __requires__ = 'setuptools==40.8.0' import re import sys from pkg_resources import load_entry_point if __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) sys.exit( load_entry_point('setuptools==40.8.0', 'console_scripts', 'easy_install-3.7')() )
[ "804092147@qq.com" ]
804092147@qq.com
5dd552a5a78b85cdb055b52651dfb140b36eca81
7255a09821deba655309b74927091ac9ab8b6075
/example/ROAD/code/reborn2.py
de7caa75976e48d03da9d5e55344d7728e2b4973
[]
no_license
summer1719/pytorchgo
2814141d6fc0b5c3369d2b9d37e1140e410b25ec
1ffd561a53d583ca4098297e585e786e472ddd1a
refs/heads/master
2020-04-25T20:45:04.203802
2019-01-10T15:03:31
2019-01-10T15:03:31
null
0
0
null
null
null
null
UTF-8
Python
false
false
17,138
py
import argparse import torch from pytorchgo.utils.pytorch_utils import model_summary, optimizer_summary from pytorchgo.utils.weight_init import weights_init import torch.nn.functional as F from torch.utils import data, model_zoo import math import os import os.path as osp import shutil import numpy as np from torch.autograd import Variable import tqdm import itertools import torchfcn from util_fns import get_parameters from pytorchgo.loss.loss import CrossEntropyLoss2d_Seg, Diff2d,CrossEntropyLoss2d from pytorchgo.utils.pytorch_utils import step_scheduler from pytorchgo.utils import logger class_num = 16 image_size = [1024, 512] # [640, 320] max_epoch = 10 base_lr = 1e-5 dis_lr = 1e-5 base_lr_schedule = [(5, 1e-6), (8, 1e-7)] dis_lr_schedule = [(5, 1e-6), (8, 1e-7)] LOSS_PRINT_INTERVAL = 500 QUICK_VAL = 50000 L_LOSS_WEIGHT = 1 DISTILL_WEIGHT = 1 DIS_WEIGHT = 1 G_STEP = 1 D_STEP = 2 Deeplabv2_restore_from = 'http://vllab.ucmerced.edu/ytsai/CVPR18/DeepLab_resnet_pretrained_init-f81d91e8.pth' def main(): logger.auto_set_dir() global args parser = argparse.ArgumentParser() parser = argparse.ArgumentParser() parser.add_argument('--dataroot', default='/home/hutao/lab/pytorchgo/example/ROAD/data', help='Path to source dataset') parser.add_argument('--batchSize', type=int, default=1, help='input batch size') parser.add_argument('--max_epoch', type=int, default=max_epoch, help='Number of training iterations') parser.add_argument('--optimizer', type=str, default='SGD', help='Optimizer to use | SGD, Adam') parser.add_argument('--lr', type=float, default=base_lr, help='learning rate') parser.add_argument('--momentum', type=float, default=0.99, help='Momentum for SGD') parser.add_argument('--beta1', type=float, default=0.9, help='beta1 for adam. default=0.5') parser.add_argument('--weight_decay', type=float, default=0.0005, help='Weight decay') parser.add_argument('--model', type=str, default='vgg16') parser.add_argument('--gpu', type=int, default=3) args = parser.parse_args() print(args) gpu = args.gpu os.environ['CUDA_VISIBLE_DEVICES'] = str(gpu) cuda = torch.cuda.is_available() torch.manual_seed(1337) if cuda: logger.info("random seed 1337") torch.cuda.manual_seed(1337) # Defining data loaders kwargs = {'num_workers': 4, 'pin_memory': True, 'drop_last': True} if cuda else {} train_loader = torch.utils.data.DataLoader( torchfcn.datasets.SYNTHIA('SYNTHIA', args.dataroot, split='train', transform=True, image_size=image_size), batch_size=args.batchSize, shuffle=True, **kwargs) val_loader = torch.utils.data.DataLoader( torchfcn.datasets.CityScapes('cityscapes', args.dataroot, split='val', transform=True, image_size=[2048,1024]), batch_size=1, shuffle=False) target_loader = torch.utils.data.DataLoader( torchfcn.datasets.CityScapes('cityscapes', args.dataroot, split='train', transform=True, image_size=image_size), batch_size=args.batchSize, shuffle=True) if cuda: torch.set_default_tensor_type('torch.cuda.FloatTensor') if args.model == "vgg16": model = origin_model = torchfcn.models.Seg_model(n_class=class_num) vgg16 = torchfcn.models.VGG16(pretrained=True) model.copy_params_from_vgg16(vgg16) model_fix = torchfcn.models.Seg_model(n_class=class_num) model_fix.copy_params_from_vgg16(vgg16) elif args.model == "deeplabv2": # TODO may have problem! model = origin_model = torchfcn.models.Res_Deeplab(num_classes=class_num, image_size=image_size) saved_state_dict = model_zoo.load_url(Deeplabv2_restore_from) new_params = model.state_dict().copy() for i in saved_state_dict: # Scale.layer5.conv2d_list.3.weight i_parts = i.split('.') # print i_parts if not class_num == 19 or not i_parts[1] == 'layer5': new_params['.'.join(i_parts[1:])] = saved_state_dict[i] # print i_parts model.load_state_dict(new_params) model_fix = torchfcn.models.Res_Deeplab(num_classes=class_num, image_size=image_size) model_fix.load_state_dict(new_params) else: raise ValueError("only support vgg16, deeplabv2!") for param in model_fix.parameters(): param.requires_grad = False netD = torchfcn.models.Domain_classifer_forAdapSegNet(n_class=class_num) netD.apply(weights_init) model_summary([model, netD]) if cuda: model = model.cuda() netD = netD.cuda() # Defining optimizer if args.optimizer == 'SGD': if args.model == "vgg16": optim = torch.optim.SGD( [ {'params': get_parameters(model, bias=False), 'weight_decay': args.weight_decay}, {'params': get_parameters(model, bias=True), 'lr': args.lr * 2, 'weight_decay': args.weight_decay}, ], lr=args.lr, momentum=args.momentum,) elif args.model == "deeplabv2": optim = torch.optim.SGD( origin_model.optim_parameters(args.lr), lr=args.lr, momentum=args.momentum, weight_decay=args.weight_decay) else: raise elif args.optimizer == 'Adam': if args.model == "vgg16": optim = torch.optim.Adam( [ {'params': get_parameters(model, bias=False), 'weight_decay': args.weight_decay}, {'params': get_parameters(model, bias=True), 'lr': args.lr * 2, 'weight_decay': args.weight_decay}, ], lr=args.lr, betas=(args.beta1, 0.999)) elif args.model == "deeplabv2": optim = torch.optim.Adam( origin_model.optim_parameters(args.lr), lr=args.lr, betas=(args.beta1, 0.999), weight_decay=args.weight_decay) else: raise else: raise ValueError('Invalid optmizer argument. Has to be SGD or Adam') optimD = torch.optim.Adam(netD.parameters(), lr=dis_lr, weight_decay=args.weight_decay, betas=(0.7, 0.999)) optimizer_summary([optim, optimD]) trainer = MyTrainer_ROAD( cuda=cuda, model=model, model_fix=model_fix, netD=netD, optimizer=optim, optimizerD=optimD, train_loader=train_loader, target_loader=target_loader, val_loader=val_loader, batch_size=args.batchSize, image_size=image_size, loss_print_interval=LOSS_PRINT_INTERVAL ) trainer.epoch = 0 trainer.iteration = 0 trainer.train() class MyTrainer_ROAD(object): def __init__(self, cuda, model, model_fix, netD, optimizer, optimizerD, train_loader, target_loader, val_loader, image_size, batch_size, size_average=True, loss_print_interval=500): self.cuda = cuda self.model = model self.model_fix = model_fix self.netD = netD self.optim = optimizer self.optimD = optimizerD self.batch_size = batch_size self.loss_print_interval = loss_print_interval self.train_loader = train_loader self.target_loader = target_loader self.val_loader = val_loader self.image_size = tuple(image_size) self.n_class = len(self.train_loader.dataset.class_names) self.size_average = size_average self.epoch = 0 self.iteration = 0 self.best_mean_iu = 0 def validate(self): """ Function to validate a training model on the val split. """ logger.info("start validation....") val_loss = 0 label_trues, label_preds = [], [] # Evaluation for batch_idx, (data, target) in tqdm.tqdm( enumerate(self.val_loader), total=len(self.val_loader), desc='Validation iteration = {},epoch={}'.format(self.iteration, self.epoch), leave=False): if batch_idx > QUICK_VAL: break if self.cuda: data, target = data.cuda(), target.cuda() data, target = Variable(data, volatile=True), Variable(target) score = self.model(data) loss = CrossEntropyLoss2d_Seg(score, target, class_num= class_num,size_average=self.size_average) if np.isnan(float(loss.data[0])): raise ValueError('loss is nan while validating') val_loss += float(loss.data[0]) / len(data) lbl_pred = score.data.max(1)[1].cpu().numpy()[:, :, :] lbl_true = target.data.cpu().numpy() label_trues.append(lbl_true) label_preds.append(lbl_pred) # Computing the metrics acc, acc_cls, mean_iu, _ = torchfcn.utils.label_accuracy_score( label_trues, label_preds, self.n_class) val_loss /= len(self.val_loader) logger.info("iteration={},epoch={},validation mIoU = {}".format(self.iteration, self.epoch, mean_iu)) is_best = mean_iu > self.best_mean_iu if is_best: self.best_mean_iu = mean_iu torch.save({ 'epoch': self.epoch, 'iteration': self.iteration, 'arch': self.model.__class__.__name__, 'optim_state_dict': self.optim.state_dict(), 'model_state_dict': self.model.state_dict(), 'best_mean_iu': self.best_mean_iu, }, osp.join(logger.get_logger_dir(), 'checkpoint.pth.tar')) if is_best: shutil.copy(osp.join(logger.get_logger_dir(), 'checkpoint.pth.tar'), osp.join(logger.get_logger_dir(), 'model_best.pth.tar')) def train_epoch(self): """ Function to train the model for one epoch """ def set_requires_grad(seg, dis): for param in self.model.parameters(): param.requires_grad = seg for param in self.netD.parameters(): param.requires_grad = dis import copy self.G_source_loader_iter = [enumerate(self.train_loader) for _ in range(G_STEP)] self.G_target_loader_iter = [enumerate(self.target_loader) for _ in range(G_STEP)] self.D_source_loader_iter = [enumerate(self.train_loader) for _ in range(D_STEP)] self.D_target_loader_iter = [enumerate(self.target_loader) for _ in range(D_STEP)] for batch_idx in tqdm.tqdm( range(self.iters_per_epoch), total=self.iters_per_epoch, desc='Train epoch = {}/{}'.format(self.epoch, self.max_epoch)): self.iteration = batch_idx + self.epoch * self.iters_per_epoch src_dis_label = 1 target_dis_label = 0 mse_loss = torch.nn.MSELoss() def get_data(source_iter, target_iter): _, source_batch = source_iter.next() source_data, source_labels = source_batch _, target_batch = target_iter.next() target_data, _ = target_batch if self.cuda: source_data, source_labels = source_data.cuda(), source_labels.cuda() target_data = target_data.cuda() source_data, source_labels = Variable(source_data), Variable(source_labels) target_data = Variable(target_data) return source_data,source_labels, target_data ##################################train D for _ in range(D_STEP): source_data, source_labels, target_data = get_data(self.D_source_loader_iter[_], self.D_target_loader_iter[_]) self.optimD.zero_grad() set_requires_grad(seg=False, dis=True) score = self.model(source_data) seg_target_score = self.model(target_data) src_discriminate_result = self.netD(F.softmax(score)) target_discriminate_result = self.netD(F.softmax(seg_target_score)) src_dis_loss = mse_loss(src_discriminate_result, Variable(torch.FloatTensor(src_discriminate_result.data.size()).fill_( src_dis_label)).cuda()) target_dis_loss = mse_loss(target_discriminate_result, Variable(torch.FloatTensor(target_discriminate_result.data.size()).fill_( target_dis_label)).cuda(), ) src_dis_loss = src_dis_loss * DIS_WEIGHT target_dis_loss = target_dis_loss * DIS_WEIGHT dis_loss = src_dis_loss + target_dis_loss dis_loss.backward() self.optimD.step() # https://ewanlee.github.io/2017/04/29/WGAN-implemented-by-PyTorch/ for p in self.netD.parameters(): p.data.clamp_(-0.01, 0.01) #####################train G, item1 for _ in range(G_STEP): source_data, source_labels, target_data = get_data(self.G_source_loader_iter[_], self.G_target_loader_iter[_]) self.optim.zero_grad() set_requires_grad(seg=True, dis=False) # Source domain score = self.model(source_data) l_seg = CrossEntropyLoss2d_Seg(score, source_labels, class_num=class_num, size_average=self.size_average) # target domain seg_target_score = self.model(target_data) modelfix_target_score = self.model_fix(target_data) diff2d = Diff2d() distill_loss = diff2d(seg_target_score, modelfix_target_score) l_seg = l_seg * L_LOSS_WEIGHT distill_loss = distill_loss * DISTILL_WEIGHT seg_loss = l_seg + distill_loss #######train G, item 2 src_discriminate_result = self.netD(F.softmax(score)) target_discriminate_result = self.netD(F.softmax(seg_target_score)) src_dis_loss = mse_loss(src_discriminate_result, Variable(torch.FloatTensor(src_discriminate_result.data.size()).fill_( src_dis_label)).cuda()) target_dis_loss = mse_loss(target_discriminate_result, Variable( torch.FloatTensor(target_discriminate_result.data.size()).fill_( src_dis_label)).cuda(), ) src_dis_loss = src_dis_loss*DIS_WEIGHT target_dis_loss = target_dis_loss*DIS_WEIGHT dis_loss = src_dis_loss + target_dis_loss total_loss = seg_loss + dis_loss total_loss.backward() self.optim.step() if np.isnan(float(dis_loss.data[0])): raise ValueError('dis_loss is nan while training') if np.isnan(float(seg_loss.data[0])): raise ValueError('total_loss is nan while training') if self.iteration % self.loss_print_interval == 0: logger.info( "After weight Loss: seg_Loss={}, distill_LOSS={}, src_dis_loss={}, target_dis_loss={}".format(l_seg.data[0], distill_loss.data[0], src_dis_loss.data[0],target_dis_loss.data[0])) def train(self): """ Function to train our model. Calls train_epoch function every epoch. Also performs learning rate annhealing """ logger.info("train_loader length: {}".format(len(self.train_loader))) logger.info("target_loader length: {}".format(len(self.target_loader))) iters_per_epoch = min(len(self.target_loader), len(self.train_loader)) self.iters_per_epoch = iters_per_epoch - (iters_per_epoch % self.batch_size) - 1 logger.info("iters_per_epoch :{}".format(self.iters_per_epoch)) self.max_epoch = args.max_epoch for epoch in tqdm.trange(self.epoch, args.max_epoch, desc='Train'): self.epoch = epoch self.optim = step_scheduler(self.optim, self.epoch, base_lr_schedule, "base model") self.optimD = step_scheduler(self.optimD, self.epoch, dis_lr_schedule, "discriminater model") self.model.train() self.netD.train() self.train_epoch() self.model.eval() self.validate() self.model.train() # return to training mode if __name__ == '__main__': main()
[ "taohu620@gmail.com" ]
taohu620@gmail.com
fc674de2b25e4e61c7efac41f15ad65666a3a62c
7040614095a27b63bbe20abeb135d2279a241304
/jwt_auth/migrations/0003_auto_20190909_1043.py
56c47bf2fcaadd5bfa568cf9bc90cf2b73b79a72
[]
no_license
FreddieHoy/GA-P4-YesChef
c71e3dabeef1a1097d7dd09085b998d43b81bda1
42fb478d471fcce0001cacbe2640cddad58b0632
refs/heads/master
2023-01-11T09:11:38.769647
2019-12-07T14:38:24
2019-12-07T14:38:24
206,760,129
0
0
null
2022-12-22T12:31:52
2019-09-06T09:27:03
JavaScript
UTF-8
Python
false
false
552
py
# Generated by Django 2.2.5 on 2019-09-09 09:43 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('jwt_auth', '0002_auto_20190906_1311'), ] operations = [ migrations.AddField( model_name='user', name='bio', field=models.CharField(blank=True, max_length=200), ), migrations.AddField( model_name='user', name='name', field=models.CharField(blank=True, max_length=25), ), ]
[ "freddiehoy@hotmail.com" ]
freddiehoy@hotmail.com
a0119b8ac14af6b3fbb394c98318e84129f4bdd8
9fbff44b162417cedb2374b72e06504762097ed0
/2016/SuperASCIIStringChecker.py
15ab9e5ca083f021764d52b570936759c5fefded
[]
no_license
Hemant-1821/codevitaSolutions
91c16d536d3d4c0e62014e9b74f1526a28250839
6e61ec65eb35927ecbf0390538176df869da6557
refs/heads/master
2021-04-23T08:25:41.391032
2020-12-25T05:09:24
2020-12-25T05:09:24
249,913,146
0
0
null
null
null
null
UTF-8
Python
false
false
297
py
alpha = list('abcdefghijklmnopqrstuvwxyz') for _ in range(int(input())): inp = input() inp = inp[:-1] flag = True for i in inp: if inp.count(i) != (alpha.index(i))+1: flag = False break if flag: print('Yes') else: print('No')
[ "singh.hemant9583@gmail.com" ]
singh.hemant9583@gmail.com
b30e15f9d459d3c6dac4676c2b09149fd535c3c2
4e390eca570591d388352700eaf9c935ec640b5f
/django_ussd_airflow/wsgi.py
7971acf1a05dae294b7be1ef2b4a9b867be782fc
[]
no_license
gitter-badger/django_ussd_airflow
9914fe01643c33dee4cccd6bc5650d9370603998
dbe669fc22517c3d5a7b2f02cb44e8605a4eb8c0
refs/heads/master
2021-01-09T08:15:52.926871
2016-07-08T06:14:05
2016-07-08T06:14:05
62,930,497
0
0
null
2016-07-09T03:38:35
2016-07-09T03:38:34
null
UTF-8
Python
false
false
455
py
""" WSGI config for django_ussd_airflow project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application from django_ussd_airflow import settings os.environ.setdefault("DJANGO_SETTINGS_MODULE", "django_ussd_airflow.settings") application = get_wsgi_application()
[ "francismwangi152@gmail.com" ]
francismwangi152@gmail.com
14e785874ed21813aa27b9ec0783c649c2c093b3
b07606136e416a05f9f8c54ce708fe5e0705ac24
/python_gp/setup.py
c0c1661afded4aa090c73f6daad01c8ab6802c33
[]
no_license
enkun-li/pythonlib
1e40257825e4100663f4e9d30a874f0f38788b44
8ef4f47e1830ef485575afa9eddd03efc233170f
refs/heads/master
2020-12-13T16:22:24.357285
2020-01-17T04:30:05
2020-01-17T04:30:05
234,468,948
0
0
null
null
null
null
UTF-8
Python
false
false
763
py
#!/usr/bin/env python #-*- coding: utf-8 -*- #================================== # File Name: setup.py # Author: ekli # Mail: ekli_091@mail.dlut.edu.cn # Created Time: 2018-12-25 21:25:47 #================================== from distutils.core import setup from distutils.extension import Extension from Cython.Distutils import build_ext ext_modules = [Extension("gp_kernel", ["gapp_kernel.pyx"]), \ Extension("cosmology", ["cosmology.pyx"]), \ Extension("gaussian_process", ["gaussian_process.pyx"]), \ Extension("rec_cosmology", ["rec_cosmology.pyx"]), \ Extension("gpsn_likelihood", ["gpsn_likelihood.pyx"]) ] setup( name="GP pyx", cmdclass = {'build_ext': build_ext}, ext_modules = ext_modules )
[ "enkunli1990@outlook.com" ]
enkunli1990@outlook.com
9c5cc58d6c8f05c09dea9f53023f41ba10f69326
d1fb1b780e8a20122081b82cb9685895464c1430
/Flipkart/flipkart.py
689d3aa7856e72801d0e386d35cc6fab436cd3ca
[ "Apache-2.0" ]
permissive
liuzuofa/FlipKartSpider
193b83d347843e02d72d26587e534bfb4f451593
50bb5c82f84637714de708653e5ee32f49ee273d
refs/heads/master
2020-05-18T12:04:20.979840
2019-05-01T10:01:17
2019-05-01T10:01:17
184,397,541
0
0
null
null
null
null
UTF-8
Python
false
false
5,304
py
import requests import time from requests.exceptions import RequestException from output import Output from lxml import etree # GET /realme-3-dynamic-black-32-gb/product-reviews/itmfe68wrbfnzqwz?pid=MOBFE68WZM7UFMDA&aid=overall&certifiedBuyer=false&sortOrder=NEGATIVE_FIRST&page=4 HTTP/1.1 # Host: www.flipkart.com # Connection: keep-alive # Upgrade-Insecure-Requests: 1 # User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36 # Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3 # Referer: https://www.flipkart.com/realme-3-dynamic-black-32-gb/product-reviews/itmfe68wrbfnzqwz?pid=MOBFE68WZM7UFMDA&aid=overall&certifiedBuyer=false&sortOrder=NEGATIVE_FIRST&page=3 # Accept-Encoding: gzip, deflate, br # Accept-Language: zh-CN,zh;q=0.9 # Cookie: T=TI155408291269051088271180464414101876800319121371635764130475883158; SN=2.VI0E6DB9FB64384AF09CEB0245DA5DFDBF.SIDBBCFC31EB314B9C8B650462E0480F8E.VS04109302537046BC9DC7ADA675D5512C.1555660730 class FlipkartSpider(object): def __init__(self): self.headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36', 'Cookie': 'T=TI155408291269051088271180464414101876800319121371635764130475883158; SN=2.VI0E6DB9FB64384AF09CEB0245DA5DFDBF.SIDBBCFC31EB314B9C8B650462E0480F8E.VS04109302537046BC9DC7ADA675D5512C.1555660730' } self.base_url = "https://www.flipkart.com" self.output = Output() def get_flipkart_html_by_url(self, url, page): try: params = {'pid': 'MOBFE68WZM7UFMDA', 'aid': 'overall', 'certifiedBuyer': 'false', 'sortOrder': 'NEGATIVE_FIRST', 'page': page} response = requests.post(url, data=params, headers=self.headers) if response.status_code == 200: return response.text return None except RequestException: return None def get_next_flipkart_comments_url(self, response): response = str(response) html = etree.HTML(response) next_urls = html.xpath('//nav[@class="_1ypTlJ"]/a[@class="_3fVaIS"]') for next_url in next_urls: print(next_url.xpath('./span/text()')) if next_url.xpath('./span/text()')[0] == 'Next': print("url: " + self.base_url + next_url.get('href')) if len(next_urls) == 1: return self.base_url + next_urls[0].get("href") elif len(next_urls) > 1: return self.base_url + next_urls[1].get("href") def get_flipkart_comments_by_url(self, response): response = str(response) response = response.replace("<br>", "") response = response.replace("<br />", "") html = etree.HTML(response) stars = html.xpath('//div[@class="col _390CkK _1gY8H-"]/div/div[@class="hGSR34 _1nLEql E_uFuv" or @class="hGSR34 _1x2VEC E_uFuv"]/text()') print(len(stars), " stars: ", stars) names = html.xpath( '//div[@class="col _390CkK _1gY8H-"]/div[@class="row _2pclJg"]/div[@class="row"]/p[@class="_3LYOAd _3sxSiS"]/text()') print(len(names), " names: ", names) times = html.xpath( '//div[@class="col _390CkK _1gY8H-"]/div[@class="row _2pclJg"]/div[@class="row"]/p[@class="_3LYOAd"]/text()') print(len(times), " times: ", times) # citys = html.xpath( # '//div[@class="col _390CkK _1gY8H-"]/div[@class="row _2pclJg"]/div[@class="row"]/p[@class="_19inI8"]/span[5 mod 3]/text()') # print(len(citys), " citys: ", citys) titles = html.xpath('//div[@class="col _390CkK _1gY8H-"]/div/p[@class="_2xg6Ul"]/text()') print(len(titles), " titles: ", titles) comments_div = html.xpath('//div[@class="col _390CkK _1gY8H-"]/div/div[@class="qwjRop"]/div/div') comments = [] for div in comments_div: comments.append(div.xpath('string(.)')) print(len(comments), " comments: ", comments) comments_list = [] for index in range(len(stars)): comments_list.append( {"star": stars[index], "name": names[index], "time": times[index], "city": "", "title": titles[index], "comment": comments[index], 'trans': ""}) return comments_list if __name__ == '__main__': flipkart = FlipkartSpider() url = 'https://www.flipkart.com/realme-3-dynamic-black-32-gb/product-reviews/itmfe68wrbfnzqwz?pid=MOBFE68WZM7UFMDA&aid=overall&certifiedBuyer=false&sortOrder=NEGATIVE_FIRST&page=1' page = 1 while page < 5: response = flipkart.get_flipkart_html_by_url(url, page) if response is None: print("get flipkart html wrong!") else: #comments_list = flipkart.get_flipkart_comments_by_url(response) #flipkart.output.add_comments((page - 1) * 10, comments_list) page = page + 1 url = flipkart.get_next_flipkart_comments_url(response) print(str(url)) time.sleep(1) #flipkart.output.save_comments() a = ["next"] print(a)
[ "91000315@realme.local" ]
91000315@realme.local
c30e374daa6ef0b7e7871e69274c82dbb29e3f50
e314c25746cd04cfc1e0c88d5044293c10a7c67e
/Exercícios/ex111/utilidadesCeV/teste.py
ccbe5e6cf9043c0379c9789a96ff77f0031d3e38
[ "MIT" ]
permissive
JosevanyAmaral/Exercicios-de-Python-Resolvidos
0c4dbbd12ec4593a6a82d7aeed64a3ef4e0fbccd
210e02ed05831a09d5445eab53cd907a09aaa280
refs/heads/main
2023-02-07T15:41:24.796702
2020-12-31T14:09:53
2020-12-31T14:09:53
324,603,260
1
0
null
null
null
null
UTF-8
Python
false
false
104
py
from ex111.utilidadesCeV import moeda p = float(input('Digite um número: R$')) moeda.resumo(p, 35, 22)
[ "Josevanyamaral2004@gmail.com" ]
Josevanyamaral2004@gmail.com
9c62b402c3b1f139bb32ee59fe7ca4513ccf9723
06d9dddc81fbbaccee0e6cc5798d0104a5febc3a
/Askisi9.py
8fb5113eff5d10c1e0df0cab6f02eb8fb5949db1
[]
no_license
chrsBlank/Askiseis_Python
e178418fd049334e653a5384de1bb06c4008da52
1c9dc9a24d15280e76885001fdc0d3bc8db33cbb
refs/heads/master
2023-08-08T03:28:40.409076
2018-02-21T11:15:42
2018-02-21T11:15:42
null
0
0
null
null
null
null
UTF-8
Python
false
false
1,495
py
import sys def execute(filename): f = open(filename, "r") evaluate(f.read()) f.close() def evaluate(code): code = cleanup(list(code)) bracemap = buildbracemap(code) cells, codeptr, cellptr = [0], 0, 0 while codeptr < len(code): command = code[codeptr] if command == ">": cellptr += 1 if cellptr == len(cells): cells.append(0) if command == "<": cellptr = 0 if cellptr <= 0 else cellptr - 1 if command == "+": cells[cellptr] = cells[cellptr] + 1 if cells[cellptr] < 255 else 0 if command == "-": cells[cellptr] = cells[cellptr] - 1 if cells[cellptr] > 0 else 255 if command == "[" and cells[cellptr] == 0: codeptr = bracemap[codeptr] if command == "]" and cells[cellptr] != 0: codeptr = bracemap[codeptr] if command == ".": sys.stdout.write(chr(cells[cellptr])) if command == ",": cells[cellptr] = ord(getch.getch()) codeptr += 1 def cleanup(code): return ''.join(filter(lambda x: x in ['.', ',', '[', ']', '<', '>', '+', '-'], code)) def buildbracemap(code): temp_bracestack, bracemap = [], {} for position, command in enumerate(code): if command == "[": temp_bracestack.append(position) if command == "]": start = temp_bracestack.pop() bracemap[start] = position bracemap[position] = start return bracemap def main(): if len(sys.argv) == 2: execute(sys.argv[1]) else: print("Usage:", sys.argv[0], "filename") if __name__ == "__main__": main()
[ "christiangrece45@gmail.com" ]
christiangrece45@gmail.com
e6c86286a352b6e8be637ea94f7acb30ed3348f1
854d0673d18cf1db557d2b9b27c248dd879ba28a
/venv/Lib/site-packages/pymavlink/dialects/v20/paparazzi.py
930bc5ac439eecddc6e991a9774529639ab527a7
[]
no_license
Miao1127/code-charpter3
51e141c0e463f1ea63f371a498d967b520f59853
313dae0b53f1f68fb7ce713ac3eab7e1a2d1b001
refs/heads/master
2023-07-15T21:27:22.688910
2021-08-23T01:13:59
2021-08-23T01:13:59
398,937,184
0
0
null
null
null
null
UTF-8
Python
false
false
1,161,977
py
''' MAVLink protocol implementation (auto-generated by mavgen.py) Generated from: paparazzi.xml,common.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 ...generator.mavcrc import x25crc import hashlib WIRE_PROTOCOL_VERSION = '2.0' DIALECT = 'paparazzi' 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', 253, 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 def format_attr(self, field): '''override field getter''' raw_attr = getattr(self,field) if isinstance(raw_attr, bytes): raw_attr = raw_attr.decode("utf-8").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 # enums class EnumEntry(object): def __init__(self, name, description): self.name = name self.description = description self.param = {} enums = {} # 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, http://ardupilot.org enums['MAV_AUTOPILOT'][3] = EnumEntry('MAV_AUTOPILOT_ARDUPILOTMEGA', '''ArduPilot - Plane/Copter/Rover/Sub/Tracker, http://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 # 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. enums['MAV_COMPONENT'][0] = EnumEntry('MAV_COMP_ID_ALL', '''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.''') 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_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_SENSOR_ENUM_END = 134217729 # enums['MAV_SYS_STATUS_SENSOR'][134217729] = 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', '''''') # 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 # Follow system ID enums['MAV_MOUNT_MODE'][5] = EnumEntry('MAV_MOUNT_MODE_SYSID_TARGET', '''Follow 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_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 for unchanged.''' 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 for unchanged.''' 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 for unchanged.''' 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 for unchanged.''' 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 for unchanged.''' 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 for unchanged.''' 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_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 for unchanged.''' 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 for unchanged.''' 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] = '''Finish 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 for unchanged. For planes indicates loiter direction (0: clockwise, 1: counter clockwise)''' enums['MAV_CMD'][192].param[5] = '''Latitude (deg * 1E7)''' enums['MAV_CMD'][192].param[6] = '''Longitude (deg * 1E7)''' enums['MAV_CMD'][192].param[7] = '''Altitude (meters)''' 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 # Camera ROI is vehicle with specified SysID. enums['MAV_CMD'][198] = EnumEntry('MAV_CMD_DO_SET_ROI_SYSID', '''Camera ROI is vehicle with specified SysID.''') 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_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_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] = '''Reserved (default:0)''' 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] = '''Reserved (default:0)''' enums['MAV_CMD'][512].param[4] = '''Reserved (default:0)''' enums['MAV_CMD'][512].param[5] = '''Reserved (default:0)''' enums['MAV_CMD'][512].param[6] = '''Reserved (default:0)''' enums['MAV_CMD'][512].param[7] = '''Reserved (default:0)''' MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES = 520 # Request autopilot capabilities. The receiver should ACK the command # and then emit its capabilities in an # AUTOPILOT_VERSION message 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), in meters''' 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), in meters''' 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), in meters''' 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), in meters''' 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), in meters''' 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), in meters''' 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), in meters''' 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), in meters''' 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), in meters''' 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), in meters''' 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), in meters''' 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_ENUM_END = 31015 # enums['MAV_CMD'][31015] = EnumEntry('MAV_CMD_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 ACCEPTED and EXECUTED enums['MAV_RESULT'][0] = EnumEntry('MAV_RESULT_ACCEPTED', '''Command ACCEPTED and EXECUTED''') MAV_RESULT_TEMPORARILY_REJECTED = 1 # Command TEMPORARY REJECTED/DENIED enums['MAV_RESULT'][1] = EnumEntry('MAV_RESULT_TEMPORARILY_REJECTED', '''Command TEMPORARY REJECTED/DENIED''') MAV_RESULT_DENIED = 2 # Command PERMANENTLY DENIED enums['MAV_RESULT'][2] = EnumEntry('MAV_RESULT_DENIED', '''Command PERMANENTLY DENIED''') MAV_RESULT_UNSUPPORTED = 3 # Command UNKNOWN/UNSUPPORTED enums['MAV_RESULT'][3] = EnumEntry('MAV_RESULT_UNSUPPORTED', '''Command UNKNOWN/UNSUPPORTED''') MAV_RESULT_FAILED = 4 # Command executed, but failed enums['MAV_RESULT'][4] = EnumEntry('MAV_RESULT_FAILED', '''Command executed, but failed''') MAV_RESULT_ENUM_END = 5 # enums['MAV_RESULT'][5] = 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_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_ENUM_END = 65 # enums['ADSB_FLAGS'][65] = 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 # North, East, Down enums['RTK_BASELINE_COORDINATE_SYSTEM'][1] = EnumEntry('RTK_BASELINE_COORDINATE_SYSTEM_NED', '''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', '''''') # message IDs MAVLINK_MSG_ID_BAD_DATA = -1 MAVLINK_MSG_ID_SCRIPT_ITEM = 180 MAVLINK_MSG_ID_SCRIPT_REQUEST = 181 MAVLINK_MSG_ID_SCRIPT_REQUEST_LIST = 182 MAVLINK_MSG_ID_SCRIPT_COUNT = 183 MAVLINK_MSG_ID_SCRIPT_CURRENT = 184 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 MAVLINK_MSG_ID_SETUP_SIGNING = 256 MAVLINK_MSG_ID_BUTTON_CHANGE = 257 MAVLINK_MSG_ID_PLAY_TUNE = 258 MAVLINK_MSG_ID_CAMERA_INFORMATION = 259 MAVLINK_MSG_ID_CAMERA_SETTINGS = 260 MAVLINK_MSG_ID_STORAGE_INFORMATION = 261 MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS = 262 MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED = 263 MAVLINK_MSG_ID_FLIGHT_INFORMATION = 264 MAVLINK_MSG_ID_MOUNT_ORIENTATION = 265 MAVLINK_MSG_ID_LOGGING_DATA = 266 MAVLINK_MSG_ID_LOGGING_DATA_ACKED = 267 MAVLINK_MSG_ID_LOGGING_ACK = 268 MAVLINK_MSG_ID_WIFI_CONFIG_AP = 299 MAVLINK_MSG_ID_UAVCAN_NODE_STATUS = 310 MAVLINK_MSG_ID_UAVCAN_NODE_INFO = 311 MAVLINK_MSG_ID_OBSTACLE_DISTANCE = 330 MAVLINK_MSG_ID_ODOMETRY = 331 MAVLINK_MSG_ID_ISBD_LINK_STATUS = 335 MAVLINK_MSG_ID_DEBUG_FLOAT_ARRAY = 350 MAVLINK_MSG_ID_STATUSTEXT_LONG = 365 MAVLINK_MSG_ID_ACTUATOR_OUTPUT_STATUS = 375 MAVLINK_MSG_ID_WHEEL_DISTANCE = 9000 class MAVLink_script_item_message(MAVLink_message): ''' Message encoding a mission script item. This message is emitted upon a request for the next script item. ''' id = MAVLINK_MSG_ID_SCRIPT_ITEM name = 'SCRIPT_ITEM' fieldnames = ['target_system', 'target_component', 'seq', 'name'] ordered_fieldnames = ['seq', 'target_system', 'target_component', 'name'] fieldtypes = ['uint8_t', 'uint8_t', 'uint16_t', 'char'] fielddisplays_by_name = {} fieldenums_by_name = {} fieldunits_by_name = {} format = '<HBB50s' native_format = bytearray('<HBBc', 'ascii') orders = [1, 2, 0, 3] lengths = [1, 1, 1, 1] array_lengths = [0, 0, 0, 50] crc_extra = 231 unpacker = struct.Struct('<HBB50s') def __init__(self, target_system, target_component, seq, name): MAVLink_message.__init__(self, MAVLink_script_item_message.id, MAVLink_script_item_message.name) self._fieldnames = MAVLink_script_item_message.fieldnames self.target_system = target_system self.target_component = target_component self.seq = seq self.name = name def pack(self, mav, force_mavlink1=False): return MAVLink_message.pack(self, mav, 231, struct.pack('<HBB50s', self.seq, self.target_system, self.target_component, self.name), force_mavlink1=force_mavlink1) class MAVLink_script_request_message(MAVLink_message): ''' Request script item with the sequence number seq. The response of the system to this message should be a SCRIPT_ITEM message. ''' id = MAVLINK_MSG_ID_SCRIPT_REQUEST name = 'SCRIPT_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 = 129 unpacker = struct.Struct('<HBB') def __init__(self, target_system, target_component, seq): MAVLink_message.__init__(self, MAVLink_script_request_message.id, MAVLink_script_request_message.name) self._fieldnames = MAVLink_script_request_message.fieldnames 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, 129, struct.pack('<HBB', self.seq, self.target_system, self.target_component), force_mavlink1=force_mavlink1) class MAVLink_script_request_list_message(MAVLink_message): ''' Request the overall list of mission items from the system/component. ''' id = MAVLINK_MSG_ID_SCRIPT_REQUEST_LIST name = 'SCRIPT_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 = 115 unpacker = struct.Struct('<BB') def __init__(self, target_system, target_component): MAVLink_message.__init__(self, MAVLink_script_request_list_message.id, MAVLink_script_request_list_message.name) self._fieldnames = MAVLink_script_request_list_message.fieldnames self.target_system = target_system self.target_component = target_component def pack(self, mav, force_mavlink1=False): return MAVLink_message.pack(self, mav, 115, struct.pack('<BB', self.target_system, self.target_component), force_mavlink1=force_mavlink1) class MAVLink_script_count_message(MAVLink_message): ''' This message is emitted as response to SCRIPT_REQUEST_LIST by the MAV to get the number of mission scripts. ''' id = MAVLINK_MSG_ID_SCRIPT_COUNT name = 'SCRIPT_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 = 186 unpacker = struct.Struct('<HBB') def __init__(self, target_system, target_component, count): MAVLink_message.__init__(self, MAVLink_script_count_message.id, MAVLink_script_count_message.name) self._fieldnames = MAVLink_script_count_message.fieldnames 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, 186, struct.pack('<HBB', self.count, self.target_system, self.target_component), force_mavlink1=force_mavlink1) class MAVLink_script_current_message(MAVLink_message): ''' This message informs about the currently active SCRIPT. ''' id = MAVLINK_MSG_ID_SCRIPT_CURRENT name = 'SCRIPT_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 = 40 unpacker = struct.Struct('<H') def __init__(self, seq): MAVLink_message.__init__(self, MAVLink_script_current_message.id, MAVLink_script_current_message.name) self._fieldnames = MAVLink_script_current_message.fieldnames self.seq = seq def pack(self, mav, force_mavlink1=False): return MAVLink_message.pack(self, mav, 40, struct.pack('<H', self.seq), 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') 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.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') 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.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') 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.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') 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.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') 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.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') 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.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') 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.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') 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.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') 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.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') 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.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') 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.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') 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.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', 'alt_ellipsoid', 'h_acc', 'v_acc', 'vel_acc', 'hdg_acc'] ordered_fieldnames = ['time_usec', 'lat', 'lon', 'alt', 'eph', 'epv', 'vel', 'cog', 'fix_type', 'satellites_visible', 'alt_ellipsoid', 'h_acc', 'v_acc', 'vel_acc', 'hdg_acc'] fieldtypes = ['uint64_t', 'uint8_t', 'int32_t', 'int32_t', 'int32_t', 'uint16_t', 'uint16_t', 'uint16_t', 'uint16_t', 'uint8_t', 'int32_t', 'uint32_t', 'uint32_t', 'uint32_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", "vel": "cm/s", "cog": "cdeg", "alt_ellipsoid": "mm", "h_acc": "mm", "v_acc": "mm", "vel_acc": "mm", "hdg_acc": "degE5"} format = '<QiiiHHHHBBiIIII' native_format = bytearray('<QiiiHHHHBBiIIII', 'ascii') orders = [0, 8, 1, 2, 3, 4, 5, 6, 7, 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 = 24 unpacker = struct.Struct('<QiiiHHHHBBiIIII') def __init__(self, time_usec, fix_type, lat, lon, alt, eph, epv, vel, cog, satellites_visible, alt_ellipsoid=0, h_acc=0, v_acc=0, vel_acc=0, hdg_acc=0): 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.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.alt_ellipsoid = alt_ellipsoid self.h_acc = h_acc self.v_acc = v_acc self.vel_acc = vel_acc self.hdg_acc = hdg_acc def pack(self, mav, force_mavlink1=False): return MAVLink_message.pack(self, mav, 24, struct.pack('<QiiiHHHHBBiIIII', self.time_usec, self.lat, self.lon, self.alt, self.eph, self.epv, self.vel, self.cog, self.fix_type, self.satellites_visible, self.alt_ellipsoid, self.h_acc, self.v_acc, self.vel_acc, self.hdg_acc), 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') 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.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', 'temperature'] ordered_fieldnames = ['time_boot_ms', 'xacc', 'yacc', 'zacc', 'xgyro', 'ygyro', 'zgyro', 'xmag', 'ymag', 'zmag', 'temperature'] fieldtypes = ['uint32_t', 'int16_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", "temperature": "cdegC"} format = '<Ihhhhhhhhhh' native_format = bytearray('<Ihhhhhhhhhh', '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 = 170 unpacker = struct.Struct('<Ihhhhhhhhhh') def __init__(self, time_boot_ms, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag, temperature=0): MAVLink_message.__init__(self, MAVLink_scaled_imu_message.id, MAVLink_scaled_imu_message.name) self._fieldnames = MAVLink_scaled_imu_message.fieldnames 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 self.temperature = temperature def pack(self, mav, force_mavlink1=False): return MAVLink_message.pack(self, mav, 170, struct.pack('<Ihhhhhhhhhh', self.time_boot_ms, self.xacc, self.yacc, self.zacc, self.xgyro, self.ygyro, self.zgyro, self.xmag, self.ymag, self.zmag, self.temperature), 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', 'id', 'temperature'] ordered_fieldnames = ['time_usec', 'xacc', 'yacc', 'zacc', 'xgyro', 'ygyro', 'zgyro', 'xmag', 'ymag', 'zmag', 'id', 'temperature'] fieldtypes = ['uint64_t', 'int16_t', 'int16_t', 'int16_t', 'int16_t', 'int16_t', 'int16_t', 'int16_t', 'int16_t', 'int16_t', 'uint8_t', 'int16_t'] fielddisplays_by_name = {} fieldenums_by_name = {} fieldunits_by_name = {"time_usec": "us", "temperature": "cdegC"} format = '<QhhhhhhhhhBh' native_format = bytearray('<QhhhhhhhhhBh', '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 = 144 unpacker = struct.Struct('<QhhhhhhhhhBh') def __init__(self, time_usec, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag, id=0, temperature=0): MAVLink_message.__init__(self, MAVLink_raw_imu_message.id, MAVLink_raw_imu_message.name) self._fieldnames = MAVLink_raw_imu_message.fieldnames 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.id = id self.temperature = temperature def pack(self, mav, force_mavlink1=False): return MAVLink_message.pack(self, mav, 144, struct.pack('<QhhhhhhhhhBh', self.time_usec, self.xacc, self.yacc, self.zacc, self.xgyro, self.ygyro, self.zgyro, self.xmag, self.ymag, self.zmag, self.id, self.temperature), 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') 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.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') 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.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') 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.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') 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.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') 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.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') 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.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') 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.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') 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.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): ''' 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', 'servo9_raw', 'servo10_raw', 'servo11_raw', 'servo12_raw', 'servo13_raw', 'servo14_raw', 'servo15_raw', 'servo16_raw'] ordered_fieldnames = ['time_usec', 'servo1_raw', 'servo2_raw', 'servo3_raw', 'servo4_raw', 'servo5_raw', 'servo6_raw', 'servo7_raw', 'servo8_raw', 'port', 'servo9_raw', 'servo10_raw', 'servo11_raw', 'servo12_raw', 'servo13_raw', 'servo14_raw', 'servo15_raw', 'servo16_raw'] 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'] 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", "servo9_raw": "us", "servo10_raw": "us", "servo11_raw": "us", "servo12_raw": "us", "servo13_raw": "us", "servo14_raw": "us", "servo15_raw": "us", "servo16_raw": "us"} format = '<IHHHHHHHHBHHHHHHHH' native_format = bytearray('<IHHHHHHHHBHHHHHHHH', 'ascii') orders = [0, 9, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 14, 15, 16, 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 = 222 unpacker = struct.Struct('<IHHHHHHHHBHHHHHHHH') def __init__(self, time_usec, port, servo1_raw, servo2_raw, servo3_raw, servo4_raw, servo5_raw, servo6_raw, servo7_raw, servo8_raw, servo9_raw=0, servo10_raw=0, servo11_raw=0, servo12_raw=0, servo13_raw=0, servo14_raw=0, servo15_raw=0, servo16_raw=0): 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.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 self.servo9_raw = servo9_raw self.servo10_raw = servo10_raw self.servo11_raw = servo11_raw self.servo12_raw = servo12_raw self.servo13_raw = servo13_raw self.servo14_raw = servo14_raw self.servo15_raw = servo15_raw self.servo16_raw = servo16_raw def pack(self, mav, force_mavlink1=False): return MAVLink_message.pack(self, mav, 222, struct.pack('<IHHHHHHHHBHHHHHHHH', 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, self.servo9_raw, self.servo10_raw, self.servo11_raw, self.servo12_raw, self.servo13_raw, self.servo14_raw, self.servo15_raw, self.servo16_raw), 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', 'mission_type'] ordered_fieldnames = ['start_index', 'end_index', 'target_system', 'target_component', 'mission_type'] fieldtypes = ['uint8_t', 'uint8_t', 'int16_t', 'int16_t', 'uint8_t'] fielddisplays_by_name = {} fieldenums_by_name = {"mission_type": "MAV_MISSION_TYPE"} fieldunits_by_name = {} format = '<hhBBB' native_format = bytearray('<hhBBB', 'ascii') orders = [2, 3, 0, 1, 4] lengths = [1, 1, 1, 1, 1] array_lengths = [0, 0, 0, 0, 0] crc_extra = 212 unpacker = struct.Struct('<hhBBB') def __init__(self, target_system, target_component, start_index, end_index, mission_type=0): 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.target_system = target_system self.target_component = target_component self.start_index = start_index self.end_index = end_index self.mission_type = mission_type def pack(self, mav, force_mavlink1=False): return MAVLink_message.pack(self, mav, 212, struct.pack('<hhBBB', self.start_index, self.end_index, self.target_system, self.target_component, self.mission_type), 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', 'mission_type'] ordered_fieldnames = ['start_index', 'end_index', 'target_system', 'target_component', 'mission_type'] fieldtypes = ['uint8_t', 'uint8_t', 'int16_t', 'int16_t', 'uint8_t'] fielddisplays_by_name = {} fieldenums_by_name = {"mission_type": "MAV_MISSION_TYPE"} fieldunits_by_name = {} format = '<hhBBB' native_format = bytearray('<hhBBB', 'ascii') orders = [2, 3, 0, 1, 4] lengths = [1, 1, 1, 1, 1] array_lengths = [0, 0, 0, 0, 0] crc_extra = 9 unpacker = struct.Struct('<hhBBB') def __init__(self, target_system, target_component, start_index, end_index, mission_type=0): 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.target_system = target_system self.target_component = target_component self.start_index = start_index self.end_index = end_index self.mission_type = mission_type def pack(self, mav, force_mavlink1=False): return MAVLink_message.pack(self, mav, 9, struct.pack('<hhBBB', self.start_index, self.end_index, self.target_system, self.target_component, self.mission_type), 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). 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', 'mission_type'] ordered_fieldnames = ['param1', 'param2', 'param3', 'param4', 'x', 'y', 'z', 'seq', 'command', 'target_system', 'target_component', 'frame', 'current', 'autocontinue', 'mission_type'] fieldtypes = ['uint8_t', 'uint8_t', 'uint16_t', 'uint8_t', 'uint16_t', 'uint8_t', 'uint8_t', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'uint8_t'] fielddisplays_by_name = {} fieldenums_by_name = {"frame": "MAV_FRAME", "command": "MAV_CMD", "mission_type": "MAV_MISSION_TYPE"} fieldunits_by_name = {} format = '<fffffffHHBBBBBB' native_format = bytearray('<fffffffHHBBBBBB', 'ascii') orders = [9, 10, 7, 11, 8, 12, 13, 0, 1, 2, 3, 4, 5, 6, 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 = 254 unpacker = struct.Struct('<fffffffHHBBBBBB') def __init__(self, target_system, target_component, seq, frame, command, current, autocontinue, param1, param2, param3, param4, x, y, z, mission_type=0): MAVLink_message.__init__(self, MAVLink_mission_item_message.id, MAVLink_mission_item_message.name) self._fieldnames = MAVLink_mission_item_message.fieldnames 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 self.mission_type = mission_type def pack(self, mav, force_mavlink1=False): return MAVLink_message.pack(self, mav, 254, struct.pack('<fffffffHHBBBBBB', 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, self.mission_type), 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', 'mission_type'] ordered_fieldnames = ['seq', 'target_system', 'target_component', 'mission_type'] fieldtypes = ['uint8_t', 'uint8_t', 'uint16_t', 'uint8_t'] fielddisplays_by_name = {} fieldenums_by_name = {"mission_type": "MAV_MISSION_TYPE"} fieldunits_by_name = {} format = '<HBBB' native_format = bytearray('<HBBB', 'ascii') orders = [1, 2, 0, 3] lengths = [1, 1, 1, 1] array_lengths = [0, 0, 0, 0] crc_extra = 230 unpacker = struct.Struct('<HBBB') def __init__(self, target_system, target_component, seq, mission_type=0): MAVLink_message.__init__(self, MAVLink_mission_request_message.id, MAVLink_mission_request_message.name) self._fieldnames = MAVLink_mission_request_message.fieldnames self.target_system = target_system self.target_component = target_component self.seq = seq self.mission_type = mission_type def pack(self, mav, force_mavlink1=False): return MAVLink_message.pack(self, mav, 230, struct.pack('<HBBB', self.seq, self.target_system, self.target_component, self.mission_type), 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') 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.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') 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.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', 'mission_type'] ordered_fieldnames = ['target_system', 'target_component', 'mission_type'] fieldtypes = ['uint8_t', 'uint8_t', 'uint8_t'] fielddisplays_by_name = {} fieldenums_by_name = {"mission_type": "MAV_MISSION_TYPE"} 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 = 132 unpacker = struct.Struct('<BBB') def __init__(self, target_system, target_component, mission_type=0): 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.target_system = target_system self.target_component = target_component self.mission_type = mission_type def pack(self, mav, force_mavlink1=False): return MAVLink_message.pack(self, mav, 132, struct.pack('<BBB', self.target_system, self.target_component, self.mission_type), 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', 'mission_type'] ordered_fieldnames = ['count', 'target_system', 'target_component', 'mission_type'] fieldtypes = ['uint8_t', 'uint8_t', 'uint16_t', 'uint8_t'] fielddisplays_by_name = {} fieldenums_by_name = {"mission_type": "MAV_MISSION_TYPE"} fieldunits_by_name = {} format = '<HBBB' native_format = bytearray('<HBBB', 'ascii') orders = [1, 2, 0, 3] lengths = [1, 1, 1, 1] array_lengths = [0, 0, 0, 0] crc_extra = 221 unpacker = struct.Struct('<HBBB') def __init__(self, target_system, target_component, count, mission_type=0): MAVLink_message.__init__(self, MAVLink_mission_count_message.id, MAVLink_mission_count_message.name) self._fieldnames = MAVLink_mission_count_message.fieldnames self.target_system = target_system self.target_component = target_component self.count = count self.mission_type = mission_type def pack(self, mav, force_mavlink1=False): return MAVLink_message.pack(self, mav, 221, struct.pack('<HBBB', self.count, self.target_system, self.target_component, self.mission_type), 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', 'mission_type'] ordered_fieldnames = ['target_system', 'target_component', 'mission_type'] fieldtypes = ['uint8_t', 'uint8_t', 'uint8_t'] fielddisplays_by_name = {} fieldenums_by_name = {"mission_type": "MAV_MISSION_TYPE"} 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 = 232 unpacker = struct.Struct('<BBB') def __init__(self, target_system, target_component, mission_type=0): 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.target_system = target_system self.target_component = target_component self.mission_type = mission_type def pack(self, mav, force_mavlink1=False): return MAVLink_message.pack(self, mav, 232, struct.pack('<BBB', self.target_system, self.target_component, self.mission_type), 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') 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.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', 'mission_type'] ordered_fieldnames = ['target_system', 'target_component', 'type', 'mission_type'] fieldtypes = ['uint8_t', 'uint8_t', 'uint8_t', 'uint8_t'] fielddisplays_by_name = {} fieldenums_by_name = {"type": "MAV_MISSION_RESULT", "mission_type": "MAV_MISSION_TYPE"} fieldunits_by_name = {} format = '<BBBB' native_format = bytearray('<BBBB', 'ascii') orders = [0, 1, 2, 3] lengths = [1, 1, 1, 1] array_lengths = [0, 0, 0, 0] crc_extra = 153 unpacker = struct.Struct('<BBBB') def __init__(self, target_system, target_component, type, mission_type=0): MAVLink_message.__init__(self, MAVLink_mission_ack_message.id, MAVLink_mission_ack_message.name) self._fieldnames = MAVLink_mission_ack_message.fieldnames self.target_system = target_system self.target_component = target_component self.type = type self.mission_type = mission_type def pack(self, mav, force_mavlink1=False): return MAVLink_message.pack(self, mav, 153, struct.pack('<BBBB', self.target_system, self.target_component, self.type, self.mission_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', 'time_usec'] ordered_fieldnames = ['latitude', 'longitude', 'altitude', 'target_system', 'time_usec'] fieldtypes = ['uint8_t', 'int32_t', 'int32_t', 'int32_t', 'uint64_t'] fielddisplays_by_name = {} fieldenums_by_name = {} fieldunits_by_name = {"latitude": "degE7", "longitude": "degE7", "altitude": "mm", "time_usec": "us"} format = '<iiiBQ' native_format = bytearray('<iiiBQ', 'ascii') orders = [3, 0, 1, 2, 4] lengths = [1, 1, 1, 1, 1] array_lengths = [0, 0, 0, 0, 0] crc_extra = 41 unpacker = struct.Struct('<iiiBQ') def __init__(self, target_system, latitude, longitude, altitude, time_usec=0): 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.target_system = target_system self.latitude = latitude self.longitude = longitude self.altitude = altitude self.time_usec = time_usec def pack(self, mav, force_mavlink1=False): return MAVLink_message.pack(self, mav, 41, struct.pack('<iiiBQ', self.latitude, self.longitude, self.altitude, self.target_system, self.time_usec), 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', 'time_usec'] ordered_fieldnames = ['latitude', 'longitude', 'altitude', 'time_usec'] fieldtypes = ['int32_t', 'int32_t', 'int32_t', 'uint64_t'] fielddisplays_by_name = {} fieldenums_by_name = {} fieldunits_by_name = {"latitude": "degE7", "longitude": "degE7", "altitude": "mm", "time_usec": "us"} format = '<iiiQ' native_format = bytearray('<iiiQ', 'ascii') orders = [0, 1, 2, 3] lengths = [1, 1, 1, 1] array_lengths = [0, 0, 0, 0] crc_extra = 39 unpacker = struct.Struct('<iiiQ') def __init__(self, latitude, longitude, altitude, time_usec=0): 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.latitude = latitude self.longitude = longitude self.altitude = altitude self.time_usec = time_usec def pack(self, mav, force_mavlink1=False): return MAVLink_message.pack(self, mav, 39, struct.pack('<iiiQ', self.latitude, self.longitude, self.altitude, self.time_usec), 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') 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.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', 'mission_type'] ordered_fieldnames = ['seq', 'target_system', 'target_component', 'mission_type'] fieldtypes = ['uint8_t', 'uint8_t', 'uint16_t', 'uint8_t'] fielddisplays_by_name = {} fieldenums_by_name = {"mission_type": "MAV_MISSION_TYPE"} fieldunits_by_name = {} format = '<HBBB' native_format = bytearray('<HBBB', 'ascii') orders = [1, 2, 0, 3] lengths = [1, 1, 1, 1] array_lengths = [0, 0, 0, 0] crc_extra = 196 unpacker = struct.Struct('<HBBB') def __init__(self, target_system, target_component, seq, mission_type=0): 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.target_system = target_system self.target_component = target_component self.seq = seq self.mission_type = mission_type def pack(self, mav, force_mavlink1=False): return MAVLink_message.pack(self, mav, 196, struct.pack('<HBBB', self.seq, self.target_system, self.target_component, self.mission_type), 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') 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.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') 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.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') 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.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') 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.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') 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.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') 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.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') 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.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') 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.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') 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.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') 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.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', 'chan9_raw', 'chan10_raw', 'chan11_raw', 'chan12_raw', 'chan13_raw', 'chan14_raw', 'chan15_raw', 'chan16_raw', 'chan17_raw', 'chan18_raw'] ordered_fieldnames = ['chan1_raw', 'chan2_raw', 'chan3_raw', 'chan4_raw', 'chan5_raw', 'chan6_raw', 'chan7_raw', 'chan8_raw', 'target_system', 'target_component', 'chan9_raw', 'chan10_raw', 'chan11_raw', 'chan12_raw', 'chan13_raw', 'chan14_raw', 'chan15_raw', 'chan16_raw', 'chan17_raw', 'chan18_raw'] fieldtypes = ['uint8_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'] 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", "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 = '<HHHHHHHHBBHHHHHHHHHH' native_format = bytearray('<HHHHHHHHBBHHHHHHHHHH', 'ascii') orders = [8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19] lengths = [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] crc_extra = 124 unpacker = struct.Struct('<HHHHHHHHBBHHHHHHHHHH') def __init__(self, target_system, target_component, chan1_raw, chan2_raw, chan3_raw, chan4_raw, chan5_raw, chan6_raw, chan7_raw, chan8_raw, chan9_raw=0, chan10_raw=0, chan11_raw=0, chan12_raw=0, chan13_raw=0, chan14_raw=0, chan15_raw=0, chan16_raw=0, chan17_raw=0, chan18_raw=0): 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.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 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 def pack(self, mav, force_mavlink1=False): return MAVLink_message.pack(self, mav, 124, struct.pack('<HHHHHHHHBBHHHHHHHHHH', 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, 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), 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). 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', 'mission_type'] ordered_fieldnames = ['param1', 'param2', 'param3', 'param4', 'x', 'y', 'z', 'seq', 'command', 'target_system', 'target_component', 'frame', 'current', 'autocontinue', 'mission_type'] fieldtypes = ['uint8_t', 'uint8_t', 'uint16_t', 'uint8_t', 'uint16_t', 'uint8_t', 'uint8_t', 'float', 'float', 'float', 'float', 'int32_t', 'int32_t', 'float', 'uint8_t'] fielddisplays_by_name = {} fieldenums_by_name = {"frame": "MAV_FRAME", "command": "MAV_CMD", "mission_type": "MAV_MISSION_TYPE"} fieldunits_by_name = {} format = '<ffffiifHHBBBBBB' native_format = bytearray('<ffffiifHHBBBBBB', 'ascii') orders = [9, 10, 7, 11, 8, 12, 13, 0, 1, 2, 3, 4, 5, 6, 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 = 38 unpacker = struct.Struct('<ffffiifHHBBBBBB') def __init__(self, target_system, target_component, seq, frame, command, current, autocontinue, param1, param2, param3, param4, x, y, z, mission_type=0): 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.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 self.mission_type = mission_type def pack(self, mav, force_mavlink1=False): return MAVLink_message.pack(self, mav, 38, struct.pack('<ffffiifHHBBBBBB', 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, self.mission_type), 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') 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.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') 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.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') 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.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') 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.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') 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.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') 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.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') 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.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') 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.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') 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.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') 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.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') 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.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') 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.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') 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.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') 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.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') 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.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') 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.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', 'flow_rate_x', 'flow_rate_y'] ordered_fieldnames = ['time_usec', 'flow_comp_m_x', 'flow_comp_m_y', 'ground_distance', 'flow_x', 'flow_y', 'sensor_id', 'quality', 'flow_rate_x', 'flow_rate_y'] fieldtypes = ['uint64_t', 'uint8_t', 'int16_t', 'int16_t', 'float', 'float', 'uint8_t', 'float', 'float', '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", "flow_rate_x": "rad/s", "flow_rate_y": "rad/s"} format = '<QfffhhBBff' native_format = bytearray('<QfffhhBBff', 'ascii') orders = [0, 6, 4, 5, 1, 2, 7, 3, 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 = 175 unpacker = struct.Struct('<QfffhhBBff') def __init__(self, time_usec, sensor_id, flow_x, flow_y, flow_comp_m_x, flow_comp_m_y, quality, ground_distance, flow_rate_x=0, flow_rate_y=0): MAVLink_message.__init__(self, MAVLink_optical_flow_message.id, MAVLink_optical_flow_message.name) self._fieldnames = MAVLink_optical_flow_message.fieldnames 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 self.flow_rate_x = flow_rate_x self.flow_rate_y = flow_rate_y def pack(self, mav, force_mavlink1=False): return MAVLink_message.pack(self, mav, 175, struct.pack('<QfffhhBBff', 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, self.flow_rate_x, self.flow_rate_y), 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', 'covariance', 'reset_counter'] ordered_fieldnames = ['usec', 'x', 'y', 'z', 'roll', 'pitch', 'yaw', 'covariance', 'reset_counter'] fieldtypes = ['uint64_t', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'uint8_t'] fielddisplays_by_name = {} fieldenums_by_name = {} fieldunits_by_name = {"usec": "us", "x": "m", "y": "m", "z": "m", "roll": "rad", "pitch": "rad", "yaw": "rad"} format = '<Qffffff21fB' native_format = bytearray('<QfffffffB', 'ascii') orders = [0, 1, 2, 3, 4, 5, 6, 7, 8] lengths = [1, 1, 1, 1, 1, 1, 1, 21, 1] array_lengths = [0, 0, 0, 0, 0, 0, 0, 21, 0] crc_extra = 102 unpacker = struct.Struct('<Qffffff21fB') def __init__(self, usec, x, y, z, roll, pitch, yaw, covariance=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], reset_counter=0): 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.usec = usec self.x = x self.y = y self.z = z self.roll = roll self.pitch = pitch self.yaw = yaw self.covariance = covariance self.reset_counter = reset_counter def pack(self, mav, force_mavlink1=False): return MAVLink_message.pack(self, mav, 102, struct.pack('<Qffffff21fB', self.usec, self.x, self.y, self.z, self.roll, self.pitch, self.yaw, 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.reset_counter), force_mavlink1=force_mavlink1) class MAVLink_vision_position_estimate_message(MAVLink_message): ''' Global 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', 'covariance', 'reset_counter'] ordered_fieldnames = ['usec', 'x', 'y', 'z', 'roll', 'pitch', 'yaw', 'covariance', 'reset_counter'] fieldtypes = ['uint64_t', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'uint8_t'] fielddisplays_by_name = {} fieldenums_by_name = {} fieldunits_by_name = {"usec": "us", "x": "m", "y": "m", "z": "m", "roll": "rad", "pitch": "rad", "yaw": "rad"} format = '<Qffffff21fB' native_format = bytearray('<QfffffffB', 'ascii') orders = [0, 1, 2, 3, 4, 5, 6, 7, 8] lengths = [1, 1, 1, 1, 1, 1, 1, 21, 1] array_lengths = [0, 0, 0, 0, 0, 0, 0, 21, 0] crc_extra = 158 unpacker = struct.Struct('<Qffffff21fB') def __init__(self, usec, x, y, z, roll, pitch, yaw, covariance=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], reset_counter=0): 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.usec = usec self.x = x self.y = y self.z = z self.roll = roll self.pitch = pitch self.yaw = yaw self.covariance = covariance self.reset_counter = reset_counter def pack(self, mav, force_mavlink1=False): return MAVLink_message.pack(self, mav, 158, struct.pack('<Qffffff21fB', self.usec, self.x, self.y, self.z, self.roll, self.pitch, self.yaw, 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.reset_counter), 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', 'covariance', 'reset_counter'] ordered_fieldnames = ['usec', 'x', 'y', 'z', 'covariance', 'reset_counter'] fieldtypes = ['uint64_t', 'float', 'float', 'float', 'float', 'uint8_t'] fielddisplays_by_name = {} fieldenums_by_name = {} fieldunits_by_name = {"usec": "us", "x": "m/s", "y": "m/s", "z": "m/s"} format = '<Qfff9fB' native_format = bytearray('<QffffB', 'ascii') orders = [0, 1, 2, 3, 4, 5] lengths = [1, 1, 1, 1, 9, 1] array_lengths = [0, 0, 0, 0, 9, 0] crc_extra = 208 unpacker = struct.Struct('<Qfff9fB') def __init__(self, usec, x, y, z, covariance=[0,0,0,0,0,0,0,0,0], reset_counter=0): 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.usec = usec self.x = x self.y = y self.z = z self.covariance = covariance self.reset_counter = reset_counter def pack(self, mav, force_mavlink1=False): return MAVLink_message.pack(self, mav, 208, struct.pack('<Qfff9fB', self.usec, self.x, self.y, self.z, 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.reset_counter), 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', 'covariance'] ordered_fieldnames = ['usec', 'x', 'y', 'z', 'roll', 'pitch', 'yaw', 'covariance'] fieldtypes = ['uint64_t', 'float', '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 = '<Qffffff21f' native_format = bytearray('<Qfffffff', 'ascii') orders = [0, 1, 2, 3, 4, 5, 6, 7] lengths = [1, 1, 1, 1, 1, 1, 1, 21] array_lengths = [0, 0, 0, 0, 0, 0, 0, 21] crc_extra = 56 unpacker = struct.Struct('<Qffffff21f') def __init__(self, usec, x, y, z, roll, pitch, yaw, covariance=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]): 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.usec = usec self.x = x self.y = y self.z = z self.roll = roll self.pitch = pitch self.yaw = yaw self.covariance = covariance def pack(self, mav, force_mavlink1=False): return MAVLink_message.pack(self, mav, 56, struct.pack('<Qffffff21f', self.usec, self.x, self.y, self.z, self.roll, self.pitch, self.yaw, 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]), 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', 'id'] ordered_fieldnames = ['time_usec', 'xacc', 'yacc', 'zacc', 'xgyro', 'ygyro', 'zgyro', 'xmag', 'ymag', 'zmag', 'abs_pressure', 'diff_pressure', 'pressure_alt', 'temperature', 'fields_updated', 'id'] fieldtypes = ['uint64_t', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'uint16_t', 'uint8_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 = '<QfffffffffffffHB' native_format = bytearray('<QfffffffffffffHB', '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 = 93 unpacker = struct.Struct('<QfffffffffffffHB') def __init__(self, time_usec, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag, abs_pressure, diff_pressure, pressure_alt, temperature, fields_updated, id=0): MAVLink_message.__init__(self, MAVLink_highres_imu_message.id, MAVLink_highres_imu_message.name) self._fieldnames = MAVLink_highres_imu_message.fieldnames 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 self.id = id def pack(self, mav, force_mavlink1=False): return MAVLink_message.pack(self, mav, 93, struct.pack('<QfffffffffffffHB', 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, self.id), 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') 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.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') 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.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') 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.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') 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.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') 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.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') def __init__(self, tc1, ts1): MAVLink_message.__init__(self, MAVLink_timesync_message.id, MAVLink_timesync_message.name) self._fieldnames = MAVLink_timesync_message.fieldnames 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') 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.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') 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.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') 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.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') 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.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', 'temperature'] ordered_fieldnames = ['time_boot_ms', 'xacc', 'yacc', 'zacc', 'xgyro', 'ygyro', 'zgyro', 'xmag', 'ymag', 'zmag', 'temperature'] fieldtypes = ['uint32_t', 'int16_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", "temperature": "cdegC"} format = '<Ihhhhhhhhhh' native_format = bytearray('<Ihhhhhhhhhh', '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 = 76 unpacker = struct.Struct('<Ihhhhhhhhhh') def __init__(self, time_boot_ms, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag, temperature=0): MAVLink_message.__init__(self, MAVLink_scaled_imu2_message.id, MAVLink_scaled_imu2_message.name) self._fieldnames = MAVLink_scaled_imu2_message.fieldnames 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 self.temperature = temperature def pack(self, mav, force_mavlink1=False): return MAVLink_message.pack(self, mav, 76, struct.pack('<Ihhhhhhhhhh', self.time_boot_ms, self.xacc, self.yacc, self.zacc, self.xgyro, self.ygyro, self.zgyro, self.xmag, self.ymag, self.zmag, self.temperature), 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') 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.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') 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.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') 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.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') 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.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') 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.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') 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.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') 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.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') 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.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') 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.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') 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.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') 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.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') 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.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', 'temperature'] ordered_fieldnames = ['time_boot_ms', 'xacc', 'yacc', 'zacc', 'xgyro', 'ygyro', 'zgyro', 'xmag', 'ymag', 'zmag', 'temperature'] fieldtypes = ['uint32_t', 'int16_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", "temperature": "cdegC"} format = '<Ihhhhhhhhhh' native_format = bytearray('<Ihhhhhhhhhh', '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 = 46 unpacker = struct.Struct('<Ihhhhhhhhhh') def __init__(self, time_boot_ms, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag, temperature=0): MAVLink_message.__init__(self, MAVLink_scaled_imu3_message.id, MAVLink_scaled_imu3_message.name) self._fieldnames = MAVLink_scaled_imu3_message.fieldnames 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 self.temperature = temperature def pack(self, mav, force_mavlink1=False): return MAVLink_message.pack(self, mav, 46, struct.pack('<Ihhhhhhhhhh', self.time_boot_ms, self.xacc, self.yacc, self.zacc, self.xgyro, self.ygyro, self.zgyro, self.xmag, self.ymag, self.zmag, self.temperature), 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') 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.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') 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.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', 'horizontal_fov', 'vertical_fov', 'quaternion'] ordered_fieldnames = ['time_boot_ms', 'min_distance', 'max_distance', 'current_distance', 'type', 'id', 'orientation', 'covariance', 'horizontal_fov', 'vertical_fov', 'quaternion'] fieldtypes = ['uint32_t', 'uint16_t', 'uint16_t', 'uint16_t', 'uint8_t', 'uint8_t', 'uint8_t', 'uint8_t', 'float', 'float', 'float'] 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", "horizontal_fov": "rad", "vertical_fov": "rad"} format = '<IHHHBBBBff4f' native_format = bytearray('<IHHHBBBBfff', 'ascii') orders = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] lengths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4] array_lengths = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4] crc_extra = 85 unpacker = struct.Struct('<IHHHBBBBff4f') def __init__(self, time_boot_ms, min_distance, max_distance, current_distance, type, id, orientation, covariance, horizontal_fov=0, vertical_fov=0, quaternion=[0,0,0,0]): MAVLink_message.__init__(self, MAVLink_distance_sensor_message.id, MAVLink_distance_sensor_message.name) self._fieldnames = MAVLink_distance_sensor_message.fieldnames 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 self.horizontal_fov = horizontal_fov self.vertical_fov = vertical_fov self.quaternion = quaternion def pack(self, mav, force_mavlink1=False): return MAVLink_message.pack(self, mav, 85, struct.pack('<IHHHBBBBff4f', self.time_boot_ms, self.min_distance, self.max_distance, self.current_distance, self.type, self.id, self.orientation, self.covariance, self.horizontal_fov, self.vertical_fov, self.quaternion[0], self.quaternion[1], self.quaternion[2], self.quaternion[3]), 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') 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.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') 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.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') 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.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') 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.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') 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.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', 'covariance'] ordered_fieldnames = ['time_usec', 'q', 'x', 'y', 'z', 'covariance'] fieldtypes = ['uint64_t', 'float', 'float', 'float', 'float', 'float'] fielddisplays_by_name = {} fieldenums_by_name = {} fieldunits_by_name = {"time_usec": "us", "x": "m", "y": "m", "z": "m"} format = '<Q4ffff21f' native_format = bytearray('<Qfffff', 'ascii') orders = [0, 1, 2, 3, 4, 5] lengths = [1, 4, 1, 1, 1, 21] array_lengths = [0, 4, 0, 0, 0, 21] crc_extra = 109 unpacker = struct.Struct('<Q4ffff21f') def __init__(self, time_usec, q, x, y, z, covariance=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]): 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.time_usec = time_usec self.q = q self.x = x self.y = y self.z = z self.covariance = covariance def pack(self, mav, force_mavlink1=False): return MAVLink_message.pack(self, mav, 109, struct.pack('<Q4ffff21f', self.time_usec, self.q[0], self.q[1], self.q[2], self.q[3], self.x, self.y, self.z, 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]), 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') 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.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') 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.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') 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.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') 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.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') 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.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') 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.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') 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.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', 'time_remaining', 'charge_state'] ordered_fieldnames = ['current_consumed', 'energy_consumed', 'temperature', 'voltages', 'current_battery', 'id', 'battery_function', 'type', 'battery_remaining', 'time_remaining', 'charge_state'] fieldtypes = ['uint8_t', 'uint8_t', 'uint8_t', 'int16_t', 'uint16_t', 'int16_t', 'int32_t', 'int32_t', 'int8_t', 'int32_t', 'uint8_t'] fielddisplays_by_name = {} fieldenums_by_name = {"battery_function": "MAV_BATTERY_FUNCTION", "type": "MAV_BATTERY_TYPE", "charge_state": "MAV_BATTERY_CHARGE_STATE"} fieldunits_by_name = {"temperature": "cdegC", "voltages": "mV", "current_battery": "cA", "current_consumed": "mAh", "energy_consumed": "hJ", "battery_remaining": "%", "time_remaining": "s"} format = '<iih10HhBBBbiB' native_format = bytearray('<iihHhBBBbiB', 'ascii') orders = [5, 6, 7, 2, 3, 4, 0, 1, 8, 9, 10] lengths = [1, 1, 1, 10, 1, 1, 1, 1, 1, 1, 1] array_lengths = [0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0] crc_extra = 154 unpacker = struct.Struct('<iih10HhBBBbiB') def __init__(self, id, battery_function, type, temperature, voltages, current_battery, current_consumed, energy_consumed, battery_remaining, time_remaining=0, charge_state=0): MAVLink_message.__init__(self, MAVLink_battery_status_message.id, MAVLink_battery_status_message.name) self._fieldnames = MAVLink_battery_status_message.fieldnames 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 self.time_remaining = time_remaining self.charge_state = charge_state def pack(self, mav, force_mavlink1=False): return MAVLink_message.pack(self, mav, 154, struct.pack('<iih10HhBBBbiB', 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, self.time_remaining, self.charge_state), 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', 'uid2'] 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', 'uid2'] fieldtypes = ['uint64_t', 'uint32_t', 'uint32_t', 'uint32_t', 'uint32_t', 'uint8_t', 'uint8_t', 'uint8_t', 'uint16_t', 'uint16_t', 'uint64_t', 'uint8_t'] fielddisplays_by_name = {"capabilities": "bitmask"} fieldenums_by_name = {"capabilities": "MAV_PROTOCOL_CAPABILITY"} fieldunits_by_name = {} format = '<QQIIIIHH8B8B8B18B' native_format = bytearray('<QQIIIIHHBBBB', 'ascii') orders = [0, 2, 3, 4, 5, 8, 9, 10, 6, 7, 1, 11] lengths = [1, 1, 1, 1, 1, 1, 1, 1, 8, 8, 8, 18] array_lengths = [0, 0, 0, 0, 0, 0, 0, 0, 8, 8, 8, 18] crc_extra = 178 unpacker = struct.Struct('<QQIIIIHH8B8B8B18B') 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, uid2=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]): MAVLink_message.__init__(self, MAVLink_autopilot_version_message.id, MAVLink_autopilot_version_message.name) self._fieldnames = MAVLink_autopilot_version_message.fieldnames 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 self.uid2 = uid2 def pack(self, mav, force_mavlink1=False): return MAVLink_message.pack(self, mav, 178, struct.pack('<QQIIIIHH8B8B8B18B', 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], self.uid2[0], self.uid2[1], self.uid2[2], self.uid2[3], self.uid2[4], self.uid2[5], self.uid2[6], self.uid2[7], self.uid2[8], self.uid2[9], self.uid2[10], self.uid2[11], self.uid2[12], self.uid2[13], self.uid2[14], self.uid2[15], self.uid2[16], self.uid2[17]), 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', 'x', 'y', 'z', 'q', 'type', 'position_valid'] ordered_fieldnames = ['time_usec', 'angle_x', 'angle_y', 'distance', 'size_x', 'size_y', 'target_num', 'frame', 'x', 'y', 'z', 'q', 'type', 'position_valid'] fieldtypes = ['uint64_t', 'uint8_t', 'uint8_t', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'uint8_t', 'uint8_t'] fielddisplays_by_name = {} fieldenums_by_name = {"frame": "MAV_FRAME", "type": "LANDING_TARGET_TYPE"} fieldunits_by_name = {"time_usec": "us", "angle_x": "rad", "angle_y": "rad", "distance": "m", "size_x": "rad", "size_y": "rad", "x": "m", "y": "m", "z": "m"} format = '<QfffffBBfff4fBB' native_format = bytearray('<QfffffBBffffBB', 'ascii') orders = [0, 6, 7, 1, 2, 3, 4, 5, 8, 9, 10, 11, 12, 13] lengths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 1, 1] array_lengths = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0] crc_extra = 200 unpacker = struct.Struct('<QfffffBBfff4fBB') def __init__(self, time_usec, target_num, frame, angle_x, angle_y, distance, size_x, size_y, x=0, y=0, z=0, q=[0,0,0,0], type=0, position_valid=0): MAVLink_message.__init__(self, MAVLink_landing_target_message.id, MAVLink_landing_target_message.name) self._fieldnames = MAVLink_landing_target_message.fieldnames 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 self.x = x self.y = y self.z = z self.q = q self.type = type self.position_valid = position_valid def pack(self, mav, force_mavlink1=False): return MAVLink_message.pack(self, mav, 200, struct.pack('<QfffffBBfff4fBB', self.time_usec, self.angle_x, self.angle_y, self.distance, self.size_x, self.size_y, self.target_num, self.frame, self.x, self.y, self.z, self.q[0], self.q[1], self.q[2], self.q[3], self.type, self.position_valid), 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') 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.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') 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.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') 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.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', 'yaw'] 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', 'yaw'] 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', 'uint16_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", "yaw": "cdeg"} format = '<QIiifffffffffHHBBBH' native_format = bytearray('<QIiifffffffffHHBBBH', 'ascii') orders = [0, 15, 13, 1, 14, 16, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 17, 18] lengths = [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] crc_extra = 151 unpacker = struct.Struct('<QIiifffffffffHHBBBH') 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, yaw=0): MAVLink_message.__init__(self, MAVLink_gps_input_message.id, MAVLink_gps_input_message.name) self._fieldnames = MAVLink_gps_input_message.fieldnames 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 self.yaw = yaw def pack(self, mav, force_mavlink1=False): return MAVLink_message.pack(self, mav, 151, struct.pack('<QIiifffffffffHHBBBH', 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, self.yaw), 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') 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.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') 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.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') 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.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 position the system will return to and land on. 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', 'time_usec'] ordered_fieldnames = ['latitude', 'longitude', 'altitude', 'x', 'y', 'z', 'q', 'approach_x', 'approach_y', 'approach_z', 'time_usec'] fieldtypes = ['int32_t', 'int32_t', 'int32_t', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'uint64_t'] 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", "time_usec": "us"} format = '<iiifff4ffffQ' native_format = bytearray('<iiifffffffQ', 'ascii') orders = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] 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 = 104 unpacker = struct.Struct('<iiifff4ffffQ') def __init__(self, latitude, longitude, altitude, x, y, z, q, approach_x, approach_y, approach_z, time_usec=0): MAVLink_message.__init__(self, MAVLink_home_position_message.id, MAVLink_home_position_message.name) self._fieldnames = MAVLink_home_position_message.fieldnames 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 self.time_usec = time_usec def pack(self, mav, force_mavlink1=False): return MAVLink_message.pack(self, mav, 104, struct.pack('<iiifff4ffffQ', 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.time_usec), 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', 'time_usec'] ordered_fieldnames = ['latitude', 'longitude', 'altitude', 'x', 'y', 'z', 'q', 'approach_x', 'approach_y', 'approach_z', 'target_system', 'time_usec'] fieldtypes = ['uint8_t', 'int32_t', 'int32_t', 'int32_t', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'uint64_t'] 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", "time_usec": "us"} format = '<iiifff4ffffBQ' native_format = bytearray('<iiifffffffBQ', 'ascii') orders = [10, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11] lengths = [1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 1, 1] array_lengths = [0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0] crc_extra = 85 unpacker = struct.Struct('<iiifff4ffffBQ') def __init__(self, target_system, latitude, longitude, altitude, x, y, z, q, approach_x, approach_y, approach_z, time_usec=0): 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.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 self.time_usec = time_usec def pack(self, mav, force_mavlink1=False): return MAVLink_message.pack(self, mav, 85, struct.pack('<iiifff4ffffBQ', 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, self.time_usec), 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') 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.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') 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.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') 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.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') 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.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') 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.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') 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.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') 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.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') 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.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') 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.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') def __init__(self, severity, text): MAVLink_message.__init__(self, MAVLink_statustext_message.id, MAVLink_statustext_message.name) self._fieldnames = MAVLink_statustext_message.fieldnames 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') 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.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) class MAVLink_setup_signing_message(MAVLink_message): ''' Setup a MAVLink2 signing key. If called with secret_key of all zero and zero initial_timestamp will disable signing ''' id = MAVLINK_MSG_ID_SETUP_SIGNING name = 'SETUP_SIGNING' fieldnames = ['target_system', 'target_component', 'secret_key', 'initial_timestamp'] ordered_fieldnames = ['initial_timestamp', 'target_system', 'target_component', 'secret_key'] fieldtypes = ['uint8_t', 'uint8_t', 'uint8_t', 'uint64_t'] fielddisplays_by_name = {} fieldenums_by_name = {} fieldunits_by_name = {} format = '<QBB32B' native_format = bytearray('<QBBB', 'ascii') orders = [1, 2, 3, 0] lengths = [1, 1, 1, 32] array_lengths = [0, 0, 0, 32] crc_extra = 71 unpacker = struct.Struct('<QBB32B') def __init__(self, target_system, target_component, secret_key, initial_timestamp): MAVLink_message.__init__(self, MAVLink_setup_signing_message.id, MAVLink_setup_signing_message.name) self._fieldnames = MAVLink_setup_signing_message.fieldnames self.target_system = target_system self.target_component = target_component self.secret_key = secret_key self.initial_timestamp = initial_timestamp def pack(self, mav, force_mavlink1=False): return MAVLink_message.pack(self, mav, 71, struct.pack('<QBB32B', self.initial_timestamp, self.target_system, self.target_component, self.secret_key[0], self.secret_key[1], self.secret_key[2], self.secret_key[3], self.secret_key[4], self.secret_key[5], self.secret_key[6], self.secret_key[7], self.secret_key[8], self.secret_key[9], self.secret_key[10], self.secret_key[11], self.secret_key[12], self.secret_key[13], self.secret_key[14], self.secret_key[15], self.secret_key[16], self.secret_key[17], self.secret_key[18], self.secret_key[19], self.secret_key[20], self.secret_key[21], self.secret_key[22], self.secret_key[23], self.secret_key[24], self.secret_key[25], self.secret_key[26], self.secret_key[27], self.secret_key[28], self.secret_key[29], self.secret_key[30], self.secret_key[31]), force_mavlink1=force_mavlink1) class MAVLink_button_change_message(MAVLink_message): ''' Report button state change. ''' id = MAVLINK_MSG_ID_BUTTON_CHANGE name = 'BUTTON_CHANGE' fieldnames = ['time_boot_ms', 'last_change_ms', 'state'] ordered_fieldnames = ['time_boot_ms', 'last_change_ms', 'state'] fieldtypes = ['uint32_t', 'uint32_t', 'uint8_t'] fielddisplays_by_name = {"state": "bitmask"} fieldenums_by_name = {} fieldunits_by_name = {"time_boot_ms": "ms", "last_change_ms": "ms"} format = '<IIB' native_format = bytearray('<IIB', 'ascii') orders = [0, 1, 2] lengths = [1, 1, 1] array_lengths = [0, 0, 0] crc_extra = 131 unpacker = struct.Struct('<IIB') def __init__(self, time_boot_ms, last_change_ms, state): MAVLink_message.__init__(self, MAVLink_button_change_message.id, MAVLink_button_change_message.name) self._fieldnames = MAVLink_button_change_message.fieldnames self.time_boot_ms = time_boot_ms self.last_change_ms = last_change_ms self.state = state def pack(self, mav, force_mavlink1=False): return MAVLink_message.pack(self, mav, 131, struct.pack('<IIB', self.time_boot_ms, self.last_change_ms, self.state), force_mavlink1=force_mavlink1) class MAVLink_play_tune_message(MAVLink_message): ''' Control vehicle tone generation (buzzer) ''' id = MAVLINK_MSG_ID_PLAY_TUNE name = 'PLAY_TUNE' fieldnames = ['target_system', 'target_component', 'tune', 'tune2'] ordered_fieldnames = ['target_system', 'target_component', 'tune', 'tune2'] fieldtypes = ['uint8_t', 'uint8_t', 'char', 'char'] fielddisplays_by_name = {} fieldenums_by_name = {} fieldunits_by_name = {} format = '<BB30s200s' native_format = bytearray('<BBcc', 'ascii') orders = [0, 1, 2, 3] lengths = [1, 1, 1, 1] array_lengths = [0, 0, 30, 200] crc_extra = 187 unpacker = struct.Struct('<BB30s200s') def __init__(self, target_system, target_component, tune, tune2=['','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','']): MAVLink_message.__init__(self, MAVLink_play_tune_message.id, MAVLink_play_tune_message.name) self._fieldnames = MAVLink_play_tune_message.fieldnames self.target_system = target_system self.target_component = target_component self.tune = tune self.tune2 = tune2 def pack(self, mav, force_mavlink1=False): return MAVLink_message.pack(self, mav, 187, struct.pack('<BB30s200s', self.target_system, self.target_component, self.tune, self.tune2), force_mavlink1=force_mavlink1) class MAVLink_camera_information_message(MAVLink_message): ''' Information about a camera ''' id = MAVLINK_MSG_ID_CAMERA_INFORMATION name = 'CAMERA_INFORMATION' fieldnames = ['time_boot_ms', 'vendor_name', 'model_name', 'firmware_version', 'focal_length', 'sensor_size_h', 'sensor_size_v', 'resolution_h', 'resolution_v', 'lens_id', 'flags', 'cam_definition_version', 'cam_definition_uri'] ordered_fieldnames = ['time_boot_ms', 'firmware_version', 'focal_length', 'sensor_size_h', 'sensor_size_v', 'flags', 'resolution_h', 'resolution_v', 'cam_definition_version', 'vendor_name', 'model_name', 'lens_id', 'cam_definition_uri'] fieldtypes = ['uint32_t', 'uint8_t', 'uint8_t', 'uint32_t', 'float', 'float', 'float', 'uint16_t', 'uint16_t', 'uint8_t', 'uint32_t', 'uint16_t', 'char'] fielddisplays_by_name = {"flags": "bitmask"} fieldenums_by_name = {"flags": "CAMERA_CAP_FLAGS"} fieldunits_by_name = {"time_boot_ms": "ms", "focal_length": "mm", "sensor_size_h": "mm", "sensor_size_v": "mm", "resolution_h": "pix", "resolution_v": "pix"} format = '<IIfffIHHH32B32BB140s' native_format = bytearray('<IIfffIHHHBBBc', 'ascii') orders = [0, 9, 10, 1, 2, 3, 4, 6, 7, 11, 5, 8, 12] lengths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 32, 32, 1, 1] array_lengths = [0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 32, 0, 140] crc_extra = 92 unpacker = struct.Struct('<IIfffIHHH32B32BB140s') def __init__(self, time_boot_ms, vendor_name, model_name, firmware_version, focal_length, sensor_size_h, sensor_size_v, resolution_h, resolution_v, lens_id, flags, cam_definition_version, cam_definition_uri): MAVLink_message.__init__(self, MAVLink_camera_information_message.id, MAVLink_camera_information_message.name) self._fieldnames = MAVLink_camera_information_message.fieldnames self.time_boot_ms = time_boot_ms self.vendor_name = vendor_name self.model_name = model_name self.firmware_version = firmware_version self.focal_length = focal_length self.sensor_size_h = sensor_size_h self.sensor_size_v = sensor_size_v self.resolution_h = resolution_h self.resolution_v = resolution_v self.lens_id = lens_id self.flags = flags self.cam_definition_version = cam_definition_version self.cam_definition_uri = cam_definition_uri def pack(self, mav, force_mavlink1=False): return MAVLink_message.pack(self, mav, 92, struct.pack('<IIfffIHHH32B32BB140s', self.time_boot_ms, self.firmware_version, self.focal_length, self.sensor_size_h, self.sensor_size_v, self.flags, self.resolution_h, self.resolution_v, self.cam_definition_version, self.vendor_name[0], self.vendor_name[1], self.vendor_name[2], self.vendor_name[3], self.vendor_name[4], self.vendor_name[5], self.vendor_name[6], self.vendor_name[7], self.vendor_name[8], self.vendor_name[9], self.vendor_name[10], self.vendor_name[11], self.vendor_name[12], self.vendor_name[13], self.vendor_name[14], self.vendor_name[15], self.vendor_name[16], self.vendor_name[17], self.vendor_name[18], self.vendor_name[19], self.vendor_name[20], self.vendor_name[21], self.vendor_name[22], self.vendor_name[23], self.vendor_name[24], self.vendor_name[25], self.vendor_name[26], self.vendor_name[27], self.vendor_name[28], self.vendor_name[29], self.vendor_name[30], self.vendor_name[31], self.model_name[0], self.model_name[1], self.model_name[2], self.model_name[3], self.model_name[4], self.model_name[5], self.model_name[6], self.model_name[7], self.model_name[8], self.model_name[9], self.model_name[10], self.model_name[11], self.model_name[12], self.model_name[13], self.model_name[14], self.model_name[15], self.model_name[16], self.model_name[17], self.model_name[18], self.model_name[19], self.model_name[20], self.model_name[21], self.model_name[22], self.model_name[23], self.model_name[24], self.model_name[25], self.model_name[26], self.model_name[27], self.model_name[28], self.model_name[29], self.model_name[30], self.model_name[31], self.lens_id, self.cam_definition_uri), force_mavlink1=force_mavlink1) class MAVLink_camera_settings_message(MAVLink_message): ''' Settings of a camera, can be requested using MAV_CMD_REQUEST_CAMERA_SETTINGS. ''' id = MAVLINK_MSG_ID_CAMERA_SETTINGS name = 'CAMERA_SETTINGS' fieldnames = ['time_boot_ms', 'mode_id', 'zoomLevel', 'focusLevel'] ordered_fieldnames = ['time_boot_ms', 'mode_id', 'zoomLevel', 'focusLevel'] fieldtypes = ['uint32_t', 'uint8_t', 'float', 'float'] fielddisplays_by_name = {} fieldenums_by_name = {"mode_id": "CAMERA_MODE"} fieldunits_by_name = {"time_boot_ms": "ms"} format = '<IBff' native_format = bytearray('<IBff', 'ascii') orders = [0, 1, 2, 3] lengths = [1, 1, 1, 1] array_lengths = [0, 0, 0, 0] crc_extra = 146 unpacker = struct.Struct('<IBff') def __init__(self, time_boot_ms, mode_id, zoomLevel=0, focusLevel=0): MAVLink_message.__init__(self, MAVLink_camera_settings_message.id, MAVLink_camera_settings_message.name) self._fieldnames = MAVLink_camera_settings_message.fieldnames self.time_boot_ms = time_boot_ms self.mode_id = mode_id self.zoomLevel = zoomLevel self.focusLevel = focusLevel def pack(self, mav, force_mavlink1=False): return MAVLink_message.pack(self, mav, 146, struct.pack('<IBff', self.time_boot_ms, self.mode_id, self.zoomLevel, self.focusLevel), force_mavlink1=force_mavlink1) class MAVLink_storage_information_message(MAVLink_message): ''' Information about a storage medium. This message is sent in response to a request and whenever the status of the storage changes (STORAGE_STATUS). ''' id = MAVLINK_MSG_ID_STORAGE_INFORMATION name = 'STORAGE_INFORMATION' fieldnames = ['time_boot_ms', 'storage_id', 'storage_count', 'status', 'total_capacity', 'used_capacity', 'available_capacity', 'read_speed', 'write_speed'] ordered_fieldnames = ['time_boot_ms', 'total_capacity', 'used_capacity', 'available_capacity', 'read_speed', 'write_speed', 'storage_id', 'storage_count', 'status'] fieldtypes = ['uint32_t', 'uint8_t', 'uint8_t', 'uint8_t', 'float', 'float', 'float', 'float', 'float'] fielddisplays_by_name = {} fieldenums_by_name = {"status": "STORAGE_STATUS"} fieldunits_by_name = {"time_boot_ms": "ms", "total_capacity": "MiB", "used_capacity": "MiB", "available_capacity": "MiB", "read_speed": "MiB/s", "write_speed": "MiB/s"} format = '<IfffffBBB' native_format = bytearray('<IfffffBBB', 'ascii') orders = [0, 6, 7, 8, 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 = 179 unpacker = struct.Struct('<IfffffBBB') def __init__(self, time_boot_ms, storage_id, storage_count, status, total_capacity, used_capacity, available_capacity, read_speed, write_speed): MAVLink_message.__init__(self, MAVLink_storage_information_message.id, MAVLink_storage_information_message.name) self._fieldnames = MAVLink_storage_information_message.fieldnames self.time_boot_ms = time_boot_ms self.storage_id = storage_id self.storage_count = storage_count self.status = status self.total_capacity = total_capacity self.used_capacity = used_capacity self.available_capacity = available_capacity self.read_speed = read_speed self.write_speed = write_speed def pack(self, mav, force_mavlink1=False): return MAVLink_message.pack(self, mav, 179, struct.pack('<IfffffBBB', self.time_boot_ms, self.total_capacity, self.used_capacity, self.available_capacity, self.read_speed, self.write_speed, self.storage_id, self.storage_count, self.status), force_mavlink1=force_mavlink1) class MAVLink_camera_capture_status_message(MAVLink_message): ''' Information about the status of a capture. ''' id = MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS name = 'CAMERA_CAPTURE_STATUS' fieldnames = ['time_boot_ms', 'image_status', 'video_status', 'image_interval', 'recording_time_ms', 'available_capacity'] ordered_fieldnames = ['time_boot_ms', 'image_interval', 'recording_time_ms', 'available_capacity', 'image_status', 'video_status'] fieldtypes = ['uint32_t', 'uint8_t', 'uint8_t', 'float', 'uint32_t', 'float'] fielddisplays_by_name = {} fieldenums_by_name = {} fieldunits_by_name = {"time_boot_ms": "ms", "image_interval": "s", "recording_time_ms": "ms", "available_capacity": "MiB"} format = '<IfIfBB' native_format = bytearray('<IfIfBB', 'ascii') orders = [0, 4, 5, 1, 2, 3] lengths = [1, 1, 1, 1, 1, 1] array_lengths = [0, 0, 0, 0, 0, 0] crc_extra = 12 unpacker = struct.Struct('<IfIfBB') def __init__(self, time_boot_ms, image_status, video_status, image_interval, recording_time_ms, available_capacity): MAVLink_message.__init__(self, MAVLink_camera_capture_status_message.id, MAVLink_camera_capture_status_message.name) self._fieldnames = MAVLink_camera_capture_status_message.fieldnames self.time_boot_ms = time_boot_ms self.image_status = image_status self.video_status = video_status self.image_interval = image_interval self.recording_time_ms = recording_time_ms self.available_capacity = available_capacity def pack(self, mav, force_mavlink1=False): return MAVLink_message.pack(self, mav, 12, struct.pack('<IfIfBB', self.time_boot_ms, self.image_interval, self.recording_time_ms, self.available_capacity, self.image_status, self.video_status), force_mavlink1=force_mavlink1) class MAVLink_camera_image_captured_message(MAVLink_message): ''' Information about a captured image ''' id = MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED name = 'CAMERA_IMAGE_CAPTURED' fieldnames = ['time_boot_ms', 'time_utc', 'camera_id', 'lat', 'lon', 'alt', 'relative_alt', 'q', 'image_index', 'capture_result', 'file_url'] ordered_fieldnames = ['time_utc', 'time_boot_ms', 'lat', 'lon', 'alt', 'relative_alt', 'q', 'image_index', 'camera_id', 'capture_result', 'file_url'] fieldtypes = ['uint32_t', 'uint64_t', 'uint8_t', 'int32_t', 'int32_t', 'int32_t', 'int32_t', 'float', 'int32_t', 'int8_t', 'char'] fielddisplays_by_name = {} fieldenums_by_name = {} fieldunits_by_name = {"time_boot_ms": "ms", "time_utc": "us", "lat": "degE7", "lon": "degE7", "alt": "mm", "relative_alt": "mm"} format = '<QIiiii4fiBb205s' native_format = bytearray('<QIiiiifiBbc', 'ascii') orders = [1, 0, 8, 2, 3, 4, 5, 6, 7, 9, 10] lengths = [1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 1] array_lengths = [0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 205] crc_extra = 133 unpacker = struct.Struct('<QIiiii4fiBb205s') def __init__(self, time_boot_ms, time_utc, camera_id, lat, lon, alt, relative_alt, q, image_index, capture_result, file_url): MAVLink_message.__init__(self, MAVLink_camera_image_captured_message.id, MAVLink_camera_image_captured_message.name) self._fieldnames = MAVLink_camera_image_captured_message.fieldnames self.time_boot_ms = time_boot_ms self.time_utc = time_utc self.camera_id = camera_id self.lat = lat self.lon = lon self.alt = alt self.relative_alt = relative_alt self.q = q self.image_index = image_index self.capture_result = capture_result self.file_url = file_url def pack(self, mav, force_mavlink1=False): return MAVLink_message.pack(self, mav, 133, struct.pack('<QIiiii4fiBb205s', self.time_utc, self.time_boot_ms, self.lat, self.lon, self.alt, self.relative_alt, self.q[0], self.q[1], self.q[2], self.q[3], self.image_index, self.camera_id, self.capture_result, self.file_url), force_mavlink1=force_mavlink1) class MAVLink_flight_information_message(MAVLink_message): ''' Information about flight since last arming. ''' id = MAVLINK_MSG_ID_FLIGHT_INFORMATION name = 'FLIGHT_INFORMATION' fieldnames = ['time_boot_ms', 'arming_time_utc', 'takeoff_time_utc', 'flight_uuid'] ordered_fieldnames = ['arming_time_utc', 'takeoff_time_utc', 'flight_uuid', 'time_boot_ms'] fieldtypes = ['uint32_t', 'uint64_t', 'uint64_t', 'uint64_t'] fielddisplays_by_name = {} fieldenums_by_name = {} fieldunits_by_name = {"time_boot_ms": "ms", "arming_time_utc": "us", "takeoff_time_utc": "us"} format = '<QQQI' native_format = bytearray('<QQQI', 'ascii') orders = [3, 0, 1, 2] lengths = [1, 1, 1, 1] array_lengths = [0, 0, 0, 0] crc_extra = 49 unpacker = struct.Struct('<QQQI') def __init__(self, time_boot_ms, arming_time_utc, takeoff_time_utc, flight_uuid): MAVLink_message.__init__(self, MAVLink_flight_information_message.id, MAVLink_flight_information_message.name) self._fieldnames = MAVLink_flight_information_message.fieldnames self.time_boot_ms = time_boot_ms self.arming_time_utc = arming_time_utc self.takeoff_time_utc = takeoff_time_utc self.flight_uuid = flight_uuid def pack(self, mav, force_mavlink1=False): return MAVLink_message.pack(self, mav, 49, struct.pack('<QQQI', self.arming_time_utc, self.takeoff_time_utc, self.flight_uuid, self.time_boot_ms), force_mavlink1=force_mavlink1) class MAVLink_mount_orientation_message(MAVLink_message): ''' Orientation of a mount ''' id = MAVLINK_MSG_ID_MOUNT_ORIENTATION name = 'MOUNT_ORIENTATION' fieldnames = ['time_boot_ms', 'roll', 'pitch', 'yaw', 'yaw_absolute'] ordered_fieldnames = ['time_boot_ms', 'roll', 'pitch', 'yaw', 'yaw_absolute'] fieldtypes = ['uint32_t', 'float', 'float', 'float', 'float'] fielddisplays_by_name = {} fieldenums_by_name = {} fieldunits_by_name = {"time_boot_ms": "ms", "roll": "deg", "pitch": "deg", "yaw": "deg", "yaw_absolute": "deg"} format = '<Iffff' native_format = bytearray('<Iffff', 'ascii') orders = [0, 1, 2, 3, 4] lengths = [1, 1, 1, 1, 1] array_lengths = [0, 0, 0, 0, 0] crc_extra = 26 unpacker = struct.Struct('<Iffff') def __init__(self, time_boot_ms, roll, pitch, yaw, yaw_absolute=0): MAVLink_message.__init__(self, MAVLink_mount_orientation_message.id, MAVLink_mount_orientation_message.name) self._fieldnames = MAVLink_mount_orientation_message.fieldnames self.time_boot_ms = time_boot_ms self.roll = roll self.pitch = pitch self.yaw = yaw self.yaw_absolute = yaw_absolute def pack(self, mav, force_mavlink1=False): return MAVLink_message.pack(self, mav, 26, struct.pack('<Iffff', self.time_boot_ms, self.roll, self.pitch, self.yaw, self.yaw_absolute), force_mavlink1=force_mavlink1) class MAVLink_logging_data_message(MAVLink_message): ''' A message containing logged data (see also MAV_CMD_LOGGING_START) ''' id = MAVLINK_MSG_ID_LOGGING_DATA name = 'LOGGING_DATA' fieldnames = ['target_system', 'target_component', 'sequence', 'length', 'first_message_offset', 'data'] ordered_fieldnames = ['sequence', 'target_system', 'target_component', 'length', 'first_message_offset', 'data'] fieldtypes = ['uint8_t', 'uint8_t', 'uint16_t', 'uint8_t', 'uint8_t', 'uint8_t'] fielddisplays_by_name = {} fieldenums_by_name = {} fieldunits_by_name = {"length": "bytes", "first_message_offset": "bytes"} format = '<HBBBB249B' native_format = bytearray('<HBBBBB', 'ascii') orders = [1, 2, 0, 3, 4, 5] lengths = [1, 1, 1, 1, 1, 249] array_lengths = [0, 0, 0, 0, 0, 249] crc_extra = 193 unpacker = struct.Struct('<HBBBB249B') def __init__(self, target_system, target_component, sequence, length, first_message_offset, data): MAVLink_message.__init__(self, MAVLink_logging_data_message.id, MAVLink_logging_data_message.name) self._fieldnames = MAVLink_logging_data_message.fieldnames self.target_system = target_system self.target_component = target_component self.sequence = sequence self.length = length self.first_message_offset = first_message_offset self.data = data def pack(self, mav, force_mavlink1=False): return MAVLink_message.pack(self, mav, 193, struct.pack('<HBBBB249B', self.sequence, self.target_system, self.target_component, self.length, self.first_message_offset, 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]), force_mavlink1=force_mavlink1) class MAVLink_logging_data_acked_message(MAVLink_message): ''' A message containing logged data which requires a LOGGING_ACK to be sent back ''' id = MAVLINK_MSG_ID_LOGGING_DATA_ACKED name = 'LOGGING_DATA_ACKED' fieldnames = ['target_system', 'target_component', 'sequence', 'length', 'first_message_offset', 'data'] ordered_fieldnames = ['sequence', 'target_system', 'target_component', 'length', 'first_message_offset', 'data'] fieldtypes = ['uint8_t', 'uint8_t', 'uint16_t', 'uint8_t', 'uint8_t', 'uint8_t'] fielddisplays_by_name = {} fieldenums_by_name = {} fieldunits_by_name = {"length": "bytes", "first_message_offset": "bytes"} format = '<HBBBB249B' native_format = bytearray('<HBBBBB', 'ascii') orders = [1, 2, 0, 3, 4, 5] lengths = [1, 1, 1, 1, 1, 249] array_lengths = [0, 0, 0, 0, 0, 249] crc_extra = 35 unpacker = struct.Struct('<HBBBB249B') def __init__(self, target_system, target_component, sequence, length, first_message_offset, data): MAVLink_message.__init__(self, MAVLink_logging_data_acked_message.id, MAVLink_logging_data_acked_message.name) self._fieldnames = MAVLink_logging_data_acked_message.fieldnames self.target_system = target_system self.target_component = target_component self.sequence = sequence self.length = length self.first_message_offset = first_message_offset self.data = data def pack(self, mav, force_mavlink1=False): return MAVLink_message.pack(self, mav, 35, struct.pack('<HBBBB249B', self.sequence, self.target_system, self.target_component, self.length, self.first_message_offset, 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]), force_mavlink1=force_mavlink1) class MAVLink_logging_ack_message(MAVLink_message): ''' An ack for a LOGGING_DATA_ACKED message ''' id = MAVLINK_MSG_ID_LOGGING_ACK name = 'LOGGING_ACK' fieldnames = ['target_system', 'target_component', 'sequence'] ordered_fieldnames = ['sequence', '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 = 14 unpacker = struct.Struct('<HBB') def __init__(self, target_system, target_component, sequence): MAVLink_message.__init__(self, MAVLink_logging_ack_message.id, MAVLink_logging_ack_message.name) self._fieldnames = MAVLink_logging_ack_message.fieldnames self.target_system = target_system self.target_component = target_component self.sequence = sequence def pack(self, mav, force_mavlink1=False): return MAVLink_message.pack(self, mav, 14, struct.pack('<HBB', self.sequence, self.target_system, self.target_component), force_mavlink1=force_mavlink1) class MAVLink_wifi_config_ap_message(MAVLink_message): ''' Configure AP SSID and Password. ''' id = MAVLINK_MSG_ID_WIFI_CONFIG_AP name = 'WIFI_CONFIG_AP' fieldnames = ['ssid', 'password'] ordered_fieldnames = ['ssid', 'password'] fieldtypes = ['char', 'char'] fielddisplays_by_name = {} fieldenums_by_name = {} fieldunits_by_name = {} format = '<32s64s' native_format = bytearray('<cc', 'ascii') orders = [0, 1] lengths = [1, 1] array_lengths = [32, 64] crc_extra = 19 unpacker = struct.Struct('<32s64s') def __init__(self, ssid, password): MAVLink_message.__init__(self, MAVLink_wifi_config_ap_message.id, MAVLink_wifi_config_ap_message.name) self._fieldnames = MAVLink_wifi_config_ap_message.fieldnames self.ssid = ssid self.password = password def pack(self, mav, force_mavlink1=False): return MAVLink_message.pack(self, mav, 19, struct.pack('<32s64s', self.ssid, self.password), force_mavlink1=force_mavlink1) class MAVLink_uavcan_node_status_message(MAVLink_message): ''' General status information of an UAVCAN node. Please refer to the definition of the UAVCAN message "uavcan.protocol.NodeStatus" for the background information. The UAVCAN specification is available at http://uavcan.org. ''' id = MAVLINK_MSG_ID_UAVCAN_NODE_STATUS name = 'UAVCAN_NODE_STATUS' fieldnames = ['time_usec', 'uptime_sec', 'health', 'mode', 'sub_mode', 'vendor_specific_status_code'] ordered_fieldnames = ['time_usec', 'uptime_sec', 'vendor_specific_status_code', 'health', 'mode', 'sub_mode'] fieldtypes = ['uint64_t', 'uint32_t', 'uint8_t', 'uint8_t', 'uint8_t', 'uint16_t'] fielddisplays_by_name = {} fieldenums_by_name = {"health": "UAVCAN_NODE_HEALTH", "mode": "UAVCAN_NODE_MODE"} fieldunits_by_name = {"time_usec": "us", "uptime_sec": "s"} format = '<QIHBBB' native_format = bytearray('<QIHBBB', 'ascii') orders = [0, 1, 3, 4, 5, 2] lengths = [1, 1, 1, 1, 1, 1] array_lengths = [0, 0, 0, 0, 0, 0] crc_extra = 28 unpacker = struct.Struct('<QIHBBB') def __init__(self, time_usec, uptime_sec, health, mode, sub_mode, vendor_specific_status_code): MAVLink_message.__init__(self, MAVLink_uavcan_node_status_message.id, MAVLink_uavcan_node_status_message.name) self._fieldnames = MAVLink_uavcan_node_status_message.fieldnames self.time_usec = time_usec self.uptime_sec = uptime_sec self.health = health self.mode = mode self.sub_mode = sub_mode self.vendor_specific_status_code = vendor_specific_status_code def pack(self, mav, force_mavlink1=False): return MAVLink_message.pack(self, mav, 28, struct.pack('<QIHBBB', self.time_usec, self.uptime_sec, self.vendor_specific_status_code, self.health, self.mode, self.sub_mode), force_mavlink1=force_mavlink1) class MAVLink_uavcan_node_info_message(MAVLink_message): ''' General information describing a particular UAVCAN node. Please refer to the definition of the UAVCAN service "uavcan.protocol.GetNodeInfo" for the background information. This message should be emitted by the system whenever a new node appears online, or an existing node reboots. Additionally, it can be emitted upon request from the other end of the MAVLink channel (see MAV_CMD_UAVCAN_GET_NODE_INFO). It is also not prohibited to emit this message unconditionally at a low frequency. The UAVCAN specification is available at http://uavcan.org. ''' id = MAVLINK_MSG_ID_UAVCAN_NODE_INFO name = 'UAVCAN_NODE_INFO' fieldnames = ['time_usec', 'uptime_sec', 'name', 'hw_version_major', 'hw_version_minor', 'hw_unique_id', 'sw_version_major', 'sw_version_minor', 'sw_vcs_commit'] ordered_fieldnames = ['time_usec', 'uptime_sec', 'sw_vcs_commit', 'name', 'hw_version_major', 'hw_version_minor', 'hw_unique_id', 'sw_version_major', 'sw_version_minor'] fieldtypes = ['uint64_t', 'uint32_t', 'char', 'uint8_t', 'uint8_t', 'uint8_t', 'uint8_t', 'uint8_t', 'uint32_t'] fielddisplays_by_name = {} fieldenums_by_name = {} fieldunits_by_name = {"time_usec": "us", "uptime_sec": "s"} format = '<QII80sBB16BBB' native_format = bytearray('<QIIcBBBBB', 'ascii') orders = [0, 1, 3, 4, 5, 6, 7, 8, 2] lengths = [1, 1, 1, 1, 1, 1, 16, 1, 1] array_lengths = [0, 0, 0, 80, 0, 0, 16, 0, 0] crc_extra = 95 unpacker = struct.Struct('<QII80sBB16BBB') def __init__(self, time_usec, uptime_sec, name, hw_version_major, hw_version_minor, hw_unique_id, sw_version_major, sw_version_minor, sw_vcs_commit): MAVLink_message.__init__(self, MAVLink_uavcan_node_info_message.id, MAVLink_uavcan_node_info_message.name) self._fieldnames = MAVLink_uavcan_node_info_message.fieldnames self.time_usec = time_usec self.uptime_sec = uptime_sec self.name = name self.hw_version_major = hw_version_major self.hw_version_minor = hw_version_minor self.hw_unique_id = hw_unique_id self.sw_version_major = sw_version_major self.sw_version_minor = sw_version_minor self.sw_vcs_commit = sw_vcs_commit def pack(self, mav, force_mavlink1=False): return MAVLink_message.pack(self, mav, 95, struct.pack('<QII80sBB16BBB', self.time_usec, self.uptime_sec, self.sw_vcs_commit, self.name, self.hw_version_major, self.hw_version_minor, self.hw_unique_id[0], self.hw_unique_id[1], self.hw_unique_id[2], self.hw_unique_id[3], self.hw_unique_id[4], self.hw_unique_id[5], self.hw_unique_id[6], self.hw_unique_id[7], self.hw_unique_id[8], self.hw_unique_id[9], self.hw_unique_id[10], self.hw_unique_id[11], self.hw_unique_id[12], self.hw_unique_id[13], self.hw_unique_id[14], self.hw_unique_id[15], self.sw_version_major, self.sw_version_minor), force_mavlink1=force_mavlink1) class MAVLink_obstacle_distance_message(MAVLink_message): ''' Obstacle distances in front of the sensor, starting from the left in increment degrees to the right ''' id = MAVLINK_MSG_ID_OBSTACLE_DISTANCE name = 'OBSTACLE_DISTANCE' fieldnames = ['time_usec', 'sensor_type', 'distances', 'increment', 'min_distance', 'max_distance', 'increment_f', 'angle_offset', 'frame'] ordered_fieldnames = ['time_usec', 'distances', 'min_distance', 'max_distance', 'sensor_type', 'increment', 'increment_f', 'angle_offset', 'frame'] fieldtypes = ['uint64_t', 'uint8_t', 'uint16_t', 'uint8_t', 'uint16_t', 'uint16_t', 'float', 'float', 'uint8_t'] fielddisplays_by_name = {} fieldenums_by_name = {"sensor_type": "MAV_DISTANCE_SENSOR", "frame": "MAV_FRAME"} fieldunits_by_name = {"time_usec": "us", "distances": "cm", "increment": "deg", "min_distance": "cm", "max_distance": "cm", "increment_f": "deg", "angle_offset": "deg"} format = '<Q72HHHBBffB' native_format = bytearray('<QHHHBBffB', 'ascii') orders = [0, 4, 1, 5, 2, 3, 6, 7, 8] lengths = [1, 72, 1, 1, 1, 1, 1, 1, 1] array_lengths = [0, 72, 0, 0, 0, 0, 0, 0, 0] crc_extra = 23 unpacker = struct.Struct('<Q72HHHBBffB') def __init__(self, time_usec, sensor_type, distances, increment, min_distance, max_distance, increment_f=0, angle_offset=0, frame=0): MAVLink_message.__init__(self, MAVLink_obstacle_distance_message.id, MAVLink_obstacle_distance_message.name) self._fieldnames = MAVLink_obstacle_distance_message.fieldnames self.time_usec = time_usec self.sensor_type = sensor_type self.distances = distances self.increment = increment self.min_distance = min_distance self.max_distance = max_distance self.increment_f = increment_f self.angle_offset = angle_offset self.frame = frame def pack(self, mav, force_mavlink1=False): return MAVLink_message.pack(self, mav, 23, struct.pack('<Q72HHHBBffB', self.time_usec, self.distances[0], self.distances[1], self.distances[2], self.distances[3], self.distances[4], self.distances[5], self.distances[6], self.distances[7], self.distances[8], self.distances[9], self.distances[10], self.distances[11], self.distances[12], self.distances[13], self.distances[14], self.distances[15], self.distances[16], self.distances[17], self.distances[18], self.distances[19], self.distances[20], self.distances[21], self.distances[22], self.distances[23], self.distances[24], self.distances[25], self.distances[26], self.distances[27], self.distances[28], self.distances[29], self.distances[30], self.distances[31], self.distances[32], self.distances[33], self.distances[34], self.distances[35], self.distances[36], self.distances[37], self.distances[38], self.distances[39], self.distances[40], self.distances[41], self.distances[42], self.distances[43], self.distances[44], self.distances[45], self.distances[46], self.distances[47], self.distances[48], self.distances[49], self.distances[50], self.distances[51], self.distances[52], self.distances[53], self.distances[54], self.distances[55], self.distances[56], self.distances[57], self.distances[58], self.distances[59], self.distances[60], self.distances[61], self.distances[62], self.distances[63], self.distances[64], self.distances[65], self.distances[66], self.distances[67], self.distances[68], self.distances[69], self.distances[70], self.distances[71], self.min_distance, self.max_distance, self.sensor_type, self.increment, self.increment_f, self.angle_offset, self.frame), force_mavlink1=force_mavlink1) class MAVLink_odometry_message(MAVLink_message): ''' Odometry message to communicate odometry information with an external interface. Fits ROS REP 147 standard for aerial vehicles (http://www.ros.org/reps/rep-0147.html). ''' id = MAVLINK_MSG_ID_ODOMETRY name = 'ODOMETRY' fieldnames = ['time_usec', 'frame_id', 'child_frame_id', 'x', 'y', 'z', 'q', 'vx', 'vy', 'vz', 'rollspeed', 'pitchspeed', 'yawspeed', 'pose_covariance', 'velocity_covariance', 'reset_counter', 'estimator_type'] ordered_fieldnames = ['time_usec', 'x', 'y', 'z', 'q', 'vx', 'vy', 'vz', 'rollspeed', 'pitchspeed', 'yawspeed', 'pose_covariance', 'velocity_covariance', 'frame_id', 'child_frame_id', 'reset_counter', 'estimator_type'] fieldtypes = ['uint64_t', 'uint8_t', 'uint8_t', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'float', 'uint8_t', 'uint8_t'] fielddisplays_by_name = {} fieldenums_by_name = {"frame_id": "MAV_FRAME", "child_frame_id": "MAV_FRAME", "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", "rollspeed": "rad/s", "pitchspeed": "rad/s", "yawspeed": "rad/s"} format = '<Qfff4fffffff21f21fBBBB' native_format = bytearray('<QffffffffffffBBBB', 'ascii') orders = [0, 13, 14, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 15, 16] lengths = [1, 1, 1, 1, 4, 1, 1, 1, 1, 1, 1, 21, 21, 1, 1, 1, 1] array_lengths = [0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 21, 21, 0, 0, 0, 0] crc_extra = 91 unpacker = struct.Struct('<Qfff4fffffff21f21fBBBB') def __init__(self, time_usec, frame_id, child_frame_id, x, y, z, q, vx, vy, vz, rollspeed, pitchspeed, yawspeed, pose_covariance, velocity_covariance, reset_counter=0, estimator_type=0): MAVLink_message.__init__(self, MAVLink_odometry_message.id, MAVLink_odometry_message.name) self._fieldnames = MAVLink_odometry_message.fieldnames self.time_usec = time_usec self.frame_id = frame_id self.child_frame_id = child_frame_id self.x = x self.y = y self.z = z self.q = q self.vx = vx self.vy = vy self.vz = vz self.rollspeed = rollspeed self.pitchspeed = pitchspeed self.yawspeed = yawspeed self.pose_covariance = pose_covariance self.velocity_covariance = velocity_covariance self.reset_counter = reset_counter self.estimator_type = estimator_type def pack(self, mav, force_mavlink1=False): return MAVLink_message.pack(self, mav, 91, struct.pack('<Qfff4fffffff21f21fBBBB', self.time_usec, self.x, self.y, self.z, self.q[0], self.q[1], self.q[2], self.q[3], self.vx, self.vy, self.vz, self.rollspeed, self.pitchspeed, self.yawspeed, self.pose_covariance[0], self.pose_covariance[1], self.pose_covariance[2], self.pose_covariance[3], self.pose_covariance[4], self.pose_covariance[5], self.pose_covariance[6], self.pose_covariance[7], self.pose_covariance[8], self.pose_covariance[9], self.pose_covariance[10], self.pose_covariance[11], self.pose_covariance[12], self.pose_covariance[13], self.pose_covariance[14], self.pose_covariance[15], self.pose_covariance[16], self.pose_covariance[17], self.pose_covariance[18], self.pose_covariance[19], self.pose_covariance[20], self.velocity_covariance[0], self.velocity_covariance[1], self.velocity_covariance[2], self.velocity_covariance[3], self.velocity_covariance[4], self.velocity_covariance[5], self.velocity_covariance[6], self.velocity_covariance[7], self.velocity_covariance[8], self.velocity_covariance[9], self.velocity_covariance[10], self.velocity_covariance[11], self.velocity_covariance[12], self.velocity_covariance[13], self.velocity_covariance[14], self.velocity_covariance[15], self.velocity_covariance[16], self.velocity_covariance[17], self.velocity_covariance[18], self.velocity_covariance[19], self.velocity_covariance[20], self.frame_id, self.child_frame_id, self.reset_counter, self.estimator_type), force_mavlink1=force_mavlink1) class MAVLink_isbd_link_status_message(MAVLink_message): ''' Status of the Iridium SBD link. ''' id = MAVLINK_MSG_ID_ISBD_LINK_STATUS name = 'ISBD_LINK_STATUS' fieldnames = ['timestamp', 'last_heartbeat', 'failed_sessions', 'successful_sessions', 'signal_quality', 'ring_pending', 'tx_session_pending', 'rx_session_pending'] ordered_fieldnames = ['timestamp', 'last_heartbeat', 'failed_sessions', 'successful_sessions', 'signal_quality', 'ring_pending', 'tx_session_pending', 'rx_session_pending'] fieldtypes = ['uint64_t', 'uint64_t', 'uint16_t', 'uint16_t', 'uint8_t', 'uint8_t', 'uint8_t', 'uint8_t'] fielddisplays_by_name = {} fieldenums_by_name = {} fieldunits_by_name = {"timestamp": "us", "last_heartbeat": "us"} format = '<QQHHBBBB' native_format = bytearray('<QQHHBBBB', '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 = 225 unpacker = struct.Struct('<QQHHBBBB') def __init__(self, timestamp, last_heartbeat, failed_sessions, successful_sessions, signal_quality, ring_pending, tx_session_pending, rx_session_pending): MAVLink_message.__init__(self, MAVLink_isbd_link_status_message.id, MAVLink_isbd_link_status_message.name) self._fieldnames = MAVLink_isbd_link_status_message.fieldnames self.timestamp = timestamp self.last_heartbeat = last_heartbeat self.failed_sessions = failed_sessions self.successful_sessions = successful_sessions self.signal_quality = signal_quality self.ring_pending = ring_pending self.tx_session_pending = tx_session_pending self.rx_session_pending = rx_session_pending def pack(self, mav, force_mavlink1=False): return MAVLink_message.pack(self, mav, 225, struct.pack('<QQHHBBBB', self.timestamp, self.last_heartbeat, self.failed_sessions, self.successful_sessions, self.signal_quality, self.ring_pending, self.tx_session_pending, self.rx_session_pending), force_mavlink1=force_mavlink1) class MAVLink_debug_float_array_message(MAVLink_message): ''' Large debug/prototyping array. The message uses the maximum available payload for data. The array_id and name fields are used to discriminate between messages in code and in user interfaces (respectively). Do not use in production code. ''' id = MAVLINK_MSG_ID_DEBUG_FLOAT_ARRAY name = 'DEBUG_FLOAT_ARRAY' fieldnames = ['time_usec', 'name', 'array_id', 'data'] ordered_fieldnames = ['time_usec', 'array_id', 'name', 'data'] fieldtypes = ['uint64_t', 'char', 'uint16_t', 'float'] fielddisplays_by_name = {} fieldenums_by_name = {} fieldunits_by_name = {"time_usec": "us"} format = '<QH10s58f' native_format = bytearray('<QHcf', 'ascii') orders = [0, 2, 1, 3] lengths = [1, 1, 1, 58] array_lengths = [0, 0, 10, 58] crc_extra = 232 unpacker = struct.Struct('<QH10s58f') def __init__(self, time_usec, name, array_id, data=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]): MAVLink_message.__init__(self, MAVLink_debug_float_array_message.id, MAVLink_debug_float_array_message.name) self._fieldnames = MAVLink_debug_float_array_message.fieldnames self.time_usec = time_usec self.name = name self.array_id = array_id self.data = data def pack(self, mav, force_mavlink1=False): return MAVLink_message.pack(self, mav, 232, struct.pack('<QH10s58f', self.time_usec, self.array_id, self.name, 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]), force_mavlink1=force_mavlink1) class MAVLink_statustext_long_message(MAVLink_message): ''' Status text message (use only for important status and error messages). The full message payload can be used for status text, but we recommend that updates be kept concise. Note: The message is intended as a less restrictive replacement for STATUSTEXT. ''' id = MAVLINK_MSG_ID_STATUSTEXT_LONG name = 'STATUSTEXT_LONG' fieldnames = ['severity', 'text'] ordered_fieldnames = ['severity', 'text'] fieldtypes = ['uint8_t', 'char'] fielddisplays_by_name = {} fieldenums_by_name = {"severity": "MAV_SEVERITY"} fieldunits_by_name = {} format = '<B254s' native_format = bytearray('<Bc', 'ascii') orders = [0, 1] lengths = [1, 1] array_lengths = [0, 254] crc_extra = 36 unpacker = struct.Struct('<B254s') def __init__(self, severity, text): MAVLink_message.__init__(self, MAVLink_statustext_long_message.id, MAVLink_statustext_long_message.name) self._fieldnames = MAVLink_statustext_long_message.fieldnames self.severity = severity self.text = text def pack(self, mav, force_mavlink1=False): return MAVLink_message.pack(self, mav, 36, struct.pack('<B254s', self.severity, self.text), force_mavlink1=force_mavlink1) class MAVLink_actuator_output_status_message(MAVLink_message): ''' The raw values of the actuator outputs. ''' id = MAVLINK_MSG_ID_ACTUATOR_OUTPUT_STATUS name = 'ACTUATOR_OUTPUT_STATUS' fieldnames = ['time_usec', 'active', 'actuator'] ordered_fieldnames = ['time_usec', 'active', 'actuator'] fieldtypes = ['uint64_t', 'uint32_t', 'float'] fielddisplays_by_name = {"active": "bitmask"} fieldenums_by_name = {} fieldunits_by_name = {"time_usec": "us"} format = '<QI32f' native_format = bytearray('<QIf', 'ascii') orders = [0, 1, 2] lengths = [1, 1, 32] array_lengths = [0, 0, 32] crc_extra = 251 unpacker = struct.Struct('<QI32f') def __init__(self, time_usec, active, actuator): MAVLink_message.__init__(self, MAVLink_actuator_output_status_message.id, MAVLink_actuator_output_status_message.name) self._fieldnames = MAVLink_actuator_output_status_message.fieldnames self.time_usec = time_usec self.active = active self.actuator = actuator def pack(self, mav, force_mavlink1=False): return MAVLink_message.pack(self, mav, 251, struct.pack('<QI32f', self.time_usec, self.active, self.actuator[0], self.actuator[1], self.actuator[2], self.actuator[3], self.actuator[4], self.actuator[5], self.actuator[6], self.actuator[7], self.actuator[8], self.actuator[9], self.actuator[10], self.actuator[11], self.actuator[12], self.actuator[13], self.actuator[14], self.actuator[15], self.actuator[16], self.actuator[17], self.actuator[18], self.actuator[19], self.actuator[20], self.actuator[21], self.actuator[22], self.actuator[23], self.actuator[24], self.actuator[25], self.actuator[26], self.actuator[27], self.actuator[28], self.actuator[29], self.actuator[30], self.actuator[31]), force_mavlink1=force_mavlink1) class MAVLink_wheel_distance_message(MAVLink_message): ''' Cumulative distance traveled for each reported wheel. ''' id = MAVLINK_MSG_ID_WHEEL_DISTANCE name = 'WHEEL_DISTANCE' fieldnames = ['time_usec', 'count', 'distance'] ordered_fieldnames = ['time_usec', 'distance', 'count'] fieldtypes = ['uint64_t', 'uint8_t', 'double'] fielddisplays_by_name = {} fieldenums_by_name = {} fieldunits_by_name = {"time_usec": "us", "distance": "m"} format = '<Q16dB' native_format = bytearray('<QdB', 'ascii') orders = [0, 2, 1] lengths = [1, 16, 1] array_lengths = [0, 16, 0] crc_extra = 113 unpacker = struct.Struct('<Q16dB') def __init__(self, time_usec, count, distance): MAVLink_message.__init__(self, MAVLink_wheel_distance_message.id, MAVLink_wheel_distance_message.name) self._fieldnames = MAVLink_wheel_distance_message.fieldnames self.time_usec = time_usec self.count = count self.distance = distance def pack(self, mav, force_mavlink1=False): return MAVLink_message.pack(self, mav, 113, struct.pack('<Q16dB', self.time_usec, self.distance[0], self.distance[1], self.distance[2], self.distance[3], self.distance[4], self.distance[5], self.distance[6], self.distance[7], self.distance[8], self.distance[9], self.distance[10], self.distance[11], self.distance[12], self.distance[13], self.distance[14], self.distance[15], self.count), force_mavlink1=force_mavlink1) mavlink_map = { MAVLINK_MSG_ID_SCRIPT_ITEM : MAVLink_script_item_message, MAVLINK_MSG_ID_SCRIPT_REQUEST : MAVLink_script_request_message, MAVLINK_MSG_ID_SCRIPT_REQUEST_LIST : MAVLink_script_request_list_message, MAVLINK_MSG_ID_SCRIPT_COUNT : MAVLink_script_count_message, MAVLINK_MSG_ID_SCRIPT_CURRENT : MAVLink_script_current_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, MAVLINK_MSG_ID_SETUP_SIGNING : MAVLink_setup_signing_message, MAVLINK_MSG_ID_BUTTON_CHANGE : MAVLink_button_change_message, MAVLINK_MSG_ID_PLAY_TUNE : MAVLink_play_tune_message, MAVLINK_MSG_ID_CAMERA_INFORMATION : MAVLink_camera_information_message, MAVLINK_MSG_ID_CAMERA_SETTINGS : MAVLink_camera_settings_message, MAVLINK_MSG_ID_STORAGE_INFORMATION : MAVLink_storage_information_message, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS : MAVLink_camera_capture_status_message, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED : MAVLink_camera_image_captured_message, MAVLINK_MSG_ID_FLIGHT_INFORMATION : MAVLink_flight_information_message, MAVLINK_MSG_ID_MOUNT_ORIENTATION : MAVLink_mount_orientation_message, MAVLINK_MSG_ID_LOGGING_DATA : MAVLink_logging_data_message, MAVLINK_MSG_ID_LOGGING_DATA_ACKED : MAVLink_logging_data_acked_message, MAVLINK_MSG_ID_LOGGING_ACK : MAVLink_logging_ack_message, MAVLINK_MSG_ID_WIFI_CONFIG_AP : MAVLink_wifi_config_ap_message, MAVLINK_MSG_ID_UAVCAN_NODE_STATUS : MAVLink_uavcan_node_status_message, MAVLINK_MSG_ID_UAVCAN_NODE_INFO : MAVLink_uavcan_node_info_message, MAVLINK_MSG_ID_OBSTACLE_DISTANCE : MAVLink_obstacle_distance_message, MAVLINK_MSG_ID_ODOMETRY : MAVLink_odometry_message, MAVLINK_MSG_ID_ISBD_LINK_STATUS : MAVLink_isbd_link_status_message, MAVLINK_MSG_ID_DEBUG_FLOAT_ARRAY : MAVLink_debug_float_array_message, MAVLINK_MSG_ID_STATUSTEXT_LONG : MAVLink_statustext_long_message, MAVLINK_MSG_ID_ACTUATOR_OUTPUT_STATUS : MAVLink_actuator_output_status_message, MAVLINK_MSG_ID_WHEEL_DISTANCE : MAVLink_wheel_distance_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 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 = 253 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 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] = tlist[i].decode('utf-8') 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 script_item_encode(self, target_system, target_component, seq, name): ''' Message encoding a mission script item. This message is emitted upon a request for the next script item. target_system : System ID (type:uint8_t) target_component : Component ID (type:uint8_t) seq : Sequence (type:uint16_t) name : The name of the mission script, NULL terminated. (type:char) ''' return MAVLink_script_item_message(target_system, target_component, seq, name) def script_item_send(self, target_system, target_component, seq, name, force_mavlink1=False): ''' Message encoding a mission script item. This message is emitted upon a request for the next script item. target_system : System ID (type:uint8_t) target_component : Component ID (type:uint8_t) seq : Sequence (type:uint16_t) name : The name of the mission script, NULL terminated. (type:char) ''' return self.send(self.script_item_encode(target_system, target_component, seq, name), force_mavlink1=force_mavlink1) def script_request_encode(self, target_system, target_component, seq): ''' Request script item with the sequence number seq. The response of the system to this message should be a SCRIPT_ITEM message. target_system : System ID (type:uint8_t) target_component : Component ID (type:uint8_t) seq : Sequence (type:uint16_t) ''' return MAVLink_script_request_message(target_system, target_component, seq) def script_request_send(self, target_system, target_component, seq, force_mavlink1=False): ''' Request script item with the sequence number seq. The response of the system to this message should be a SCRIPT_ITEM message. target_system : System ID (type:uint8_t) target_component : Component ID (type:uint8_t) seq : Sequence (type:uint16_t) ''' return self.send(self.script_request_encode(target_system, target_component, seq), force_mavlink1=force_mavlink1) def script_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_script_request_list_message(target_system, target_component) def script_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.script_request_list_encode(target_system, target_component), force_mavlink1=force_mavlink1) def script_count_encode(self, target_system, target_component, count): ''' This message is emitted as response to SCRIPT_REQUEST_LIST by the MAV to get the number of mission scripts. target_system : System ID (type:uint8_t) target_component : Component ID (type:uint8_t) count : Number of script items in the sequence (type:uint16_t) ''' return MAVLink_script_count_message(target_system, target_component, count) def script_count_send(self, target_system, target_component, count, force_mavlink1=False): ''' This message is emitted as response to SCRIPT_REQUEST_LIST by the MAV to get the number of mission scripts. target_system : System ID (type:uint8_t) target_component : Component ID (type:uint8_t) count : Number of script items in the sequence (type:uint16_t) ''' return self.send(self.script_count_encode(target_system, target_component, count), force_mavlink1=force_mavlink1) def script_current_encode(self, seq): ''' This message informs about the currently active SCRIPT. seq : Active Sequence (type:uint16_t) ''' return MAVLink_script_current_message(seq) def script_current_send(self, seq, force_mavlink1=False): ''' This message informs about the currently active SCRIPT. seq : Active Sequence (type:uint16_t) ''' return self.send(self.script_current_encode(seq), 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 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 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, alt_ellipsoid=0, h_acc=0, v_acc=0, vel_acc=0, hdg_acc=0): ''' 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 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) alt_ellipsoid : Altitude (above WGS84, EGM96 ellipsoid). Positive for up. [mm] (type:int32_t) h_acc : Position uncertainty. Positive for up. [mm] (type:uint32_t) v_acc : Altitude uncertainty. Positive for up. [mm] (type:uint32_t) vel_acc : Speed uncertainty. Positive for up. [mm] (type:uint32_t) hdg_acc : Heading / track uncertainty [degE5] (type:uint32_t) ''' return MAVLink_gps_raw_int_message(time_usec, fix_type, lat, lon, alt, eph, epv, vel, cog, satellites_visible, alt_ellipsoid, h_acc, v_acc, vel_acc, hdg_acc) def gps_raw_int_send(self, time_usec, fix_type, lat, lon, alt, eph, epv, vel, cog, satellites_visible, alt_ellipsoid=0, h_acc=0, v_acc=0, vel_acc=0, hdg_acc=0, 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 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) alt_ellipsoid : Altitude (above WGS84, EGM96 ellipsoid). Positive for up. [mm] (type:int32_t) h_acc : Position uncertainty. Positive for up. [mm] (type:uint32_t) v_acc : Altitude uncertainty. Positive for up. [mm] (type:uint32_t) vel_acc : Speed uncertainty. Positive for up. [mm] (type:uint32_t) hdg_acc : Heading / track uncertainty [degE5] (type:uint32_t) ''' return self.send(self.gps_raw_int_encode(time_usec, fix_type, lat, lon, alt, eph, epv, vel, cog, satellites_visible, alt_ellipsoid, h_acc, v_acc, vel_acc, hdg_acc), 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, temperature=0): ''' 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) temperature : Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C). [cdegC] (type:int16_t) ''' return MAVLink_scaled_imu_message(time_boot_ms, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag, temperature) def scaled_imu_send(self, time_boot_ms, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag, temperature=0, 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) temperature : Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C). [cdegC] (type:int16_t) ''' return self.send(self.scaled_imu_encode(time_boot_ms, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag, temperature), force_mavlink1=force_mavlink1) def raw_imu_encode(self, time_usec, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag, id=0, temperature=0): ''' 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 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) id : Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0) (type:uint8_t) temperature : Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C). [cdegC] (type:int16_t) ''' return MAVLink_raw_imu_message(time_usec, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag, id, temperature) def raw_imu_send(self, time_usec, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag, id=0, temperature=0, 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 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) id : Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0) (type:uint8_t) temperature : Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C). [cdegC] (type:int16_t) ''' return self.send(self.raw_imu_encode(time_usec, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag, id, temperature), 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 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 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 : 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 : 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, servo9_raw=0, servo10_raw=0, servo11_raw=0, servo12_raw=0, servo13_raw=0, servo14_raw=0, servo15_raw=0, servo16_raw=0): ''' 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 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) servo9_raw : Servo output 9 value [us] (type:uint16_t) servo10_raw : Servo output 10 value [us] (type:uint16_t) servo11_raw : Servo output 11 value [us] (type:uint16_t) servo12_raw : Servo output 12 value [us] (type:uint16_t) servo13_raw : Servo output 13 value [us] (type:uint16_t) servo14_raw : Servo output 14 value [us] (type:uint16_t) servo15_raw : Servo output 15 value [us] (type:uint16_t) servo16_raw : Servo output 16 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, servo9_raw, servo10_raw, servo11_raw, servo12_raw, servo13_raw, servo14_raw, servo15_raw, servo16_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, servo9_raw=0, servo10_raw=0, servo11_raw=0, servo12_raw=0, servo13_raw=0, servo14_raw=0, servo15_raw=0, servo16_raw=0, force_mavlink1=False): ''' 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 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) servo9_raw : Servo output 9 value [us] (type:uint16_t) servo10_raw : Servo output 10 value [us] (type:uint16_t) servo11_raw : Servo output 11 value [us] (type:uint16_t) servo12_raw : Servo output 12 value [us] (type:uint16_t) servo13_raw : Servo output 13 value [us] (type:uint16_t) servo14_raw : Servo output 14 value [us] (type:uint16_t) servo15_raw : Servo output 15 value [us] (type:uint16_t) servo16_raw : Servo output 16 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, servo9_raw, servo10_raw, servo11_raw, servo12_raw, servo13_raw, servo14_raw, servo15_raw, servo16_raw), force_mavlink1=force_mavlink1) def mission_request_partial_list_encode(self, target_system, target_component, start_index, end_index, mission_type=0): ''' 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) mission_type : Mission type. (type:uint8_t, values:MAV_MISSION_TYPE) ''' return MAVLink_mission_request_partial_list_message(target_system, target_component, start_index, end_index, mission_type) def mission_request_partial_list_send(self, target_system, target_component, start_index, end_index, mission_type=0, 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) mission_type : Mission type. (type:uint8_t, values:MAV_MISSION_TYPE) ''' return self.send(self.mission_request_partial_list_encode(target_system, target_component, start_index, end_index, mission_type), force_mavlink1=force_mavlink1) def mission_write_partial_list_encode(self, target_system, target_component, start_index, end_index, mission_type=0): ''' 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) mission_type : Mission type. (type:uint8_t, values:MAV_MISSION_TYPE) ''' return MAVLink_mission_write_partial_list_message(target_system, target_component, start_index, end_index, mission_type) def mission_write_partial_list_send(self, target_system, target_component, start_index, end_index, mission_type=0, 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) mission_type : Mission type. (type:uint8_t, values:MAV_MISSION_TYPE) ''' return self.send(self.mission_write_partial_list_encode(target_system, target_component, start_index, end_index, mission_type), 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, mission_type=0): ''' 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). 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) mission_type : Mission type. (type:uint8_t, values:MAV_MISSION_TYPE) ''' return MAVLink_mission_item_message(target_system, target_component, seq, frame, command, current, autocontinue, param1, param2, param3, param4, x, y, z, mission_type) def mission_item_send(self, target_system, target_component, seq, frame, command, current, autocontinue, param1, param2, param3, param4, x, y, z, mission_type=0, 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). 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) mission_type : Mission type. (type:uint8_t, values:MAV_MISSION_TYPE) ''' return self.send(self.mission_item_encode(target_system, target_component, seq, frame, command, current, autocontinue, param1, param2, param3, param4, x, y, z, mission_type), force_mavlink1=force_mavlink1) def mission_request_encode(self, target_system, target_component, seq, mission_type=0): ''' 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) mission_type : Mission type. (type:uint8_t, values:MAV_MISSION_TYPE) ''' return MAVLink_mission_request_message(target_system, target_component, seq, mission_type) def mission_request_send(self, target_system, target_component, seq, mission_type=0, 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) mission_type : Mission type. (type:uint8_t, values:MAV_MISSION_TYPE) ''' return self.send(self.mission_request_encode(target_system, target_component, seq, mission_type), 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, mission_type=0): ''' 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) mission_type : Mission type. (type:uint8_t, values:MAV_MISSION_TYPE) ''' return MAVLink_mission_request_list_message(target_system, target_component, mission_type) def mission_request_list_send(self, target_system, target_component, mission_type=0, 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) mission_type : Mission type. (type:uint8_t, values:MAV_MISSION_TYPE) ''' return self.send(self.mission_request_list_encode(target_system, target_component, mission_type), force_mavlink1=force_mavlink1) def mission_count_encode(self, target_system, target_component, count, mission_type=0): ''' 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) mission_type : Mission type. (type:uint8_t, values:MAV_MISSION_TYPE) ''' return MAVLink_mission_count_message(target_system, target_component, count, mission_type) def mission_count_send(self, target_system, target_component, count, mission_type=0, 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) mission_type : Mission type. (type:uint8_t, values:MAV_MISSION_TYPE) ''' return self.send(self.mission_count_encode(target_system, target_component, count, mission_type), force_mavlink1=force_mavlink1) def mission_clear_all_encode(self, target_system, target_component, mission_type=0): ''' Delete all mission items at once. target_system : System ID (type:uint8_t) target_component : Component ID (type:uint8_t) mission_type : Mission type. (type:uint8_t, values:MAV_MISSION_TYPE) ''' return MAVLink_mission_clear_all_message(target_system, target_component, mission_type) def mission_clear_all_send(self, target_system, target_component, mission_type=0, force_mavlink1=False): ''' Delete all mission items at once. target_system : System ID (type:uint8_t) target_component : Component ID (type:uint8_t) mission_type : Mission type. (type:uint8_t, values:MAV_MISSION_TYPE) ''' return self.send(self.mission_clear_all_encode(target_system, target_component, mission_type), 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, mission_type=0): ''' 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) mission_type : Mission type. (type:uint8_t, values:MAV_MISSION_TYPE) ''' return MAVLink_mission_ack_message(target_system, target_component, type, mission_type) def mission_ack_send(self, target_system, target_component, type, mission_type=0, 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) mission_type : Mission type. (type:uint8_t, values:MAV_MISSION_TYPE) ''' return self.send(self.mission_ack_encode(target_system, target_component, type, mission_type), force_mavlink1=force_mavlink1) def set_gps_global_origin_encode(self, target_system, latitude, longitude, altitude, time_usec=0): ''' 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) 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 the number. [us] (type:uint64_t) ''' return MAVLink_set_gps_global_origin_message(target_system, latitude, longitude, altitude, time_usec) def set_gps_global_origin_send(self, target_system, latitude, longitude, altitude, time_usec=0, 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) 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 the number. [us] (type:uint64_t) ''' return self.send(self.set_gps_global_origin_encode(target_system, latitude, longitude, altitude, time_usec), force_mavlink1=force_mavlink1) def gps_global_origin_encode(self, latitude, longitude, altitude, time_usec=0): ''' 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) 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 the number. [us] (type:uint64_t) ''' return MAVLink_gps_global_origin_message(latitude, longitude, altitude, time_usec) def gps_global_origin_send(self, latitude, longitude, altitude, time_usec=0, 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) 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 the number. [us] (type:uint64_t) ''' return self.send(self.gps_global_origin_encode(latitude, longitude, altitude, time_usec), 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, mission_type=0): ''' 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) mission_type : Mission type. (type:uint8_t, values:MAV_MISSION_TYPE) ''' return MAVLink_mission_request_int_message(target_system, target_component, seq, mission_type) def mission_request_int_send(self, target_system, target_component, seq, mission_type=0, 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) mission_type : Mission type. (type:uint8_t, values:MAV_MISSION_TYPE) ''' return self.send(self.mission_request_int_encode(target_system, target_component, seq, mission_type), 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 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 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 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 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 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 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, chan9_raw=0, chan10_raw=0, chan11_raw=0, chan12_raw=0, chan13_raw=0, chan14_raw=0, chan15_raw=0, chan16_raw=0, chan17_raw=0, chan18_raw=0): ''' 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) chan9_raw : RC channel 9 value. A value of 0 or UINT16_MAX means to ignore this field. [us] (type:uint16_t) chan10_raw : RC channel 10 value. A value of 0 or UINT16_MAX means to ignore this field. [us] (type:uint16_t) chan11_raw : RC channel 11 value. A value of 0 or UINT16_MAX means to ignore this field. [us] (type:uint16_t) chan12_raw : RC channel 12 value. A value of 0 or UINT16_MAX means to ignore this field. [us] (type:uint16_t) chan13_raw : RC channel 13 value. A value of 0 or UINT16_MAX means to ignore this field. [us] (type:uint16_t) chan14_raw : RC channel 14 value. A value of 0 or UINT16_MAX means to ignore this field. [us] (type:uint16_t) chan15_raw : RC channel 15 value. A value of 0 or UINT16_MAX means to ignore this field. [us] (type:uint16_t) chan16_raw : RC channel 16 value. A value of 0 or UINT16_MAX means to ignore this field. [us] (type:uint16_t) chan17_raw : RC channel 17 value. A value of 0 or UINT16_MAX means to ignore this field. [us] (type:uint16_t) chan18_raw : RC channel 18 value. A value of 0 or 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, chan9_raw, chan10_raw, chan11_raw, chan12_raw, chan13_raw, chan14_raw, chan15_raw, chan16_raw, chan17_raw, chan18_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, chan9_raw=0, chan10_raw=0, chan11_raw=0, chan12_raw=0, chan13_raw=0, chan14_raw=0, chan15_raw=0, chan16_raw=0, chan17_raw=0, chan18_raw=0, 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) chan9_raw : RC channel 9 value. A value of 0 or UINT16_MAX means to ignore this field. [us] (type:uint16_t) chan10_raw : RC channel 10 value. A value of 0 or UINT16_MAX means to ignore this field. [us] (type:uint16_t) chan11_raw : RC channel 11 value. A value of 0 or UINT16_MAX means to ignore this field. [us] (type:uint16_t) chan12_raw : RC channel 12 value. A value of 0 or UINT16_MAX means to ignore this field. [us] (type:uint16_t) chan13_raw : RC channel 13 value. A value of 0 or UINT16_MAX means to ignore this field. [us] (type:uint16_t) chan14_raw : RC channel 14 value. A value of 0 or UINT16_MAX means to ignore this field. [us] (type:uint16_t) chan15_raw : RC channel 15 value. A value of 0 or UINT16_MAX means to ignore this field. [us] (type:uint16_t) chan16_raw : RC channel 16 value. A value of 0 or UINT16_MAX means to ignore this field. [us] (type:uint16_t) chan17_raw : RC channel 17 value. A value of 0 or UINT16_MAX means to ignore this field. [us] (type:uint16_t) chan18_raw : RC channel 18 value. A value of 0 or 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, chan9_raw, chan10_raw, chan11_raw, chan12_raw, chan13_raw, chan14_raw, chan15_raw, chan16_raw, chan17_raw, chan18_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, mission_type=0): ''' 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). 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) mission_type : Mission type. (type:uint8_t, values:MAV_MISSION_TYPE) ''' return MAVLink_mission_item_int_message(target_system, target_component, seq, frame, command, current, autocontinue, param1, param2, param3, param4, x, y, z, mission_type) def mission_item_int_send(self, target_system, target_component, seq, frame, command, current, autocontinue, param1, param2, param3, param4, x, y, z, mission_type=0, 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). 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) mission_type : Mission type. (type:uint8_t, values:MAV_MISSION_TYPE) ''' return self.send(self.mission_item_int_encode(target_system, target_component, seq, frame, command, current, autocontinue, param1, param2, param3, param4, x, y, z, mission_type), 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 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 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 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 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 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 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 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, reserved for future use. (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 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, reserved for future use. (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, flow_rate_x=0, flow_rate_y=0): ''' 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 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) flow_rate_x : Flow rate about X axis [rad/s] (type:float) flow_rate_y : Flow rate about Y axis [rad/s] (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, flow_rate_x, flow_rate_y) def optical_flow_send(self, time_usec, sensor_id, flow_x, flow_y, flow_comp_m_x, flow_comp_m_y, quality, ground_distance, flow_rate_x=0, flow_rate_y=0, 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 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) flow_rate_x : Flow rate about X axis [rad/s] (type:float) flow_rate_y : Flow rate about Y axis [rad/s] (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, flow_rate_x, flow_rate_y), force_mavlink1=force_mavlink1) def global_vision_position_estimate_encode(self, usec, x, y, z, roll, pitch, yaw, covariance=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], reset_counter=0): ''' 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) covariance : Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x_global, y_global, z_global, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array. (type:float) reset_counter : Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps. (type:uint8_t) ''' return MAVLink_global_vision_position_estimate_message(usec, x, y, z, roll, pitch, yaw, covariance, reset_counter) def global_vision_position_estimate_send(self, usec, x, y, z, roll, pitch, yaw, covariance=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], reset_counter=0, 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) covariance : Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x_global, y_global, z_global, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array. (type:float) reset_counter : Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps. (type:uint8_t) ''' return self.send(self.global_vision_position_estimate_encode(usec, x, y, z, roll, pitch, yaw, covariance, reset_counter), force_mavlink1=force_mavlink1) def vision_position_estimate_encode(self, usec, x, y, z, roll, pitch, yaw, covariance=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], reset_counter=0): ''' Global position/attitude estimate from a vision 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) covariance : Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array. (type:float) reset_counter : Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps. (type:uint8_t) ''' return MAVLink_vision_position_estimate_message(usec, x, y, z, roll, pitch, yaw, covariance, reset_counter) def vision_position_estimate_send(self, usec, x, y, z, roll, pitch, yaw, covariance=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], reset_counter=0, force_mavlink1=False): ''' Global position/attitude estimate from a vision 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) covariance : Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array. (type:float) reset_counter : Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps. (type:uint8_t) ''' return self.send(self.vision_position_estimate_encode(usec, x, y, z, roll, pitch, yaw, covariance, reset_counter), force_mavlink1=force_mavlink1) def vision_speed_estimate_encode(self, usec, x, y, z, covariance=[0,0,0,0,0,0,0,0,0], reset_counter=0): ''' 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) covariance : Row-major representation of 3x3 linear velocity covariance matrix (states: vx, vy, vz; 1st three entries - 1st row, etc.). If unknown, assign NaN value to first element in the array. (type:float) reset_counter : Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps. (type:uint8_t) ''' return MAVLink_vision_speed_estimate_message(usec, x, y, z, covariance, reset_counter) def vision_speed_estimate_send(self, usec, x, y, z, covariance=[0,0,0,0,0,0,0,0,0], reset_counter=0, 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) covariance : Row-major representation of 3x3 linear velocity covariance matrix (states: vx, vy, vz; 1st three entries - 1st row, etc.). If unknown, assign NaN value to first element in the array. (type:float) reset_counter : Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps. (type:uint8_t) ''' return self.send(self.vision_speed_estimate_encode(usec, x, y, z, covariance, reset_counter), force_mavlink1=force_mavlink1) def vicon_position_estimate_encode(self, usec, x, y, z, roll, pitch, yaw, covariance=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]): ''' 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) covariance : Row-major representation of 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array. (type:float) ''' return MAVLink_vicon_position_estimate_message(usec, x, y, z, roll, pitch, yaw, covariance) def vicon_position_estimate_send(self, usec, x, y, z, roll, pitch, yaw, covariance=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], 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) covariance : Row-major representation of 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array. (type:float) ''' return self.send(self.vicon_position_estimate_encode(usec, x, y, z, roll, pitch, yaw, covariance), 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, id=0): ''' 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 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) id : Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0) (type:uint8_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, id) 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, id=0, 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 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) id : Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0) (type:uint8_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, id), 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 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 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 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 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 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 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 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 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 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 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 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 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, temperature=0): ''' 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) temperature : Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C). [cdegC] (type:int16_t) ''' return MAVLink_scaled_imu2_message(time_boot_ms, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag, temperature) def scaled_imu2_send(self, time_boot_ms, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag, temperature=0, 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) temperature : Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C). [cdegC] (type:int16_t) ''' return self.send(self.scaled_imu2_encode(time_boot_ms, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag, temperature), 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 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 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, temperature=0): ''' 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) temperature : Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C). [cdegC] (type:int16_t) ''' return MAVLink_scaled_imu3_message(time_boot_ms, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag, temperature) def scaled_imu3_send(self, time_boot_ms, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag, temperature=0, 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) temperature : Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C). [cdegC] (type:int16_t) ''' return self.send(self.scaled_imu3_encode(time_boot_ms, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag, temperature), 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, horizontal_fov=0, vertical_fov=0, quaternion=[0,0,0,0]): ''' 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) horizontal_fov : Horizontal Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0. [rad] (type:float) vertical_fov : Vertical Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0. [rad] (type:float) quaternion : Quaternion of the sensor orientation in vehicle body frame (w, x, y, z order, zero-rotation is 1, 0, 0, 0). Zero-rotation is along the vehicle body x-axis. This field is required if the orientation is set to MAV_SENSOR_ROTATION_CUSTOM. Set it to 0 if invalid." (type:float) ''' return MAVLink_distance_sensor_message(time_boot_ms, min_distance, max_distance, current_distance, type, id, orientation, covariance, horizontal_fov, vertical_fov, quaternion) def distance_sensor_send(self, time_boot_ms, min_distance, max_distance, current_distance, type, id, orientation, covariance, horizontal_fov=0, vertical_fov=0, quaternion=[0,0,0,0], 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) horizontal_fov : Horizontal Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0. [rad] (type:float) vertical_fov : Vertical Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0. [rad] (type:float) quaternion : Quaternion of the sensor orientation in vehicle body frame (w, x, y, z order, zero-rotation is 1, 0, 0, 0). Zero-rotation is along the vehicle body x-axis. This field is required if the orientation is set to MAV_SENSOR_ROTATION_CUSTOM. Set it to 0 if invalid." (type:float) ''' return self.send(self.distance_sensor_encode(time_boot_ms, min_distance, max_distance, current_distance, type, id, orientation, covariance, horizontal_fov, vertical_fov, quaternion), 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 : Temperature measurement [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 : Temperature measurement [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, covariance=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]): ''' 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 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) covariance : Row-major representation of a pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array. (type:float) ''' return MAVLink_att_pos_mocap_message(time_usec, q, x, y, z, covariance) def att_pos_mocap_send(self, time_usec, q, x, y, z, covariance=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], 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 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) covariance : Row-major representation of a pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array. (type:float) ''' return self.send(self.att_pos_mocap_encode(time_usec, q, x, y, z, covariance), 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 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 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 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 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 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 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 : Temperature measurement [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 : Temperature measurement [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 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 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, time_remaining=0, charge_state=0): ''' 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. [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) time_remaining : Remaining battery time, 0: autopilot does not provide remaining battery time estimate [s] (type:int32_t) charge_state : State for extent of discharge, provided by autopilot for warning or external reactions (type:uint8_t, values:MAV_BATTERY_CHARGE_STATE) ''' return MAVLink_battery_status_message(id, battery_function, type, temperature, voltages, current_battery, current_consumed, energy_consumed, battery_remaining, time_remaining, charge_state) def battery_status_send(self, id, battery_function, type, temperature, voltages, current_battery, current_consumed, energy_consumed, battery_remaining, time_remaining=0, charge_state=0, 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. [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) time_remaining : Remaining battery time, 0: autopilot does not provide remaining battery time estimate [s] (type:int32_t) charge_state : State for extent of discharge, provided by autopilot for warning or external reactions (type:uint8_t, values:MAV_BATTERY_CHARGE_STATE) ''' return self.send(self.battery_status_encode(id, battery_function, type, temperature, voltages, current_battery, current_consumed, energy_consumed, battery_remaining, time_remaining, charge_state), 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, uid2=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]): ''' 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) uid2 : UID if provided by hardware (supersedes the uid field. If this is non-zero, use this field, otherwise use uid) (type:uint8_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, uid2) 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, uid2=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], 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) uid2 : UID if provided by hardware (supersedes the uid field. If this is non-zero, use this field, otherwise use uid) (type:uint8_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, uid2), force_mavlink1=force_mavlink1) def landing_target_encode(self, time_usec, target_num, frame, angle_x, angle_y, distance, size_x, size_y, x=0, y=0, z=0, q=[0,0,0,0], type=0, position_valid=0): ''' 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 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) x : X Position of the landing target in MAV_FRAME [m] (type:float) y : Y Position of the landing target in MAV_FRAME [m] (type:float) z : Z Position of the landing target in MAV_FRAME [m] (type:float) q : Quaternion of landing target orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0) (type:float) type : Type of landing target (type:uint8_t, values:LANDING_TARGET_TYPE) position_valid : Boolean indicating whether the position fields (x, y, z, q, type) contain valid target position information (valid: 1, invalid: 0). Default is 0 (invalid). (type:uint8_t) ''' return MAVLink_landing_target_message(time_usec, target_num, frame, angle_x, angle_y, distance, size_x, size_y, x, y, z, q, type, position_valid) def landing_target_send(self, time_usec, target_num, frame, angle_x, angle_y, distance, size_x, size_y, x=0, y=0, z=0, q=[0,0,0,0], type=0, position_valid=0, 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 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) x : X Position of the landing target in MAV_FRAME [m] (type:float) y : Y Position of the landing target in MAV_FRAME [m] (type:float) z : Z Position of the landing target in MAV_FRAME [m] (type:float) q : Quaternion of landing target orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0) (type:float) type : Type of landing target (type:uint8_t, values:LANDING_TARGET_TYPE) position_valid : Boolean indicating whether the position fields (x, y, z, q, type) contain valid target position information (valid: 1, invalid: 0). Default is 0 (invalid). (type:uint8_t) ''' return self.send(self.landing_target_encode(time_usec, target_num, frame, angle_x, angle_y, distance, size_x, size_y, x, y, z, q, type, position_valid), 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 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 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 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 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, yaw=0): ''' 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 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) yaw : Yaw of vehicle, zero means not available, use 36000 for north [cdeg] (type:uint16_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, yaw) 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, yaw=0, 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 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) yaw : Yaw of vehicle, zero means not available, use 36000 for north [cdeg] (type:uint16_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, yaw), 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 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 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, time_usec=0): ''' 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 position the system will return to and land on. 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) 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 the number. [us] (type:uint64_t) ''' return MAVLink_home_position_message(latitude, longitude, altitude, x, y, z, q, approach_x, approach_y, approach_z, time_usec) def home_position_send(self, latitude, longitude, altitude, x, y, z, q, approach_x, approach_y, approach_z, time_usec=0, 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 position the system will return to and land on. 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) 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 the number. [us] (type:uint64_t) ''' return self.send(self.home_position_encode(latitude, longitude, altitude, x, y, z, q, approach_x, approach_y, approach_z, time_usec), 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, time_usec=0): ''' 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) 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 the number. [us] (type:uint64_t) ''' return MAVLink_set_home_position_message(target_system, latitude, longitude, altitude, x, y, z, q, approach_x, approach_y, approach_z, time_usec) def set_home_position_send(self, target_system, latitude, longitude, altitude, x, y, z, q, approach_x, approach_y, approach_z, time_usec=0, 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) 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 the number. [us] (type:uint64_t) ''' return self.send(self.set_home_position_encode(target_system, latitude, longitude, altitude, x, y, z, q, approach_x, approach_y, approach_z, time_usec), 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 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 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) def setup_signing_encode(self, target_system, target_component, secret_key, initial_timestamp): ''' Setup a MAVLink2 signing key. If called with secret_key of all zero and zero initial_timestamp will disable signing target_system : system id of the target (type:uint8_t) target_component : component ID of the target (type:uint8_t) secret_key : signing key (type:uint8_t) initial_timestamp : initial timestamp (type:uint64_t) ''' return MAVLink_setup_signing_message(target_system, target_component, secret_key, initial_timestamp) def setup_signing_send(self, target_system, target_component, secret_key, initial_timestamp, force_mavlink1=False): ''' Setup a MAVLink2 signing key. If called with secret_key of all zero and zero initial_timestamp will disable signing target_system : system id of the target (type:uint8_t) target_component : component ID of the target (type:uint8_t) secret_key : signing key (type:uint8_t) initial_timestamp : initial timestamp (type:uint64_t) ''' return self.send(self.setup_signing_encode(target_system, target_component, secret_key, initial_timestamp), force_mavlink1=force_mavlink1) def button_change_encode(self, time_boot_ms, last_change_ms, state): ''' Report button state change. time_boot_ms : Timestamp (time since system boot). [ms] (type:uint32_t) last_change_ms : Time of last change of button state. [ms] (type:uint32_t) state : Bitmap for state of buttons. (type:uint8_t) ''' return MAVLink_button_change_message(time_boot_ms, last_change_ms, state) def button_change_send(self, time_boot_ms, last_change_ms, state, force_mavlink1=False): ''' Report button state change. time_boot_ms : Timestamp (time since system boot). [ms] (type:uint32_t) last_change_ms : Time of last change of button state. [ms] (type:uint32_t) state : Bitmap for state of buttons. (type:uint8_t) ''' return self.send(self.button_change_encode(time_boot_ms, last_change_ms, state), force_mavlink1=force_mavlink1) def play_tune_encode(self, target_system, target_component, tune, tune2=['','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','']): ''' Control vehicle tone generation (buzzer) target_system : System ID (type:uint8_t) target_component : Component ID (type:uint8_t) tune : tune in board specific format (type:char) tune2 : tune extension (appended to tune) (type:char) ''' return MAVLink_play_tune_message(target_system, target_component, tune, tune2) def play_tune_send(self, target_system, target_component, tune, tune2=['','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','',''], force_mavlink1=False): ''' Control vehicle tone generation (buzzer) target_system : System ID (type:uint8_t) target_component : Component ID (type:uint8_t) tune : tune in board specific format (type:char) tune2 : tune extension (appended to tune) (type:char) ''' return self.send(self.play_tune_encode(target_system, target_component, tune, tune2), force_mavlink1=force_mavlink1) def camera_information_encode(self, time_boot_ms, vendor_name, model_name, firmware_version, focal_length, sensor_size_h, sensor_size_v, resolution_h, resolution_v, lens_id, flags, cam_definition_version, cam_definition_uri): ''' Information about a camera time_boot_ms : Timestamp (time since system boot). [ms] (type:uint32_t) vendor_name : Name of the camera vendor (type:uint8_t) model_name : Name of the camera model (type:uint8_t) firmware_version : Version of the camera firmware (v << 24 & 0xff = Dev, v << 16 & 0xff = Patch, v << 8 & 0xff = Minor, v & 0xff = Major) (type:uint32_t) focal_length : Focal length [mm] (type:float) sensor_size_h : Image sensor size horizontal [mm] (type:float) sensor_size_v : Image sensor size vertical [mm] (type:float) resolution_h : Horizontal image resolution [pix] (type:uint16_t) resolution_v : Vertical image resolution [pix] (type:uint16_t) lens_id : Reserved for a lens ID (type:uint8_t) flags : Bitmap of camera capability flags. (type:uint32_t, values:CAMERA_CAP_FLAGS) cam_definition_version : Camera definition version (iteration) (type:uint16_t) cam_definition_uri : Camera definition URI (if any, otherwise only basic functions will be available). HTTP- (http://) and MAVLink FTP- (mavlinkftp://) formatted URIs are allowed (and both must be supported by any GCS that implements the Camera Protocol). (type:char) ''' return MAVLink_camera_information_message(time_boot_ms, vendor_name, model_name, firmware_version, focal_length, sensor_size_h, sensor_size_v, resolution_h, resolution_v, lens_id, flags, cam_definition_version, cam_definition_uri) def camera_information_send(self, time_boot_ms, vendor_name, model_name, firmware_version, focal_length, sensor_size_h, sensor_size_v, resolution_h, resolution_v, lens_id, flags, cam_definition_version, cam_definition_uri, force_mavlink1=False): ''' Information about a camera time_boot_ms : Timestamp (time since system boot). [ms] (type:uint32_t) vendor_name : Name of the camera vendor (type:uint8_t) model_name : Name of the camera model (type:uint8_t) firmware_version : Version of the camera firmware (v << 24 & 0xff = Dev, v << 16 & 0xff = Patch, v << 8 & 0xff = Minor, v & 0xff = Major) (type:uint32_t) focal_length : Focal length [mm] (type:float) sensor_size_h : Image sensor size horizontal [mm] (type:float) sensor_size_v : Image sensor size vertical [mm] (type:float) resolution_h : Horizontal image resolution [pix] (type:uint16_t) resolution_v : Vertical image resolution [pix] (type:uint16_t) lens_id : Reserved for a lens ID (type:uint8_t) flags : Bitmap of camera capability flags. (type:uint32_t, values:CAMERA_CAP_FLAGS) cam_definition_version : Camera definition version (iteration) (type:uint16_t) cam_definition_uri : Camera definition URI (if any, otherwise only basic functions will be available). HTTP- (http://) and MAVLink FTP- (mavlinkftp://) formatted URIs are allowed (and both must be supported by any GCS that implements the Camera Protocol). (type:char) ''' return self.send(self.camera_information_encode(time_boot_ms, vendor_name, model_name, firmware_version, focal_length, sensor_size_h, sensor_size_v, resolution_h, resolution_v, lens_id, flags, cam_definition_version, cam_definition_uri), force_mavlink1=force_mavlink1) def camera_settings_encode(self, time_boot_ms, mode_id, zoomLevel=0, focusLevel=0): ''' Settings of a camera, can be requested using MAV_CMD_REQUEST_CAMERA_SETTINGS. time_boot_ms : Timestamp (time since system boot). [ms] (type:uint32_t) mode_id : Camera mode (type:uint8_t, values:CAMERA_MODE) zoomLevel : Current zoom level (0.0 to 100.0, NaN if not known) (type:float) focusLevel : Current focus level (0.0 to 100.0, NaN if not known) (type:float) ''' return MAVLink_camera_settings_message(time_boot_ms, mode_id, zoomLevel, focusLevel) def camera_settings_send(self, time_boot_ms, mode_id, zoomLevel=0, focusLevel=0, force_mavlink1=False): ''' Settings of a camera, can be requested using MAV_CMD_REQUEST_CAMERA_SETTINGS. time_boot_ms : Timestamp (time since system boot). [ms] (type:uint32_t) mode_id : Camera mode (type:uint8_t, values:CAMERA_MODE) zoomLevel : Current zoom level (0.0 to 100.0, NaN if not known) (type:float) focusLevel : Current focus level (0.0 to 100.0, NaN if not known) (type:float) ''' return self.send(self.camera_settings_encode(time_boot_ms, mode_id, zoomLevel, focusLevel), force_mavlink1=force_mavlink1) def storage_information_encode(self, time_boot_ms, storage_id, storage_count, status, total_capacity, used_capacity, available_capacity, read_speed, write_speed): ''' Information about a storage medium. This message is sent in response to a request and whenever the status of the storage changes (STORAGE_STATUS). time_boot_ms : Timestamp (time since system boot). [ms] (type:uint32_t) storage_id : Storage ID (1 for first, 2 for second, etc.) (type:uint8_t) storage_count : Number of storage devices (type:uint8_t) status : Status of storage (type:uint8_t, values:STORAGE_STATUS) total_capacity : Total capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored. [MiB] (type:float) used_capacity : Used capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored. [MiB] (type:float) available_capacity : Available storage capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored. [MiB] (type:float) read_speed : Read speed. [MiB/s] (type:float) write_speed : Write speed. [MiB/s] (type:float) ''' return MAVLink_storage_information_message(time_boot_ms, storage_id, storage_count, status, total_capacity, used_capacity, available_capacity, read_speed, write_speed) def storage_information_send(self, time_boot_ms, storage_id, storage_count, status, total_capacity, used_capacity, available_capacity, read_speed, write_speed, force_mavlink1=False): ''' Information about a storage medium. This message is sent in response to a request and whenever the status of the storage changes (STORAGE_STATUS). time_boot_ms : Timestamp (time since system boot). [ms] (type:uint32_t) storage_id : Storage ID (1 for first, 2 for second, etc.) (type:uint8_t) storage_count : Number of storage devices (type:uint8_t) status : Status of storage (type:uint8_t, values:STORAGE_STATUS) total_capacity : Total capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored. [MiB] (type:float) used_capacity : Used capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored. [MiB] (type:float) available_capacity : Available storage capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored. [MiB] (type:float) read_speed : Read speed. [MiB/s] (type:float) write_speed : Write speed. [MiB/s] (type:float) ''' return self.send(self.storage_information_encode(time_boot_ms, storage_id, storage_count, status, total_capacity, used_capacity, available_capacity, read_speed, write_speed), force_mavlink1=force_mavlink1) def camera_capture_status_encode(self, time_boot_ms, image_status, video_status, image_interval, recording_time_ms, available_capacity): ''' Information about the status of a capture. time_boot_ms : Timestamp (time since system boot). [ms] (type:uint32_t) image_status : Current status of image capturing (0: idle, 1: capture in progress, 2: interval set but idle, 3: interval set and capture in progress) (type:uint8_t) video_status : Current status of video capturing (0: idle, 1: capture in progress) (type:uint8_t) image_interval : Image capture interval [s] (type:float) recording_time_ms : Time since recording started [ms] (type:uint32_t) available_capacity : Available storage capacity. [MiB] (type:float) ''' return MAVLink_camera_capture_status_message(time_boot_ms, image_status, video_status, image_interval, recording_time_ms, available_capacity) def camera_capture_status_send(self, time_boot_ms, image_status, video_status, image_interval, recording_time_ms, available_capacity, force_mavlink1=False): ''' Information about the status of a capture. time_boot_ms : Timestamp (time since system boot). [ms] (type:uint32_t) image_status : Current status of image capturing (0: idle, 1: capture in progress, 2: interval set but idle, 3: interval set and capture in progress) (type:uint8_t) video_status : Current status of video capturing (0: idle, 1: capture in progress) (type:uint8_t) image_interval : Image capture interval [s] (type:float) recording_time_ms : Time since recording started [ms] (type:uint32_t) available_capacity : Available storage capacity. [MiB] (type:float) ''' return self.send(self.camera_capture_status_encode(time_boot_ms, image_status, video_status, image_interval, recording_time_ms, available_capacity), force_mavlink1=force_mavlink1) def camera_image_captured_encode(self, time_boot_ms, time_utc, camera_id, lat, lon, alt, relative_alt, q, image_index, capture_result, file_url): ''' Information about a captured image time_boot_ms : Timestamp (time since system boot). [ms] (type:uint32_t) time_utc : Timestamp (time since UNIX epoch) in UTC. 0 for unknown. [us] (type:uint64_t) camera_id : Camera ID (1 for first, 2 for second, etc.) (type:uint8_t) lat : Latitude where image was taken [degE7] (type:int32_t) lon : Longitude where capture was taken [degE7] (type:int32_t) alt : Altitude (MSL) where image was taken [mm] (type:int32_t) relative_alt : Altitude above ground [mm] (type:int32_t) q : Quaternion of camera orientation (w, x, y, z order, zero-rotation is 0, 0, 0, 0) (type:float) image_index : Zero based index of this image (image count since armed -1) (type:int32_t) capture_result : Boolean indicating success (1) or failure (0) while capturing this image. (type:int8_t) file_url : URL of image taken. Either local storage or http://foo.jpg if camera provides an HTTP interface. (type:char) ''' return MAVLink_camera_image_captured_message(time_boot_ms, time_utc, camera_id, lat, lon, alt, relative_alt, q, image_index, capture_result, file_url) def camera_image_captured_send(self, time_boot_ms, time_utc, camera_id, lat, lon, alt, relative_alt, q, image_index, capture_result, file_url, force_mavlink1=False): ''' Information about a captured image time_boot_ms : Timestamp (time since system boot). [ms] (type:uint32_t) time_utc : Timestamp (time since UNIX epoch) in UTC. 0 for unknown. [us] (type:uint64_t) camera_id : Camera ID (1 for first, 2 for second, etc.) (type:uint8_t) lat : Latitude where image was taken [degE7] (type:int32_t) lon : Longitude where capture was taken [degE7] (type:int32_t) alt : Altitude (MSL) where image was taken [mm] (type:int32_t) relative_alt : Altitude above ground [mm] (type:int32_t) q : Quaternion of camera orientation (w, x, y, z order, zero-rotation is 0, 0, 0, 0) (type:float) image_index : Zero based index of this image (image count since armed -1) (type:int32_t) capture_result : Boolean indicating success (1) or failure (0) while capturing this image. (type:int8_t) file_url : URL of image taken. Either local storage or http://foo.jpg if camera provides an HTTP interface. (type:char) ''' return self.send(self.camera_image_captured_encode(time_boot_ms, time_utc, camera_id, lat, lon, alt, relative_alt, q, image_index, capture_result, file_url), force_mavlink1=force_mavlink1) def flight_information_encode(self, time_boot_ms, arming_time_utc, takeoff_time_utc, flight_uuid): ''' Information about flight since last arming. time_boot_ms : Timestamp (time since system boot). [ms] (type:uint32_t) arming_time_utc : Timestamp at arming (time since UNIX epoch) in UTC, 0 for unknown [us] (type:uint64_t) takeoff_time_utc : Timestamp at takeoff (time since UNIX epoch) in UTC, 0 for unknown [us] (type:uint64_t) flight_uuid : Universally unique identifier (UUID) of flight, should correspond to name of log files (type:uint64_t) ''' return MAVLink_flight_information_message(time_boot_ms, arming_time_utc, takeoff_time_utc, flight_uuid) def flight_information_send(self, time_boot_ms, arming_time_utc, takeoff_time_utc, flight_uuid, force_mavlink1=False): ''' Information about flight since last arming. time_boot_ms : Timestamp (time since system boot). [ms] (type:uint32_t) arming_time_utc : Timestamp at arming (time since UNIX epoch) in UTC, 0 for unknown [us] (type:uint64_t) takeoff_time_utc : Timestamp at takeoff (time since UNIX epoch) in UTC, 0 for unknown [us] (type:uint64_t) flight_uuid : Universally unique identifier (UUID) of flight, should correspond to name of log files (type:uint64_t) ''' return self.send(self.flight_information_encode(time_boot_ms, arming_time_utc, takeoff_time_utc, flight_uuid), force_mavlink1=force_mavlink1) def mount_orientation_encode(self, time_boot_ms, roll, pitch, yaw, yaw_absolute=0): ''' Orientation of a mount time_boot_ms : Timestamp (time since system boot). [ms] (type:uint32_t) roll : Roll in global frame (set to NaN for invalid). [deg] (type:float) pitch : Pitch in global frame (set to NaN for invalid). [deg] (type:float) yaw : Yaw relative to vehicle(set to NaN for invalid). [deg] (type:float) yaw_absolute : Yaw in absolute frame, North is 0 (set to NaN for invalid). [deg] (type:float) ''' return MAVLink_mount_orientation_message(time_boot_ms, roll, pitch, yaw, yaw_absolute) def mount_orientation_send(self, time_boot_ms, roll, pitch, yaw, yaw_absolute=0, force_mavlink1=False): ''' Orientation of a mount time_boot_ms : Timestamp (time since system boot). [ms] (type:uint32_t) roll : Roll in global frame (set to NaN for invalid). [deg] (type:float) pitch : Pitch in global frame (set to NaN for invalid). [deg] (type:float) yaw : Yaw relative to vehicle(set to NaN for invalid). [deg] (type:float) yaw_absolute : Yaw in absolute frame, North is 0 (set to NaN for invalid). [deg] (type:float) ''' return self.send(self.mount_orientation_encode(time_boot_ms, roll, pitch, yaw, yaw_absolute), force_mavlink1=force_mavlink1) def logging_data_encode(self, target_system, target_component, sequence, length, first_message_offset, data): ''' A message containing logged data (see also MAV_CMD_LOGGING_START) target_system : system ID of the target (type:uint8_t) target_component : component ID of the target (type:uint8_t) sequence : sequence number (can wrap) (type:uint16_t) length : data length [bytes] (type:uint8_t) first_message_offset : offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to 255 if no start exists). [bytes] (type:uint8_t) data : logged data (type:uint8_t) ''' return MAVLink_logging_data_message(target_system, target_component, sequence, length, first_message_offset, data) def logging_data_send(self, target_system, target_component, sequence, length, first_message_offset, data, force_mavlink1=False): ''' A message containing logged data (see also MAV_CMD_LOGGING_START) target_system : system ID of the target (type:uint8_t) target_component : component ID of the target (type:uint8_t) sequence : sequence number (can wrap) (type:uint16_t) length : data length [bytes] (type:uint8_t) first_message_offset : offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to 255 if no start exists). [bytes] (type:uint8_t) data : logged data (type:uint8_t) ''' return self.send(self.logging_data_encode(target_system, target_component, sequence, length, first_message_offset, data), force_mavlink1=force_mavlink1) def logging_data_acked_encode(self, target_system, target_component, sequence, length, first_message_offset, data): ''' A message containing logged data which requires a LOGGING_ACK to be sent back target_system : system ID of the target (type:uint8_t) target_component : component ID of the target (type:uint8_t) sequence : sequence number (can wrap) (type:uint16_t) length : data length [bytes] (type:uint8_t) first_message_offset : offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to 255 if no start exists). [bytes] (type:uint8_t) data : logged data (type:uint8_t) ''' return MAVLink_logging_data_acked_message(target_system, target_component, sequence, length, first_message_offset, data) def logging_data_acked_send(self, target_system, target_component, sequence, length, first_message_offset, data, force_mavlink1=False): ''' A message containing logged data which requires a LOGGING_ACK to be sent back target_system : system ID of the target (type:uint8_t) target_component : component ID of the target (type:uint8_t) sequence : sequence number (can wrap) (type:uint16_t) length : data length [bytes] (type:uint8_t) first_message_offset : offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to 255 if no start exists). [bytes] (type:uint8_t) data : logged data (type:uint8_t) ''' return self.send(self.logging_data_acked_encode(target_system, target_component, sequence, length, first_message_offset, data), force_mavlink1=force_mavlink1) def logging_ack_encode(self, target_system, target_component, sequence): ''' An ack for a LOGGING_DATA_ACKED message target_system : system ID of the target (type:uint8_t) target_component : component ID of the target (type:uint8_t) sequence : sequence number (must match the one in LOGGING_DATA_ACKED) (type:uint16_t) ''' return MAVLink_logging_ack_message(target_system, target_component, sequence) def logging_ack_send(self, target_system, target_component, sequence, force_mavlink1=False): ''' An ack for a LOGGING_DATA_ACKED message target_system : system ID of the target (type:uint8_t) target_component : component ID of the target (type:uint8_t) sequence : sequence number (must match the one in LOGGING_DATA_ACKED) (type:uint16_t) ''' return self.send(self.logging_ack_encode(target_system, target_component, sequence), force_mavlink1=force_mavlink1) def wifi_config_ap_encode(self, ssid, password): ''' Configure AP SSID and Password. ssid : Name of Wi-Fi network (SSID). Leave it blank to leave it unchanged. (type:char) password : Password. Leave it blank for an open AP. (type:char) ''' return MAVLink_wifi_config_ap_message(ssid, password) def wifi_config_ap_send(self, ssid, password, force_mavlink1=False): ''' Configure AP SSID and Password. ssid : Name of Wi-Fi network (SSID). Leave it blank to leave it unchanged. (type:char) password : Password. Leave it blank for an open AP. (type:char) ''' return self.send(self.wifi_config_ap_encode(ssid, password), force_mavlink1=force_mavlink1) def uavcan_node_status_encode(self, time_usec, uptime_sec, health, mode, sub_mode, vendor_specific_status_code): ''' General status information of an UAVCAN node. Please refer to the definition of the UAVCAN message "uavcan.protocol.NodeStatus" for the background information. The UAVCAN specification is available at http://uavcan.org. 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 the number. [us] (type:uint64_t) uptime_sec : Time since the start-up of the node. [s] (type:uint32_t) health : Generalized node health status. (type:uint8_t, values:UAVCAN_NODE_HEALTH) mode : Generalized operating mode. (type:uint8_t, values:UAVCAN_NODE_MODE) sub_mode : Not used currently. (type:uint8_t) vendor_specific_status_code : Vendor-specific status information. (type:uint16_t) ''' return MAVLink_uavcan_node_status_message(time_usec, uptime_sec, health, mode, sub_mode, vendor_specific_status_code) def uavcan_node_status_send(self, time_usec, uptime_sec, health, mode, sub_mode, vendor_specific_status_code, force_mavlink1=False): ''' General status information of an UAVCAN node. Please refer to the definition of the UAVCAN message "uavcan.protocol.NodeStatus" for the background information. The UAVCAN specification is available at http://uavcan.org. 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 the number. [us] (type:uint64_t) uptime_sec : Time since the start-up of the node. [s] (type:uint32_t) health : Generalized node health status. (type:uint8_t, values:UAVCAN_NODE_HEALTH) mode : Generalized operating mode. (type:uint8_t, values:UAVCAN_NODE_MODE) sub_mode : Not used currently. (type:uint8_t) vendor_specific_status_code : Vendor-specific status information. (type:uint16_t) ''' return self.send(self.uavcan_node_status_encode(time_usec, uptime_sec, health, mode, sub_mode, vendor_specific_status_code), force_mavlink1=force_mavlink1) def uavcan_node_info_encode(self, time_usec, uptime_sec, name, hw_version_major, hw_version_minor, hw_unique_id, sw_version_major, sw_version_minor, sw_vcs_commit): ''' General information describing a particular UAVCAN node. Please refer to the definition of the UAVCAN service "uavcan.protocol.GetNodeInfo" for the background information. This message should be emitted by the system whenever a new node appears online, or an existing node reboots. Additionally, it can be emitted upon request from the other end of the MAVLink channel (see MAV_CMD_UAVCAN_GET_NODE_INFO). It is also not prohibited to emit this message unconditionally at a low frequency. The UAVCAN specification is available at http://uavcan.org. 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 the number. [us] (type:uint64_t) uptime_sec : Time since the start-up of the node. [s] (type:uint32_t) name : Node name string. For example, "sapog.px4.io". (type:char) hw_version_major : Hardware major version number. (type:uint8_t) hw_version_minor : Hardware minor version number. (type:uint8_t) hw_unique_id : Hardware unique 128-bit ID. (type:uint8_t) sw_version_major : Software major version number. (type:uint8_t) sw_version_minor : Software minor version number. (type:uint8_t) sw_vcs_commit : Version control system (VCS) revision identifier (e.g. git short commit hash). Zero if unknown. (type:uint32_t) ''' return MAVLink_uavcan_node_info_message(time_usec, uptime_sec, name, hw_version_major, hw_version_minor, hw_unique_id, sw_version_major, sw_version_minor, sw_vcs_commit) def uavcan_node_info_send(self, time_usec, uptime_sec, name, hw_version_major, hw_version_minor, hw_unique_id, sw_version_major, sw_version_minor, sw_vcs_commit, force_mavlink1=False): ''' General information describing a particular UAVCAN node. Please refer to the definition of the UAVCAN service "uavcan.protocol.GetNodeInfo" for the background information. This message should be emitted by the system whenever a new node appears online, or an existing node reboots. Additionally, it can be emitted upon request from the other end of the MAVLink channel (see MAV_CMD_UAVCAN_GET_NODE_INFO). It is also not prohibited to emit this message unconditionally at a low frequency. The UAVCAN specification is available at http://uavcan.org. 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 the number. [us] (type:uint64_t) uptime_sec : Time since the start-up of the node. [s] (type:uint32_t) name : Node name string. For example, "sapog.px4.io". (type:char) hw_version_major : Hardware major version number. (type:uint8_t) hw_version_minor : Hardware minor version number. (type:uint8_t) hw_unique_id : Hardware unique 128-bit ID. (type:uint8_t) sw_version_major : Software major version number. (type:uint8_t) sw_version_minor : Software minor version number. (type:uint8_t) sw_vcs_commit : Version control system (VCS) revision identifier (e.g. git short commit hash). Zero if unknown. (type:uint32_t) ''' return self.send(self.uavcan_node_info_encode(time_usec, uptime_sec, name, hw_version_major, hw_version_minor, hw_unique_id, sw_version_major, sw_version_minor, sw_vcs_commit), force_mavlink1=force_mavlink1) def obstacle_distance_encode(self, time_usec, sensor_type, distances, increment, min_distance, max_distance, increment_f=0, angle_offset=0, frame=0): ''' Obstacle distances in front of the sensor, starting from the left in increment degrees to the right 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 the number. [us] (type:uint64_t) sensor_type : Class id of the distance sensor type. (type:uint8_t, values:MAV_DISTANCE_SENSOR) distances : Distance of obstacles around the vehicle with index 0 corresponding to North + angle_offset, unless otherwise specified in the frame. A value of 0 is valid and means that the obstacle is practically touching the sensor. A value of max_distance +1 means no obstacle is present. A value of UINT16_MAX for unknown/not used. In a array element, one unit corresponds to 1cm. [cm] (type:uint16_t) increment : Angular width in degrees of each array element. Increment direction is clockwise. This field is ignored if increment_f is non-zero. [deg] (type:uint8_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) increment_f : Angular width in degrees of each array element as a float. If non-zero then this value is used instead of the uint8_t increment field. Positive is clockwise direction, negative is counter-clockwise. [deg] (type:float) angle_offset : Relative angle offset of the 0-index element in the distances array. Value of 0 corresponds to forward. Positive is clockwise direction, negative is counter-clockwise. [deg] (type:float) frame : Coordinate frame of reference for the yaw rotation and offset of the sensor data. Defaults to MAV_FRAME_GLOBAL, which is North aligned. For body-mounted sensors use MAV_FRAME_BODY_FRD, which is vehicle front aligned. (type:uint8_t, values:MAV_FRAME) ''' return MAVLink_obstacle_distance_message(time_usec, sensor_type, distances, increment, min_distance, max_distance, increment_f, angle_offset, frame) def obstacle_distance_send(self, time_usec, sensor_type, distances, increment, min_distance, max_distance, increment_f=0, angle_offset=0, frame=0, force_mavlink1=False): ''' Obstacle distances in front of the sensor, starting from the left in increment degrees to the right 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 the number. [us] (type:uint64_t) sensor_type : Class id of the distance sensor type. (type:uint8_t, values:MAV_DISTANCE_SENSOR) distances : Distance of obstacles around the vehicle with index 0 corresponding to North + angle_offset, unless otherwise specified in the frame. A value of 0 is valid and means that the obstacle is practically touching the sensor. A value of max_distance +1 means no obstacle is present. A value of UINT16_MAX for unknown/not used. In a array element, one unit corresponds to 1cm. [cm] (type:uint16_t) increment : Angular width in degrees of each array element. Increment direction is clockwise. This field is ignored if increment_f is non-zero. [deg] (type:uint8_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) increment_f : Angular width in degrees of each array element as a float. If non-zero then this value is used instead of the uint8_t increment field. Positive is clockwise direction, negative is counter-clockwise. [deg] (type:float) angle_offset : Relative angle offset of the 0-index element in the distances array. Value of 0 corresponds to forward. Positive is clockwise direction, negative is counter-clockwise. [deg] (type:float) frame : Coordinate frame of reference for the yaw rotation and offset of the sensor data. Defaults to MAV_FRAME_GLOBAL, which is North aligned. For body-mounted sensors use MAV_FRAME_BODY_FRD, which is vehicle front aligned. (type:uint8_t, values:MAV_FRAME) ''' return self.send(self.obstacle_distance_encode(time_usec, sensor_type, distances, increment, min_distance, max_distance, increment_f, angle_offset, frame), force_mavlink1=force_mavlink1) def odometry_encode(self, time_usec, frame_id, child_frame_id, x, y, z, q, vx, vy, vz, rollspeed, pitchspeed, yawspeed, pose_covariance, velocity_covariance, reset_counter=0, estimator_type=0): ''' Odometry message to communicate odometry information with an external interface. Fits ROS REP 147 standard for aerial vehicles (http://www.ros.org/reps/rep-0147.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 the number. [us] (type:uint64_t) frame_id : Coordinate frame of reference for the pose data. (type:uint8_t, values:MAV_FRAME) child_frame_id : Coordinate frame of reference for the velocity in free space (twist) data. (type:uint8_t, values:MAV_FRAME) x : X Position [m] (type:float) y : Y Position [m] (type:float) z : Z Position [m] (type:float) q : Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation) (type:float) vx : X linear speed [m/s] (type:float) vy : Y linear speed [m/s] (type:float) vz : Z linear speed [m/s] (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) pose_covariance : Row-major representation of a 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array. (type:float) velocity_covariance : Row-major representation of a 6x6 velocity cross-covariance matrix upper right triangle (states: vx, vy, vz, rollspeed, pitchspeed, yawspeed; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array. (type:float) reset_counter : Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps. (type:uint8_t) estimator_type : Type of estimator that is providing the odometry. (type:uint8_t, values:MAV_ESTIMATOR_TYPE) ''' return MAVLink_odometry_message(time_usec, frame_id, child_frame_id, x, y, z, q, vx, vy, vz, rollspeed, pitchspeed, yawspeed, pose_covariance, velocity_covariance, reset_counter, estimator_type) def odometry_send(self, time_usec, frame_id, child_frame_id, x, y, z, q, vx, vy, vz, rollspeed, pitchspeed, yawspeed, pose_covariance, velocity_covariance, reset_counter=0, estimator_type=0, force_mavlink1=False): ''' Odometry message to communicate odometry information with an external interface. Fits ROS REP 147 standard for aerial vehicles (http://www.ros.org/reps/rep-0147.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 the number. [us] (type:uint64_t) frame_id : Coordinate frame of reference for the pose data. (type:uint8_t, values:MAV_FRAME) child_frame_id : Coordinate frame of reference for the velocity in free space (twist) data. (type:uint8_t, values:MAV_FRAME) x : X Position [m] (type:float) y : Y Position [m] (type:float) z : Z Position [m] (type:float) q : Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation) (type:float) vx : X linear speed [m/s] (type:float) vy : Y linear speed [m/s] (type:float) vz : Z linear speed [m/s] (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) pose_covariance : Row-major representation of a 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array. (type:float) velocity_covariance : Row-major representation of a 6x6 velocity cross-covariance matrix upper right triangle (states: vx, vy, vz, rollspeed, pitchspeed, yawspeed; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array. (type:float) reset_counter : Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps. (type:uint8_t) estimator_type : Type of estimator that is providing the odometry. (type:uint8_t, values:MAV_ESTIMATOR_TYPE) ''' return self.send(self.odometry_encode(time_usec, frame_id, child_frame_id, x, y, z, q, vx, vy, vz, rollspeed, pitchspeed, yawspeed, pose_covariance, velocity_covariance, reset_counter, estimator_type), force_mavlink1=force_mavlink1) def isbd_link_status_encode(self, timestamp, last_heartbeat, failed_sessions, successful_sessions, signal_quality, ring_pending, tx_session_pending, rx_session_pending): ''' Status of the Iridium SBD link. timestamp : Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number. [us] (type:uint64_t) last_heartbeat : Timestamp of the last successful sbd session. The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number. [us] (type:uint64_t) failed_sessions : Number of failed SBD sessions. (type:uint16_t) successful_sessions : Number of successful SBD sessions. (type:uint16_t) signal_quality : Signal quality equal to the number of bars displayed on the ISU signal strength indicator. Range is 0 to 5, where 0 indicates no signal and 5 indicates maximum signal strength. (type:uint8_t) ring_pending : 1: Ring call pending, 0: No call pending. (type:uint8_t) tx_session_pending : 1: Transmission session pending, 0: No transmission session pending. (type:uint8_t) rx_session_pending : 1: Receiving session pending, 0: No receiving session pending. (type:uint8_t) ''' return MAVLink_isbd_link_status_message(timestamp, last_heartbeat, failed_sessions, successful_sessions, signal_quality, ring_pending, tx_session_pending, rx_session_pending) def isbd_link_status_send(self, timestamp, last_heartbeat, failed_sessions, successful_sessions, signal_quality, ring_pending, tx_session_pending, rx_session_pending, force_mavlink1=False): ''' Status of the Iridium SBD link. timestamp : Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number. [us] (type:uint64_t) last_heartbeat : Timestamp of the last successful sbd session. The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number. [us] (type:uint64_t) failed_sessions : Number of failed SBD sessions. (type:uint16_t) successful_sessions : Number of successful SBD sessions. (type:uint16_t) signal_quality : Signal quality equal to the number of bars displayed on the ISU signal strength indicator. Range is 0 to 5, where 0 indicates no signal and 5 indicates maximum signal strength. (type:uint8_t) ring_pending : 1: Ring call pending, 0: No call pending. (type:uint8_t) tx_session_pending : 1: Transmission session pending, 0: No transmission session pending. (type:uint8_t) rx_session_pending : 1: Receiving session pending, 0: No receiving session pending. (type:uint8_t) ''' return self.send(self.isbd_link_status_encode(timestamp, last_heartbeat, failed_sessions, successful_sessions, signal_quality, ring_pending, tx_session_pending, rx_session_pending), force_mavlink1=force_mavlink1) def debug_float_array_encode(self, time_usec, name, array_id, data=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]): ''' Large debug/prototyping array. The message uses the maximum available payload for data. The array_id and name fields are used to discriminate between messages in code and in user interfaces (respectively). Do not use in production code. 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 the number. [us] (type:uint64_t) name : Name, for human-friendly display in a Ground Control Station (type:char) array_id : Unique ID used to discriminate between arrays (type:uint16_t) data : data (type:float) ''' return MAVLink_debug_float_array_message(time_usec, name, array_id, data) def debug_float_array_send(self, time_usec, name, array_id, data=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], force_mavlink1=False): ''' Large debug/prototyping array. The message uses the maximum available payload for data. The array_id and name fields are used to discriminate between messages in code and in user interfaces (respectively). Do not use in production code. 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 the number. [us] (type:uint64_t) name : Name, for human-friendly display in a Ground Control Station (type:char) array_id : Unique ID used to discriminate between arrays (type:uint16_t) data : data (type:float) ''' return self.send(self.debug_float_array_encode(time_usec, name, array_id, data), force_mavlink1=force_mavlink1) def statustext_long_encode(self, severity, text): ''' Status text message (use only for important status and error messages). The full message payload can be used for status text, but we recommend that updates be kept concise. Note: The message is intended as a less restrictive replacement for STATUSTEXT. 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_long_message(severity, text) def statustext_long_send(self, severity, text, force_mavlink1=False): ''' Status text message (use only for important status and error messages). The full message payload can be used for status text, but we recommend that updates be kept concise. Note: The message is intended as a less restrictive replacement for STATUSTEXT. 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_long_encode(severity, text), force_mavlink1=force_mavlink1) def actuator_output_status_encode(self, time_usec, active, actuator): ''' The raw values of the actuator outputs. time_usec : Timestamp (since system boot). [us] (type:uint64_t) active : Active outputs (type:uint32_t) actuator : Servo / motor output array values. Zero values indicate unused channels. (type:float) ''' return MAVLink_actuator_output_status_message(time_usec, active, actuator) def actuator_output_status_send(self, time_usec, active, actuator, force_mavlink1=False): ''' The raw values of the actuator outputs. time_usec : Timestamp (since system boot). [us] (type:uint64_t) active : Active outputs (type:uint32_t) actuator : Servo / motor output array values. Zero values indicate unused channels. (type:float) ''' return self.send(self.actuator_output_status_encode(time_usec, active, actuator), force_mavlink1=force_mavlink1) def wheel_distance_encode(self, time_usec, count, distance): ''' Cumulative distance traveled for each reported wheel. time_usec : Timestamp (synced to UNIX time or since system boot). [us] (type:uint64_t) count : Number of wheels reported. (type:uint8_t) distance : Distance reported by individual wheel encoders. Forward rotations increase values, reverse rotations decrease them. Not all wheels will necessarily have wheel encoders; the mapping of encoders to wheel positions must be agreed/understood by the endpoints. [m] (type:double) ''' return MAVLink_wheel_distance_message(time_usec, count, distance) def wheel_distance_send(self, time_usec, count, distance, force_mavlink1=False): ''' Cumulative distance traveled for each reported wheel. time_usec : Timestamp (synced to UNIX time or since system boot). [us] (type:uint64_t) count : Number of wheels reported. (type:uint8_t) distance : Distance reported by individual wheel encoders. Forward rotations increase values, reverse rotations decrease them. Not all wheels will necessarily have wheel encoders; the mapping of encoders to wheel positions must be agreed/understood by the endpoints. [m] (type:double) ''' return self.send(self.wheel_distance_encode(time_usec, count, distance), force_mavlink1=force_mavlink1)
[ "Miao@DESKTOP-AJA95IE" ]
Miao@DESKTOP-AJA95IE
c75536852e252b5c4f8293e45f4008fa0530ec2a
18b741084bda1f1500e9accd2a52b8e75b23c8be
/mootdx/tools/__init__.py
23308c243ebde3e3097759557232e2deaccfc518
[ "MIT" ]
permissive
adam1iu/mootdx
bd55baaf10a10c9862f81776a045a3ae3c1ee8ad
704e2d20d6d81a16b82c67e028de54e48a7cae9c
refs/heads/master
2023-08-25T09:33:54.619594
2021-10-29T06:21:05
2021-10-29T06:21:05
null
0
0
null
null
null
null
UTF-8
Python
false
false
84
py
# -*- coding: utf-8 -*- # @Author : BoPo # @Time : 2021/9/18 10:00 # @Function:
[ "ibopo@126.com" ]
ibopo@126.com