INSTRUCTION
stringlengths 1
46.3k
| RESPONSE
stringlengths 75
80.2k
|
---|---|
Return the list of this task's authors
|
def get_authors(self, language):
""" Return the list of this task's authors """
return self.gettext(language, self._author) if self._author else ""
|
Adapt the input from web.py for the inginious.backend
|
def adapt_input_for_backend(self, input_data):
""" Adapt the input from web.py for the inginious.backend """
for problem in self._problems:
input_data = problem.adapt_input_for_backend(input_data)
return input_data
|
Get all data and display the page
|
def page(self, course, username):
""" Get all data and display the page """
data = list(self.database.user_tasks.find({"username": username, "courseid": course.get_id()}))
tasks = course.get_tasks()
result = dict([(taskid, {"taskid": taskid, "name": tasks[taskid].get_name(self.user_manager.session_language()),
"tried": 0, "status": "notviewed", "grade": 0,
"url": self.submission_url_generator(username, taskid)}) for taskid in tasks])
for taskdata in data:
if taskdata["taskid"] in result:
result[taskdata["taskid"]]["tried"] = taskdata["tried"]
if taskdata["tried"] == 0:
result[taskdata["taskid"]]["status"] = "notattempted"
elif taskdata["succeeded"]:
result[taskdata["taskid"]]["status"] = "succeeded"
else:
result[taskdata["taskid"]]["status"] = "failed"
result[taskdata["taskid"]]["grade"] = taskdata["grade"]
result[taskdata["taskid"]]["submissionid"] = str(taskdata["submissionid"])
if "csv" in web.input():
return make_csv(result)
results = sorted(list(result.values()), key=lambda result: (tasks[result["taskid"]].get_order(), result["taskid"]))
return self.template_helper.get_renderer().course_admin.student_info(course, username, results)
|
POST request
|
def POST_AUTH(self, courseid): # pylint: disable=arguments-differ
""" POST request """
course, __ = self.get_course_and_check_rights(courseid)
msgs = []
if "replay" in web.input():
if not self.user_manager.has_admin_rights_on_course(course):
raise web.notfound()
input = self.get_input()
tasks = course.get_tasks()
data, __ = self.get_submissions(course, input)
for submission in data:
self.submission_manager.replay_job(tasks[submission["taskid"]], submission)
msgs.append(_("{0} selected submissions were set for replay.").format(str(len(data))))
return self.page(course, msgs)
|
Get all data and display the page
|
def page(self, course, msgs=None):
""" Get all data and display the page """
msgs = msgs if msgs else []
user_input = self.get_input()
data, classroom = self.get_submissions(course, user_input) # ONLY classrooms user wants to query
if len(data) == 0 and not self.show_collapse(user_input):
msgs.append(_("No submissions found"))
classrooms = self.user_manager.get_course_aggregations(course) # ALL classrooms of the course
users = self.get_users(course) # All users of the course
tasks = course.get_tasks() # All tasks of the course
statistics = None
if user_input.stat != "no_stat":
statistics = compute_statistics(tasks, data, True if "with_pond_stat" == user_input.stat else False)
if "csv" in web.input():
return make_csv(data)
if "download" in web.input():
# self._logger.info("Downloading %d submissions from course %s", len(data), course.get_id())
web.header('Content-Type', 'application/x-gzip', unique=True)
web.header('Content-Disposition', 'attachment; filename="submissions.tgz"', unique=True)
# Tweak if not using classrooms : classroom['students'] may content ungrouped users
aggregations = dict([(username,
aggregation if course.use_classrooms() or (
username in aggregation['groups'][0]["students"]) else None
) for aggregation in classroom for username in aggregation["students"]])
download_type = web.input(download_type=self._valid_formats[0]).download_type
if download_type not in self._valid_formats:
download_type = self._valid_formats[0]
return self.submission_manager.get_submission_archive(data, list(reversed(download_type.split('/'))), aggregations)
if user_input.limit != '' and user_input.limit.isdigit():
data = data[:int(user_input.limit)]
if len(data) > self._trunc_limit:
msgs.append(_("The result contains more than {0} submissions. The displayed submissions are truncated.\n").format(self._trunc_limit))
data = data[:self._trunc_limit]
return self.template_helper.get_renderer().course_admin.submissions(course, tasks, users, classrooms, data, statistics, user_input, self._allowed_sort, self._allowed_sort_name, self._valid_formats, msgs, self.show_collapse(user_input))
|
Returns a sorted list of users
|
def get_users(self, course):
""" Returns a sorted list of users """
users = OrderedDict(sorted(list(self.user_manager.get_users_info(self.user_manager.get_course_registered_users(course)).items()),
key=lambda k: k[1][0] if k[1] is not None else ""))
return users
|
Returns the list of submissions and corresponding aggragations based on inputs
|
def get_submissions(self, course, user_input):
""" Returns the list of submissions and corresponding aggragations based on inputs """
# Build lists of wanted users based on classrooms and specific users
list_classroom_id = [ObjectId(o) for o in user_input.aggregation]
classroom = list(self.database.aggregations.find({"_id": {"$in": list_classroom_id}}))
more_username = [s["students"] for s in classroom] # Extract usernames of students
more_username = [y for x in more_username for y in x] # Flatten lists
# Get tasks based on organisational tags
more_tasks = []
for org_tag in user_input.org_tags:
if org_tag in course.get_organisational_tags_to_task():
more_tasks += course.get_organisational_tags_to_task()[org_tag]
#Base query
query_base = {
"username": {"$in": user_input.user + more_username},
"courseid": course.get_id(),
"taskid": {"$in": user_input.task + more_tasks}
}
# Additional query field
query_advanced = {}
if user_input.grade_min and not user_input.grade_max:
query_advanced["grade"] = {"$gte": float(user_input.grade_min)}
elif not user_input.grade_min and user_input.grade_max:
query_advanced["grade"] = {"$lte": float(user_input.grade_max)}
elif user_input.grade_min and user_input.grade_max:
query_advanced["grade"] = {"$gte": float(user_input.grade_min), "$lte": float(user_input.grade_max)}
try:
date_before = datetime.strptime(user_input.date_before, "%Y-%m-%d %H:%M:%S") if user_input.date_before else ''
date_after = datetime.strptime(user_input.date_after, "%Y-%m-%d %H:%M:%S") if user_input.date_after else ''
if date_before and not date_after:
query_advanced["submitted_on"] = {"$lte": date_before}
elif not date_before and date_after:
query_advanced["submitted_on"] = {"$gte": date_after}
elif date_before and date_after:
query_advanced["submitted_on"] = {"$gte": date_after, "$lte": date_before}
except ValueError: # If match of datetime.strptime() fails
pass
# Query with tags
if len(user_input.filter_tags) == len(user_input.filter_tags_presence):
for i in range(0, len(user_input.filter_tags)):
if id_checker(user_input.filter_tags[i]):
state = (user_input.filter_tags_presence[i] in ["True", "true"])
query_advanced["tests." + user_input.filter_tags[i]] = {"$in": [None, False]} if not state else True
# Mongo operations
data = list(self.database.submissions.find({**query_base, **query_advanced}).sort([(user_input.sort_by,
pymongo.DESCENDING if user_input.order == "0" else pymongo.ASCENDING)]))
data = [dict(list(f.items()) + [("url", self.submission_url_generator(str(f["_id"])))]) for f in data]
# Get best submissions from database
user_tasks = list(self.database.user_tasks.find(query_base, {"submissionid": 1, "_id": 0}))
best_submissions_list = [u["submissionid"] for u in user_tasks] # list containing ids of best submissions
for d in data:
d["best"] = d["_id"] in best_submissions_list # mark best submissions
# Keep best submissions
if "eval" in user_input or ("eval_dl" in user_input and "download" in web.input()):
data = [d for d in data if d["best"]]
return data, classroom
|
Loads web input, initialise default values and check/sanitise some inputs from users
|
def get_input(self):
""" Loads web input, initialise default values and check/sanitise some inputs from users """
user_input = web.input(
user=[],
task=[],
aggregation=[],
org_tags=[],
grade_min='',
grade_max='',
sort_by="submitted_on",
order='0', # "0" for pymongo.DESCENDING, anything else for pymongo.ASCENDING
limit='',
filter_tags=[],
filter_tags_presence=[],
date_after='',
date_before='',
stat='with_stat',
)
# Sanitise inputs
for item in itertools.chain(user_input.task, user_input.aggregation):
if not id_checker(item):
raise web.notfound()
if user_input.sort_by not in self._allowed_sort:
raise web.notfound()
digits = [user_input.grade_min, user_input.grade_max, user_input.order, user_input.limit]
for d in digits:
if d != '' and not d.isdigit():
raise web.notfound()
return user_input
|
Shorthand for creating Factories
:param fs_provider: A FileSystemProvider leading to the courses
:param hook_manager: an Hook Manager instance. If None, a new Hook Manager is created
:param course_class:
:param task_class:
:return: a tuple with two objects: the first being of type CourseFactory, the second of type TaskFactory
|
def create_factories(fs_provider, task_problem_types, hook_manager=None, course_class=Course, task_class=Task):
"""
Shorthand for creating Factories
:param fs_provider: A FileSystemProvider leading to the courses
:param hook_manager: an Hook Manager instance. If None, a new Hook Manager is created
:param course_class:
:param task_class:
:return: a tuple with two objects: the first being of type CourseFactory, the second of type TaskFactory
"""
if hook_manager is None:
hook_manager = HookManager()
task_factory = TaskFactory(fs_provider, hook_manager, task_problem_types, task_class)
return CourseFactory(fs_provider, task_factory, hook_manager, course_class), task_factory
|
:param courseid: the course id of the course
:raise InvalidNameException, CourseNotFoundException, CourseUnreadableException
:return: an object representing the course, of the type given in the constructor
|
def get_course(self, courseid):
"""
:param courseid: the course id of the course
:raise InvalidNameException, CourseNotFoundException, CourseUnreadableException
:return: an object representing the course, of the type given in the constructor
"""
if not id_checker(courseid):
raise InvalidNameException("Course with invalid name: " + courseid)
if self._cache_update_needed(courseid):
self._update_cache(courseid)
return self._cache[courseid][0]
|
:param courseid: the course id of the course
:raise InvalidNameException, CourseNotFoundException, CourseUnreadableException
:return: the content of the dict that describes the course
|
def get_course_descriptor_content(self, courseid):
"""
:param courseid: the course id of the course
:raise InvalidNameException, CourseNotFoundException, CourseUnreadableException
:return: the content of the dict that describes the course
"""
path = self._get_course_descriptor_path(courseid)
return loads_json_or_yaml(path, self._filesystem.get(path).decode("utf-8"))
|
Updates the content of the dict that describes the course
:param courseid: the course id of the course
:param content: the new dict that replaces the old content
:raise InvalidNameException, CourseNotFoundException
|
def update_course_descriptor_content(self, courseid, content):
"""
Updates the content of the dict that describes the course
:param courseid: the course id of the course
:param content: the new dict that replaces the old content
:raise InvalidNameException, CourseNotFoundException
"""
path = self._get_course_descriptor_path(courseid)
self._filesystem.put(path, get_json_or_yaml(path, content))
|
:param courseid:
:return: a FileSystemProvider pointing to the directory of the course
|
def get_course_fs(self, courseid):
"""
:param courseid:
:return: a FileSystemProvider pointing to the directory of the course
"""
if not id_checker(courseid):
raise InvalidNameException("Course with invalid name: " + courseid)
return self._filesystem.from_subfolder(courseid)
|
:return: a table containing courseid=>Course pairs
|
def get_all_courses(self):
"""
:return: a table containing courseid=>Course pairs
"""
course_ids = [f[0:len(f)-1] for f in self._filesystem.list(folders=True, files=False, recursive=False)] # remove trailing "/"
output = {}
for courseid in course_ids:
try:
output[courseid] = self.get_course(courseid)
except Exception:
get_course_logger(courseid).warning("Cannot open course", exc_info=True)
return output
|
:param courseid: the course id of the course
:raise InvalidNameException, CourseNotFoundException
:return: the path to the descriptor of the course
|
def _get_course_descriptor_path(self, courseid):
"""
:param courseid: the course id of the course
:raise InvalidNameException, CourseNotFoundException
:return: the path to the descriptor of the course
"""
if not id_checker(courseid):
raise InvalidNameException("Course with invalid name: " + courseid)
course_fs = self.get_course_fs(courseid)
if course_fs.exists("course.yaml"):
return courseid+"/course.yaml"
if course_fs.exists("course.json"):
return courseid+"/course.json"
raise CourseNotFoundException()
|
:param courseid: the course id of the course
:param init_content: initial descriptor content
:raise InvalidNameException or CourseAlreadyExistsException
Create a new course folder and set initial descriptor content, folder can already exist
|
def create_course(self, courseid, init_content):
"""
:param courseid: the course id of the course
:param init_content: initial descriptor content
:raise InvalidNameException or CourseAlreadyExistsException
Create a new course folder and set initial descriptor content, folder can already exist
"""
if not id_checker(courseid):
raise InvalidNameException("Course with invalid name: " + courseid)
course_fs = self.get_course_fs(courseid)
course_fs.ensure_exists()
if course_fs.exists("course.yaml") or course_fs.exists("course.json"):
raise CourseAlreadyExistsException("Course with id " + courseid + " already exists.")
else:
course_fs.put("course.yaml", get_json_or_yaml("course.yaml", init_content))
get_course_logger(courseid).info("Course %s created in the factory.", courseid)
|
:param courseid: the course id of the course
:raise InvalidNameException or CourseNotFoundException
Erase the content of the course folder
|
def delete_course(self, courseid):
"""
:param courseid: the course id of the course
:raise InvalidNameException or CourseNotFoundException
Erase the content of the course folder
"""
if not id_checker(courseid):
raise InvalidNameException("Course with invalid name: " + courseid)
course_fs = self.get_course_fs(courseid)
if not course_fs.exists():
raise CourseNotFoundException()
course_fs.delete()
get_course_logger(courseid).info("Course %s erased from the factory.", courseid)
|
:param courseid: the (valid) course id of the course
:raise InvalidNameException, CourseNotFoundException
:return: True if an update of the cache is needed, False else
|
def _cache_update_needed(self, courseid):
"""
:param courseid: the (valid) course id of the course
:raise InvalidNameException, CourseNotFoundException
:return: True if an update of the cache is needed, False else
"""
if courseid not in self._cache:
return True
try:
descriptor_name = self._get_course_descriptor_path(courseid)
last_update = {descriptor_name: self._filesystem.get_last_modification_time(descriptor_name)}
translations_fs = self._filesystem.from_subfolder("$i18n")
if translations_fs.exists():
for f in translations_fs.list(folders=False, files=True, recursive=False):
lang = f[0:len(f) - 3]
if translations_fs.exists(lang + ".mo"):
last_update["$i18n/" + lang + ".mo"] = translations_fs.get_last_modification_time(lang + ".mo")
except:
raise CourseNotFoundException()
last_modif = self._cache[courseid][1]
for filename, mftime in last_update.items():
if filename not in last_modif or last_modif[filename] < mftime:
return True
return False
|
Updates the cache
:param courseid: the (valid) course id of the course
:raise InvalidNameException, CourseNotFoundException, CourseUnreadableException
|
def _update_cache(self, courseid):
"""
Updates the cache
:param courseid: the (valid) course id of the course
:raise InvalidNameException, CourseNotFoundException, CourseUnreadableException
"""
path_to_descriptor = self._get_course_descriptor_path(courseid)
try:
course_descriptor = loads_json_or_yaml(path_to_descriptor, self._filesystem.get(path_to_descriptor).decode("utf8"))
except Exception as e:
raise CourseUnreadableException(str(e))
last_modif = {path_to_descriptor: self._filesystem.get_last_modification_time(path_to_descriptor)}
translations_fs = self._filesystem.from_subfolder("$i18n")
if translations_fs.exists():
for f in translations_fs.list(folders=False, files=True, recursive=False):
lang = f[0:len(f) - 3]
if translations_fs.exists(lang + ".mo"):
last_modif["$i18n/" + lang + ".mo"] = translations_fs.get_last_modification_time(lang + ".mo")
self._cache[courseid] = (
self._course_class(courseid, course_descriptor, self.get_course_fs(courseid), self._task_factory, self._hook_manager),
last_modif
)
self._task_factory.update_cache_for_course(courseid)
|
Return the course
|
def get_course(self, courseid):
""" Return the course """
try:
course = self.course_factory.get_course(courseid)
except:
raise web.notfound()
return course
|
POST request
|
def POST(self, courseid): # pylint: disable=arguments-differ
""" POST request """
course = self.get_course(courseid)
user_input = web.input()
if "unregister" in user_input and course.allow_unregister():
self.user_manager.course_unregister_user(course, self.user_manager.session_username())
raise web.seeother(self.app.get_homepath() + '/mycourses')
return self.show_page(course)
|
GET request
|
def GET(self, courseid): # pylint: disable=arguments-differ
""" GET request """
course = self.get_course(courseid)
return self.show_page(course)
|
Prepares and shows the course page
|
def show_page(self, course):
""" Prepares and shows the course page """
username = self.user_manager.session_username()
if not self.user_manager.course_is_open_to_user(course, lti=False):
return self.template_helper.get_renderer().course_unavailable()
else:
tasks = course.get_tasks()
last_submissions = self.submission_manager.get_user_last_submissions(5, {"courseid": course.get_id(), "taskid": {"$in": list(tasks.keys())}})
for submission in last_submissions:
submission["taskname"] = tasks[submission['taskid']].get_name(self.user_manager.session_language())
tasks_data = {}
user_tasks = self.database.user_tasks.find({"username": username, "courseid": course.get_id(), "taskid": {"$in": list(tasks.keys())}})
is_admin = self.user_manager.has_staff_rights_on_course(course, username)
tasks_score = [0.0, 0.0]
for taskid, task in tasks.items():
tasks_data[taskid] = {"visible": task.get_accessible_time().after_start() or is_admin, "succeeded": False,
"grade": 0.0}
tasks_score[1] += task.get_grading_weight() if tasks_data[taskid]["visible"] else 0
for user_task in user_tasks:
tasks_data[user_task["taskid"]]["succeeded"] = user_task["succeeded"]
tasks_data[user_task["taskid"]]["grade"] = user_task["grade"]
weighted_score = user_task["grade"]*tasks[user_task["taskid"]].get_grading_weight()
tasks_score[0] += weighted_score if tasks_data[user_task["taskid"]]["visible"] else 0
course_grade = round(tasks_score[0]/tasks_score[1]) if tasks_score[1] > 0 else 0
tag_list = course.get_all_tags_names_as_list(is_admin, self.user_manager.session_language())
user_info = self.database.users.find_one({"username": username})
return self.template_helper.get_renderer().course(user_info, course, last_submissions, tasks, tasks_data, course_grade, tag_list)
|
extract mavlink parameters
|
def mavparms(logfile):
'''extract mavlink parameters'''
mlog = mavutil.mavlink_connection(filename)
while True:
try:
m = mlog.recv_match(type=['PARAM_VALUE', 'PARM'])
if m is None:
return
except Exception:
return
if m.get_type() == 'PARAM_VALUE':
pname = str(m.param_id).strip()
value = m.param_value
else:
pname = m.Name
value = m.Value
if len(pname) > 0:
if args.changesOnly is True and pname in parms and parms[pname] != value:
print("%s %-15s %.6f -> %.6f" % (time.asctime(time.localtime(m._timestamp)), pname, parms[pname], value))
parms[pname] = value
|
send a MAVLink message
|
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)
|
return number of bytes needed for next parsing stage
|
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
|
this method exists only to make profiling results easier to read
|
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)
|
input some data bytes, possibly returning a new message
|
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 != 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
|
input some data bytes, possibly returning a new message (uses no native code)
|
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(chr(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[0] < 3:
sbuf = str(sbuf)
(magic, self.expected_length, incompat_flags) = struct.unpack('BBB', 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
|
input some data bytes, possibly returning a list of new messages
|
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
|
check signature on incoming message
|
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) = struct.unpack('<IH', 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])
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
|
decode a buffer as a MAVLink message
|
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 = struct.unpack('<cBBBBBBHB', 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 = struct.unpack('<cBBBBB', 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, = struct.unpack('<H', 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 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 = struct.calcsize(fmt)
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 = struct.unpack(fmt, 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 isinstance(tlist[i], str):
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
|
Depreciated but used as a compiler flag. Do not remove
target_system : System ID (uint8_t)
target_component : Component ID (uint8_t)
|
def flexifunction_set_send(self, target_system, target_component, force_mavlink1=False):
'''
Depreciated but used as a compiler flag. Do not remove
target_system : System ID (uint8_t)
target_component : Component ID (uint8_t)
'''
return self.send(self.flexifunction_set_encode(target_system, target_component), force_mavlink1=force_mavlink1)
|
Reqest reading of flexifunction data
target_system : System ID (uint8_t)
target_component : Component ID (uint8_t)
read_req_type : Type of flexifunction data requested (int16_t)
data_index : index into data where needed (int16_t)
|
def flexifunction_read_req_encode(self, target_system, target_component, read_req_type, data_index):
'''
Reqest reading of flexifunction data
target_system : System ID (uint8_t)
target_component : Component ID (uint8_t)
read_req_type : Type of flexifunction data requested (int16_t)
data_index : index into data where needed (int16_t)
'''
return MAVLink_flexifunction_read_req_message(target_system, target_component, read_req_type, data_index)
|
Reqest reading of flexifunction data
target_system : System ID (uint8_t)
target_component : Component ID (uint8_t)
read_req_type : Type of flexifunction data requested (int16_t)
data_index : index into data where needed (int16_t)
|
def flexifunction_read_req_send(self, target_system, target_component, read_req_type, data_index, force_mavlink1=False):
'''
Reqest reading of flexifunction data
target_system : System ID (uint8_t)
target_component : Component ID (uint8_t)
read_req_type : Type of flexifunction data requested (int16_t)
data_index : index into data where needed (int16_t)
'''
return self.send(self.flexifunction_read_req_encode(target_system, target_component, read_req_type, data_index), force_mavlink1=force_mavlink1)
|
Flexifunction type and parameters for component at function index from
buffer
target_system : System ID (uint8_t)
target_component : Component ID (uint8_t)
func_index : Function index (uint16_t)
func_count : Total count of functions (uint16_t)
data_address : Address in the flexifunction data, Set to 0xFFFF to use address in target memory (uint16_t)
data_size : Size of the (uint16_t)
data : Settings data (int8_t)
|
def flexifunction_buffer_function_encode(self, target_system, target_component, func_index, func_count, data_address, data_size, data):
'''
Flexifunction type and parameters for component at function index from
buffer
target_system : System ID (uint8_t)
target_component : Component ID (uint8_t)
func_index : Function index (uint16_t)
func_count : Total count of functions (uint16_t)
data_address : Address in the flexifunction data, Set to 0xFFFF to use address in target memory (uint16_t)
data_size : Size of the (uint16_t)
data : Settings data (int8_t)
'''
return MAVLink_flexifunction_buffer_function_message(target_system, target_component, func_index, func_count, data_address, data_size, data)
|
Flexifunction type and parameters for component at function index from
buffer
target_system : System ID (uint8_t)
target_component : Component ID (uint8_t)
func_index : Function index (uint16_t)
func_count : Total count of functions (uint16_t)
data_address : Address in the flexifunction data, Set to 0xFFFF to use address in target memory (uint16_t)
data_size : Size of the (uint16_t)
data : Settings data (int8_t)
|
def flexifunction_buffer_function_send(self, target_system, target_component, func_index, func_count, data_address, data_size, data, force_mavlink1=False):
'''
Flexifunction type and parameters for component at function index from
buffer
target_system : System ID (uint8_t)
target_component : Component ID (uint8_t)
func_index : Function index (uint16_t)
func_count : Total count of functions (uint16_t)
data_address : Address in the flexifunction data, Set to 0xFFFF to use address in target memory (uint16_t)
data_size : Size of the (uint16_t)
data : Settings data (int8_t)
'''
return self.send(self.flexifunction_buffer_function_encode(target_system, target_component, func_index, func_count, data_address, data_size, data), force_mavlink1=force_mavlink1)
|
Flexifunction type and parameters for component at function index from
buffer
target_system : System ID (uint8_t)
target_component : Component ID (uint8_t)
func_index : Function index (uint16_t)
result : result of acknowledge, 0=fail, 1=good (uint16_t)
|
def flexifunction_buffer_function_ack_encode(self, target_system, target_component, func_index, result):
'''
Flexifunction type and parameters for component at function index from
buffer
target_system : System ID (uint8_t)
target_component : Component ID (uint8_t)
func_index : Function index (uint16_t)
result : result of acknowledge, 0=fail, 1=good (uint16_t)
'''
return MAVLink_flexifunction_buffer_function_ack_message(target_system, target_component, func_index, result)
|
Flexifunction type and parameters for component at function index from
buffer
target_system : System ID (uint8_t)
target_component : Component ID (uint8_t)
func_index : Function index (uint16_t)
result : result of acknowledge, 0=fail, 1=good (uint16_t)
|
def flexifunction_buffer_function_ack_send(self, target_system, target_component, func_index, result, force_mavlink1=False):
'''
Flexifunction type and parameters for component at function index from
buffer
target_system : System ID (uint8_t)
target_component : Component ID (uint8_t)
func_index : Function index (uint16_t)
result : result of acknowledge, 0=fail, 1=good (uint16_t)
'''
return self.send(self.flexifunction_buffer_function_ack_encode(target_system, target_component, func_index, result), force_mavlink1=force_mavlink1)
|
Acknowldge sucess or failure of a flexifunction command
target_system : System ID (uint8_t)
target_component : Component ID (uint8_t)
directory_type : 0=inputs, 1=outputs (uint8_t)
start_index : index of first directory entry to write (uint8_t)
count : count of directory entries to write (uint8_t)
directory_data : Settings data (int8_t)
|
def flexifunction_directory_encode(self, target_system, target_component, directory_type, start_index, count, directory_data):
'''
Acknowldge sucess or failure of a flexifunction command
target_system : System ID (uint8_t)
target_component : Component ID (uint8_t)
directory_type : 0=inputs, 1=outputs (uint8_t)
start_index : index of first directory entry to write (uint8_t)
count : count of directory entries to write (uint8_t)
directory_data : Settings data (int8_t)
'''
return MAVLink_flexifunction_directory_message(target_system, target_component, directory_type, start_index, count, directory_data)
|
Acknowldge sucess or failure of a flexifunction command
target_system : System ID (uint8_t)
target_component : Component ID (uint8_t)
directory_type : 0=inputs, 1=outputs (uint8_t)
start_index : index of first directory entry to write (uint8_t)
count : count of directory entries to write (uint8_t)
directory_data : Settings data (int8_t)
|
def flexifunction_directory_send(self, target_system, target_component, directory_type, start_index, count, directory_data, force_mavlink1=False):
'''
Acknowldge sucess or failure of a flexifunction command
target_system : System ID (uint8_t)
target_component : Component ID (uint8_t)
directory_type : 0=inputs, 1=outputs (uint8_t)
start_index : index of first directory entry to write (uint8_t)
count : count of directory entries to write (uint8_t)
directory_data : Settings data (int8_t)
'''
return self.send(self.flexifunction_directory_encode(target_system, target_component, directory_type, start_index, count, directory_data), force_mavlink1=force_mavlink1)
|
Acknowldge sucess or failure of a flexifunction command
target_system : System ID (uint8_t)
target_component : Component ID (uint8_t)
directory_type : 0=inputs, 1=outputs (uint8_t)
start_index : index of first directory entry to write (uint8_t)
count : count of directory entries to write (uint8_t)
result : result of acknowledge, 0=fail, 1=good (uint16_t)
|
def flexifunction_directory_ack_encode(self, target_system, target_component, directory_type, start_index, count, result):
'''
Acknowldge sucess or failure of a flexifunction command
target_system : System ID (uint8_t)
target_component : Component ID (uint8_t)
directory_type : 0=inputs, 1=outputs (uint8_t)
start_index : index of first directory entry to write (uint8_t)
count : count of directory entries to write (uint8_t)
result : result of acknowledge, 0=fail, 1=good (uint16_t)
'''
return MAVLink_flexifunction_directory_ack_message(target_system, target_component, directory_type, start_index, count, result)
|
Acknowldge sucess or failure of a flexifunction command
target_system : System ID (uint8_t)
target_component : Component ID (uint8_t)
directory_type : 0=inputs, 1=outputs (uint8_t)
start_index : index of first directory entry to write (uint8_t)
count : count of directory entries to write (uint8_t)
result : result of acknowledge, 0=fail, 1=good (uint16_t)
|
def flexifunction_directory_ack_send(self, target_system, target_component, directory_type, start_index, count, result, force_mavlink1=False):
'''
Acknowldge sucess or failure of a flexifunction command
target_system : System ID (uint8_t)
target_component : Component ID (uint8_t)
directory_type : 0=inputs, 1=outputs (uint8_t)
start_index : index of first directory entry to write (uint8_t)
count : count of directory entries to write (uint8_t)
result : result of acknowledge, 0=fail, 1=good (uint16_t)
'''
return self.send(self.flexifunction_directory_ack_encode(target_system, target_component, directory_type, start_index, count, result), force_mavlink1=force_mavlink1)
|
Acknowldge sucess or failure of a flexifunction command
target_system : System ID (uint8_t)
target_component : Component ID (uint8_t)
command_type : Flexifunction command type (uint8_t)
|
def flexifunction_command_send(self, target_system, target_component, command_type, force_mavlink1=False):
'''
Acknowldge sucess or failure of a flexifunction command
target_system : System ID (uint8_t)
target_component : Component ID (uint8_t)
command_type : Flexifunction command type (uint8_t)
'''
return self.send(self.flexifunction_command_encode(target_system, target_component, command_type), force_mavlink1=force_mavlink1)
|
Acknowldge sucess or failure of a flexifunction command
command_type : Command acknowledged (uint16_t)
result : result of acknowledge (uint16_t)
|
def flexifunction_command_ack_send(self, command_type, result, force_mavlink1=False):
'''
Acknowldge sucess or failure of a flexifunction command
command_type : Command acknowledged (uint16_t)
result : result of acknowledge (uint16_t)
'''
return self.send(self.flexifunction_command_ack_encode(command_type, result), force_mavlink1=force_mavlink1)
|
Backwards compatible MAVLink version of SERIAL_UDB_EXTRA - F2: Format
Part A
sue_time : Serial UDB Extra Time (uint32_t)
sue_status : Serial UDB Extra Status (uint8_t)
sue_latitude : Serial UDB Extra Latitude (int32_t)
sue_longitude : Serial UDB Extra Longitude (int32_t)
sue_altitude : Serial UDB Extra Altitude (int32_t)
sue_waypoint_index : Serial UDB Extra Waypoint Index (uint16_t)
sue_rmat0 : Serial UDB Extra Rmat 0 (int16_t)
sue_rmat1 : Serial UDB Extra Rmat 1 (int16_t)
sue_rmat2 : Serial UDB Extra Rmat 2 (int16_t)
sue_rmat3 : Serial UDB Extra Rmat 3 (int16_t)
sue_rmat4 : Serial UDB Extra Rmat 4 (int16_t)
sue_rmat5 : Serial UDB Extra Rmat 5 (int16_t)
sue_rmat6 : Serial UDB Extra Rmat 6 (int16_t)
sue_rmat7 : Serial UDB Extra Rmat 7 (int16_t)
sue_rmat8 : Serial UDB Extra Rmat 8 (int16_t)
sue_cog : Serial UDB Extra GPS Course Over Ground (uint16_t)
sue_sog : Serial UDB Extra Speed Over Ground (int16_t)
sue_cpu_load : Serial UDB Extra CPU Load (uint16_t)
sue_voltage_milis : Serial UDB Extra Voltage in MilliVolts (int16_t)
sue_air_speed_3DIMU : Serial UDB Extra 3D IMU Air Speed (uint16_t)
sue_estimated_wind_0 : Serial UDB Extra Estimated Wind 0 (int16_t)
sue_estimated_wind_1 : Serial UDB Extra Estimated Wind 1 (int16_t)
sue_estimated_wind_2 : Serial UDB Extra Estimated Wind 2 (int16_t)
sue_magFieldEarth0 : Serial UDB Extra Magnetic Field Earth 0 (int16_t)
sue_magFieldEarth1 : Serial UDB Extra Magnetic Field Earth 1 (int16_t)
sue_magFieldEarth2 : Serial UDB Extra Magnetic Field Earth 2 (int16_t)
sue_svs : Serial UDB Extra Number of Sattelites in View (int16_t)
sue_hdop : Serial UDB Extra GPS Horizontal Dilution of Precision (int16_t)
|
def serial_udb_extra_f2_a_encode(self, sue_time, sue_status, sue_latitude, sue_longitude, sue_altitude, sue_waypoint_index, sue_rmat0, sue_rmat1, sue_rmat2, sue_rmat3, sue_rmat4, sue_rmat5, sue_rmat6, sue_rmat7, sue_rmat8, sue_cog, sue_sog, sue_cpu_load, sue_voltage_milis, sue_air_speed_3DIMU, sue_estimated_wind_0, sue_estimated_wind_1, sue_estimated_wind_2, sue_magFieldEarth0, sue_magFieldEarth1, sue_magFieldEarth2, sue_svs, sue_hdop):
'''
Backwards compatible MAVLink version of SERIAL_UDB_EXTRA - F2: Format
Part A
sue_time : Serial UDB Extra Time (uint32_t)
sue_status : Serial UDB Extra Status (uint8_t)
sue_latitude : Serial UDB Extra Latitude (int32_t)
sue_longitude : Serial UDB Extra Longitude (int32_t)
sue_altitude : Serial UDB Extra Altitude (int32_t)
sue_waypoint_index : Serial UDB Extra Waypoint Index (uint16_t)
sue_rmat0 : Serial UDB Extra Rmat 0 (int16_t)
sue_rmat1 : Serial UDB Extra Rmat 1 (int16_t)
sue_rmat2 : Serial UDB Extra Rmat 2 (int16_t)
sue_rmat3 : Serial UDB Extra Rmat 3 (int16_t)
sue_rmat4 : Serial UDB Extra Rmat 4 (int16_t)
sue_rmat5 : Serial UDB Extra Rmat 5 (int16_t)
sue_rmat6 : Serial UDB Extra Rmat 6 (int16_t)
sue_rmat7 : Serial UDB Extra Rmat 7 (int16_t)
sue_rmat8 : Serial UDB Extra Rmat 8 (int16_t)
sue_cog : Serial UDB Extra GPS Course Over Ground (uint16_t)
sue_sog : Serial UDB Extra Speed Over Ground (int16_t)
sue_cpu_load : Serial UDB Extra CPU Load (uint16_t)
sue_voltage_milis : Serial UDB Extra Voltage in MilliVolts (int16_t)
sue_air_speed_3DIMU : Serial UDB Extra 3D IMU Air Speed (uint16_t)
sue_estimated_wind_0 : Serial UDB Extra Estimated Wind 0 (int16_t)
sue_estimated_wind_1 : Serial UDB Extra Estimated Wind 1 (int16_t)
sue_estimated_wind_2 : Serial UDB Extra Estimated Wind 2 (int16_t)
sue_magFieldEarth0 : Serial UDB Extra Magnetic Field Earth 0 (int16_t)
sue_magFieldEarth1 : Serial UDB Extra Magnetic Field Earth 1 (int16_t)
sue_magFieldEarth2 : Serial UDB Extra Magnetic Field Earth 2 (int16_t)
sue_svs : Serial UDB Extra Number of Sattelites in View (int16_t)
sue_hdop : Serial UDB Extra GPS Horizontal Dilution of Precision (int16_t)
'''
return MAVLink_serial_udb_extra_f2_a_message(sue_time, sue_status, sue_latitude, sue_longitude, sue_altitude, sue_waypoint_index, sue_rmat0, sue_rmat1, sue_rmat2, sue_rmat3, sue_rmat4, sue_rmat5, sue_rmat6, sue_rmat7, sue_rmat8, sue_cog, sue_sog, sue_cpu_load, sue_voltage_milis, sue_air_speed_3DIMU, sue_estimated_wind_0, sue_estimated_wind_1, sue_estimated_wind_2, sue_magFieldEarth0, sue_magFieldEarth1, sue_magFieldEarth2, sue_svs, sue_hdop)
|
Backwards compatible version of SERIAL_UDB_EXTRA - F2: Part B
sue_time : Serial UDB Extra Time (uint32_t)
sue_pwm_input_1 : Serial UDB Extra PWM Input Channel 1 (int16_t)
sue_pwm_input_2 : Serial UDB Extra PWM Input Channel 2 (int16_t)
sue_pwm_input_3 : Serial UDB Extra PWM Input Channel 3 (int16_t)
sue_pwm_input_4 : Serial UDB Extra PWM Input Channel 4 (int16_t)
sue_pwm_input_5 : Serial UDB Extra PWM Input Channel 5 (int16_t)
sue_pwm_input_6 : Serial UDB Extra PWM Input Channel 6 (int16_t)
sue_pwm_input_7 : Serial UDB Extra PWM Input Channel 7 (int16_t)
sue_pwm_input_8 : Serial UDB Extra PWM Input Channel 8 (int16_t)
sue_pwm_input_9 : Serial UDB Extra PWM Input Channel 9 (int16_t)
sue_pwm_input_10 : Serial UDB Extra PWM Input Channel 10 (int16_t)
sue_pwm_output_1 : Serial UDB Extra PWM Output Channel 1 (int16_t)
sue_pwm_output_2 : Serial UDB Extra PWM Output Channel 2 (int16_t)
sue_pwm_output_3 : Serial UDB Extra PWM Output Channel 3 (int16_t)
sue_pwm_output_4 : Serial UDB Extra PWM Output Channel 4 (int16_t)
sue_pwm_output_5 : Serial UDB Extra PWM Output Channel 5 (int16_t)
sue_pwm_output_6 : Serial UDB Extra PWM Output Channel 6 (int16_t)
sue_pwm_output_7 : Serial UDB Extra PWM Output Channel 7 (int16_t)
sue_pwm_output_8 : Serial UDB Extra PWM Output Channel 8 (int16_t)
sue_pwm_output_9 : Serial UDB Extra PWM Output Channel 9 (int16_t)
sue_pwm_output_10 : Serial UDB Extra PWM Output Channel 10 (int16_t)
sue_imu_location_x : Serial UDB Extra IMU Location X (int16_t)
sue_imu_location_y : Serial UDB Extra IMU Location Y (int16_t)
sue_imu_location_z : Serial UDB Extra IMU Location Z (int16_t)
sue_flags : Serial UDB Extra Status Flags (uint32_t)
sue_osc_fails : Serial UDB Extra Oscillator Failure Count (int16_t)
sue_imu_velocity_x : Serial UDB Extra IMU Velocity X (int16_t)
sue_imu_velocity_y : Serial UDB Extra IMU Velocity Y (int16_t)
sue_imu_velocity_z : Serial UDB Extra IMU Velocity Z (int16_t)
sue_waypoint_goal_x : Serial UDB Extra Current Waypoint Goal X (int16_t)
sue_waypoint_goal_y : Serial UDB Extra Current Waypoint Goal Y (int16_t)
sue_waypoint_goal_z : Serial UDB Extra Current Waypoint Goal Z (int16_t)
sue_memory_stack_free : Serial UDB Extra Stack Memory Free (int16_t)
|
def serial_udb_extra_f2_b_encode(self, sue_time, sue_pwm_input_1, sue_pwm_input_2, sue_pwm_input_3, sue_pwm_input_4, sue_pwm_input_5, sue_pwm_input_6, sue_pwm_input_7, sue_pwm_input_8, sue_pwm_input_9, sue_pwm_input_10, sue_pwm_output_1, sue_pwm_output_2, sue_pwm_output_3, sue_pwm_output_4, sue_pwm_output_5, sue_pwm_output_6, sue_pwm_output_7, sue_pwm_output_8, sue_pwm_output_9, sue_pwm_output_10, sue_imu_location_x, sue_imu_location_y, sue_imu_location_z, sue_flags, sue_osc_fails, sue_imu_velocity_x, sue_imu_velocity_y, sue_imu_velocity_z, sue_waypoint_goal_x, sue_waypoint_goal_y, sue_waypoint_goal_z, sue_memory_stack_free):
'''
Backwards compatible version of SERIAL_UDB_EXTRA - F2: Part B
sue_time : Serial UDB Extra Time (uint32_t)
sue_pwm_input_1 : Serial UDB Extra PWM Input Channel 1 (int16_t)
sue_pwm_input_2 : Serial UDB Extra PWM Input Channel 2 (int16_t)
sue_pwm_input_3 : Serial UDB Extra PWM Input Channel 3 (int16_t)
sue_pwm_input_4 : Serial UDB Extra PWM Input Channel 4 (int16_t)
sue_pwm_input_5 : Serial UDB Extra PWM Input Channel 5 (int16_t)
sue_pwm_input_6 : Serial UDB Extra PWM Input Channel 6 (int16_t)
sue_pwm_input_7 : Serial UDB Extra PWM Input Channel 7 (int16_t)
sue_pwm_input_8 : Serial UDB Extra PWM Input Channel 8 (int16_t)
sue_pwm_input_9 : Serial UDB Extra PWM Input Channel 9 (int16_t)
sue_pwm_input_10 : Serial UDB Extra PWM Input Channel 10 (int16_t)
sue_pwm_output_1 : Serial UDB Extra PWM Output Channel 1 (int16_t)
sue_pwm_output_2 : Serial UDB Extra PWM Output Channel 2 (int16_t)
sue_pwm_output_3 : Serial UDB Extra PWM Output Channel 3 (int16_t)
sue_pwm_output_4 : Serial UDB Extra PWM Output Channel 4 (int16_t)
sue_pwm_output_5 : Serial UDB Extra PWM Output Channel 5 (int16_t)
sue_pwm_output_6 : Serial UDB Extra PWM Output Channel 6 (int16_t)
sue_pwm_output_7 : Serial UDB Extra PWM Output Channel 7 (int16_t)
sue_pwm_output_8 : Serial UDB Extra PWM Output Channel 8 (int16_t)
sue_pwm_output_9 : Serial UDB Extra PWM Output Channel 9 (int16_t)
sue_pwm_output_10 : Serial UDB Extra PWM Output Channel 10 (int16_t)
sue_imu_location_x : Serial UDB Extra IMU Location X (int16_t)
sue_imu_location_y : Serial UDB Extra IMU Location Y (int16_t)
sue_imu_location_z : Serial UDB Extra IMU Location Z (int16_t)
sue_flags : Serial UDB Extra Status Flags (uint32_t)
sue_osc_fails : Serial UDB Extra Oscillator Failure Count (int16_t)
sue_imu_velocity_x : Serial UDB Extra IMU Velocity X (int16_t)
sue_imu_velocity_y : Serial UDB Extra IMU Velocity Y (int16_t)
sue_imu_velocity_z : Serial UDB Extra IMU Velocity Z (int16_t)
sue_waypoint_goal_x : Serial UDB Extra Current Waypoint Goal X (int16_t)
sue_waypoint_goal_y : Serial UDB Extra Current Waypoint Goal Y (int16_t)
sue_waypoint_goal_z : Serial UDB Extra Current Waypoint Goal Z (int16_t)
sue_memory_stack_free : Serial UDB Extra Stack Memory Free (int16_t)
'''
return MAVLink_serial_udb_extra_f2_b_message(sue_time, sue_pwm_input_1, sue_pwm_input_2, sue_pwm_input_3, sue_pwm_input_4, sue_pwm_input_5, sue_pwm_input_6, sue_pwm_input_7, sue_pwm_input_8, sue_pwm_input_9, sue_pwm_input_10, sue_pwm_output_1, sue_pwm_output_2, sue_pwm_output_3, sue_pwm_output_4, sue_pwm_output_5, sue_pwm_output_6, sue_pwm_output_7, sue_pwm_output_8, sue_pwm_output_9, sue_pwm_output_10, sue_imu_location_x, sue_imu_location_y, sue_imu_location_z, sue_flags, sue_osc_fails, sue_imu_velocity_x, sue_imu_velocity_y, sue_imu_velocity_z, sue_waypoint_goal_x, sue_waypoint_goal_y, sue_waypoint_goal_z, sue_memory_stack_free)
|
Backwards compatible version of SERIAL_UDB_EXTRA F4: format
sue_ROLL_STABILIZATION_AILERONS : Serial UDB Extra Roll Stabilization with Ailerons Enabled (uint8_t)
sue_ROLL_STABILIZATION_RUDDER : Serial UDB Extra Roll Stabilization with Rudder Enabled (uint8_t)
sue_PITCH_STABILIZATION : Serial UDB Extra Pitch Stabilization Enabled (uint8_t)
sue_YAW_STABILIZATION_RUDDER : Serial UDB Extra Yaw Stabilization using Rudder Enabled (uint8_t)
sue_YAW_STABILIZATION_AILERON : Serial UDB Extra Yaw Stabilization using Ailerons Enabled (uint8_t)
sue_AILERON_NAVIGATION : Serial UDB Extra Navigation with Ailerons Enabled (uint8_t)
sue_RUDDER_NAVIGATION : Serial UDB Extra Navigation with Rudder Enabled (uint8_t)
sue_ALTITUDEHOLD_STABILIZED : Serial UDB Extra Type of Alitude Hold when in Stabilized Mode (uint8_t)
sue_ALTITUDEHOLD_WAYPOINT : Serial UDB Extra Type of Alitude Hold when in Waypoint Mode (uint8_t)
sue_RACING_MODE : Serial UDB Extra Firmware racing mode enabled (uint8_t)
|
def serial_udb_extra_f4_encode(self, sue_ROLL_STABILIZATION_AILERONS, sue_ROLL_STABILIZATION_RUDDER, sue_PITCH_STABILIZATION, sue_YAW_STABILIZATION_RUDDER, sue_YAW_STABILIZATION_AILERON, sue_AILERON_NAVIGATION, sue_RUDDER_NAVIGATION, sue_ALTITUDEHOLD_STABILIZED, sue_ALTITUDEHOLD_WAYPOINT, sue_RACING_MODE):
'''
Backwards compatible version of SERIAL_UDB_EXTRA F4: format
sue_ROLL_STABILIZATION_AILERONS : Serial UDB Extra Roll Stabilization with Ailerons Enabled (uint8_t)
sue_ROLL_STABILIZATION_RUDDER : Serial UDB Extra Roll Stabilization with Rudder Enabled (uint8_t)
sue_PITCH_STABILIZATION : Serial UDB Extra Pitch Stabilization Enabled (uint8_t)
sue_YAW_STABILIZATION_RUDDER : Serial UDB Extra Yaw Stabilization using Rudder Enabled (uint8_t)
sue_YAW_STABILIZATION_AILERON : Serial UDB Extra Yaw Stabilization using Ailerons Enabled (uint8_t)
sue_AILERON_NAVIGATION : Serial UDB Extra Navigation with Ailerons Enabled (uint8_t)
sue_RUDDER_NAVIGATION : Serial UDB Extra Navigation with Rudder Enabled (uint8_t)
sue_ALTITUDEHOLD_STABILIZED : Serial UDB Extra Type of Alitude Hold when in Stabilized Mode (uint8_t)
sue_ALTITUDEHOLD_WAYPOINT : Serial UDB Extra Type of Alitude Hold when in Waypoint Mode (uint8_t)
sue_RACING_MODE : Serial UDB Extra Firmware racing mode enabled (uint8_t)
'''
return MAVLink_serial_udb_extra_f4_message(sue_ROLL_STABILIZATION_AILERONS, sue_ROLL_STABILIZATION_RUDDER, sue_PITCH_STABILIZATION, sue_YAW_STABILIZATION_RUDDER, sue_YAW_STABILIZATION_AILERON, sue_AILERON_NAVIGATION, sue_RUDDER_NAVIGATION, sue_ALTITUDEHOLD_STABILIZED, sue_ALTITUDEHOLD_WAYPOINT, sue_RACING_MODE)
|
Backwards compatible version of SERIAL_UDB_EXTRA F4: format
sue_ROLL_STABILIZATION_AILERONS : Serial UDB Extra Roll Stabilization with Ailerons Enabled (uint8_t)
sue_ROLL_STABILIZATION_RUDDER : Serial UDB Extra Roll Stabilization with Rudder Enabled (uint8_t)
sue_PITCH_STABILIZATION : Serial UDB Extra Pitch Stabilization Enabled (uint8_t)
sue_YAW_STABILIZATION_RUDDER : Serial UDB Extra Yaw Stabilization using Rudder Enabled (uint8_t)
sue_YAW_STABILIZATION_AILERON : Serial UDB Extra Yaw Stabilization using Ailerons Enabled (uint8_t)
sue_AILERON_NAVIGATION : Serial UDB Extra Navigation with Ailerons Enabled (uint8_t)
sue_RUDDER_NAVIGATION : Serial UDB Extra Navigation with Rudder Enabled (uint8_t)
sue_ALTITUDEHOLD_STABILIZED : Serial UDB Extra Type of Alitude Hold when in Stabilized Mode (uint8_t)
sue_ALTITUDEHOLD_WAYPOINT : Serial UDB Extra Type of Alitude Hold when in Waypoint Mode (uint8_t)
sue_RACING_MODE : Serial UDB Extra Firmware racing mode enabled (uint8_t)
|
def serial_udb_extra_f4_send(self, sue_ROLL_STABILIZATION_AILERONS, sue_ROLL_STABILIZATION_RUDDER, sue_PITCH_STABILIZATION, sue_YAW_STABILIZATION_RUDDER, sue_YAW_STABILIZATION_AILERON, sue_AILERON_NAVIGATION, sue_RUDDER_NAVIGATION, sue_ALTITUDEHOLD_STABILIZED, sue_ALTITUDEHOLD_WAYPOINT, sue_RACING_MODE, force_mavlink1=False):
'''
Backwards compatible version of SERIAL_UDB_EXTRA F4: format
sue_ROLL_STABILIZATION_AILERONS : Serial UDB Extra Roll Stabilization with Ailerons Enabled (uint8_t)
sue_ROLL_STABILIZATION_RUDDER : Serial UDB Extra Roll Stabilization with Rudder Enabled (uint8_t)
sue_PITCH_STABILIZATION : Serial UDB Extra Pitch Stabilization Enabled (uint8_t)
sue_YAW_STABILIZATION_RUDDER : Serial UDB Extra Yaw Stabilization using Rudder Enabled (uint8_t)
sue_YAW_STABILIZATION_AILERON : Serial UDB Extra Yaw Stabilization using Ailerons Enabled (uint8_t)
sue_AILERON_NAVIGATION : Serial UDB Extra Navigation with Ailerons Enabled (uint8_t)
sue_RUDDER_NAVIGATION : Serial UDB Extra Navigation with Rudder Enabled (uint8_t)
sue_ALTITUDEHOLD_STABILIZED : Serial UDB Extra Type of Alitude Hold when in Stabilized Mode (uint8_t)
sue_ALTITUDEHOLD_WAYPOINT : Serial UDB Extra Type of Alitude Hold when in Waypoint Mode (uint8_t)
sue_RACING_MODE : Serial UDB Extra Firmware racing mode enabled (uint8_t)
'''
return self.send(self.serial_udb_extra_f4_encode(sue_ROLL_STABILIZATION_AILERONS, sue_ROLL_STABILIZATION_RUDDER, sue_PITCH_STABILIZATION, sue_YAW_STABILIZATION_RUDDER, sue_YAW_STABILIZATION_AILERON, sue_AILERON_NAVIGATION, sue_RUDDER_NAVIGATION, sue_ALTITUDEHOLD_STABILIZED, sue_ALTITUDEHOLD_WAYPOINT, sue_RACING_MODE), force_mavlink1=force_mavlink1)
|
Backwards compatible version of SERIAL_UDB_EXTRA F5: format
sue_YAWKP_AILERON : Serial UDB YAWKP_AILERON Gain for Proporional control of navigation (float)
sue_YAWKD_AILERON : Serial UDB YAWKD_AILERON Gain for Rate control of navigation (float)
sue_ROLLKP : Serial UDB Extra ROLLKP Gain for Proportional control of roll stabilization (float)
sue_ROLLKD : Serial UDB Extra ROLLKD Gain for Rate control of roll stabilization (float)
sue_YAW_STABILIZATION_AILERON : YAW_STABILIZATION_AILERON Proportional control (float)
sue_AILERON_BOOST : Gain For Boosting Manual Aileron control When Plane Stabilized (float)
|
def serial_udb_extra_f5_encode(self, sue_YAWKP_AILERON, sue_YAWKD_AILERON, sue_ROLLKP, sue_ROLLKD, sue_YAW_STABILIZATION_AILERON, sue_AILERON_BOOST):
'''
Backwards compatible version of SERIAL_UDB_EXTRA F5: format
sue_YAWKP_AILERON : Serial UDB YAWKP_AILERON Gain for Proporional control of navigation (float)
sue_YAWKD_AILERON : Serial UDB YAWKD_AILERON Gain for Rate control of navigation (float)
sue_ROLLKP : Serial UDB Extra ROLLKP Gain for Proportional control of roll stabilization (float)
sue_ROLLKD : Serial UDB Extra ROLLKD Gain for Rate control of roll stabilization (float)
sue_YAW_STABILIZATION_AILERON : YAW_STABILIZATION_AILERON Proportional control (float)
sue_AILERON_BOOST : Gain For Boosting Manual Aileron control When Plane Stabilized (float)
'''
return MAVLink_serial_udb_extra_f5_message(sue_YAWKP_AILERON, sue_YAWKD_AILERON, sue_ROLLKP, sue_ROLLKD, sue_YAW_STABILIZATION_AILERON, sue_AILERON_BOOST)
|
Backwards compatible version of SERIAL_UDB_EXTRA F5: format
sue_YAWKP_AILERON : Serial UDB YAWKP_AILERON Gain for Proporional control of navigation (float)
sue_YAWKD_AILERON : Serial UDB YAWKD_AILERON Gain for Rate control of navigation (float)
sue_ROLLKP : Serial UDB Extra ROLLKP Gain for Proportional control of roll stabilization (float)
sue_ROLLKD : Serial UDB Extra ROLLKD Gain for Rate control of roll stabilization (float)
sue_YAW_STABILIZATION_AILERON : YAW_STABILIZATION_AILERON Proportional control (float)
sue_AILERON_BOOST : Gain For Boosting Manual Aileron control When Plane Stabilized (float)
|
def serial_udb_extra_f5_send(self, sue_YAWKP_AILERON, sue_YAWKD_AILERON, sue_ROLLKP, sue_ROLLKD, sue_YAW_STABILIZATION_AILERON, sue_AILERON_BOOST, force_mavlink1=False):
'''
Backwards compatible version of SERIAL_UDB_EXTRA F5: format
sue_YAWKP_AILERON : Serial UDB YAWKP_AILERON Gain for Proporional control of navigation (float)
sue_YAWKD_AILERON : Serial UDB YAWKD_AILERON Gain for Rate control of navigation (float)
sue_ROLLKP : Serial UDB Extra ROLLKP Gain for Proportional control of roll stabilization (float)
sue_ROLLKD : Serial UDB Extra ROLLKD Gain for Rate control of roll stabilization (float)
sue_YAW_STABILIZATION_AILERON : YAW_STABILIZATION_AILERON Proportional control (float)
sue_AILERON_BOOST : Gain For Boosting Manual Aileron control When Plane Stabilized (float)
'''
return self.send(self.serial_udb_extra_f5_encode(sue_YAWKP_AILERON, sue_YAWKD_AILERON, sue_ROLLKP, sue_ROLLKD, sue_YAW_STABILIZATION_AILERON, sue_AILERON_BOOST), force_mavlink1=force_mavlink1)
|
Backwards compatible version of SERIAL_UDB_EXTRA F6: format
sue_PITCHGAIN : Serial UDB Extra PITCHGAIN Proportional Control (float)
sue_PITCHKD : Serial UDB Extra Pitch Rate Control (float)
sue_RUDDER_ELEV_MIX : Serial UDB Extra Rudder to Elevator Mix (float)
sue_ROLL_ELEV_MIX : Serial UDB Extra Roll to Elevator Mix (float)
sue_ELEVATOR_BOOST : Gain For Boosting Manual Elevator control When Plane Stabilized (float)
|
def serial_udb_extra_f6_encode(self, sue_PITCHGAIN, sue_PITCHKD, sue_RUDDER_ELEV_MIX, sue_ROLL_ELEV_MIX, sue_ELEVATOR_BOOST):
'''
Backwards compatible version of SERIAL_UDB_EXTRA F6: format
sue_PITCHGAIN : Serial UDB Extra PITCHGAIN Proportional Control (float)
sue_PITCHKD : Serial UDB Extra Pitch Rate Control (float)
sue_RUDDER_ELEV_MIX : Serial UDB Extra Rudder to Elevator Mix (float)
sue_ROLL_ELEV_MIX : Serial UDB Extra Roll to Elevator Mix (float)
sue_ELEVATOR_BOOST : Gain For Boosting Manual Elevator control When Plane Stabilized (float)
'''
return MAVLink_serial_udb_extra_f6_message(sue_PITCHGAIN, sue_PITCHKD, sue_RUDDER_ELEV_MIX, sue_ROLL_ELEV_MIX, sue_ELEVATOR_BOOST)
|
Backwards compatible version of SERIAL_UDB_EXTRA F6: format
sue_PITCHGAIN : Serial UDB Extra PITCHGAIN Proportional Control (float)
sue_PITCHKD : Serial UDB Extra Pitch Rate Control (float)
sue_RUDDER_ELEV_MIX : Serial UDB Extra Rudder to Elevator Mix (float)
sue_ROLL_ELEV_MIX : Serial UDB Extra Roll to Elevator Mix (float)
sue_ELEVATOR_BOOST : Gain For Boosting Manual Elevator control When Plane Stabilized (float)
|
def serial_udb_extra_f6_send(self, sue_PITCHGAIN, sue_PITCHKD, sue_RUDDER_ELEV_MIX, sue_ROLL_ELEV_MIX, sue_ELEVATOR_BOOST, force_mavlink1=False):
'''
Backwards compatible version of SERIAL_UDB_EXTRA F6: format
sue_PITCHGAIN : Serial UDB Extra PITCHGAIN Proportional Control (float)
sue_PITCHKD : Serial UDB Extra Pitch Rate Control (float)
sue_RUDDER_ELEV_MIX : Serial UDB Extra Rudder to Elevator Mix (float)
sue_ROLL_ELEV_MIX : Serial UDB Extra Roll to Elevator Mix (float)
sue_ELEVATOR_BOOST : Gain For Boosting Manual Elevator control When Plane Stabilized (float)
'''
return self.send(self.serial_udb_extra_f6_encode(sue_PITCHGAIN, sue_PITCHKD, sue_RUDDER_ELEV_MIX, sue_ROLL_ELEV_MIX, sue_ELEVATOR_BOOST), force_mavlink1=force_mavlink1)
|
Backwards compatible version of SERIAL_UDB_EXTRA F7: format
sue_YAWKP_RUDDER : Serial UDB YAWKP_RUDDER Gain for Proporional control of navigation (float)
sue_YAWKD_RUDDER : Serial UDB YAWKD_RUDDER Gain for Rate control of navigation (float)
sue_ROLLKP_RUDDER : Serial UDB Extra ROLLKP_RUDDER Gain for Proportional control of roll stabilization (float)
sue_ROLLKD_RUDDER : Serial UDB Extra ROLLKD_RUDDER Gain for Rate control of roll stabilization (float)
sue_RUDDER_BOOST : SERIAL UDB EXTRA Rudder Boost Gain to Manual Control when stabilized (float)
sue_RTL_PITCH_DOWN : Serial UDB Extra Return To Landing - Angle to Pitch Plane Down (float)
|
def serial_udb_extra_f7_encode(self, sue_YAWKP_RUDDER, sue_YAWKD_RUDDER, sue_ROLLKP_RUDDER, sue_ROLLKD_RUDDER, sue_RUDDER_BOOST, sue_RTL_PITCH_DOWN):
'''
Backwards compatible version of SERIAL_UDB_EXTRA F7: format
sue_YAWKP_RUDDER : Serial UDB YAWKP_RUDDER Gain for Proporional control of navigation (float)
sue_YAWKD_RUDDER : Serial UDB YAWKD_RUDDER Gain for Rate control of navigation (float)
sue_ROLLKP_RUDDER : Serial UDB Extra ROLLKP_RUDDER Gain for Proportional control of roll stabilization (float)
sue_ROLLKD_RUDDER : Serial UDB Extra ROLLKD_RUDDER Gain for Rate control of roll stabilization (float)
sue_RUDDER_BOOST : SERIAL UDB EXTRA Rudder Boost Gain to Manual Control when stabilized (float)
sue_RTL_PITCH_DOWN : Serial UDB Extra Return To Landing - Angle to Pitch Plane Down (float)
'''
return MAVLink_serial_udb_extra_f7_message(sue_YAWKP_RUDDER, sue_YAWKD_RUDDER, sue_ROLLKP_RUDDER, sue_ROLLKD_RUDDER, sue_RUDDER_BOOST, sue_RTL_PITCH_DOWN)
|
Backwards compatible version of SERIAL_UDB_EXTRA F7: format
sue_YAWKP_RUDDER : Serial UDB YAWKP_RUDDER Gain for Proporional control of navigation (float)
sue_YAWKD_RUDDER : Serial UDB YAWKD_RUDDER Gain for Rate control of navigation (float)
sue_ROLLKP_RUDDER : Serial UDB Extra ROLLKP_RUDDER Gain for Proportional control of roll stabilization (float)
sue_ROLLKD_RUDDER : Serial UDB Extra ROLLKD_RUDDER Gain for Rate control of roll stabilization (float)
sue_RUDDER_BOOST : SERIAL UDB EXTRA Rudder Boost Gain to Manual Control when stabilized (float)
sue_RTL_PITCH_DOWN : Serial UDB Extra Return To Landing - Angle to Pitch Plane Down (float)
|
def serial_udb_extra_f7_send(self, sue_YAWKP_RUDDER, sue_YAWKD_RUDDER, sue_ROLLKP_RUDDER, sue_ROLLKD_RUDDER, sue_RUDDER_BOOST, sue_RTL_PITCH_DOWN, force_mavlink1=False):
'''
Backwards compatible version of SERIAL_UDB_EXTRA F7: format
sue_YAWKP_RUDDER : Serial UDB YAWKP_RUDDER Gain for Proporional control of navigation (float)
sue_YAWKD_RUDDER : Serial UDB YAWKD_RUDDER Gain for Rate control of navigation (float)
sue_ROLLKP_RUDDER : Serial UDB Extra ROLLKP_RUDDER Gain for Proportional control of roll stabilization (float)
sue_ROLLKD_RUDDER : Serial UDB Extra ROLLKD_RUDDER Gain for Rate control of roll stabilization (float)
sue_RUDDER_BOOST : SERIAL UDB EXTRA Rudder Boost Gain to Manual Control when stabilized (float)
sue_RTL_PITCH_DOWN : Serial UDB Extra Return To Landing - Angle to Pitch Plane Down (float)
'''
return self.send(self.serial_udb_extra_f7_encode(sue_YAWKP_RUDDER, sue_YAWKD_RUDDER, sue_ROLLKP_RUDDER, sue_ROLLKD_RUDDER, sue_RUDDER_BOOST, sue_RTL_PITCH_DOWN), force_mavlink1=force_mavlink1)
|
Backwards compatible version of SERIAL_UDB_EXTRA F8: format
sue_HEIGHT_TARGET_MAX : Serial UDB Extra HEIGHT_TARGET_MAX (float)
sue_HEIGHT_TARGET_MIN : Serial UDB Extra HEIGHT_TARGET_MIN (float)
sue_ALT_HOLD_THROTTLE_MIN : Serial UDB Extra ALT_HOLD_THROTTLE_MIN (float)
sue_ALT_HOLD_THROTTLE_MAX : Serial UDB Extra ALT_HOLD_THROTTLE_MAX (float)
sue_ALT_HOLD_PITCH_MIN : Serial UDB Extra ALT_HOLD_PITCH_MIN (float)
sue_ALT_HOLD_PITCH_MAX : Serial UDB Extra ALT_HOLD_PITCH_MAX (float)
sue_ALT_HOLD_PITCH_HIGH : Serial UDB Extra ALT_HOLD_PITCH_HIGH (float)
|
def serial_udb_extra_f8_encode(self, sue_HEIGHT_TARGET_MAX, sue_HEIGHT_TARGET_MIN, sue_ALT_HOLD_THROTTLE_MIN, sue_ALT_HOLD_THROTTLE_MAX, sue_ALT_HOLD_PITCH_MIN, sue_ALT_HOLD_PITCH_MAX, sue_ALT_HOLD_PITCH_HIGH):
'''
Backwards compatible version of SERIAL_UDB_EXTRA F8: format
sue_HEIGHT_TARGET_MAX : Serial UDB Extra HEIGHT_TARGET_MAX (float)
sue_HEIGHT_TARGET_MIN : Serial UDB Extra HEIGHT_TARGET_MIN (float)
sue_ALT_HOLD_THROTTLE_MIN : Serial UDB Extra ALT_HOLD_THROTTLE_MIN (float)
sue_ALT_HOLD_THROTTLE_MAX : Serial UDB Extra ALT_HOLD_THROTTLE_MAX (float)
sue_ALT_HOLD_PITCH_MIN : Serial UDB Extra ALT_HOLD_PITCH_MIN (float)
sue_ALT_HOLD_PITCH_MAX : Serial UDB Extra ALT_HOLD_PITCH_MAX (float)
sue_ALT_HOLD_PITCH_HIGH : Serial UDB Extra ALT_HOLD_PITCH_HIGH (float)
'''
return MAVLink_serial_udb_extra_f8_message(sue_HEIGHT_TARGET_MAX, sue_HEIGHT_TARGET_MIN, sue_ALT_HOLD_THROTTLE_MIN, sue_ALT_HOLD_THROTTLE_MAX, sue_ALT_HOLD_PITCH_MIN, sue_ALT_HOLD_PITCH_MAX, sue_ALT_HOLD_PITCH_HIGH)
|
Backwards compatible version of SERIAL_UDB_EXTRA F8: format
sue_HEIGHT_TARGET_MAX : Serial UDB Extra HEIGHT_TARGET_MAX (float)
sue_HEIGHT_TARGET_MIN : Serial UDB Extra HEIGHT_TARGET_MIN (float)
sue_ALT_HOLD_THROTTLE_MIN : Serial UDB Extra ALT_HOLD_THROTTLE_MIN (float)
sue_ALT_HOLD_THROTTLE_MAX : Serial UDB Extra ALT_HOLD_THROTTLE_MAX (float)
sue_ALT_HOLD_PITCH_MIN : Serial UDB Extra ALT_HOLD_PITCH_MIN (float)
sue_ALT_HOLD_PITCH_MAX : Serial UDB Extra ALT_HOLD_PITCH_MAX (float)
sue_ALT_HOLD_PITCH_HIGH : Serial UDB Extra ALT_HOLD_PITCH_HIGH (float)
|
def serial_udb_extra_f8_send(self, sue_HEIGHT_TARGET_MAX, sue_HEIGHT_TARGET_MIN, sue_ALT_HOLD_THROTTLE_MIN, sue_ALT_HOLD_THROTTLE_MAX, sue_ALT_HOLD_PITCH_MIN, sue_ALT_HOLD_PITCH_MAX, sue_ALT_HOLD_PITCH_HIGH, force_mavlink1=False):
'''
Backwards compatible version of SERIAL_UDB_EXTRA F8: format
sue_HEIGHT_TARGET_MAX : Serial UDB Extra HEIGHT_TARGET_MAX (float)
sue_HEIGHT_TARGET_MIN : Serial UDB Extra HEIGHT_TARGET_MIN (float)
sue_ALT_HOLD_THROTTLE_MIN : Serial UDB Extra ALT_HOLD_THROTTLE_MIN (float)
sue_ALT_HOLD_THROTTLE_MAX : Serial UDB Extra ALT_HOLD_THROTTLE_MAX (float)
sue_ALT_HOLD_PITCH_MIN : Serial UDB Extra ALT_HOLD_PITCH_MIN (float)
sue_ALT_HOLD_PITCH_MAX : Serial UDB Extra ALT_HOLD_PITCH_MAX (float)
sue_ALT_HOLD_PITCH_HIGH : Serial UDB Extra ALT_HOLD_PITCH_HIGH (float)
'''
return self.send(self.serial_udb_extra_f8_encode(sue_HEIGHT_TARGET_MAX, sue_HEIGHT_TARGET_MIN, sue_ALT_HOLD_THROTTLE_MIN, sue_ALT_HOLD_THROTTLE_MAX, sue_ALT_HOLD_PITCH_MIN, sue_ALT_HOLD_PITCH_MAX, sue_ALT_HOLD_PITCH_HIGH), force_mavlink1=force_mavlink1)
|
Backwards compatible version of SERIAL_UDB_EXTRA F13: format
sue_week_no : Serial UDB Extra GPS Week Number (int16_t)
sue_lat_origin : Serial UDB Extra MP Origin Latitude (int32_t)
sue_lon_origin : Serial UDB Extra MP Origin Longitude (int32_t)
sue_alt_origin : Serial UDB Extra MP Origin Altitude Above Sea Level (int32_t)
|
def serial_udb_extra_f13_encode(self, sue_week_no, sue_lat_origin, sue_lon_origin, sue_alt_origin):
'''
Backwards compatible version of SERIAL_UDB_EXTRA F13: format
sue_week_no : Serial UDB Extra GPS Week Number (int16_t)
sue_lat_origin : Serial UDB Extra MP Origin Latitude (int32_t)
sue_lon_origin : Serial UDB Extra MP Origin Longitude (int32_t)
sue_alt_origin : Serial UDB Extra MP Origin Altitude Above Sea Level (int32_t)
'''
return MAVLink_serial_udb_extra_f13_message(sue_week_no, sue_lat_origin, sue_lon_origin, sue_alt_origin)
|
Backwards compatible version of SERIAL_UDB_EXTRA F13: format
sue_week_no : Serial UDB Extra GPS Week Number (int16_t)
sue_lat_origin : Serial UDB Extra MP Origin Latitude (int32_t)
sue_lon_origin : Serial UDB Extra MP Origin Longitude (int32_t)
sue_alt_origin : Serial UDB Extra MP Origin Altitude Above Sea Level (int32_t)
|
def serial_udb_extra_f13_send(self, sue_week_no, sue_lat_origin, sue_lon_origin, sue_alt_origin, force_mavlink1=False):
'''
Backwards compatible version of SERIAL_UDB_EXTRA F13: format
sue_week_no : Serial UDB Extra GPS Week Number (int16_t)
sue_lat_origin : Serial UDB Extra MP Origin Latitude (int32_t)
sue_lon_origin : Serial UDB Extra MP Origin Longitude (int32_t)
sue_alt_origin : Serial UDB Extra MP Origin Altitude Above Sea Level (int32_t)
'''
return self.send(self.serial_udb_extra_f13_encode(sue_week_no, sue_lat_origin, sue_lon_origin, sue_alt_origin), force_mavlink1=force_mavlink1)
|
Backwards compatible version of SERIAL_UDB_EXTRA F14: format
sue_WIND_ESTIMATION : Serial UDB Extra Wind Estimation Enabled (uint8_t)
sue_GPS_TYPE : Serial UDB Extra Type of GPS Unit (uint8_t)
sue_DR : Serial UDB Extra Dead Reckoning Enabled (uint8_t)
sue_BOARD_TYPE : Serial UDB Extra Type of UDB Hardware (uint8_t)
sue_AIRFRAME : Serial UDB Extra Type of Airframe (uint8_t)
sue_RCON : Serial UDB Extra Reboot Regitster of DSPIC (int16_t)
sue_TRAP_FLAGS : Serial UDB Extra Last dspic Trap Flags (int16_t)
sue_TRAP_SOURCE : Serial UDB Extra Type Program Address of Last Trap (uint32_t)
sue_osc_fail_count : Serial UDB Extra Number of Ocillator Failures (int16_t)
sue_CLOCK_CONFIG : Serial UDB Extra UDB Internal Clock Configuration (uint8_t)
sue_FLIGHT_PLAN_TYPE : Serial UDB Extra Type of Flight Plan (uint8_t)
|
def serial_udb_extra_f14_encode(self, sue_WIND_ESTIMATION, sue_GPS_TYPE, sue_DR, sue_BOARD_TYPE, sue_AIRFRAME, sue_RCON, sue_TRAP_FLAGS, sue_TRAP_SOURCE, sue_osc_fail_count, sue_CLOCK_CONFIG, sue_FLIGHT_PLAN_TYPE):
'''
Backwards compatible version of SERIAL_UDB_EXTRA F14: format
sue_WIND_ESTIMATION : Serial UDB Extra Wind Estimation Enabled (uint8_t)
sue_GPS_TYPE : Serial UDB Extra Type of GPS Unit (uint8_t)
sue_DR : Serial UDB Extra Dead Reckoning Enabled (uint8_t)
sue_BOARD_TYPE : Serial UDB Extra Type of UDB Hardware (uint8_t)
sue_AIRFRAME : Serial UDB Extra Type of Airframe (uint8_t)
sue_RCON : Serial UDB Extra Reboot Regitster of DSPIC (int16_t)
sue_TRAP_FLAGS : Serial UDB Extra Last dspic Trap Flags (int16_t)
sue_TRAP_SOURCE : Serial UDB Extra Type Program Address of Last Trap (uint32_t)
sue_osc_fail_count : Serial UDB Extra Number of Ocillator Failures (int16_t)
sue_CLOCK_CONFIG : Serial UDB Extra UDB Internal Clock Configuration (uint8_t)
sue_FLIGHT_PLAN_TYPE : Serial UDB Extra Type of Flight Plan (uint8_t)
'''
return MAVLink_serial_udb_extra_f14_message(sue_WIND_ESTIMATION, sue_GPS_TYPE, sue_DR, sue_BOARD_TYPE, sue_AIRFRAME, sue_RCON, sue_TRAP_FLAGS, sue_TRAP_SOURCE, sue_osc_fail_count, sue_CLOCK_CONFIG, sue_FLIGHT_PLAN_TYPE)
|
Backwards compatible version of SERIAL_UDB_EXTRA F14: format
sue_WIND_ESTIMATION : Serial UDB Extra Wind Estimation Enabled (uint8_t)
sue_GPS_TYPE : Serial UDB Extra Type of GPS Unit (uint8_t)
sue_DR : Serial UDB Extra Dead Reckoning Enabled (uint8_t)
sue_BOARD_TYPE : Serial UDB Extra Type of UDB Hardware (uint8_t)
sue_AIRFRAME : Serial UDB Extra Type of Airframe (uint8_t)
sue_RCON : Serial UDB Extra Reboot Regitster of DSPIC (int16_t)
sue_TRAP_FLAGS : Serial UDB Extra Last dspic Trap Flags (int16_t)
sue_TRAP_SOURCE : Serial UDB Extra Type Program Address of Last Trap (uint32_t)
sue_osc_fail_count : Serial UDB Extra Number of Ocillator Failures (int16_t)
sue_CLOCK_CONFIG : Serial UDB Extra UDB Internal Clock Configuration (uint8_t)
sue_FLIGHT_PLAN_TYPE : Serial UDB Extra Type of Flight Plan (uint8_t)
|
def serial_udb_extra_f14_send(self, sue_WIND_ESTIMATION, sue_GPS_TYPE, sue_DR, sue_BOARD_TYPE, sue_AIRFRAME, sue_RCON, sue_TRAP_FLAGS, sue_TRAP_SOURCE, sue_osc_fail_count, sue_CLOCK_CONFIG, sue_FLIGHT_PLAN_TYPE, force_mavlink1=False):
'''
Backwards compatible version of SERIAL_UDB_EXTRA F14: format
sue_WIND_ESTIMATION : Serial UDB Extra Wind Estimation Enabled (uint8_t)
sue_GPS_TYPE : Serial UDB Extra Type of GPS Unit (uint8_t)
sue_DR : Serial UDB Extra Dead Reckoning Enabled (uint8_t)
sue_BOARD_TYPE : Serial UDB Extra Type of UDB Hardware (uint8_t)
sue_AIRFRAME : Serial UDB Extra Type of Airframe (uint8_t)
sue_RCON : Serial UDB Extra Reboot Regitster of DSPIC (int16_t)
sue_TRAP_FLAGS : Serial UDB Extra Last dspic Trap Flags (int16_t)
sue_TRAP_SOURCE : Serial UDB Extra Type Program Address of Last Trap (uint32_t)
sue_osc_fail_count : Serial UDB Extra Number of Ocillator Failures (int16_t)
sue_CLOCK_CONFIG : Serial UDB Extra UDB Internal Clock Configuration (uint8_t)
sue_FLIGHT_PLAN_TYPE : Serial UDB Extra Type of Flight Plan (uint8_t)
'''
return self.send(self.serial_udb_extra_f14_encode(sue_WIND_ESTIMATION, sue_GPS_TYPE, sue_DR, sue_BOARD_TYPE, sue_AIRFRAME, sue_RCON, sue_TRAP_FLAGS, sue_TRAP_SOURCE, sue_osc_fail_count, sue_CLOCK_CONFIG, sue_FLIGHT_PLAN_TYPE), force_mavlink1=force_mavlink1)
|
Backwards compatible version of SERIAL_UDB_EXTRA F15 and F16: format
sue_ID_VEHICLE_MODEL_NAME : Serial UDB Extra Model Name Of Vehicle (uint8_t)
sue_ID_VEHICLE_REGISTRATION : Serial UDB Extra Registraton Number of Vehicle (uint8_t)
|
def serial_udb_extra_f15_send(self, sue_ID_VEHICLE_MODEL_NAME, sue_ID_VEHICLE_REGISTRATION, force_mavlink1=False):
'''
Backwards compatible version of SERIAL_UDB_EXTRA F15 and F16: format
sue_ID_VEHICLE_MODEL_NAME : Serial UDB Extra Model Name Of Vehicle (uint8_t)
sue_ID_VEHICLE_REGISTRATION : Serial UDB Extra Registraton Number of Vehicle (uint8_t)
'''
return self.send(self.serial_udb_extra_f15_encode(sue_ID_VEHICLE_MODEL_NAME, sue_ID_VEHICLE_REGISTRATION), force_mavlink1=force_mavlink1)
|
The altitude measured by sensors and IMU
time_boot_ms : Timestamp (milliseconds since system boot) (uint32_t)
alt_gps : GPS altitude in meters, expressed as * 1000 (millimeters), above MSL (int32_t)
alt_imu : IMU altitude above ground in meters, expressed as * 1000 (millimeters) (int32_t)
alt_barometric : barometeric altitude above ground in meters, expressed as * 1000 (millimeters) (int32_t)
alt_optical_flow : Optical flow altitude above ground in meters, expressed as * 1000 (millimeters) (int32_t)
alt_range_finder : Rangefinder Altitude above ground in meters, expressed as * 1000 (millimeters) (int32_t)
alt_extra : Extra altitude above ground in meters, expressed as * 1000 (millimeters) (int32_t)
|
def altitudes_encode(self, time_boot_ms, alt_gps, alt_imu, alt_barometric, alt_optical_flow, alt_range_finder, alt_extra):
'''
The altitude measured by sensors and IMU
time_boot_ms : Timestamp (milliseconds since system boot) (uint32_t)
alt_gps : GPS altitude in meters, expressed as * 1000 (millimeters), above MSL (int32_t)
alt_imu : IMU altitude above ground in meters, expressed as * 1000 (millimeters) (int32_t)
alt_barometric : barometeric altitude above ground in meters, expressed as * 1000 (millimeters) (int32_t)
alt_optical_flow : Optical flow altitude above ground in meters, expressed as * 1000 (millimeters) (int32_t)
alt_range_finder : Rangefinder Altitude above ground in meters, expressed as * 1000 (millimeters) (int32_t)
alt_extra : Extra altitude above ground in meters, expressed as * 1000 (millimeters) (int32_t)
'''
return MAVLink_altitudes_message(time_boot_ms, alt_gps, alt_imu, alt_barometric, alt_optical_flow, alt_range_finder, alt_extra)
|
The altitude measured by sensors and IMU
time_boot_ms : Timestamp (milliseconds since system boot) (uint32_t)
alt_gps : GPS altitude in meters, expressed as * 1000 (millimeters), above MSL (int32_t)
alt_imu : IMU altitude above ground in meters, expressed as * 1000 (millimeters) (int32_t)
alt_barometric : barometeric altitude above ground in meters, expressed as * 1000 (millimeters) (int32_t)
alt_optical_flow : Optical flow altitude above ground in meters, expressed as * 1000 (millimeters) (int32_t)
alt_range_finder : Rangefinder Altitude above ground in meters, expressed as * 1000 (millimeters) (int32_t)
alt_extra : Extra altitude above ground in meters, expressed as * 1000 (millimeters) (int32_t)
|
def altitudes_send(self, time_boot_ms, alt_gps, alt_imu, alt_barometric, alt_optical_flow, alt_range_finder, alt_extra, force_mavlink1=False):
'''
The altitude measured by sensors and IMU
time_boot_ms : Timestamp (milliseconds since system boot) (uint32_t)
alt_gps : GPS altitude in meters, expressed as * 1000 (millimeters), above MSL (int32_t)
alt_imu : IMU altitude above ground in meters, expressed as * 1000 (millimeters) (int32_t)
alt_barometric : barometeric altitude above ground in meters, expressed as * 1000 (millimeters) (int32_t)
alt_optical_flow : Optical flow altitude above ground in meters, expressed as * 1000 (millimeters) (int32_t)
alt_range_finder : Rangefinder Altitude above ground in meters, expressed as * 1000 (millimeters) (int32_t)
alt_extra : Extra altitude above ground in meters, expressed as * 1000 (millimeters) (int32_t)
'''
return self.send(self.altitudes_encode(time_boot_ms, alt_gps, alt_imu, alt_barometric, alt_optical_flow, alt_range_finder, alt_extra), force_mavlink1=force_mavlink1)
|
The airspeed measured by sensors and IMU
time_boot_ms : Timestamp (milliseconds since system boot) (uint32_t)
airspeed_imu : Airspeed estimate from IMU, cm/s (int16_t)
airspeed_pitot : Pitot measured forward airpseed, cm/s (int16_t)
airspeed_hot_wire : Hot wire anenometer measured airspeed, cm/s (int16_t)
airspeed_ultrasonic : Ultrasonic measured airspeed, cm/s (int16_t)
aoa : Angle of attack sensor, degrees * 10 (int16_t)
aoy : Yaw angle sensor, degrees * 10 (int16_t)
|
def airspeeds_encode(self, time_boot_ms, airspeed_imu, airspeed_pitot, airspeed_hot_wire, airspeed_ultrasonic, aoa, aoy):
'''
The airspeed measured by sensors and IMU
time_boot_ms : Timestamp (milliseconds since system boot) (uint32_t)
airspeed_imu : Airspeed estimate from IMU, cm/s (int16_t)
airspeed_pitot : Pitot measured forward airpseed, cm/s (int16_t)
airspeed_hot_wire : Hot wire anenometer measured airspeed, cm/s (int16_t)
airspeed_ultrasonic : Ultrasonic measured airspeed, cm/s (int16_t)
aoa : Angle of attack sensor, degrees * 10 (int16_t)
aoy : Yaw angle sensor, degrees * 10 (int16_t)
'''
return MAVLink_airspeeds_message(time_boot_ms, airspeed_imu, airspeed_pitot, airspeed_hot_wire, airspeed_ultrasonic, aoa, aoy)
|
The airspeed measured by sensors and IMU
time_boot_ms : Timestamp (milliseconds since system boot) (uint32_t)
airspeed_imu : Airspeed estimate from IMU, cm/s (int16_t)
airspeed_pitot : Pitot measured forward airpseed, cm/s (int16_t)
airspeed_hot_wire : Hot wire anenometer measured airspeed, cm/s (int16_t)
airspeed_ultrasonic : Ultrasonic measured airspeed, cm/s (int16_t)
aoa : Angle of attack sensor, degrees * 10 (int16_t)
aoy : Yaw angle sensor, degrees * 10 (int16_t)
|
def airspeeds_send(self, time_boot_ms, airspeed_imu, airspeed_pitot, airspeed_hot_wire, airspeed_ultrasonic, aoa, aoy, force_mavlink1=False):
'''
The airspeed measured by sensors and IMU
time_boot_ms : Timestamp (milliseconds since system boot) (uint32_t)
airspeed_imu : Airspeed estimate from IMU, cm/s (int16_t)
airspeed_pitot : Pitot measured forward airpseed, cm/s (int16_t)
airspeed_hot_wire : Hot wire anenometer measured airspeed, cm/s (int16_t)
airspeed_ultrasonic : Ultrasonic measured airspeed, cm/s (int16_t)
aoa : Angle of attack sensor, degrees * 10 (int16_t)
aoy : Yaw angle sensor, degrees * 10 (int16_t)
'''
return self.send(self.airspeeds_encode(time_boot_ms, airspeed_imu, airspeed_pitot, airspeed_hot_wire, airspeed_ultrasonic, aoa, aoy), force_mavlink1=force_mavlink1)
|
The general system state. If the system is following the MAVLink
standard, the system state is mainly defined by three
orthogonal states/modes: The system mode, which is
either LOCKED (motors shut down and locked), MANUAL
(system under RC control), GUIDED (system with
autonomous position control, position setpoint
controlled manually) or AUTO (system guided by
path/waypoint planner). The NAV_MODE defined the
current flight state: LIFTOFF (often an open-loop
maneuver), LANDING, WAYPOINTS or VECTOR. This
represents the internal navigation state machine. The
system status shows wether the system is currently
active or not and if an emergency occured. During the
CRITICAL and EMERGENCY states the MAV is still
considered to be active, but should start emergency
procedures autonomously. After a failure occured it
should first move from active to critical to allow
manual intervention and then move to emergency after a
certain timeout.
onboard_control_sensors_present : Bitmask showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present. Indices defined by ENUM MAV_SYS_STATUS_SENSOR (uint32_t)
onboard_control_sensors_enabled : Bitmask showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled. Indices defined by ENUM MAV_SYS_STATUS_SENSOR (uint32_t)
onboard_control_sensors_health : Bitmask showing which onboard controllers and sensors are operational or have an error: Value of 0: not enabled. Value of 1: enabled. Indices defined by ENUM MAV_SYS_STATUS_SENSOR (uint32_t)
load : Maximum usage in percent of the mainloop time, (0%: 0, 100%: 1000) should be always below 1000 (uint16_t)
voltage_battery : Battery voltage, in millivolts (1 = 1 millivolt) (uint16_t)
current_battery : Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current (int16_t)
battery_remaining : Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot estimate the remaining battery (int8_t)
drop_rate_comm : Communication drops in percent, (0%: 0, 100%: 10'000), (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV) (uint16_t)
errors_comm : Communication errors (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV) (uint16_t)
errors_count1 : Autopilot-specific errors (uint16_t)
errors_count2 : Autopilot-specific errors (uint16_t)
errors_count3 : Autopilot-specific errors (uint16_t)
errors_count4 : Autopilot-specific errors (uint16_t)
|
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 wether the system is currently
active or not and if an emergency occured. During the
CRITICAL and EMERGENCY states the MAV is still
considered to be active, but should start emergency
procedures autonomously. After a failure occured it
should first move from active to critical to allow
manual intervention and then move to emergency after a
certain timeout.
onboard_control_sensors_present : Bitmask showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present. Indices defined by ENUM MAV_SYS_STATUS_SENSOR (uint32_t)
onboard_control_sensors_enabled : Bitmask showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled. Indices defined by ENUM MAV_SYS_STATUS_SENSOR (uint32_t)
onboard_control_sensors_health : Bitmask showing which onboard controllers and sensors are operational or have an error: Value of 0: not enabled. Value of 1: enabled. Indices defined by ENUM MAV_SYS_STATUS_SENSOR (uint32_t)
load : Maximum usage in percent of the mainloop time, (0%: 0, 100%: 1000) should be always below 1000 (uint16_t)
voltage_battery : Battery voltage, in millivolts (1 = 1 millivolt) (uint16_t)
current_battery : Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current (int16_t)
battery_remaining : Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot estimate the remaining battery (int8_t)
drop_rate_comm : Communication drops in percent, (0%: 0, 100%: 10'000), (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV) (uint16_t)
errors_comm : Communication errors (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV) (uint16_t)
errors_count1 : Autopilot-specific errors (uint16_t)
errors_count2 : Autopilot-specific errors (uint16_t)
errors_count3 : Autopilot-specific errors (uint16_t)
errors_count4 : Autopilot-specific errors (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)
|
The general system state. If the system is following the MAVLink
standard, the system state is mainly defined by three
orthogonal states/modes: The system mode, which is
either LOCKED (motors shut down and locked), MANUAL
(system under RC control), GUIDED (system with
autonomous position control, position setpoint
controlled manually) or AUTO (system guided by
path/waypoint planner). The NAV_MODE defined the
current flight state: LIFTOFF (often an open-loop
maneuver), LANDING, WAYPOINTS or VECTOR. This
represents the internal navigation state machine. The
system status shows wether the system is currently
active or not and if an emergency occured. During the
CRITICAL and EMERGENCY states the MAV is still
considered to be active, but should start emergency
procedures autonomously. After a failure occured it
should first move from active to critical to allow
manual intervention and then move to emergency after a
certain timeout.
onboard_control_sensors_present : Bitmask showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present. Indices defined by ENUM MAV_SYS_STATUS_SENSOR (uint32_t)
onboard_control_sensors_enabled : Bitmask showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled. Indices defined by ENUM MAV_SYS_STATUS_SENSOR (uint32_t)
onboard_control_sensors_health : Bitmask showing which onboard controllers and sensors are operational or have an error: Value of 0: not enabled. Value of 1: enabled. Indices defined by ENUM MAV_SYS_STATUS_SENSOR (uint32_t)
load : Maximum usage in percent of the mainloop time, (0%: 0, 100%: 1000) should be always below 1000 (uint16_t)
voltage_battery : Battery voltage, in millivolts (1 = 1 millivolt) (uint16_t)
current_battery : Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current (int16_t)
battery_remaining : Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot estimate the remaining battery (int8_t)
drop_rate_comm : Communication drops in percent, (0%: 0, 100%: 10'000), (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV) (uint16_t)
errors_comm : Communication errors (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV) (uint16_t)
errors_count1 : Autopilot-specific errors (uint16_t)
errors_count2 : Autopilot-specific errors (uint16_t)
errors_count3 : Autopilot-specific errors (uint16_t)
errors_count4 : Autopilot-specific errors (uint16_t)
|
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 wether the system is currently
active or not and if an emergency occured. During the
CRITICAL and EMERGENCY states the MAV is still
considered to be active, but should start emergency
procedures autonomously. After a failure occured it
should first move from active to critical to allow
manual intervention and then move to emergency after a
certain timeout.
onboard_control_sensors_present : Bitmask showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present. Indices defined by ENUM MAV_SYS_STATUS_SENSOR (uint32_t)
onboard_control_sensors_enabled : Bitmask showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled. Indices defined by ENUM MAV_SYS_STATUS_SENSOR (uint32_t)
onboard_control_sensors_health : Bitmask showing which onboard controllers and sensors are operational or have an error: Value of 0: not enabled. Value of 1: enabled. Indices defined by ENUM MAV_SYS_STATUS_SENSOR (uint32_t)
load : Maximum usage in percent of the mainloop time, (0%: 0, 100%: 1000) should be always below 1000 (uint16_t)
voltage_battery : Battery voltage, in millivolts (1 = 1 millivolt) (uint16_t)
current_battery : Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current (int16_t)
battery_remaining : Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot estimate the remaining battery (int8_t)
drop_rate_comm : Communication drops in percent, (0%: 0, 100%: 10'000), (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV) (uint16_t)
errors_comm : Communication errors (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV) (uint16_t)
errors_count1 : Autopilot-specific errors (uint16_t)
errors_count2 : Autopilot-specific errors (uint16_t)
errors_count3 : Autopilot-specific errors (uint16_t)
errors_count4 : Autopilot-specific errors (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)
|
The system time is the time of the master clock, typically the
computer clock of the main onboard computer.
time_unix_usec : Timestamp of the master clock in microseconds since UNIX epoch. (uint64_t)
time_boot_ms : Timestamp of the component clock since boot time in milliseconds. (uint32_t)
|
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 of the master clock in microseconds since UNIX epoch. (uint64_t)
time_boot_ms : Timestamp of the component clock since boot time in milliseconds. (uint32_t)
'''
return self.send(self.system_time_encode(time_unix_usec, time_boot_ms), force_mavlink1=force_mavlink1)
|
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.
time_usec : Unix timestamp in microseconds or since system boot if smaller than MAVLink epoch (1.1.2009) (uint64_t)
seq : PING sequence (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 (uint8_t)
target_component : 0: request ping from all receiving components, if greater than 0: message is a ping response and number is the system id of the requesting system (uint8_t)
|
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.
time_usec : Unix timestamp in microseconds or since system boot if smaller than MAVLink epoch (1.1.2009) (uint64_t)
seq : PING sequence (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 (uint8_t)
target_component : 0: request ping from all receiving components, if greater than 0: message is a ping response and number is the system id of the requesting system (uint8_t)
'''
return MAVLink_ping_message(time_usec, seq, target_system, target_component)
|
Request to control this MAV
target_system : System the GCS requests control for (uint8_t)
control_request : 0: request control of this MAV, 1: Release control of this MAV (uint8_t)
version : 0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch. (uint8_t)
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 "!?,.-" (char)
|
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 (uint8_t)
control_request : 0: request control of this MAV, 1: Release control of this MAV (uint8_t)
version : 0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch. (uint8_t)
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 "!?,.-" (char)
'''
return MAVLink_change_operator_control_message(target_system, control_request, version, passkey)
|
Request to control this MAV
target_system : System the GCS requests control for (uint8_t)
control_request : 0: request control of this MAV, 1: Release control of this MAV (uint8_t)
version : 0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch. (uint8_t)
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 "!?,.-" (char)
|
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 (uint8_t)
control_request : 0: request control of this MAV, 1: Release control of this MAV (uint8_t)
version : 0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch. (uint8_t)
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 "!?,.-" (char)
'''
return self.send(self.change_operator_control_encode(target_system, control_request, version, passkey), force_mavlink1=force_mavlink1)
|
Accept / deny control of this MAV
gcs_system_id : ID of the GCS this message (uint8_t)
control_request : 0: request control of this MAV, 1: Release control of this MAV (uint8_t)
ack : 0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control (uint8_t)
|
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 (uint8_t)
control_request : 0: request control of this MAV, 1: Release control of this MAV (uint8_t)
ack : 0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control (uint8_t)
'''
return self.send(self.change_operator_control_ack_encode(gcs_system_id, control_request, ack), force_mavlink1=force_mavlink1)
|
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 (char)
|
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 (char)
'''
return self.send(self.auth_key_encode(key), force_mavlink1=force_mavlink1)
|
THIS INTERFACE IS DEPRECATED. USE COMMAND_LONG with
MAV_CMD_DO_SET_MODE INSTEAD. 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 (uint8_t)
base_mode : The new base mode (uint8_t)
custom_mode : The new autopilot-specific mode. This field can be ignored by an autopilot. (uint32_t)
|
def set_mode_send(self, target_system, base_mode, custom_mode, force_mavlink1=False):
'''
THIS INTERFACE IS DEPRECATED. USE COMMAND_LONG with
MAV_CMD_DO_SET_MODE INSTEAD. 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 (uint8_t)
base_mode : The new base mode (uint8_t)
custom_mode : The new autopilot-specific mode. This field can be ignored by an autopilot. (uint32_t)
'''
return self.send(self.set_mode_encode(target_system, base_mode, custom_mode), force_mavlink1=force_mavlink1)
|
Request to read the onboard parameter with the param_id string id.
Onboard parameters are stored as key[const char*] ->
value[float]. This allows to send a parameter to any
other component (such as the GCS) without the need of
previous knowledge of possible parameter names. Thus
the same GCS can store different parameters for
different autopilots. See also
http://qgroundcontrol.org/parameter_interface for a
full documentation of QGroundControl and IMU code.
target_system : System ID (uint8_t)
target_component : Component ID (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 (char)
param_index : Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored) (int16_t)
|
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
http://qgroundcontrol.org/parameter_interface for a
full documentation of QGroundControl and IMU code.
target_system : System ID (uint8_t)
target_component : Component ID (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 (char)
param_index : Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored) (int16_t)
'''
return MAVLink_param_request_read_message(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
http://qgroundcontrol.org/parameter_interface for a
full documentation of QGroundControl and IMU code.
target_system : System ID (uint8_t)
target_component : Component ID (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 (char)
param_index : Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored) (int16_t)
|
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
http://qgroundcontrol.org/parameter_interface for a
full documentation of QGroundControl and IMU code.
target_system : System ID (uint8_t)
target_component : Component ID (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 (char)
param_index : Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored) (int16_t)
'''
return self.send(self.param_request_read_encode(target_system, target_component, param_id, param_index), force_mavlink1=force_mavlink1)
|
Request all parameters of this component. After this request, all
parameters are emitted.
target_system : System ID (uint8_t)
target_component : Component ID (uint8_t)
|
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.
target_system : System ID (uint8_t)
target_component : Component ID (uint8_t)
'''
return self.send(self.param_request_list_encode(target_system, target_component), force_mavlink1=force_mavlink1)
|
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.
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 (char)
param_value : Onboard parameter value (float)
param_type : Onboard parameter type: see the MAV_PARAM_TYPE enum for supported data types. (uint8_t)
param_count : Total number of onboard parameters (uint16_t)
param_index : Index of this onboard parameter (uint16_t)
|
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.
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 (char)
param_value : Onboard parameter value (float)
param_type : Onboard parameter type: see the MAV_PARAM_TYPE enum for supported data types. (uint8_t)
param_count : Total number of onboard parameters (uint16_t)
param_index : Index of this onboard parameter (uint16_t)
'''
return MAVLink_param_value_message(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.
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 (char)
param_value : Onboard parameter value (float)
param_type : Onboard parameter type: see the MAV_PARAM_TYPE enum for supported data types. (uint8_t)
param_count : Total number of onboard parameters (uint16_t)
param_index : Index of this onboard parameter (uint16_t)
|
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.
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 (char)
param_value : Onboard parameter value (float)
param_type : Onboard parameter type: see the MAV_PARAM_TYPE enum for supported data types. (uint8_t)
param_count : Total number of onboard parameters (uint16_t)
param_index : Index of this onboard parameter (uint16_t)
'''
return self.send(self.param_value_encode(param_id, param_value, param_type, param_count, param_index), force_mavlink1=force_mavlink1)
|
Set a parameter value TEMPORARILY to RAM. It will be reset to default
on system reboot. Send the ACTION
MAV_ACTION_STORAGE_WRITE to PERMANENTLY write the RAM
contents to EEPROM. IMPORTANT: The receiving component
should acknowledge the new parameter value by sending
a param_value message to all communication partners.
This will also ensure that multiple GCS all have an
up-to-date list of all parameters. If the sending GCS
did not receive a PARAM_VALUE message within its
timeout time, it should re-send the PARAM_SET message.
target_system : System ID (uint8_t)
target_component : Component ID (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 (char)
param_value : Onboard parameter value (float)
param_type : Onboard parameter type: see the MAV_PARAM_TYPE enum for supported data types. (uint8_t)
|
def param_set_encode(self, target_system, target_component, param_id, param_value, param_type):
'''
Set a parameter value TEMPORARILY to RAM. It will be reset to default
on system reboot. Send the ACTION
MAV_ACTION_STORAGE_WRITE to PERMANENTLY write the RAM
contents to EEPROM. IMPORTANT: The receiving component
should acknowledge the new parameter value by sending
a param_value message to all communication partners.
This will also ensure that multiple GCS all have an
up-to-date list of all parameters. If the sending GCS
did not receive a PARAM_VALUE message within its
timeout time, it should re-send the PARAM_SET message.
target_system : System ID (uint8_t)
target_component : Component ID (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 (char)
param_value : Onboard parameter value (float)
param_type : Onboard parameter type: see the MAV_PARAM_TYPE enum for supported data types. (uint8_t)
'''
return MAVLink_param_set_message(target_system, target_component, param_id, param_value, param_type)
|
Set a parameter value TEMPORARILY to RAM. It will be reset to default
on system reboot. Send the ACTION
MAV_ACTION_STORAGE_WRITE to PERMANENTLY write the RAM
contents to EEPROM. IMPORTANT: The receiving component
should acknowledge the new parameter value by sending
a param_value message to all communication partners.
This will also ensure that multiple GCS all have an
up-to-date list of all parameters. If the sending GCS
did not receive a PARAM_VALUE message within its
timeout time, it should re-send the PARAM_SET message.
target_system : System ID (uint8_t)
target_component : Component ID (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 (char)
param_value : Onboard parameter value (float)
param_type : Onboard parameter type: see the MAV_PARAM_TYPE enum for supported data types. (uint8_t)
|
def param_set_send(self, target_system, target_component, param_id, param_value, param_type, force_mavlink1=False):
'''
Set a parameter value TEMPORARILY to RAM. It will be reset to default
on system reboot. Send the ACTION
MAV_ACTION_STORAGE_WRITE to PERMANENTLY write the RAM
contents to EEPROM. IMPORTANT: The receiving component
should acknowledge the new parameter value by sending
a param_value message to all communication partners.
This will also ensure that multiple GCS all have an
up-to-date list of all parameters. If the sending GCS
did not receive a PARAM_VALUE message within its
timeout time, it should re-send the PARAM_SET message.
target_system : System ID (uint8_t)
target_component : Component ID (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 (char)
param_value : Onboard parameter value (float)
param_type : Onboard parameter type: see the MAV_PARAM_TYPE enum for supported data types. (uint8_t)
'''
return self.send(self.param_set_encode(target_system, target_component, param_id, param_value, param_type), force_mavlink1=force_mavlink1)
|
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. Coordinate frame is right-handed, Z-axis up
(GPS frame).
time_usec : Timestamp (microseconds since UNIX epoch or microseconds since system boot) (uint64_t)
fix_type : See the GPS_FIX_TYPE enum. (uint8_t)
lat : Latitude (WGS84), in degrees * 1E7 (int32_t)
lon : Longitude (WGS84), in degrees * 1E7 (int32_t)
alt : Altitude (AMSL, NOT WGS84), in meters * 1000 (positive for up). Note that virtually all GPS modules provide the AMSL altitude in addition to the WGS84 altitude. (int32_t)
eph : GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX (uint16_t)
epv : GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX (uint16_t)
vel : GPS ground speed (m/s * 100). If unknown, set to: UINT16_MAX (uint16_t)
cog : Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX (uint16_t)
satellites_visible : Number of satellites visible. If unknown, set to 255 (uint8_t)
|
def gps_raw_int_encode(self, time_usec, fix_type, lat, lon, alt, eph, epv, vel, cog, satellites_visible):
'''
The global position, as returned by the Global Positioning System
(GPS). This is NOT the global position
estimate of the system, but rather a RAW sensor value.
See message GLOBAL_POSITION for the global position
estimate. Coordinate frame is right-handed, Z-axis up
(GPS frame).
time_usec : Timestamp (microseconds since UNIX epoch or microseconds since system boot) (uint64_t)
fix_type : See the GPS_FIX_TYPE enum. (uint8_t)
lat : Latitude (WGS84), in degrees * 1E7 (int32_t)
lon : Longitude (WGS84), in degrees * 1E7 (int32_t)
alt : Altitude (AMSL, NOT WGS84), in meters * 1000 (positive for up). Note that virtually all GPS modules provide the AMSL altitude in addition to the WGS84 altitude. (int32_t)
eph : GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX (uint16_t)
epv : GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX (uint16_t)
vel : GPS ground speed (m/s * 100). If unknown, set to: UINT16_MAX (uint16_t)
cog : Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX (uint16_t)
satellites_visible : Number of satellites visible. If unknown, set to 255 (uint8_t)
'''
return MAVLink_gps_raw_int_message(time_usec, fix_type, lat, lon, alt, eph, epv, vel, cog, satellites_visible)
|
The global position, as returned by the Global Positioning System
(GPS). This is NOT the global position
estimate of the system, but rather a RAW sensor value.
See message GLOBAL_POSITION for the global position
estimate. Coordinate frame is right-handed, Z-axis up
(GPS frame).
time_usec : Timestamp (microseconds since UNIX epoch or microseconds since system boot) (uint64_t)
fix_type : See the GPS_FIX_TYPE enum. (uint8_t)
lat : Latitude (WGS84), in degrees * 1E7 (int32_t)
lon : Longitude (WGS84), in degrees * 1E7 (int32_t)
alt : Altitude (AMSL, NOT WGS84), in meters * 1000 (positive for up). Note that virtually all GPS modules provide the AMSL altitude in addition to the WGS84 altitude. (int32_t)
eph : GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX (uint16_t)
epv : GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX (uint16_t)
vel : GPS ground speed (m/s * 100). If unknown, set to: UINT16_MAX (uint16_t)
cog : Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX (uint16_t)
satellites_visible : Number of satellites visible. If unknown, set to 255 (uint8_t)
|
def gps_raw_int_send(self, time_usec, fix_type, lat, lon, alt, eph, epv, vel, cog, satellites_visible, force_mavlink1=False):
'''
The global position, as returned by the Global Positioning System
(GPS). This is NOT the global position
estimate of the system, but rather a RAW sensor value.
See message GLOBAL_POSITION for the global position
estimate. Coordinate frame is right-handed, Z-axis up
(GPS frame).
time_usec : Timestamp (microseconds since UNIX epoch or microseconds since system boot) (uint64_t)
fix_type : See the GPS_FIX_TYPE enum. (uint8_t)
lat : Latitude (WGS84), in degrees * 1E7 (int32_t)
lon : Longitude (WGS84), in degrees * 1E7 (int32_t)
alt : Altitude (AMSL, NOT WGS84), in meters * 1000 (positive for up). Note that virtually all GPS modules provide the AMSL altitude in addition to the WGS84 altitude. (int32_t)
eph : GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX (uint16_t)
epv : GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX (uint16_t)
vel : GPS ground speed (m/s * 100). If unknown, set to: UINT16_MAX (uint16_t)
cog : Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX (uint16_t)
satellites_visible : Number of satellites visible. If unknown, set to 255 (uint8_t)
'''
return self.send(self.gps_raw_int_encode(time_usec, fix_type, lat, lon, alt, eph, epv, vel, cog, satellites_visible), force_mavlink1=force_mavlink1)
|
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 (uint8_t)
satellite_prn : Global satellite ID (uint8_t)
satellite_used : 0: Satellite not used, 1: used for localization (uint8_t)
satellite_elevation : Elevation (0: right on top of receiver, 90: on the horizon) of satellite (uint8_t)
satellite_azimuth : Direction of satellite, 0: 0 deg, 255: 360 deg. (uint8_t)
satellite_snr : Signal to noise ratio of satellite (uint8_t)
|
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 (uint8_t)
satellite_prn : Global satellite ID (uint8_t)
satellite_used : 0: Satellite not used, 1: used for localization (uint8_t)
satellite_elevation : Elevation (0: right on top of receiver, 90: on the horizon) of satellite (uint8_t)
satellite_azimuth : Direction of satellite, 0: 0 deg, 255: 360 deg. (uint8_t)
satellite_snr : Signal to noise ratio of satellite (uint8_t)
'''
return MAVLink_gps_status_message(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 (uint8_t)
satellite_prn : Global satellite ID (uint8_t)
satellite_used : 0: Satellite not used, 1: used for localization (uint8_t)
satellite_elevation : Elevation (0: right on top of receiver, 90: on the horizon) of satellite (uint8_t)
satellite_azimuth : Direction of satellite, 0: 0 deg, 255: 360 deg. (uint8_t)
satellite_snr : Signal to noise ratio of satellite (uint8_t)
|
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 (uint8_t)
satellite_prn : Global satellite ID (uint8_t)
satellite_used : 0: Satellite not used, 1: used for localization (uint8_t)
satellite_elevation : Elevation (0: right on top of receiver, 90: on the horizon) of satellite (uint8_t)
satellite_azimuth : Direction of satellite, 0: 0 deg, 255: 360 deg. (uint8_t)
satellite_snr : Signal to noise ratio of satellite (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)
|
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 (milliseconds since system boot) (uint32_t)
xacc : X acceleration (mg) (int16_t)
yacc : Y acceleration (mg) (int16_t)
zacc : Z acceleration (mg) (int16_t)
xgyro : Angular speed around X axis (millirad /sec) (int16_t)
ygyro : Angular speed around Y axis (millirad /sec) (int16_t)
zgyro : Angular speed around Z axis (millirad /sec) (int16_t)
xmag : X Magnetic field (milli tesla) (int16_t)
ymag : Y Magnetic field (milli tesla) (int16_t)
zmag : Z Magnetic field (milli tesla) (int16_t)
|
def scaled_imu_encode(self, time_boot_ms, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag):
'''
The RAW IMU readings for the usual 9DOF sensor setup. This message
should contain the scaled values to the described
units
time_boot_ms : Timestamp (milliseconds since system boot) (uint32_t)
xacc : X acceleration (mg) (int16_t)
yacc : Y acceleration (mg) (int16_t)
zacc : Z acceleration (mg) (int16_t)
xgyro : Angular speed around X axis (millirad /sec) (int16_t)
ygyro : Angular speed around Y axis (millirad /sec) (int16_t)
zgyro : Angular speed around Z axis (millirad /sec) (int16_t)
xmag : X Magnetic field (milli tesla) (int16_t)
ymag : Y Magnetic field (milli tesla) (int16_t)
zmag : Z Magnetic field (milli tesla) (int16_t)
'''
return MAVLink_scaled_imu_message(time_boot_ms, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag)
|
The RAW IMU readings for the usual 9DOF sensor setup. This message
should contain the scaled values to the described
units
time_boot_ms : Timestamp (milliseconds since system boot) (uint32_t)
xacc : X acceleration (mg) (int16_t)
yacc : Y acceleration (mg) (int16_t)
zacc : Z acceleration (mg) (int16_t)
xgyro : Angular speed around X axis (millirad /sec) (int16_t)
ygyro : Angular speed around Y axis (millirad /sec) (int16_t)
zgyro : Angular speed around Z axis (millirad /sec) (int16_t)
xmag : X Magnetic field (milli tesla) (int16_t)
ymag : Y Magnetic field (milli tesla) (int16_t)
zmag : Z Magnetic field (milli tesla) (int16_t)
|
def scaled_imu_send(self, time_boot_ms, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag, force_mavlink1=False):
'''
The RAW IMU readings for the usual 9DOF sensor setup. This message
should contain the scaled values to the described
units
time_boot_ms : Timestamp (milliseconds since system boot) (uint32_t)
xacc : X acceleration (mg) (int16_t)
yacc : Y acceleration (mg) (int16_t)
zacc : Z acceleration (mg) (int16_t)
xgyro : Angular speed around X axis (millirad /sec) (int16_t)
ygyro : Angular speed around Y axis (millirad /sec) (int16_t)
zgyro : Angular speed around Z axis (millirad /sec) (int16_t)
xmag : X Magnetic field (milli tesla) (int16_t)
ymag : Y Magnetic field (milli tesla) (int16_t)
zmag : Z Magnetic field (milli tesla) (int16_t)
'''
return self.send(self.scaled_imu_encode(time_boot_ms, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag), force_mavlink1=force_mavlink1)
|
The RAW IMU readings for the usual 9DOF sensor setup. This message
should always contain the true raw values without any
scaling to allow data capture and system debugging.
time_usec : Timestamp (microseconds since UNIX epoch or microseconds since system boot) (uint64_t)
xacc : X acceleration (raw) (int16_t)
yacc : Y acceleration (raw) (int16_t)
zacc : Z acceleration (raw) (int16_t)
xgyro : Angular speed around X axis (raw) (int16_t)
ygyro : Angular speed around Y axis (raw) (int16_t)
zgyro : Angular speed around Z axis (raw) (int16_t)
xmag : X Magnetic field (raw) (int16_t)
ymag : Y Magnetic field (raw) (int16_t)
zmag : Z Magnetic field (raw) (int16_t)
|
def raw_imu_encode(self, time_usec, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag):
'''
The RAW IMU readings for the usual 9DOF sensor setup. This message
should always contain the true raw values without any
scaling to allow data capture and system debugging.
time_usec : Timestamp (microseconds since UNIX epoch or microseconds since system boot) (uint64_t)
xacc : X acceleration (raw) (int16_t)
yacc : Y acceleration (raw) (int16_t)
zacc : Z acceleration (raw) (int16_t)
xgyro : Angular speed around X axis (raw) (int16_t)
ygyro : Angular speed around Y axis (raw) (int16_t)
zgyro : Angular speed around Z axis (raw) (int16_t)
xmag : X Magnetic field (raw) (int16_t)
ymag : Y Magnetic field (raw) (int16_t)
zmag : Z Magnetic field (raw) (int16_t)
'''
return MAVLink_raw_imu_message(time_usec, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag)
|
The RAW IMU readings for the usual 9DOF sensor setup. This message
should always contain the true raw values without any
scaling to allow data capture and system debugging.
time_usec : Timestamp (microseconds since UNIX epoch or microseconds since system boot) (uint64_t)
xacc : X acceleration (raw) (int16_t)
yacc : Y acceleration (raw) (int16_t)
zacc : Z acceleration (raw) (int16_t)
xgyro : Angular speed around X axis (raw) (int16_t)
ygyro : Angular speed around Y axis (raw) (int16_t)
zgyro : Angular speed around Z axis (raw) (int16_t)
xmag : X Magnetic field (raw) (int16_t)
ymag : Y Magnetic field (raw) (int16_t)
zmag : Z Magnetic field (raw) (int16_t)
|
def raw_imu_send(self, time_usec, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag, force_mavlink1=False):
'''
The RAW IMU readings for the usual 9DOF sensor setup. This message
should always contain the true raw values without any
scaling to allow data capture and system debugging.
time_usec : Timestamp (microseconds since UNIX epoch or microseconds since system boot) (uint64_t)
xacc : X acceleration (raw) (int16_t)
yacc : Y acceleration (raw) (int16_t)
zacc : Z acceleration (raw) (int16_t)
xgyro : Angular speed around X axis (raw) (int16_t)
ygyro : Angular speed around Y axis (raw) (int16_t)
zgyro : Angular speed around Z axis (raw) (int16_t)
xmag : X Magnetic field (raw) (int16_t)
ymag : Y Magnetic field (raw) (int16_t)
zmag : Z Magnetic field (raw) (int16_t)
'''
return self.send(self.raw_imu_encode(time_usec, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag), force_mavlink1=force_mavlink1)
|
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 (microseconds since UNIX epoch or microseconds since system boot) (uint64_t)
press_abs : Absolute pressure (raw) (int16_t)
press_diff1 : Differential pressure 1 (raw, 0 if nonexistant) (int16_t)
press_diff2 : Differential pressure 2 (raw, 0 if nonexistant) (int16_t)
temperature : Raw Temperature measurement (raw) (int16_t)
|
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 (microseconds since UNIX epoch or microseconds since system boot) (uint64_t)
press_abs : Absolute pressure (raw) (int16_t)
press_diff1 : Differential pressure 1 (raw, 0 if nonexistant) (int16_t)
press_diff2 : Differential pressure 2 (raw, 0 if nonexistant) (int16_t)
temperature : Raw Temperature measurement (raw) (int16_t)
'''
return MAVLink_raw_pressure_message(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 (microseconds since UNIX epoch or microseconds since system boot) (uint64_t)
press_abs : Absolute pressure (raw) (int16_t)
press_diff1 : Differential pressure 1 (raw, 0 if nonexistant) (int16_t)
press_diff2 : Differential pressure 2 (raw, 0 if nonexistant) (int16_t)
temperature : Raw Temperature measurement (raw) (int16_t)
|
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 (microseconds since UNIX epoch or microseconds since system boot) (uint64_t)
press_abs : Absolute pressure (raw) (int16_t)
press_diff1 : Differential pressure 1 (raw, 0 if nonexistant) (int16_t)
press_diff2 : Differential pressure 2 (raw, 0 if nonexistant) (int16_t)
temperature : Raw Temperature measurement (raw) (int16_t)
'''
return self.send(self.raw_pressure_encode(time_usec, press_abs, press_diff1, press_diff2, temperature), force_mavlink1=force_mavlink1)
|
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 (milliseconds since system boot) (uint32_t)
press_abs : Absolute pressure (hectopascal) (float)
press_diff : Differential pressure 1 (hectopascal) (float)
temperature : Temperature measurement (0.01 degrees celsius) (int16_t)
|
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 (milliseconds since system boot) (uint32_t)
press_abs : Absolute pressure (hectopascal) (float)
press_diff : Differential pressure 1 (hectopascal) (float)
temperature : Temperature measurement (0.01 degrees celsius) (int16_t)
'''
return MAVLink_scaled_pressure_message(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 (milliseconds since system boot) (uint32_t)
press_abs : Absolute pressure (hectopascal) (float)
press_diff : Differential pressure 1 (hectopascal) (float)
temperature : Temperature measurement (0.01 degrees celsius) (int16_t)
|
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 (milliseconds since system boot) (uint32_t)
press_abs : Absolute pressure (hectopascal) (float)
press_diff : Differential pressure 1 (hectopascal) (float)
temperature : Temperature measurement (0.01 degrees celsius) (int16_t)
'''
return self.send(self.scaled_pressure_encode(time_boot_ms, press_abs, press_diff, temperature), force_mavlink1=force_mavlink1)
|
The attitude in the aeronautical frame (right-handed, Z-down, X-front,
Y-right).
time_boot_ms : Timestamp (milliseconds since system boot) (uint32_t)
roll : Roll angle (rad, -pi..+pi) (float)
pitch : Pitch angle (rad, -pi..+pi) (float)
yaw : Yaw angle (rad, -pi..+pi) (float)
rollspeed : Roll angular speed (rad/s) (float)
pitchspeed : Pitch angular speed (rad/s) (float)
yawspeed : Yaw angular speed (rad/s) (float)
|
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 (milliseconds since system boot) (uint32_t)
roll : Roll angle (rad, -pi..+pi) (float)
pitch : Pitch angle (rad, -pi..+pi) (float)
yaw : Yaw angle (rad, -pi..+pi) (float)
rollspeed : Roll angular speed (rad/s) (float)
pitchspeed : Pitch angular speed (rad/s) (float)
yawspeed : Yaw angular speed (rad/s) (float)
'''
return MAVLink_attitude_message(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 (milliseconds since system boot) (uint32_t)
roll : Roll angle (rad, -pi..+pi) (float)
pitch : Pitch angle (rad, -pi..+pi) (float)
yaw : Yaw angle (rad, -pi..+pi) (float)
rollspeed : Roll angular speed (rad/s) (float)
pitchspeed : Pitch angular speed (rad/s) (float)
yawspeed : Yaw angular speed (rad/s) (float)
|
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 (milliseconds since system boot) (uint32_t)
roll : Roll angle (rad, -pi..+pi) (float)
pitch : Pitch angle (rad, -pi..+pi) (float)
yaw : Yaw angle (rad, -pi..+pi) (float)
rollspeed : Roll angular speed (rad/s) (float)
pitchspeed : Pitch angular speed (rad/s) (float)
yawspeed : Yaw angular speed (rad/s) (float)
'''
return self.send(self.attitude_encode(time_boot_ms, roll, pitch, yaw, rollspeed, pitchspeed, yawspeed), force_mavlink1=force_mavlink1)
|
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 (milliseconds since system boot) (uint32_t)
q1 : Quaternion component 1, w (1 in null-rotation) (float)
q2 : Quaternion component 2, x (0 in null-rotation) (float)
q3 : Quaternion component 3, y (0 in null-rotation) (float)
q4 : Quaternion component 4, z (0 in null-rotation) (float)
rollspeed : Roll angular speed (rad/s) (float)
pitchspeed : Pitch angular speed (rad/s) (float)
yawspeed : Yaw angular speed (rad/s) (float)
|
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 (milliseconds since system boot) (uint32_t)
q1 : Quaternion component 1, w (1 in null-rotation) (float)
q2 : Quaternion component 2, x (0 in null-rotation) (float)
q3 : Quaternion component 3, y (0 in null-rotation) (float)
q4 : Quaternion component 4, z (0 in null-rotation) (float)
rollspeed : Roll angular speed (rad/s) (float)
pitchspeed : Pitch angular speed (rad/s) (float)
yawspeed : Yaw angular speed (rad/s) (float)
'''
return MAVLink_attitude_quaternion_message(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 (milliseconds since system boot) (uint32_t)
q1 : Quaternion component 1, w (1 in null-rotation) (float)
q2 : Quaternion component 2, x (0 in null-rotation) (float)
q3 : Quaternion component 3, y (0 in null-rotation) (float)
q4 : Quaternion component 4, z (0 in null-rotation) (float)
rollspeed : Roll angular speed (rad/s) (float)
pitchspeed : Pitch angular speed (rad/s) (float)
yawspeed : Yaw angular speed (rad/s) (float)
|
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 (milliseconds since system boot) (uint32_t)
q1 : Quaternion component 1, w (1 in null-rotation) (float)
q2 : Quaternion component 2, x (0 in null-rotation) (float)
q3 : Quaternion component 3, y (0 in null-rotation) (float)
q4 : Quaternion component 4, z (0 in null-rotation) (float)
rollspeed : Roll angular speed (rad/s) (float)
pitchspeed : Pitch angular speed (rad/s) (float)
yawspeed : Yaw angular speed (rad/s) (float)
'''
return self.send(self.attitude_quaternion_encode(time_boot_ms, q1, q2, q3, q4, rollspeed, pitchspeed, yawspeed), force_mavlink1=force_mavlink1)
|
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 (milliseconds since system boot) (uint32_t)
x : X Position (float)
y : Y Position (float)
z : Z Position (float)
vx : X Speed (float)
vy : Y Speed (float)
vz : Z Speed (float)
|
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 (milliseconds since system boot) (uint32_t)
x : X Position (float)
y : Y Position (float)
z : Z Position (float)
vx : X Speed (float)
vy : Y Speed (float)
vz : Z Speed (float)
'''
return MAVLink_local_position_ned_message(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 (milliseconds since system boot) (uint32_t)
x : X Position (float)
y : Y Position (float)
z : Z Position (float)
vx : X Speed (float)
vy : Y Speed (float)
vz : Z Speed (float)
|
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 (milliseconds since system boot) (uint32_t)
x : X Position (float)
y : Y Position (float)
z : Z Position (float)
vx : X Speed (float)
vy : Y Speed (float)
vz : Z Speed (float)
'''
return self.send(self.local_position_ned_encode(time_boot_ms, x, y, z, vx, vy, vz), force_mavlink1=force_mavlink1)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.