Classes | Functions | Variables
pymavlink.mavutil Namespace Reference

Classes

class  FakeSerial
 
class  location
 
class  mavchildexec
 
class  mavfile
 
class  mavfile_state
 
class  MavlinkSerialPort
 
class  mavlogfile
 
class  mavmcast
 
class  mavmmaplog
 
class  mavserial
 
class  mavtcp
 
class  mavtcpin
 
class  mavudp
 
class  param_state
 
class  periodic_event
 
class  SerialPort
 
class  x25crc
 

Functions

def all_printable (buf)
 
def auto_detect_serial (preferred_list=['*'])
 
def auto_detect_serial_unix (preferred_list=['*'])
 
def auto_detect_serial_win32 (preferred_list=['*'])
 
def evaluate_condition (condition, vars)
 
def evaluate_expression (expression, vars)
 
def interpret_px4_mode (base_mode, custom_mode)
 
def is_printable (c)
 
def mavlink10 ()
 
def mavlink20 ()
 
def mavlink_connection (device, baud=115200, source_system=255, source_component=0, planner_format=None, write=False, append=False, robust_parsing=True, notimestamps=False, input=True, dialect=None, autoreconnect=False, zero_time_base=False, retries=3, use_native=default_native, force_connected=False, progress_callback=None)
 
def mode_mapping_byname (mav_type)
 
def mode_mapping_bynumber (mav_type)
 
def mode_string_acm (mode_number)
 
def mode_string_apm (mode_number)
 
def mode_string_px4 (MainState)
 
def mode_string_v09 (msg)
 
def mode_string_v10 (msg)
 
def set_close_on_exec (fd)
 
def set_dialect (dialect)
 
def u_ord (c)
 

Variables

 auto_mode_flags = mavlink.MAV_MODE_FLAG_AUTO_ENABLED\
 
bool default_native = False
 
int global_link_id = 0
 
dictionary mainstate_mapping_px4
 
 mavfile_global = None
 
 mavlink = None
 
dictionary mode_mapping_acm
 
dictionary mode_mapping_apm
 
dictionary mode_mapping_rover
 
dictionary mode_mapping_sub
 
dictionary mode_mapping_tracker
 
int PX4_CUSTOM_MAIN_MODE_ACRO = 5
 
int PX4_CUSTOM_MAIN_MODE_ALTCTL = 2
 
int PX4_CUSTOM_MAIN_MODE_AUTO = 4
 
int PX4_CUSTOM_MAIN_MODE_MANUAL = 1
 
int PX4_CUSTOM_MAIN_MODE_OFFBOARD = 6
 
int PX4_CUSTOM_MAIN_MODE_POSCTL = 3
 
int PX4_CUSTOM_MAIN_MODE_RATTITUDE = 8
 
int PX4_CUSTOM_MAIN_MODE_STABILIZED = 7
 
int PX4_CUSTOM_SUB_MODE_AUTO_FOLLOW_TARGET = 8
 
int PX4_CUSTOM_SUB_MODE_AUTO_LAND = 6
 
int PX4_CUSTOM_SUB_MODE_AUTO_LOITER = 3
 
int PX4_CUSTOM_SUB_MODE_AUTO_MISSION = 4
 
int PX4_CUSTOM_SUB_MODE_AUTO_READY = 1
 
int PX4_CUSTOM_SUB_MODE_AUTO_RTGS = 7
 
int PX4_CUSTOM_SUB_MODE_AUTO_RTL = 5
 
int PX4_CUSTOM_SUB_MODE_AUTO_TAKEOFF = 2
 
int PX4_CUSTOM_SUB_MODE_OFFBOARD = 0
 
dictionary px4_map
 
 serial_list = auto_detect_serial(preferred_list=['*FTDI*',"*Arduino_Mega_2560*", "*3D_Robotics*", "*USB_to_UART*", '*PX4*', '*FMU*'])
 
int UDP_MAX_PACKET_LEN = 65535
 

Detailed Description

mavlink python utility functions

Copyright Andrew Tridgell 2011
Released under GNU GPL version 3 or later

Function Documentation

def pymavlink.mavutil.all_printable (   buf)
see if a string is all printable

Definition at line 1711 of file mavutil.py.

def pymavlink.mavutil.auto_detect_serial (   preferred_list = ['*'])
try to auto-detect serial port

Definition at line 1782 of file mavutil.py.

def pymavlink.mavutil.auto_detect_serial_unix (   preferred_list = ['*'])
try to auto-detect serial ports on unix

Definition at line 1761 of file mavutil.py.

def pymavlink.mavutil.auto_detect_serial_win32 (   preferred_list = ['*'])
try to auto-detect serial ports on win32

Definition at line 1733 of file mavutil.py.

def pymavlink.mavutil.evaluate_condition (   condition,
  vars 
)
evaluation a conditional (boolean) statement

Definition at line 57 of file mavutil.py.

def pymavlink.mavutil.evaluate_expression (   expression,
  vars 
)
evaluation an expression

Definition at line 53 of file mavutil.py.

def pymavlink.mavutil.interpret_px4_mode (   base_mode,
  custom_mode 
)

Definition at line 1985 of file mavutil.py.

def pymavlink.mavutil.is_printable (   c)
see if a character is printable

Definition at line 1700 of file mavutil.py.

def pymavlink.mavutil.mavlink10 ( )
return True if using MAVLink 1.0 or later

Definition at line 45 of file mavutil.py.

def pymavlink.mavutil.mavlink20 ( )
return True if using MAVLink 2.0

Definition at line 49 of file mavutil.py.

def pymavlink.mavutil.mavlink_connection (   device,
  baud = 115200,
  source_system = 255,
  source_component = 0,
  planner_format = None,
  write = False,
  append = False,
  robust_parsing = True,
  notimestamps = False,
  input = True,
  dialect = None,
  autoreconnect = False,
  zero_time_base = False,
  retries = 3,
  use_native = default_native,
  force_connected = False,
  progress_callback = None 
)
open a serial, UDP, TCP or file mavlink connection

Definition at line 1601 of file mavutil.py.

def pymavlink.mavutil.mode_mapping_byname (   mav_type)
return dictionary mapping mode names to numbers, or None if unknown

Definition at line 2022 of file mavutil.py.

def pymavlink.mavutil.mode_mapping_bynumber (   mav_type)
return dictionary mapping mode numbers to name, or None if unknown

Definition at line 2047 of file mavutil.py.

def pymavlink.mavutil.mode_string_acm (   mode_number)
return mode string for APM:Copter

Definition at line 2108 of file mavutil.py.

def pymavlink.mavutil.mode_string_apm (   mode_number)
return mode string for APM:Plane

Definition at line 2102 of file mavutil.py.

def pymavlink.mavutil.mode_string_px4 (   MainState)

Definition at line 1941 of file mavutil.py.

def pymavlink.mavutil.mode_string_v09 (   msg)
mode string for 0.9 protocol

Definition at line 1789 of file mavutil.py.

def pymavlink.mavutil.mode_string_v10 (   msg)
mode string for 1.0 protocol, from heartbeat

Definition at line 2073 of file mavutil.py.

def pymavlink.mavutil.set_close_on_exec (   fd)
set the clone on exec flag on a file descriptor. Ignore exceptions

Definition at line 884 of file mavutil.py.

def pymavlink.mavutil.set_dialect (   dialect)
set the MAVLink dialect to work with.
For example, set_dialect("ardupilotmega")

Definition at line 80 of file mavutil.py.

def pymavlink.mavutil.u_ord (   c)

Definition at line 66 of file mavutil.py.

Variable Documentation

pymavlink.mavutil.auto_mode_flags = mavlink.MAV_MODE_FLAG_AUTO_ENABLED\

Definition at line 1965 of file mavutil.py.

bool pymavlink.mavutil.default_native = False

Definition at line 36 of file mavutil.py.

int pymavlink.mavutil.global_link_id = 0

Definition at line 39 of file mavutil.py.

dictionary pymavlink.mavutil.mainstate_mapping_px4
Initial value:
1 = {
2  0 : 'MANUAL',
3  1 : 'ALTCTL',
4  2 : 'POSCTL',
5  3 : 'AUTO_MISSION',
6  4 : 'AUTO_LOITER',
7  5 : 'AUTO_RTL',
8  6 : 'ACRO',
9  7 : 'OFFBOARD',
10  8 : 'STAB',
11  9 : 'RATTITUDE',
12  10 : 'AUTO_TAKEOFF',
13  11 : 'AUTO_LAND',
14  12 : 'AUTO_FOLLOW_TARGET',
15  13 : 'MAX',
16 }

Definition at line 1925 of file mavutil.py.

pymavlink.mavutil.mavfile_global = None

Definition at line 33 of file mavutil.py.

pymavlink.mavutil.mavlink = None

Definition at line 29 of file mavutil.py.

dictionary pymavlink.mavutil.mode_mapping_acm
Initial value:
1 = {
2  0 : 'STABILIZE',
3  1 : 'ACRO',
4  2 : 'ALT_HOLD',
5  3 : 'AUTO',
6  4 : 'GUIDED',
7  5 : 'LOITER',
8  6 : 'RTL',
9  7 : 'CIRCLE',
10  8 : 'POSITION',
11  9 : 'LAND',
12  10 : 'OF_LOITER',
13  11 : 'DRIFT',
14  13 : 'SPORT',
15  14 : 'FLIP',
16  15 : 'AUTOTUNE',
17  16 : 'POSHOLD',
18  17 : 'BRAKE',
19  18 : 'THROW',
20  19 : 'AVOID_ADSB',
21  20 : 'GUIDED_NOGPS',
22  21 : 'SMART_RTL',
23  22 : 'FLOWHOLD',
24  23 : 'FOLLOW',
25 }

Definition at line 1861 of file mavutil.py.

dictionary pymavlink.mavutil.mode_mapping_apm
Initial value:
1 = {
2  0 : 'MANUAL',
3  1 : 'CIRCLE',
4  2 : 'STABILIZE',
5  3 : 'TRAINING',
6  4 : 'ACRO',
7  5 : 'FBWA',
8  6 : 'FBWB',
9  7 : 'CRUISE',
10  8 : 'AUTOTUNE',
11  10 : 'AUTO',
12  11 : 'RTL',
13  12 : 'LOITER',
14  14 : 'LAND',
15  15 : 'GUIDED',
16  16 : 'INITIALISING',
17  17 : 'QSTABILIZE',
18  18 : 'QHOVER',
19  19 : 'QLOITER',
20  20 : 'QLAND',
21  21 : 'QRTL',
22  22 : 'QAUTOTUNE',
23  }

Definition at line 1838 of file mavutil.py.

dictionary pymavlink.mavutil.mode_mapping_rover
Initial value:
1 = {
2  0 : 'MANUAL',
3  1 : 'ACRO',
4  2 : 'LEARNING',
5  3 : 'STEERING',
6  4 : 'HOLD',
7  5 : 'LOITER',
8  10 : 'AUTO',
9  11 : 'RTL',
10  12 : 'SMART_RTL',
11  15 : 'GUIDED',
12  16 : 'INITIALISING'
13  }

Definition at line 1886 of file mavutil.py.

dictionary pymavlink.mavutil.mode_mapping_sub
Initial value:
1 = {
2  0: 'STABILIZE',
3  1: 'ACRO',
4  2: 'ALT_HOLD',
5  3: 'AUTO',
6  4: 'GUIDED',
7  7: 'CIRCLE',
8  9: 'SURFACE',
9  16: 'POSHOLD',
10  19: 'MANUAL',
11  }

Definition at line 1908 of file mavutil.py.

dictionary pymavlink.mavutil.mode_mapping_tracker
Initial value:
1 = {
2  0 : 'MANUAL',
3  1 : 'STOP',
4  2 : 'SCAN',
5  10 : 'AUTO',
6  16 : 'INITIALISING'
7  }

Definition at line 1900 of file mavutil.py.

int pymavlink.mavutil.PX4_CUSTOM_MAIN_MODE_ACRO = 5

Definition at line 1950 of file mavutil.py.

int pymavlink.mavutil.PX4_CUSTOM_MAIN_MODE_ALTCTL = 2

Definition at line 1947 of file mavutil.py.

int pymavlink.mavutil.PX4_CUSTOM_MAIN_MODE_AUTO = 4

Definition at line 1949 of file mavutil.py.

int pymavlink.mavutil.PX4_CUSTOM_MAIN_MODE_MANUAL = 1

Definition at line 1946 of file mavutil.py.

int pymavlink.mavutil.PX4_CUSTOM_MAIN_MODE_OFFBOARD = 6

Definition at line 1951 of file mavutil.py.

int pymavlink.mavutil.PX4_CUSTOM_MAIN_MODE_POSCTL = 3

Definition at line 1948 of file mavutil.py.

int pymavlink.mavutil.PX4_CUSTOM_MAIN_MODE_RATTITUDE = 8

Definition at line 1953 of file mavutil.py.

int pymavlink.mavutil.PX4_CUSTOM_MAIN_MODE_STABILIZED = 7

Definition at line 1952 of file mavutil.py.

int pymavlink.mavutil.PX4_CUSTOM_SUB_MODE_AUTO_FOLLOW_TARGET = 8

Definition at line 1963 of file mavutil.py.

int pymavlink.mavutil.PX4_CUSTOM_SUB_MODE_AUTO_LAND = 6

Definition at line 1961 of file mavutil.py.

int pymavlink.mavutil.PX4_CUSTOM_SUB_MODE_AUTO_LOITER = 3

Definition at line 1958 of file mavutil.py.

int pymavlink.mavutil.PX4_CUSTOM_SUB_MODE_AUTO_MISSION = 4

Definition at line 1959 of file mavutil.py.

int pymavlink.mavutil.PX4_CUSTOM_SUB_MODE_AUTO_READY = 1

Definition at line 1956 of file mavutil.py.

int pymavlink.mavutil.PX4_CUSTOM_SUB_MODE_AUTO_RTGS = 7

Definition at line 1962 of file mavutil.py.

int pymavlink.mavutil.PX4_CUSTOM_SUB_MODE_AUTO_RTL = 5

Definition at line 1960 of file mavutil.py.

int pymavlink.mavutil.PX4_CUSTOM_SUB_MODE_AUTO_TAKEOFF = 2

Definition at line 1957 of file mavutil.py.

int pymavlink.mavutil.PX4_CUSTOM_SUB_MODE_OFFBOARD = 0

Definition at line 1955 of file mavutil.py.

dictionary pymavlink.mavutil.px4_map
Initial value:
1 = { "MANUAL": (mavlink.MAV_MODE_FLAG_CUSTOM_MODE_ENABLED | mavlink.MAV_MODE_FLAG_STABILIZE_ENABLED | mavlink.MAV_MODE_FLAG_MANUAL_INPUT_ENABLED, PX4_CUSTOM_MAIN_MODE_MANUAL, 0 ),
2  "STABILIZED": (mavlink.MAV_MODE_FLAG_CUSTOM_MODE_ENABLED | mavlink.MAV_MODE_FLAG_STABILIZE_ENABLED | mavlink.MAV_MODE_FLAG_MANUAL_INPUT_ENABLED, PX4_CUSTOM_MAIN_MODE_STABILIZED, 0 ),
3  "ACRO": (mavlink.MAV_MODE_FLAG_CUSTOM_MODE_ENABLED | mavlink.MAV_MODE_FLAG_MANUAL_INPUT_ENABLED, PX4_CUSTOM_MAIN_MODE_ACRO, 0 ),
4  "RATTITUDE": (mavlink.MAV_MODE_FLAG_CUSTOM_MODE_ENABLED | mavlink.MAV_MODE_FLAG_MANUAL_INPUT_ENABLED, PX4_CUSTOM_MAIN_MODE_RATTITUDE, 0 ),
5  "ALTCTL": (mavlink.MAV_MODE_FLAG_CUSTOM_MODE_ENABLED | mavlink.MAV_MODE_FLAG_STABILIZE_ENABLED | mavlink.MAV_MODE_FLAG_MANUAL_INPUT_ENABLED, PX4_CUSTOM_MAIN_MODE_ALTCTL, 0 ),
6  "POSCTL": (mavlink.MAV_MODE_FLAG_CUSTOM_MODE_ENABLED | mavlink.MAV_MODE_FLAG_STABILIZE_ENABLED | mavlink.MAV_MODE_FLAG_MANUAL_INPUT_ENABLED, PX4_CUSTOM_MAIN_MODE_POSCTL, 0 ),
7  "LOITER": (mavlink.MAV_MODE_FLAG_CUSTOM_MODE_ENABLED | auto_mode_flags, PX4_CUSTOM_MAIN_MODE_AUTO, PX4_CUSTOM_SUB_MODE_AUTO_LOITER ),
8  "MISSION": (mavlink.MAV_MODE_FLAG_CUSTOM_MODE_ENABLED | auto_mode_flags, PX4_CUSTOM_MAIN_MODE_AUTO, PX4_CUSTOM_SUB_MODE_AUTO_MISSION ),
9  "RTL": (mavlink.MAV_MODE_FLAG_CUSTOM_MODE_ENABLED | auto_mode_flags, PX4_CUSTOM_MAIN_MODE_AUTO, PX4_CUSTOM_SUB_MODE_AUTO_RTL ),
10  "LAND": (mavlink.MAV_MODE_FLAG_CUSTOM_MODE_ENABLED | auto_mode_flags, PX4_CUSTOM_MAIN_MODE_AUTO, PX4_CUSTOM_SUB_MODE_AUTO_LAND ),
11  "RTGS": (mavlink.MAV_MODE_FLAG_CUSTOM_MODE_ENABLED | auto_mode_flags, PX4_CUSTOM_MAIN_MODE_AUTO, PX4_CUSTOM_SUB_MODE_AUTO_RTGS ),
12  "FOLLOWME": (mavlink.MAV_MODE_FLAG_CUSTOM_MODE_ENABLED | auto_mode_flags, PX4_CUSTOM_MAIN_MODE_AUTO, PX4_CUSTOM_SUB_MODE_AUTO_FOLLOW_TARGET ),
13  "OFFBOARD": (mavlink.MAV_MODE_FLAG_CUSTOM_MODE_ENABLED | auto_mode_flags, PX4_CUSTOM_MAIN_MODE_OFFBOARD, 0 ),
14  "TAKEOFF": (mavlink.MAV_MODE_FLAG_CUSTOM_MODE_ENABLED | auto_mode_flags, PX4_CUSTOM_MAIN_MODE_AUTO, PX4_CUSTOM_SUB_MODE_AUTO_TAKEOFF )}

Definition at line 1969 of file mavutil.py.

pymavlink.mavutil.serial_list = auto_detect_serial(preferred_list=['*FTDI*',"*Arduino_Mega_2560*", "*3D_Robotics*", "*USB_to_UART*", '*PX4*', '*FMU*'])

Definition at line 2243 of file mavutil.py.

int pymavlink.mavutil.UDP_MAX_PACKET_LEN = 65535

Definition at line 25 of file mavutil.py.



mavlink
Author(s): Lorenz Meier
autogenerated on Sun Jul 7 2019 03:22:08