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_mana...
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.notfou...
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_co...
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(s...
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...
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...
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 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...
: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_descr...
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, CourseNotFoundExceptio...
: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_su...
: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: ...
: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...
: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 ...
: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 n...
: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 Tru...
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: ...
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.sess...
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 ...
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() ==...
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_b...
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: ...
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.__pa...
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 ...
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: ...
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.unp...
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, srcC...
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) ...
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 ...
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) ...
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 ...
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 (uin...
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_cou...
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...
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_cou...
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 ...
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 ...
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) targ...
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 ...
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) ...
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...
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 ...
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...
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) ...
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...
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 ...
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...
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) targ...
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...
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...
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 (...
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...
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...
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_ou...
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) ...
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) ...
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=...
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...
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...
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...
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 UD...
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...
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 (floa...
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...
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 Propor...
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_R...
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 ...
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_R...
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 UD...
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_TH...
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 ...
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_TH...
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: ...
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 ...
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 ...
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 ...
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) ...
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 Reckonin...
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 ...
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 Reckonin...
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 ...
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)...
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 ...
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_g...
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 ...
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) ...
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) ...
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) airspe...
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) ...
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) ...
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 ...
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 gener...
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 ...
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 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...
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 mi...
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...
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...
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, diff...
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 MA...
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, diff...
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: reques...
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: Un...
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...
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. ...
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. ...
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 ...
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 possibl...
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 par...
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 possibl...
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 ...
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_...
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 ...
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 ...
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 ...
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 rece...
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 ...
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 RA...
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 ...
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 PERM...
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 i...
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, b...
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 i...
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 estim...
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...
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 ...
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...
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 sat...
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) (i...
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...
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) (i...
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 ...
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 ...
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 sys...
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 ...
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 ...
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...
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...
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...
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 t...
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 ...
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 ...
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 ...
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. ...
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 : P...
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...
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 : P...
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 ...
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 ...
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 rot...
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 ...
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,...
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) (uint3...
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 ...
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) (uint3...
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...