INSTRUCTION
stringlengths 1
46.3k
| RESPONSE
stringlengths 75
80.2k
|
---|---|
Request a list of available logs. On some systems calling this may
stop on-board logging until LOG_REQUEST_END is called.
target_system : System ID (uint8_t)
target_component : Component ID (uint8_t)
start : First log id (0 for first available) (uint16_t)
end : Last log id (0xffff for last available) (uint16_t)
|
def log_request_list_encode(self, target_system, target_component, start, end):
'''
Request a list of available logs. On some systems calling this may
stop on-board logging until LOG_REQUEST_END is called.
target_system : System ID (uint8_t)
target_component : Component ID (uint8_t)
start : First log id (0 for first available) (uint16_t)
end : Last log id (0xffff for last available) (uint16_t)
'''
return MAVLink_log_request_list_message(target_system, target_component, start, end)
|
Request a list of available logs. On some systems calling this may
stop on-board logging until LOG_REQUEST_END is called.
target_system : System ID (uint8_t)
target_component : Component ID (uint8_t)
start : First log id (0 for first available) (uint16_t)
end : Last log id (0xffff for last available) (uint16_t)
|
def log_request_list_send(self, target_system, target_component, start, end, force_mavlink1=False):
'''
Request a list of available logs. On some systems calling this may
stop on-board logging until LOG_REQUEST_END is called.
target_system : System ID (uint8_t)
target_component : Component ID (uint8_t)
start : First log id (0 for first available) (uint16_t)
end : Last log id (0xffff for last available) (uint16_t)
'''
return self.send(self.log_request_list_encode(target_system, target_component, start, end), force_mavlink1=force_mavlink1)
|
Reply to LOG_REQUEST_LIST
id : Log id (uint16_t)
num_logs : Total number of logs (uint16_t)
last_log_num : High log number (uint16_t)
time_utc : UTC timestamp of log in seconds since 1970, or 0 if not available (uint32_t)
size : Size of the log (may be approximate) in bytes (uint32_t)
|
def log_entry_encode(self, id, num_logs, last_log_num, time_utc, size):
'''
Reply to LOG_REQUEST_LIST
id : Log id (uint16_t)
num_logs : Total number of logs (uint16_t)
last_log_num : High log number (uint16_t)
time_utc : UTC timestamp of log in seconds since 1970, or 0 if not available (uint32_t)
size : Size of the log (may be approximate) in bytes (uint32_t)
'''
return MAVLink_log_entry_message(id, num_logs, last_log_num, time_utc, size)
|
Reply to LOG_REQUEST_LIST
id : Log id (uint16_t)
num_logs : Total number of logs (uint16_t)
last_log_num : High log number (uint16_t)
time_utc : UTC timestamp of log in seconds since 1970, or 0 if not available (uint32_t)
size : Size of the log (may be approximate) in bytes (uint32_t)
|
def log_entry_send(self, id, num_logs, last_log_num, time_utc, size, force_mavlink1=False):
'''
Reply to LOG_REQUEST_LIST
id : Log id (uint16_t)
num_logs : Total number of logs (uint16_t)
last_log_num : High log number (uint16_t)
time_utc : UTC timestamp of log in seconds since 1970, or 0 if not available (uint32_t)
size : Size of the log (may be approximate) in bytes (uint32_t)
'''
return self.send(self.log_entry_encode(id, num_logs, last_log_num, time_utc, size), force_mavlink1=force_mavlink1)
|
Request a chunk of a log
target_system : System ID (uint8_t)
target_component : Component ID (uint8_t)
id : Log id (from LOG_ENTRY reply) (uint16_t)
ofs : Offset into the log (uint32_t)
count : Number of bytes (uint32_t)
|
def log_request_data_encode(self, target_system, target_component, id, ofs, count):
'''
Request a chunk of a log
target_system : System ID (uint8_t)
target_component : Component ID (uint8_t)
id : Log id (from LOG_ENTRY reply) (uint16_t)
ofs : Offset into the log (uint32_t)
count : Number of bytes (uint32_t)
'''
return MAVLink_log_request_data_message(target_system, target_component, id, ofs, count)
|
Request a chunk of a log
target_system : System ID (uint8_t)
target_component : Component ID (uint8_t)
id : Log id (from LOG_ENTRY reply) (uint16_t)
ofs : Offset into the log (uint32_t)
count : Number of bytes (uint32_t)
|
def log_request_data_send(self, target_system, target_component, id, ofs, count, force_mavlink1=False):
'''
Request a chunk of a log
target_system : System ID (uint8_t)
target_component : Component ID (uint8_t)
id : Log id (from LOG_ENTRY reply) (uint16_t)
ofs : Offset into the log (uint32_t)
count : Number of bytes (uint32_t)
'''
return self.send(self.log_request_data_encode(target_system, target_component, id, ofs, count), force_mavlink1=force_mavlink1)
|
Reply to LOG_REQUEST_DATA
id : Log id (from LOG_ENTRY reply) (uint16_t)
ofs : Offset into the log (uint32_t)
count : Number of bytes (zero for end of log) (uint8_t)
data : log data (uint8_t)
|
def log_data_encode(self, id, ofs, count, data):
'''
Reply to LOG_REQUEST_DATA
id : Log id (from LOG_ENTRY reply) (uint16_t)
ofs : Offset into the log (uint32_t)
count : Number of bytes (zero for end of log) (uint8_t)
data : log data (uint8_t)
'''
return MAVLink_log_data_message(id, ofs, count, data)
|
Reply to LOG_REQUEST_DATA
id : Log id (from LOG_ENTRY reply) (uint16_t)
ofs : Offset into the log (uint32_t)
count : Number of bytes (zero for end of log) (uint8_t)
data : log data (uint8_t)
|
def log_data_send(self, id, ofs, count, data, force_mavlink1=False):
'''
Reply to LOG_REQUEST_DATA
id : Log id (from LOG_ENTRY reply) (uint16_t)
ofs : Offset into the log (uint32_t)
count : Number of bytes (zero for end of log) (uint8_t)
data : log data (uint8_t)
'''
return self.send(self.log_data_encode(id, ofs, count, data), force_mavlink1=force_mavlink1)
|
Erase all logs
target_system : System ID (uint8_t)
target_component : Component ID (uint8_t)
|
def log_erase_send(self, target_system, target_component, force_mavlink1=False):
'''
Erase all logs
target_system : System ID (uint8_t)
target_component : Component ID (uint8_t)
'''
return self.send(self.log_erase_encode(target_system, target_component), force_mavlink1=force_mavlink1)
|
Stop log transfer and resume normal logging
target_system : System ID (uint8_t)
target_component : Component ID (uint8_t)
|
def log_request_end_send(self, target_system, target_component, force_mavlink1=False):
'''
Stop log transfer and resume normal logging
target_system : System ID (uint8_t)
target_component : Component ID (uint8_t)
'''
return self.send(self.log_request_end_encode(target_system, target_component), force_mavlink1=force_mavlink1)
|
data for injecting into the onboard GPS (used for DGPS)
target_system : System ID (uint8_t)
target_component : Component ID (uint8_t)
len : data length (uint8_t)
data : raw data (110 is enough for 12 satellites of RTCMv2) (uint8_t)
|
def gps_inject_data_encode(self, target_system, target_component, len, data):
'''
data for injecting into the onboard GPS (used for DGPS)
target_system : System ID (uint8_t)
target_component : Component ID (uint8_t)
len : data length (uint8_t)
data : raw data (110 is enough for 12 satellites of RTCMv2) (uint8_t)
'''
return MAVLink_gps_inject_data_message(target_system, target_component, len, data)
|
data for injecting into the onboard GPS (used for DGPS)
target_system : System ID (uint8_t)
target_component : Component ID (uint8_t)
len : data length (uint8_t)
data : raw data (110 is enough for 12 satellites of RTCMv2) (uint8_t)
|
def gps_inject_data_send(self, target_system, target_component, len, data, force_mavlink1=False):
'''
data for injecting into the onboard GPS (used for DGPS)
target_system : System ID (uint8_t)
target_component : Component ID (uint8_t)
len : data length (uint8_t)
data : raw data (110 is enough for 12 satellites of RTCMv2) (uint8_t)
'''
return self.send(self.gps_inject_data_encode(target_system, target_component, len, data), force_mavlink1=force_mavlink1)
|
Second GPS data. 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) (int32_t)
eph : GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: UINT16_MAX (uint16_t)
epv : GPS VDOP vertical dilution of position in cm (m*100). 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)
dgps_numch : Number of DGPS satellites (uint8_t)
dgps_age : Age of DGPS info (uint32_t)
|
def gps2_raw_encode(self, time_usec, fix_type, lat, lon, alt, eph, epv, vel, cog, satellites_visible, dgps_numch, dgps_age):
'''
Second GPS data. 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) (int32_t)
eph : GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: UINT16_MAX (uint16_t)
epv : GPS VDOP vertical dilution of position in cm (m*100). 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)
dgps_numch : Number of DGPS satellites (uint8_t)
dgps_age : Age of DGPS info (uint32_t)
'''
return MAVLink_gps2_raw_message(time_usec, fix_type, lat, lon, alt, eph, epv, vel, cog, satellites_visible, dgps_numch, dgps_age)
|
Second GPS data. 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) (int32_t)
eph : GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: UINT16_MAX (uint16_t)
epv : GPS VDOP vertical dilution of position in cm (m*100). 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)
dgps_numch : Number of DGPS satellites (uint8_t)
dgps_age : Age of DGPS info (uint32_t)
|
def gps2_raw_send(self, time_usec, fix_type, lat, lon, alt, eph, epv, vel, cog, satellites_visible, dgps_numch, dgps_age, force_mavlink1=False):
'''
Second GPS data. 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) (int32_t)
eph : GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: UINT16_MAX (uint16_t)
epv : GPS VDOP vertical dilution of position in cm (m*100). 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)
dgps_numch : Number of DGPS satellites (uint8_t)
dgps_age : Age of DGPS info (uint32_t)
'''
return self.send(self.gps2_raw_encode(time_usec, fix_type, lat, lon, alt, eph, epv, vel, cog, satellites_visible, dgps_numch, dgps_age), force_mavlink1=force_mavlink1)
|
Power supply status
Vcc : 5V rail voltage in millivolts (uint16_t)
Vservo : servo rail voltage in millivolts (uint16_t)
flags : power supply status flags (see MAV_POWER_STATUS enum) (uint16_t)
|
def power_status_send(self, Vcc, Vservo, flags, force_mavlink1=False):
'''
Power supply status
Vcc : 5V rail voltage in millivolts (uint16_t)
Vservo : servo rail voltage in millivolts (uint16_t)
flags : power supply status flags (see MAV_POWER_STATUS enum) (uint16_t)
'''
return self.send(self.power_status_encode(Vcc, Vservo, flags), force_mavlink1=force_mavlink1)
|
Control a serial port. This can be used for raw access to an onboard
serial peripheral such as a GPS or telemetry radio. It
is designed to make it possible to update the devices
firmware via MAVLink messages or change the devices
settings. A message with zero bytes can be used to
change just the baudrate.
device : See SERIAL_CONTROL_DEV enum (uint8_t)
flags : See SERIAL_CONTROL_FLAG enum (uint8_t)
timeout : Timeout for reply data in milliseconds (uint16_t)
baudrate : Baudrate of transfer. Zero means no change. (uint32_t)
count : how many bytes in this transfer (uint8_t)
data : serial data (uint8_t)
|
def serial_control_encode(self, device, flags, timeout, baudrate, count, data):
'''
Control a serial port. This can be used for raw access to an onboard
serial peripheral such as a GPS or telemetry radio. It
is designed to make it possible to update the devices
firmware via MAVLink messages or change the devices
settings. A message with zero bytes can be used to
change just the baudrate.
device : See SERIAL_CONTROL_DEV enum (uint8_t)
flags : See SERIAL_CONTROL_FLAG enum (uint8_t)
timeout : Timeout for reply data in milliseconds (uint16_t)
baudrate : Baudrate of transfer. Zero means no change. (uint32_t)
count : how many bytes in this transfer (uint8_t)
data : serial data (uint8_t)
'''
return MAVLink_serial_control_message(device, flags, timeout, baudrate, count, data)
|
Control a serial port. This can be used for raw access to an onboard
serial peripheral such as a GPS or telemetry radio. It
is designed to make it possible to update the devices
firmware via MAVLink messages or change the devices
settings. A message with zero bytes can be used to
change just the baudrate.
device : See SERIAL_CONTROL_DEV enum (uint8_t)
flags : See SERIAL_CONTROL_FLAG enum (uint8_t)
timeout : Timeout for reply data in milliseconds (uint16_t)
baudrate : Baudrate of transfer. Zero means no change. (uint32_t)
count : how many bytes in this transfer (uint8_t)
data : serial data (uint8_t)
|
def serial_control_send(self, device, flags, timeout, baudrate, count, data, force_mavlink1=False):
'''
Control a serial port. This can be used for raw access to an onboard
serial peripheral such as a GPS or telemetry radio. It
is designed to make it possible to update the devices
firmware via MAVLink messages or change the devices
settings. A message with zero bytes can be used to
change just the baudrate.
device : See SERIAL_CONTROL_DEV enum (uint8_t)
flags : See SERIAL_CONTROL_FLAG enum (uint8_t)
timeout : Timeout for reply data in milliseconds (uint16_t)
baudrate : Baudrate of transfer. Zero means no change. (uint32_t)
count : how many bytes in this transfer (uint8_t)
data : serial data (uint8_t)
'''
return self.send(self.serial_control_encode(device, flags, timeout, baudrate, count, data), force_mavlink1=force_mavlink1)
|
RTK GPS data. Gives information on the relative baseline calculation
the GPS is reporting
time_last_baseline_ms : Time since boot of last baseline message received in ms. (uint32_t)
rtk_receiver_id : Identification of connected RTK receiver. (uint8_t)
wn : GPS Week Number of last baseline (uint16_t)
tow : GPS Time of Week of last baseline (uint32_t)
rtk_health : GPS-specific health report for RTK data. (uint8_t)
rtk_rate : Rate of baseline messages being received by GPS, in HZ (uint8_t)
nsats : Current number of sats used for RTK calculation. (uint8_t)
baseline_coords_type : Coordinate system of baseline. 0 == ECEF, 1 == NED (uint8_t)
baseline_a_mm : Current baseline in ECEF x or NED north component in mm. (int32_t)
baseline_b_mm : Current baseline in ECEF y or NED east component in mm. (int32_t)
baseline_c_mm : Current baseline in ECEF z or NED down component in mm. (int32_t)
accuracy : Current estimate of baseline accuracy. (uint32_t)
iar_num_hypotheses : Current number of integer ambiguity hypotheses. (int32_t)
|
def gps_rtk_encode(self, time_last_baseline_ms, rtk_receiver_id, wn, tow, rtk_health, rtk_rate, nsats, baseline_coords_type, baseline_a_mm, baseline_b_mm, baseline_c_mm, accuracy, iar_num_hypotheses):
'''
RTK GPS data. Gives information on the relative baseline calculation
the GPS is reporting
time_last_baseline_ms : Time since boot of last baseline message received in ms. (uint32_t)
rtk_receiver_id : Identification of connected RTK receiver. (uint8_t)
wn : GPS Week Number of last baseline (uint16_t)
tow : GPS Time of Week of last baseline (uint32_t)
rtk_health : GPS-specific health report for RTK data. (uint8_t)
rtk_rate : Rate of baseline messages being received by GPS, in HZ (uint8_t)
nsats : Current number of sats used for RTK calculation. (uint8_t)
baseline_coords_type : Coordinate system of baseline. 0 == ECEF, 1 == NED (uint8_t)
baseline_a_mm : Current baseline in ECEF x or NED north component in mm. (int32_t)
baseline_b_mm : Current baseline in ECEF y or NED east component in mm. (int32_t)
baseline_c_mm : Current baseline in ECEF z or NED down component in mm. (int32_t)
accuracy : Current estimate of baseline accuracy. (uint32_t)
iar_num_hypotheses : Current number of integer ambiguity hypotheses. (int32_t)
'''
return MAVLink_gps_rtk_message(time_last_baseline_ms, rtk_receiver_id, wn, tow, rtk_health, rtk_rate, nsats, baseline_coords_type, baseline_a_mm, baseline_b_mm, baseline_c_mm, accuracy, iar_num_hypotheses)
|
RTK GPS data. Gives information on the relative baseline calculation
the GPS is reporting
time_last_baseline_ms : Time since boot of last baseline message received in ms. (uint32_t)
rtk_receiver_id : Identification of connected RTK receiver. (uint8_t)
wn : GPS Week Number of last baseline (uint16_t)
tow : GPS Time of Week of last baseline (uint32_t)
rtk_health : GPS-specific health report for RTK data. (uint8_t)
rtk_rate : Rate of baseline messages being received by GPS, in HZ (uint8_t)
nsats : Current number of sats used for RTK calculation. (uint8_t)
baseline_coords_type : Coordinate system of baseline. 0 == ECEF, 1 == NED (uint8_t)
baseline_a_mm : Current baseline in ECEF x or NED north component in mm. (int32_t)
baseline_b_mm : Current baseline in ECEF y or NED east component in mm. (int32_t)
baseline_c_mm : Current baseline in ECEF z or NED down component in mm. (int32_t)
accuracy : Current estimate of baseline accuracy. (uint32_t)
iar_num_hypotheses : Current number of integer ambiguity hypotheses. (int32_t)
|
def gps_rtk_send(self, time_last_baseline_ms, rtk_receiver_id, wn, tow, rtk_health, rtk_rate, nsats, baseline_coords_type, baseline_a_mm, baseline_b_mm, baseline_c_mm, accuracy, iar_num_hypotheses, force_mavlink1=False):
'''
RTK GPS data. Gives information on the relative baseline calculation
the GPS is reporting
time_last_baseline_ms : Time since boot of last baseline message received in ms. (uint32_t)
rtk_receiver_id : Identification of connected RTK receiver. (uint8_t)
wn : GPS Week Number of last baseline (uint16_t)
tow : GPS Time of Week of last baseline (uint32_t)
rtk_health : GPS-specific health report for RTK data. (uint8_t)
rtk_rate : Rate of baseline messages being received by GPS, in HZ (uint8_t)
nsats : Current number of sats used for RTK calculation. (uint8_t)
baseline_coords_type : Coordinate system of baseline. 0 == ECEF, 1 == NED (uint8_t)
baseline_a_mm : Current baseline in ECEF x or NED north component in mm. (int32_t)
baseline_b_mm : Current baseline in ECEF y or NED east component in mm. (int32_t)
baseline_c_mm : Current baseline in ECEF z or NED down component in mm. (int32_t)
accuracy : Current estimate of baseline accuracy. (uint32_t)
iar_num_hypotheses : Current number of integer ambiguity hypotheses. (int32_t)
'''
return self.send(self.gps_rtk_encode(time_last_baseline_ms, rtk_receiver_id, wn, tow, rtk_health, rtk_rate, nsats, baseline_coords_type, baseline_a_mm, baseline_b_mm, baseline_c_mm, accuracy, iar_num_hypotheses), force_mavlink1=force_mavlink1)
|
RTK GPS data. Gives information on the relative baseline calculation
the GPS is reporting
time_last_baseline_ms : Time since boot of last baseline message received in ms. (uint32_t)
rtk_receiver_id : Identification of connected RTK receiver. (uint8_t)
wn : GPS Week Number of last baseline (uint16_t)
tow : GPS Time of Week of last baseline (uint32_t)
rtk_health : GPS-specific health report for RTK data. (uint8_t)
rtk_rate : Rate of baseline messages being received by GPS, in HZ (uint8_t)
nsats : Current number of sats used for RTK calculation. (uint8_t)
baseline_coords_type : Coordinate system of baseline. 0 == ECEF, 1 == NED (uint8_t)
baseline_a_mm : Current baseline in ECEF x or NED north component in mm. (int32_t)
baseline_b_mm : Current baseline in ECEF y or NED east component in mm. (int32_t)
baseline_c_mm : Current baseline in ECEF z or NED down component in mm. (int32_t)
accuracy : Current estimate of baseline accuracy. (uint32_t)
iar_num_hypotheses : Current number of integer ambiguity hypotheses. (int32_t)
|
def gps2_rtk_encode(self, time_last_baseline_ms, rtk_receiver_id, wn, tow, rtk_health, rtk_rate, nsats, baseline_coords_type, baseline_a_mm, baseline_b_mm, baseline_c_mm, accuracy, iar_num_hypotheses):
'''
RTK GPS data. Gives information on the relative baseline calculation
the GPS is reporting
time_last_baseline_ms : Time since boot of last baseline message received in ms. (uint32_t)
rtk_receiver_id : Identification of connected RTK receiver. (uint8_t)
wn : GPS Week Number of last baseline (uint16_t)
tow : GPS Time of Week of last baseline (uint32_t)
rtk_health : GPS-specific health report for RTK data. (uint8_t)
rtk_rate : Rate of baseline messages being received by GPS, in HZ (uint8_t)
nsats : Current number of sats used for RTK calculation. (uint8_t)
baseline_coords_type : Coordinate system of baseline. 0 == ECEF, 1 == NED (uint8_t)
baseline_a_mm : Current baseline in ECEF x or NED north component in mm. (int32_t)
baseline_b_mm : Current baseline in ECEF y or NED east component in mm. (int32_t)
baseline_c_mm : Current baseline in ECEF z or NED down component in mm. (int32_t)
accuracy : Current estimate of baseline accuracy. (uint32_t)
iar_num_hypotheses : Current number of integer ambiguity hypotheses. (int32_t)
'''
return MAVLink_gps2_rtk_message(time_last_baseline_ms, rtk_receiver_id, wn, tow, rtk_health, rtk_rate, nsats, baseline_coords_type, baseline_a_mm, baseline_b_mm, baseline_c_mm, accuracy, iar_num_hypotheses)
|
The RAW IMU readings for 3rd 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_imu3_encode(self, time_boot_ms, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag):
'''
The RAW IMU readings for 3rd 9DOF sensor setup. This message should
contain the scaled values to the described units
time_boot_ms : Timestamp (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_imu3_message(time_boot_ms, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag)
|
The RAW IMU readings for 3rd 9DOF sensor setup. This message should
contain the scaled values to the described units
time_boot_ms : Timestamp (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_imu3_send(self, time_boot_ms, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag, force_mavlink1=False):
'''
The RAW IMU readings for 3rd 9DOF sensor setup. This message should
contain the scaled values to the described units
time_boot_ms : Timestamp (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_imu3_encode(time_boot_ms, xacc, yacc, zacc, xgyro, ygyro, zgyro, xmag, ymag, zmag), force_mavlink1=force_mavlink1)
|
Request for terrain data and terrain status
lat : Latitude of SW corner of first grid (degrees *10^7) (int32_t)
lon : Longitude of SW corner of first grid (in degrees *10^7) (int32_t)
grid_spacing : Grid spacing in meters (uint16_t)
mask : Bitmask of requested 4x4 grids (row major 8x7 array of grids, 56 bits) (uint64_t)
|
def terrain_request_encode(self, lat, lon, grid_spacing, mask):
'''
Request for terrain data and terrain status
lat : Latitude of SW corner of first grid (degrees *10^7) (int32_t)
lon : Longitude of SW corner of first grid (in degrees *10^7) (int32_t)
grid_spacing : Grid spacing in meters (uint16_t)
mask : Bitmask of requested 4x4 grids (row major 8x7 array of grids, 56 bits) (uint64_t)
'''
return MAVLink_terrain_request_message(lat, lon, grid_spacing, mask)
|
Request for terrain data and terrain status
lat : Latitude of SW corner of first grid (degrees *10^7) (int32_t)
lon : Longitude of SW corner of first grid (in degrees *10^7) (int32_t)
grid_spacing : Grid spacing in meters (uint16_t)
mask : Bitmask of requested 4x4 grids (row major 8x7 array of grids, 56 bits) (uint64_t)
|
def terrain_request_send(self, lat, lon, grid_spacing, mask, force_mavlink1=False):
'''
Request for terrain data and terrain status
lat : Latitude of SW corner of first grid (degrees *10^7) (int32_t)
lon : Longitude of SW corner of first grid (in degrees *10^7) (int32_t)
grid_spacing : Grid spacing in meters (uint16_t)
mask : Bitmask of requested 4x4 grids (row major 8x7 array of grids, 56 bits) (uint64_t)
'''
return self.send(self.terrain_request_encode(lat, lon, grid_spacing, mask), force_mavlink1=force_mavlink1)
|
Terrain data sent from GCS. The lat/lon and grid_spacing must be the
same as a lat/lon from a TERRAIN_REQUEST
lat : Latitude of SW corner of first grid (degrees *10^7) (int32_t)
lon : Longitude of SW corner of first grid (in degrees *10^7) (int32_t)
grid_spacing : Grid spacing in meters (uint16_t)
gridbit : bit within the terrain request mask (uint8_t)
data : Terrain data in meters AMSL (int16_t)
|
def terrain_data_encode(self, lat, lon, grid_spacing, gridbit, data):
'''
Terrain data sent from GCS. The lat/lon and grid_spacing must be the
same as a lat/lon from a TERRAIN_REQUEST
lat : Latitude of SW corner of first grid (degrees *10^7) (int32_t)
lon : Longitude of SW corner of first grid (in degrees *10^7) (int32_t)
grid_spacing : Grid spacing in meters (uint16_t)
gridbit : bit within the terrain request mask (uint8_t)
data : Terrain data in meters AMSL (int16_t)
'''
return MAVLink_terrain_data_message(lat, lon, grid_spacing, gridbit, data)
|
Terrain data sent from GCS. The lat/lon and grid_spacing must be the
same as a lat/lon from a TERRAIN_REQUEST
lat : Latitude of SW corner of first grid (degrees *10^7) (int32_t)
lon : Longitude of SW corner of first grid (in degrees *10^7) (int32_t)
grid_spacing : Grid spacing in meters (uint16_t)
gridbit : bit within the terrain request mask (uint8_t)
data : Terrain data in meters AMSL (int16_t)
|
def terrain_data_send(self, lat, lon, grid_spacing, gridbit, data, force_mavlink1=False):
'''
Terrain data sent from GCS. The lat/lon and grid_spacing must be the
same as a lat/lon from a TERRAIN_REQUEST
lat : Latitude of SW corner of first grid (degrees *10^7) (int32_t)
lon : Longitude of SW corner of first grid (in degrees *10^7) (int32_t)
grid_spacing : Grid spacing in meters (uint16_t)
gridbit : bit within the terrain request mask (uint8_t)
data : Terrain data in meters AMSL (int16_t)
'''
return self.send(self.terrain_data_encode(lat, lon, grid_spacing, gridbit, data), force_mavlink1=force_mavlink1)
|
Request that the vehicle report terrain height at the given location.
Used by GCS to check if vehicle has all terrain data
needed for a mission.
lat : Latitude (degrees *10^7) (int32_t)
lon : Longitude (degrees *10^7) (int32_t)
|
def terrain_check_send(self, lat, lon, force_mavlink1=False):
'''
Request that the vehicle report terrain height at the given location.
Used by GCS to check if vehicle has all terrain data
needed for a mission.
lat : Latitude (degrees *10^7) (int32_t)
lon : Longitude (degrees *10^7) (int32_t)
'''
return self.send(self.terrain_check_encode(lat, lon), force_mavlink1=force_mavlink1)
|
Response from a TERRAIN_CHECK request
lat : Latitude (degrees *10^7) (int32_t)
lon : Longitude (degrees *10^7) (int32_t)
spacing : grid spacing (zero if terrain at this location unavailable) (uint16_t)
terrain_height : Terrain height in meters AMSL (float)
current_height : Current vehicle height above lat/lon terrain height (meters) (float)
pending : Number of 4x4 terrain blocks waiting to be received or read from disk (uint16_t)
loaded : Number of 4x4 terrain blocks in memory (uint16_t)
|
def terrain_report_encode(self, lat, lon, spacing, terrain_height, current_height, pending, loaded):
'''
Response from a TERRAIN_CHECK request
lat : Latitude (degrees *10^7) (int32_t)
lon : Longitude (degrees *10^7) (int32_t)
spacing : grid spacing (zero if terrain at this location unavailable) (uint16_t)
terrain_height : Terrain height in meters AMSL (float)
current_height : Current vehicle height above lat/lon terrain height (meters) (float)
pending : Number of 4x4 terrain blocks waiting to be received or read from disk (uint16_t)
loaded : Number of 4x4 terrain blocks in memory (uint16_t)
'''
return MAVLink_terrain_report_message(lat, lon, spacing, terrain_height, current_height, pending, loaded)
|
Response from a TERRAIN_CHECK request
lat : Latitude (degrees *10^7) (int32_t)
lon : Longitude (degrees *10^7) (int32_t)
spacing : grid spacing (zero if terrain at this location unavailable) (uint16_t)
terrain_height : Terrain height in meters AMSL (float)
current_height : Current vehicle height above lat/lon terrain height (meters) (float)
pending : Number of 4x4 terrain blocks waiting to be received or read from disk (uint16_t)
loaded : Number of 4x4 terrain blocks in memory (uint16_t)
|
def terrain_report_send(self, lat, lon, spacing, terrain_height, current_height, pending, loaded, force_mavlink1=False):
'''
Response from a TERRAIN_CHECK request
lat : Latitude (degrees *10^7) (int32_t)
lon : Longitude (degrees *10^7) (int32_t)
spacing : grid spacing (zero if terrain at this location unavailable) (uint16_t)
terrain_height : Terrain height in meters AMSL (float)
current_height : Current vehicle height above lat/lon terrain height (meters) (float)
pending : Number of 4x4 terrain blocks waiting to be received or read from disk (uint16_t)
loaded : Number of 4x4 terrain blocks in memory (uint16_t)
'''
return self.send(self.terrain_report_encode(lat, lon, spacing, terrain_height, current_height, pending, loaded), force_mavlink1=force_mavlink1)
|
Barometer readings for 2nd barometer
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_pressure2_encode(self, time_boot_ms, press_abs, press_diff, temperature):
'''
Barometer readings for 2nd barometer
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_pressure2_message(time_boot_ms, press_abs, press_diff, temperature)
|
Barometer readings for 2nd barometer
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_pressure2_send(self, time_boot_ms, press_abs, press_diff, temperature, force_mavlink1=False):
'''
Barometer readings for 2nd barometer
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_pressure2_encode(time_boot_ms, press_abs, press_diff, temperature), force_mavlink1=force_mavlink1)
|
Motion capture attitude and position
time_usec : Timestamp (micros since boot or Unix epoch) (uint64_t)
q : Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) (float)
x : X position in meters (NED) (float)
y : Y position in meters (NED) (float)
z : Z position in meters (NED) (float)
|
def att_pos_mocap_encode(self, time_usec, q, x, y, z):
'''
Motion capture attitude and position
time_usec : Timestamp (micros since boot or Unix epoch) (uint64_t)
q : Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) (float)
x : X position in meters (NED) (float)
y : Y position in meters (NED) (float)
z : Z position in meters (NED) (float)
'''
return MAVLink_att_pos_mocap_message(time_usec, q, x, y, z)
|
Motion capture attitude and position
time_usec : Timestamp (micros since boot or Unix epoch) (uint64_t)
q : Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) (float)
x : X position in meters (NED) (float)
y : Y position in meters (NED) (float)
z : Z position in meters (NED) (float)
|
def att_pos_mocap_send(self, time_usec, q, x, y, z, force_mavlink1=False):
'''
Motion capture attitude and position
time_usec : Timestamp (micros since boot or Unix epoch) (uint64_t)
q : Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) (float)
x : X position in meters (NED) (float)
y : Y position in meters (NED) (float)
z : Z position in meters (NED) (float)
'''
return self.send(self.att_pos_mocap_encode(time_usec, q, x, y, z), force_mavlink1=force_mavlink1)
|
Set the vehicle attitude and body angular rates.
time_usec : Timestamp (micros since boot or Unix epoch) (uint64_t)
group_mlx : Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances. (uint8_t)
target_system : System ID (uint8_t)
target_component : Component ID (uint8_t)
controls : Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs. (float)
|
def set_actuator_control_target_encode(self, time_usec, group_mlx, target_system, target_component, controls):
'''
Set the vehicle attitude and body angular rates.
time_usec : Timestamp (micros since boot or Unix epoch) (uint64_t)
group_mlx : Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances. (uint8_t)
target_system : System ID (uint8_t)
target_component : Component ID (uint8_t)
controls : Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs. (float)
'''
return MAVLink_set_actuator_control_target_message(time_usec, group_mlx, target_system, target_component, controls)
|
Set the vehicle attitude and body angular rates.
time_usec : Timestamp (micros since boot or Unix epoch) (uint64_t)
group_mlx : Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances. (uint8_t)
target_system : System ID (uint8_t)
target_component : Component ID (uint8_t)
controls : Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs. (float)
|
def set_actuator_control_target_send(self, time_usec, group_mlx, target_system, target_component, controls, force_mavlink1=False):
'''
Set the vehicle attitude and body angular rates.
time_usec : Timestamp (micros since boot or Unix epoch) (uint64_t)
group_mlx : Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances. (uint8_t)
target_system : System ID (uint8_t)
target_component : Component ID (uint8_t)
controls : Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs. (float)
'''
return self.send(self.set_actuator_control_target_encode(time_usec, group_mlx, target_system, target_component, controls), force_mavlink1=force_mavlink1)
|
Set the vehicle attitude and body angular rates.
time_usec : Timestamp (micros since boot or Unix epoch) (uint64_t)
group_mlx : Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances. (uint8_t)
controls : Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs. (float)
|
def actuator_control_target_send(self, time_usec, group_mlx, controls, force_mavlink1=False):
'''
Set the vehicle attitude and body angular rates.
time_usec : Timestamp (micros since boot or Unix epoch) (uint64_t)
group_mlx : Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances. (uint8_t)
controls : Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs. (float)
'''
return self.send(self.actuator_control_target_encode(time_usec, group_mlx, controls), force_mavlink1=force_mavlink1)
|
The current system altitude.
time_usec : Timestamp (micros since boot or Unix epoch) (uint64_t)
altitude_monotonic : This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights. (float)
altitude_amsl : This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output AMSL by default and not the WGS84 altitude. (float)
altitude_local : This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive. (float)
altitude_relative : This is the altitude above the home position. It resets on each change of the current home position. (float)
altitude_terrain : This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown. (float)
bottom_clearance : This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available. (float)
|
def altitude_encode(self, time_usec, altitude_monotonic, altitude_amsl, altitude_local, altitude_relative, altitude_terrain, bottom_clearance):
'''
The current system altitude.
time_usec : Timestamp (micros since boot or Unix epoch) (uint64_t)
altitude_monotonic : This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights. (float)
altitude_amsl : This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output AMSL by default and not the WGS84 altitude. (float)
altitude_local : This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive. (float)
altitude_relative : This is the altitude above the home position. It resets on each change of the current home position. (float)
altitude_terrain : This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown. (float)
bottom_clearance : This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available. (float)
'''
return MAVLink_altitude_message(time_usec, altitude_monotonic, altitude_amsl, altitude_local, altitude_relative, altitude_terrain, bottom_clearance)
|
The current system altitude.
time_usec : Timestamp (micros since boot or Unix epoch) (uint64_t)
altitude_monotonic : This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights. (float)
altitude_amsl : This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output AMSL by default and not the WGS84 altitude. (float)
altitude_local : This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive. (float)
altitude_relative : This is the altitude above the home position. It resets on each change of the current home position. (float)
altitude_terrain : This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown. (float)
bottom_clearance : This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available. (float)
|
def altitude_send(self, time_usec, altitude_monotonic, altitude_amsl, altitude_local, altitude_relative, altitude_terrain, bottom_clearance, force_mavlink1=False):
'''
The current system altitude.
time_usec : Timestamp (micros since boot or Unix epoch) (uint64_t)
altitude_monotonic : This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights. (float)
altitude_amsl : This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output AMSL by default and not the WGS84 altitude. (float)
altitude_local : This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive. (float)
altitude_relative : This is the altitude above the home position. It resets on each change of the current home position. (float)
altitude_terrain : This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown. (float)
bottom_clearance : This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available. (float)
'''
return self.send(self.altitude_encode(time_usec, altitude_monotonic, altitude_amsl, altitude_local, altitude_relative, altitude_terrain, bottom_clearance), force_mavlink1=force_mavlink1)
|
The autopilot is requesting a resource (file, binary, other type of
data)
request_id : Request ID. This ID should be re-used when sending back URI contents (uint8_t)
uri_type : The type of requested URI. 0 = a file via URL. 1 = a UAVCAN binary (uint8_t)
uri : The requested unique resource identifier (URI). It is not necessarily a straight domain name (depends on the URI type enum) (uint8_t)
transfer_type : The way the autopilot wants to receive the URI. 0 = MAVLink FTP. 1 = binary stream. (uint8_t)
storage : The storage path the autopilot wants the URI to be stored in. Will only be valid if the transfer_type has a storage associated (e.g. MAVLink FTP). (uint8_t)
|
def resource_request_encode(self, request_id, uri_type, uri, transfer_type, storage):
'''
The autopilot is requesting a resource (file, binary, other type of
data)
request_id : Request ID. This ID should be re-used when sending back URI contents (uint8_t)
uri_type : The type of requested URI. 0 = a file via URL. 1 = a UAVCAN binary (uint8_t)
uri : The requested unique resource identifier (URI). It is not necessarily a straight domain name (depends on the URI type enum) (uint8_t)
transfer_type : The way the autopilot wants to receive the URI. 0 = MAVLink FTP. 1 = binary stream. (uint8_t)
storage : The storage path the autopilot wants the URI to be stored in. Will only be valid if the transfer_type has a storage associated (e.g. MAVLink FTP). (uint8_t)
'''
return MAVLink_resource_request_message(request_id, uri_type, uri, transfer_type, storage)
|
The autopilot is requesting a resource (file, binary, other type of
data)
request_id : Request ID. This ID should be re-used when sending back URI contents (uint8_t)
uri_type : The type of requested URI. 0 = a file via URL. 1 = a UAVCAN binary (uint8_t)
uri : The requested unique resource identifier (URI). It is not necessarily a straight domain name (depends on the URI type enum) (uint8_t)
transfer_type : The way the autopilot wants to receive the URI. 0 = MAVLink FTP. 1 = binary stream. (uint8_t)
storage : The storage path the autopilot wants the URI to be stored in. Will only be valid if the transfer_type has a storage associated (e.g. MAVLink FTP). (uint8_t)
|
def resource_request_send(self, request_id, uri_type, uri, transfer_type, storage, force_mavlink1=False):
'''
The autopilot is requesting a resource (file, binary, other type of
data)
request_id : Request ID. This ID should be re-used when sending back URI contents (uint8_t)
uri_type : The type of requested URI. 0 = a file via URL. 1 = a UAVCAN binary (uint8_t)
uri : The requested unique resource identifier (URI). It is not necessarily a straight domain name (depends on the URI type enum) (uint8_t)
transfer_type : The way the autopilot wants to receive the URI. 0 = MAVLink FTP. 1 = binary stream. (uint8_t)
storage : The storage path the autopilot wants the URI to be stored in. Will only be valid if the transfer_type has a storage associated (e.g. MAVLink FTP). (uint8_t)
'''
return self.send(self.resource_request_encode(request_id, uri_type, uri, transfer_type, storage), force_mavlink1=force_mavlink1)
|
Barometer readings for 3rd barometer
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_pressure3_encode(self, time_boot_ms, press_abs, press_diff, temperature):
'''
Barometer readings for 3rd barometer
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_pressure3_message(time_boot_ms, press_abs, press_diff, temperature)
|
Barometer readings for 3rd barometer
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_pressure3_send(self, time_boot_ms, press_abs, press_diff, temperature, force_mavlink1=False):
'''
Barometer readings for 3rd barometer
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_pressure3_encode(time_boot_ms, press_abs, press_diff, temperature), force_mavlink1=force_mavlink1)
|
current motion information from a designated system
timestamp : Timestamp in milliseconds since system boot (uint64_t)
est_capabilities : bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3) (uint8_t)
lat : Latitude (WGS84), in degrees * 1E7 (int32_t)
lon : Longitude (WGS84), in degrees * 1E7 (int32_t)
alt : AMSL, in meters (float)
vel : target velocity (0,0,0) for unknown (float)
acc : linear target acceleration (0,0,0) for unknown (float)
attitude_q : (1 0 0 0 for unknown) (float)
rates : (0 0 0 for unknown) (float)
position_cov : eph epv (float)
custom_state : button states or switches of a tracker device (uint64_t)
|
def follow_target_encode(self, timestamp, est_capabilities, lat, lon, alt, vel, acc, attitude_q, rates, position_cov, custom_state):
'''
current motion information from a designated system
timestamp : Timestamp in milliseconds since system boot (uint64_t)
est_capabilities : bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3) (uint8_t)
lat : Latitude (WGS84), in degrees * 1E7 (int32_t)
lon : Longitude (WGS84), in degrees * 1E7 (int32_t)
alt : AMSL, in meters (float)
vel : target velocity (0,0,0) for unknown (float)
acc : linear target acceleration (0,0,0) for unknown (float)
attitude_q : (1 0 0 0 for unknown) (float)
rates : (0 0 0 for unknown) (float)
position_cov : eph epv (float)
custom_state : button states or switches of a tracker device (uint64_t)
'''
return MAVLink_follow_target_message(timestamp, est_capabilities, lat, lon, alt, vel, acc, attitude_q, rates, position_cov, custom_state)
|
current motion information from a designated system
timestamp : Timestamp in milliseconds since system boot (uint64_t)
est_capabilities : bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3) (uint8_t)
lat : Latitude (WGS84), in degrees * 1E7 (int32_t)
lon : Longitude (WGS84), in degrees * 1E7 (int32_t)
alt : AMSL, in meters (float)
vel : target velocity (0,0,0) for unknown (float)
acc : linear target acceleration (0,0,0) for unknown (float)
attitude_q : (1 0 0 0 for unknown) (float)
rates : (0 0 0 for unknown) (float)
position_cov : eph epv (float)
custom_state : button states or switches of a tracker device (uint64_t)
|
def follow_target_send(self, timestamp, est_capabilities, lat, lon, alt, vel, acc, attitude_q, rates, position_cov, custom_state, force_mavlink1=False):
'''
current motion information from a designated system
timestamp : Timestamp in milliseconds since system boot (uint64_t)
est_capabilities : bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3) (uint8_t)
lat : Latitude (WGS84), in degrees * 1E7 (int32_t)
lon : Longitude (WGS84), in degrees * 1E7 (int32_t)
alt : AMSL, in meters (float)
vel : target velocity (0,0,0) for unknown (float)
acc : linear target acceleration (0,0,0) for unknown (float)
attitude_q : (1 0 0 0 for unknown) (float)
rates : (0 0 0 for unknown) (float)
position_cov : eph epv (float)
custom_state : button states or switches of a tracker device (uint64_t)
'''
return self.send(self.follow_target_encode(timestamp, est_capabilities, lat, lon, alt, vel, acc, attitude_q, rates, position_cov, custom_state), force_mavlink1=force_mavlink1)
|
The smoothed, monotonic system state used to feed the control loops of
the system.
time_usec : Timestamp (micros since boot or Unix epoch) (uint64_t)
x_acc : X acceleration in body frame (float)
y_acc : Y acceleration in body frame (float)
z_acc : Z acceleration in body frame (float)
x_vel : X velocity in body frame (float)
y_vel : Y velocity in body frame (float)
z_vel : Z velocity in body frame (float)
x_pos : X position in local frame (float)
y_pos : Y position in local frame (float)
z_pos : Z position in local frame (float)
airspeed : Airspeed, set to -1 if unknown (float)
vel_variance : Variance of body velocity estimate (float)
pos_variance : Variance in local position (float)
q : The attitude, represented as Quaternion (float)
roll_rate : Angular rate in roll axis (float)
pitch_rate : Angular rate in pitch axis (float)
yaw_rate : Angular rate in yaw axis (float)
|
def control_system_state_encode(self, time_usec, x_acc, y_acc, z_acc, x_vel, y_vel, z_vel, x_pos, y_pos, z_pos, airspeed, vel_variance, pos_variance, q, roll_rate, pitch_rate, yaw_rate):
'''
The smoothed, monotonic system state used to feed the control loops of
the system.
time_usec : Timestamp (micros since boot or Unix epoch) (uint64_t)
x_acc : X acceleration in body frame (float)
y_acc : Y acceleration in body frame (float)
z_acc : Z acceleration in body frame (float)
x_vel : X velocity in body frame (float)
y_vel : Y velocity in body frame (float)
z_vel : Z velocity in body frame (float)
x_pos : X position in local frame (float)
y_pos : Y position in local frame (float)
z_pos : Z position in local frame (float)
airspeed : Airspeed, set to -1 if unknown (float)
vel_variance : Variance of body velocity estimate (float)
pos_variance : Variance in local position (float)
q : The attitude, represented as Quaternion (float)
roll_rate : Angular rate in roll axis (float)
pitch_rate : Angular rate in pitch axis (float)
yaw_rate : Angular rate in yaw axis (float)
'''
return MAVLink_control_system_state_message(time_usec, x_acc, y_acc, z_acc, x_vel, y_vel, z_vel, x_pos, y_pos, z_pos, airspeed, vel_variance, pos_variance, q, roll_rate, pitch_rate, yaw_rate)
|
The smoothed, monotonic system state used to feed the control loops of
the system.
time_usec : Timestamp (micros since boot or Unix epoch) (uint64_t)
x_acc : X acceleration in body frame (float)
y_acc : Y acceleration in body frame (float)
z_acc : Z acceleration in body frame (float)
x_vel : X velocity in body frame (float)
y_vel : Y velocity in body frame (float)
z_vel : Z velocity in body frame (float)
x_pos : X position in local frame (float)
y_pos : Y position in local frame (float)
z_pos : Z position in local frame (float)
airspeed : Airspeed, set to -1 if unknown (float)
vel_variance : Variance of body velocity estimate (float)
pos_variance : Variance in local position (float)
q : The attitude, represented as Quaternion (float)
roll_rate : Angular rate in roll axis (float)
pitch_rate : Angular rate in pitch axis (float)
yaw_rate : Angular rate in yaw axis (float)
|
def control_system_state_send(self, time_usec, x_acc, y_acc, z_acc, x_vel, y_vel, z_vel, x_pos, y_pos, z_pos, airspeed, vel_variance, pos_variance, q, roll_rate, pitch_rate, yaw_rate, force_mavlink1=False):
'''
The smoothed, monotonic system state used to feed the control loops of
the system.
time_usec : Timestamp (micros since boot or Unix epoch) (uint64_t)
x_acc : X acceleration in body frame (float)
y_acc : Y acceleration in body frame (float)
z_acc : Z acceleration in body frame (float)
x_vel : X velocity in body frame (float)
y_vel : Y velocity in body frame (float)
z_vel : Z velocity in body frame (float)
x_pos : X position in local frame (float)
y_pos : Y position in local frame (float)
z_pos : Z position in local frame (float)
airspeed : Airspeed, set to -1 if unknown (float)
vel_variance : Variance of body velocity estimate (float)
pos_variance : Variance in local position (float)
q : The attitude, represented as Quaternion (float)
roll_rate : Angular rate in roll axis (float)
pitch_rate : Angular rate in pitch axis (float)
yaw_rate : Angular rate in yaw axis (float)
'''
return self.send(self.control_system_state_encode(time_usec, x_acc, y_acc, z_acc, x_vel, y_vel, z_vel, x_pos, y_pos, z_pos, airspeed, vel_variance, pos_variance, q, roll_rate, pitch_rate, yaw_rate), force_mavlink1=force_mavlink1)
|
Battery information
id : Battery ID (uint8_t)
battery_function : Function of the battery (uint8_t)
type : Type (chemistry) of the battery (uint8_t)
temperature : Temperature of the battery in centi-degrees celsius. INT16_MAX for unknown temperature. (int16_t)
voltages : Battery voltage of cells, in millivolts (1 = 1 millivolt). Cells above the valid cell count for this battery should have the UINT16_MAX value. (uint16_t)
current_battery : Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current (int16_t)
current_consumed : Consumed charge, in milliampere hours (1 = 1 mAh), -1: autopilot does not provide mAh consumption estimate (int32_t)
energy_consumed : Consumed energy, in 100*Joules (intergrated U*I*dt) (1 = 100 Joule), -1: autopilot does not provide energy consumption estimate (int32_t)
battery_remaining : Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot does not estimate the remaining battery (int8_t)
|
def battery_status_encode(self, id, battery_function, type, temperature, voltages, current_battery, current_consumed, energy_consumed, battery_remaining):
'''
Battery information
id : Battery ID (uint8_t)
battery_function : Function of the battery (uint8_t)
type : Type (chemistry) of the battery (uint8_t)
temperature : Temperature of the battery in centi-degrees celsius. INT16_MAX for unknown temperature. (int16_t)
voltages : Battery voltage of cells, in millivolts (1 = 1 millivolt). Cells above the valid cell count for this battery should have the UINT16_MAX value. (uint16_t)
current_battery : Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current (int16_t)
current_consumed : Consumed charge, in milliampere hours (1 = 1 mAh), -1: autopilot does not provide mAh consumption estimate (int32_t)
energy_consumed : Consumed energy, in 100*Joules (intergrated U*I*dt) (1 = 100 Joule), -1: autopilot does not provide energy consumption estimate (int32_t)
battery_remaining : Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot does not estimate the remaining battery (int8_t)
'''
return MAVLink_battery_status_message(id, battery_function, type, temperature, voltages, current_battery, current_consumed, energy_consumed, battery_remaining)
|
Battery information
id : Battery ID (uint8_t)
battery_function : Function of the battery (uint8_t)
type : Type (chemistry) of the battery (uint8_t)
temperature : Temperature of the battery in centi-degrees celsius. INT16_MAX for unknown temperature. (int16_t)
voltages : Battery voltage of cells, in millivolts (1 = 1 millivolt). Cells above the valid cell count for this battery should have the UINT16_MAX value. (uint16_t)
current_battery : Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current (int16_t)
current_consumed : Consumed charge, in milliampere hours (1 = 1 mAh), -1: autopilot does not provide mAh consumption estimate (int32_t)
energy_consumed : Consumed energy, in 100*Joules (intergrated U*I*dt) (1 = 100 Joule), -1: autopilot does not provide energy consumption estimate (int32_t)
battery_remaining : Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot does not estimate the remaining battery (int8_t)
|
def battery_status_send(self, id, battery_function, type, temperature, voltages, current_battery, current_consumed, energy_consumed, battery_remaining, force_mavlink1=False):
'''
Battery information
id : Battery ID (uint8_t)
battery_function : Function of the battery (uint8_t)
type : Type (chemistry) of the battery (uint8_t)
temperature : Temperature of the battery in centi-degrees celsius. INT16_MAX for unknown temperature. (int16_t)
voltages : Battery voltage of cells, in millivolts (1 = 1 millivolt). Cells above the valid cell count for this battery should have the UINT16_MAX value. (uint16_t)
current_battery : Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current (int16_t)
current_consumed : Consumed charge, in milliampere hours (1 = 1 mAh), -1: autopilot does not provide mAh consumption estimate (int32_t)
energy_consumed : Consumed energy, in 100*Joules (intergrated U*I*dt) (1 = 100 Joule), -1: autopilot does not provide energy consumption estimate (int32_t)
battery_remaining : Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot does not estimate the remaining battery (int8_t)
'''
return self.send(self.battery_status_encode(id, battery_function, type, temperature, voltages, current_battery, current_consumed, energy_consumed, battery_remaining), force_mavlink1=force_mavlink1)
|
Version and capability of autopilot software
capabilities : bitmask of capabilities (see MAV_PROTOCOL_CAPABILITY enum) (uint64_t)
flight_sw_version : Firmware version number (uint32_t)
middleware_sw_version : Middleware version number (uint32_t)
os_sw_version : Operating system version number (uint32_t)
board_version : HW / board version (last 8 bytes should be silicon ID, if any) (uint32_t)
flight_custom_version : Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases. (uint8_t)
middleware_custom_version : Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases. (uint8_t)
os_custom_version : Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases. (uint8_t)
vendor_id : ID of the board vendor (uint16_t)
product_id : ID of the product (uint16_t)
uid : UID if provided by hardware (uint64_t)
|
def autopilot_version_encode(self, capabilities, flight_sw_version, middleware_sw_version, os_sw_version, board_version, flight_custom_version, middleware_custom_version, os_custom_version, vendor_id, product_id, uid):
'''
Version and capability of autopilot software
capabilities : bitmask of capabilities (see MAV_PROTOCOL_CAPABILITY enum) (uint64_t)
flight_sw_version : Firmware version number (uint32_t)
middleware_sw_version : Middleware version number (uint32_t)
os_sw_version : Operating system version number (uint32_t)
board_version : HW / board version (last 8 bytes should be silicon ID, if any) (uint32_t)
flight_custom_version : Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases. (uint8_t)
middleware_custom_version : Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases. (uint8_t)
os_custom_version : Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases. (uint8_t)
vendor_id : ID of the board vendor (uint16_t)
product_id : ID of the product (uint16_t)
uid : UID if provided by hardware (uint64_t)
'''
return MAVLink_autopilot_version_message(capabilities, flight_sw_version, middleware_sw_version, os_sw_version, board_version, flight_custom_version, middleware_custom_version, os_custom_version, vendor_id, product_id, uid)
|
Version and capability of autopilot software
capabilities : bitmask of capabilities (see MAV_PROTOCOL_CAPABILITY enum) (uint64_t)
flight_sw_version : Firmware version number (uint32_t)
middleware_sw_version : Middleware version number (uint32_t)
os_sw_version : Operating system version number (uint32_t)
board_version : HW / board version (last 8 bytes should be silicon ID, if any) (uint32_t)
flight_custom_version : Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases. (uint8_t)
middleware_custom_version : Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases. (uint8_t)
os_custom_version : Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases. (uint8_t)
vendor_id : ID of the board vendor (uint16_t)
product_id : ID of the product (uint16_t)
uid : UID if provided by hardware (uint64_t)
|
def autopilot_version_send(self, capabilities, flight_sw_version, middleware_sw_version, os_sw_version, board_version, flight_custom_version, middleware_custom_version, os_custom_version, vendor_id, product_id, uid, force_mavlink1=False):
'''
Version and capability of autopilot software
capabilities : bitmask of capabilities (see MAV_PROTOCOL_CAPABILITY enum) (uint64_t)
flight_sw_version : Firmware version number (uint32_t)
middleware_sw_version : Middleware version number (uint32_t)
os_sw_version : Operating system version number (uint32_t)
board_version : HW / board version (last 8 bytes should be silicon ID, if any) (uint32_t)
flight_custom_version : Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases. (uint8_t)
middleware_custom_version : Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases. (uint8_t)
os_custom_version : Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases. (uint8_t)
vendor_id : ID of the board vendor (uint16_t)
product_id : ID of the product (uint16_t)
uid : UID if provided by hardware (uint64_t)
'''
return self.send(self.autopilot_version_encode(capabilities, flight_sw_version, middleware_sw_version, os_sw_version, board_version, flight_custom_version, middleware_custom_version, os_custom_version, vendor_id, product_id, uid), force_mavlink1=force_mavlink1)
|
The location of a landing area captured from a downward facing camera
time_usec : Timestamp (micros since boot or Unix epoch) (uint64_t)
target_num : The ID of the target if multiple targets are present (uint8_t)
frame : MAV_FRAME enum specifying the whether the following feilds are earth-frame, body-frame, etc. (uint8_t)
angle_x : X-axis angular offset (in radians) of the target from the center of the image (float)
angle_y : Y-axis angular offset (in radians) of the target from the center of the image (float)
distance : Distance to the target from the vehicle in meters (float)
size_x : Size in radians of target along x-axis (float)
size_y : Size in radians of target along y-axis (float)
|
def landing_target_encode(self, time_usec, target_num, frame, angle_x, angle_y, distance, size_x, size_y):
'''
The location of a landing area captured from a downward facing camera
time_usec : Timestamp (micros since boot or Unix epoch) (uint64_t)
target_num : The ID of the target if multiple targets are present (uint8_t)
frame : MAV_FRAME enum specifying the whether the following feilds are earth-frame, body-frame, etc. (uint8_t)
angle_x : X-axis angular offset (in radians) of the target from the center of the image (float)
angle_y : Y-axis angular offset (in radians) of the target from the center of the image (float)
distance : Distance to the target from the vehicle in meters (float)
size_x : Size in radians of target along x-axis (float)
size_y : Size in radians of target along y-axis (float)
'''
return MAVLink_landing_target_message(time_usec, target_num, frame, angle_x, angle_y, distance, size_x, size_y)
|
The location of a landing area captured from a downward facing camera
time_usec : Timestamp (micros since boot or Unix epoch) (uint64_t)
target_num : The ID of the target if multiple targets are present (uint8_t)
frame : MAV_FRAME enum specifying the whether the following feilds are earth-frame, body-frame, etc. (uint8_t)
angle_x : X-axis angular offset (in radians) of the target from the center of the image (float)
angle_y : Y-axis angular offset (in radians) of the target from the center of the image (float)
distance : Distance to the target from the vehicle in meters (float)
size_x : Size in radians of target along x-axis (float)
size_y : Size in radians of target along y-axis (float)
|
def landing_target_send(self, time_usec, target_num, frame, angle_x, angle_y, distance, size_x, size_y, force_mavlink1=False):
'''
The location of a landing area captured from a downward facing camera
time_usec : Timestamp (micros since boot or Unix epoch) (uint64_t)
target_num : The ID of the target if multiple targets are present (uint8_t)
frame : MAV_FRAME enum specifying the whether the following feilds are earth-frame, body-frame, etc. (uint8_t)
angle_x : X-axis angular offset (in radians) of the target from the center of the image (float)
angle_y : Y-axis angular offset (in radians) of the target from the center of the image (float)
distance : Distance to the target from the vehicle in meters (float)
size_x : Size in radians of target along x-axis (float)
size_y : Size in radians of target along y-axis (float)
'''
return self.send(self.landing_target_encode(time_usec, target_num, frame, angle_x, angle_y, distance, size_x, size_y), force_mavlink1=force_mavlink1)
|
Estimator status message including flags, innovation test ratios and
estimated accuracies. The flags message is an integer
bitmask containing information on which EKF outputs
are valid. See the ESTIMATOR_STATUS_FLAGS enum
definition for further information. The innovaton test
ratios show the magnitude of the sensor innovation
divided by the innovation check threshold. Under
normal operation the innovaton test ratios should be
below 0.5 with occasional values up to 1.0. Values
greater than 1.0 should be rare under normal operation
and indicate that a measurement has been rejected by
the filter. The user should be notified if an
innovation test ratio greater than 1.0 is recorded.
Notifications for values in the range between 0.5 and
1.0 should be optional and controllable by the user.
time_usec : Timestamp (micros since boot or Unix epoch) (uint64_t)
flags : Integer bitmask indicating which EKF outputs are valid. See definition for ESTIMATOR_STATUS_FLAGS. (uint16_t)
vel_ratio : Velocity innovation test ratio (float)
pos_horiz_ratio : Horizontal position innovation test ratio (float)
pos_vert_ratio : Vertical position innovation test ratio (float)
mag_ratio : Magnetometer innovation test ratio (float)
hagl_ratio : Height above terrain innovation test ratio (float)
tas_ratio : True airspeed innovation test ratio (float)
pos_horiz_accuracy : Horizontal position 1-STD accuracy relative to the EKF local origin (m) (float)
pos_vert_accuracy : Vertical position 1-STD accuracy relative to the EKF local origin (m) (float)
|
def estimator_status_encode(self, time_usec, flags, vel_ratio, pos_horiz_ratio, pos_vert_ratio, mag_ratio, hagl_ratio, tas_ratio, pos_horiz_accuracy, pos_vert_accuracy):
'''
Estimator status message including flags, innovation test ratios and
estimated accuracies. The flags message is an integer
bitmask containing information on which EKF outputs
are valid. See the ESTIMATOR_STATUS_FLAGS enum
definition for further information. The innovaton test
ratios show the magnitude of the sensor innovation
divided by the innovation check threshold. Under
normal operation the innovaton test ratios should be
below 0.5 with occasional values up to 1.0. Values
greater than 1.0 should be rare under normal operation
and indicate that a measurement has been rejected by
the filter. The user should be notified if an
innovation test ratio greater than 1.0 is recorded.
Notifications for values in the range between 0.5 and
1.0 should be optional and controllable by the user.
time_usec : Timestamp (micros since boot or Unix epoch) (uint64_t)
flags : Integer bitmask indicating which EKF outputs are valid. See definition for ESTIMATOR_STATUS_FLAGS. (uint16_t)
vel_ratio : Velocity innovation test ratio (float)
pos_horiz_ratio : Horizontal position innovation test ratio (float)
pos_vert_ratio : Vertical position innovation test ratio (float)
mag_ratio : Magnetometer innovation test ratio (float)
hagl_ratio : Height above terrain innovation test ratio (float)
tas_ratio : True airspeed innovation test ratio (float)
pos_horiz_accuracy : Horizontal position 1-STD accuracy relative to the EKF local origin (m) (float)
pos_vert_accuracy : Vertical position 1-STD accuracy relative to the EKF local origin (m) (float)
'''
return MAVLink_estimator_status_message(time_usec, flags, vel_ratio, pos_horiz_ratio, pos_vert_ratio, mag_ratio, hagl_ratio, tas_ratio, pos_horiz_accuracy, pos_vert_accuracy)
|
Estimator status message including flags, innovation test ratios and
estimated accuracies. The flags message is an integer
bitmask containing information on which EKF outputs
are valid. See the ESTIMATOR_STATUS_FLAGS enum
definition for further information. The innovaton test
ratios show the magnitude of the sensor innovation
divided by the innovation check threshold. Under
normal operation the innovaton test ratios should be
below 0.5 with occasional values up to 1.0. Values
greater than 1.0 should be rare under normal operation
and indicate that a measurement has been rejected by
the filter. The user should be notified if an
innovation test ratio greater than 1.0 is recorded.
Notifications for values in the range between 0.5 and
1.0 should be optional and controllable by the user.
time_usec : Timestamp (micros since boot or Unix epoch) (uint64_t)
flags : Integer bitmask indicating which EKF outputs are valid. See definition for ESTIMATOR_STATUS_FLAGS. (uint16_t)
vel_ratio : Velocity innovation test ratio (float)
pos_horiz_ratio : Horizontal position innovation test ratio (float)
pos_vert_ratio : Vertical position innovation test ratio (float)
mag_ratio : Magnetometer innovation test ratio (float)
hagl_ratio : Height above terrain innovation test ratio (float)
tas_ratio : True airspeed innovation test ratio (float)
pos_horiz_accuracy : Horizontal position 1-STD accuracy relative to the EKF local origin (m) (float)
pos_vert_accuracy : Vertical position 1-STD accuracy relative to the EKF local origin (m) (float)
|
def estimator_status_send(self, time_usec, flags, vel_ratio, pos_horiz_ratio, pos_vert_ratio, mag_ratio, hagl_ratio, tas_ratio, pos_horiz_accuracy, pos_vert_accuracy, force_mavlink1=False):
'''
Estimator status message including flags, innovation test ratios and
estimated accuracies. The flags message is an integer
bitmask containing information on which EKF outputs
are valid. See the ESTIMATOR_STATUS_FLAGS enum
definition for further information. The innovaton test
ratios show the magnitude of the sensor innovation
divided by the innovation check threshold. Under
normal operation the innovaton test ratios should be
below 0.5 with occasional values up to 1.0. Values
greater than 1.0 should be rare under normal operation
and indicate that a measurement has been rejected by
the filter. The user should be notified if an
innovation test ratio greater than 1.0 is recorded.
Notifications for values in the range between 0.5 and
1.0 should be optional and controllable by the user.
time_usec : Timestamp (micros since boot or Unix epoch) (uint64_t)
flags : Integer bitmask indicating which EKF outputs are valid. See definition for ESTIMATOR_STATUS_FLAGS. (uint16_t)
vel_ratio : Velocity innovation test ratio (float)
pos_horiz_ratio : Horizontal position innovation test ratio (float)
pos_vert_ratio : Vertical position innovation test ratio (float)
mag_ratio : Magnetometer innovation test ratio (float)
hagl_ratio : Height above terrain innovation test ratio (float)
tas_ratio : True airspeed innovation test ratio (float)
pos_horiz_accuracy : Horizontal position 1-STD accuracy relative to the EKF local origin (m) (float)
pos_vert_accuracy : Vertical position 1-STD accuracy relative to the EKF local origin (m) (float)
'''
return self.send(self.estimator_status_encode(time_usec, flags, vel_ratio, pos_horiz_ratio, pos_vert_ratio, mag_ratio, hagl_ratio, tas_ratio, pos_horiz_accuracy, pos_vert_accuracy), force_mavlink1=force_mavlink1)
|
GPS sensor input message. This is a raw sensor value sent by the GPS.
This is NOT the global position estimate of the sytem.
time_usec : Timestamp (micros since boot or Unix epoch) (uint64_t)
gps_id : ID of the GPS for multiple GPS inputs (uint8_t)
ignore_flags : Flags indicating which fields to ignore (see GPS_INPUT_IGNORE_FLAGS enum). All other fields must be provided. (uint16_t)
time_week_ms : GPS time (milliseconds from start of GPS week) (uint32_t)
time_week : GPS week number (uint16_t)
fix_type : 0-1: no fix, 2: 2D fix, 3: 3D fix. 4: 3D with DGPS. 5: 3D with RTK (uint8_t)
lat : Latitude (WGS84), in degrees * 1E7 (int32_t)
lon : Longitude (WGS84), in degrees * 1E7 (int32_t)
alt : Altitude (AMSL, not WGS84), in m (positive for up) (float)
hdop : GPS HDOP horizontal dilution of position in m (float)
vdop : GPS VDOP vertical dilution of position in m (float)
vn : GPS velocity in m/s in NORTH direction in earth-fixed NED frame (float)
ve : GPS velocity in m/s in EAST direction in earth-fixed NED frame (float)
vd : GPS velocity in m/s in DOWN direction in earth-fixed NED frame (float)
speed_accuracy : GPS speed accuracy in m/s (float)
horiz_accuracy : GPS horizontal accuracy in m (float)
vert_accuracy : GPS vertical accuracy in m (float)
satellites_visible : Number of satellites visible. (uint8_t)
|
def gps_input_encode(self, time_usec, gps_id, ignore_flags, time_week_ms, time_week, fix_type, lat, lon, alt, hdop, vdop, vn, ve, vd, speed_accuracy, horiz_accuracy, vert_accuracy, satellites_visible):
'''
GPS sensor input message. This is a raw sensor value sent by the GPS.
This is NOT the global position estimate of the sytem.
time_usec : Timestamp (micros since boot or Unix epoch) (uint64_t)
gps_id : ID of the GPS for multiple GPS inputs (uint8_t)
ignore_flags : Flags indicating which fields to ignore (see GPS_INPUT_IGNORE_FLAGS enum). All other fields must be provided. (uint16_t)
time_week_ms : GPS time (milliseconds from start of GPS week) (uint32_t)
time_week : GPS week number (uint16_t)
fix_type : 0-1: no fix, 2: 2D fix, 3: 3D fix. 4: 3D with DGPS. 5: 3D with RTK (uint8_t)
lat : Latitude (WGS84), in degrees * 1E7 (int32_t)
lon : Longitude (WGS84), in degrees * 1E7 (int32_t)
alt : Altitude (AMSL, not WGS84), in m (positive for up) (float)
hdop : GPS HDOP horizontal dilution of position in m (float)
vdop : GPS VDOP vertical dilution of position in m (float)
vn : GPS velocity in m/s in NORTH direction in earth-fixed NED frame (float)
ve : GPS velocity in m/s in EAST direction in earth-fixed NED frame (float)
vd : GPS velocity in m/s in DOWN direction in earth-fixed NED frame (float)
speed_accuracy : GPS speed accuracy in m/s (float)
horiz_accuracy : GPS horizontal accuracy in m (float)
vert_accuracy : GPS vertical accuracy in m (float)
satellites_visible : Number of satellites visible. (uint8_t)
'''
return MAVLink_gps_input_message(time_usec, gps_id, ignore_flags, time_week_ms, time_week, fix_type, lat, lon, alt, hdop, vdop, vn, ve, vd, speed_accuracy, horiz_accuracy, vert_accuracy, satellites_visible)
|
WORK IN PROGRESS! RTCM message for injecting into the onboard GPS
(used for DGPS)
flags : LSB: 1 means message is fragmented (uint8_t)
len : data length (uint8_t)
data : RTCM message (may be fragmented) (uint8_t)
|
def gps_rtcm_data_send(self, flags, len, data, force_mavlink1=False):
'''
WORK IN PROGRESS! RTCM message for injecting into the onboard GPS
(used for DGPS)
flags : LSB: 1 means message is fragmented (uint8_t)
len : data length (uint8_t)
data : RTCM message (may be fragmented) (uint8_t)
'''
return self.send(self.gps_rtcm_data_encode(flags, len, data), force_mavlink1=force_mavlink1)
|
Vibration levels and accelerometer clipping
time_usec : Timestamp (micros since boot or Unix epoch) (uint64_t)
vibration_x : Vibration levels on X-axis (float)
vibration_y : Vibration levels on Y-axis (float)
vibration_z : Vibration levels on Z-axis (float)
clipping_0 : first accelerometer clipping count (uint32_t)
clipping_1 : second accelerometer clipping count (uint32_t)
clipping_2 : third accelerometer clipping count (uint32_t)
|
def vibration_encode(self, time_usec, vibration_x, vibration_y, vibration_z, clipping_0, clipping_1, clipping_2):
'''
Vibration levels and accelerometer clipping
time_usec : Timestamp (micros since boot or Unix epoch) (uint64_t)
vibration_x : Vibration levels on X-axis (float)
vibration_y : Vibration levels on Y-axis (float)
vibration_z : Vibration levels on Z-axis (float)
clipping_0 : first accelerometer clipping count (uint32_t)
clipping_1 : second accelerometer clipping count (uint32_t)
clipping_2 : third accelerometer clipping count (uint32_t)
'''
return MAVLink_vibration_message(time_usec, vibration_x, vibration_y, vibration_z, clipping_0, clipping_1, clipping_2)
|
Vibration levels and accelerometer clipping
time_usec : Timestamp (micros since boot or Unix epoch) (uint64_t)
vibration_x : Vibration levels on X-axis (float)
vibration_y : Vibration levels on Y-axis (float)
vibration_z : Vibration levels on Z-axis (float)
clipping_0 : first accelerometer clipping count (uint32_t)
clipping_1 : second accelerometer clipping count (uint32_t)
clipping_2 : third accelerometer clipping count (uint32_t)
|
def vibration_send(self, time_usec, vibration_x, vibration_y, vibration_z, clipping_0, clipping_1, clipping_2, force_mavlink1=False):
'''
Vibration levels and accelerometer clipping
time_usec : Timestamp (micros since boot or Unix epoch) (uint64_t)
vibration_x : Vibration levels on X-axis (float)
vibration_y : Vibration levels on Y-axis (float)
vibration_z : Vibration levels on Z-axis (float)
clipping_0 : first accelerometer clipping count (uint32_t)
clipping_1 : second accelerometer clipping count (uint32_t)
clipping_2 : third accelerometer clipping count (uint32_t)
'''
return self.send(self.vibration_encode(time_usec, vibration_x, vibration_y, vibration_z, clipping_0, clipping_1, clipping_2), force_mavlink1=force_mavlink1)
|
This message can be requested by sending the MAV_CMD_GET_HOME_POSITION
command. The position the system will return to and
land on. The position is set automatically by the
system during the takeoff in case it was not
explicitely set by the operator before or after. The
position the system will return to and land on. The
global and local positions encode the position in the
respective coordinate frames, while the q parameter
encodes the orientation of the surface. Under normal
conditions it describes the heading and terrain slope,
which can be used by the aircraft to adjust the
approach. The approach 3D vector describes the point
to which the system should fly in normal flight mode
and then perform a landing sequence along the vector.
latitude : Latitude (WGS84), in degrees * 1E7 (int32_t)
longitude : Longitude (WGS84, in degrees * 1E7 (int32_t)
altitude : Altitude (AMSL), in meters * 1000 (positive for up) (int32_t)
x : Local X position of this position in the local coordinate frame (float)
y : Local Y position of this position in the local coordinate frame (float)
z : Local Z position of this position in the local coordinate frame (float)
q : World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground (float)
approach_x : Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. (float)
approach_y : Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. (float)
approach_z : Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. (float)
|
def home_position_encode(self, latitude, longitude, altitude, x, y, z, q, approach_x, approach_y, approach_z):
'''
This message can be requested by sending the MAV_CMD_GET_HOME_POSITION
command. The position the system will return to and
land on. The position is set automatically by the
system during the takeoff in case it was not
explicitely set by the operator before or after. The
position the system will return to and land on. The
global and local positions encode the position in the
respective coordinate frames, while the q parameter
encodes the orientation of the surface. Under normal
conditions it describes the heading and terrain slope,
which can be used by the aircraft to adjust the
approach. The approach 3D vector describes the point
to which the system should fly in normal flight mode
and then perform a landing sequence along the vector.
latitude : Latitude (WGS84), in degrees * 1E7 (int32_t)
longitude : Longitude (WGS84, in degrees * 1E7 (int32_t)
altitude : Altitude (AMSL), in meters * 1000 (positive for up) (int32_t)
x : Local X position of this position in the local coordinate frame (float)
y : Local Y position of this position in the local coordinate frame (float)
z : Local Z position of this position in the local coordinate frame (float)
q : World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground (float)
approach_x : Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. (float)
approach_y : Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. (float)
approach_z : Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. (float)
'''
return MAVLink_home_position_message(latitude, longitude, altitude, x, y, z, q, approach_x, approach_y, approach_z)
|
This message can be requested by sending the MAV_CMD_GET_HOME_POSITION
command. The position the system will return to and
land on. The position is set automatically by the
system during the takeoff in case it was not
explicitely set by the operator before or after. The
position the system will return to and land on. The
global and local positions encode the position in the
respective coordinate frames, while the q parameter
encodes the orientation of the surface. Under normal
conditions it describes the heading and terrain slope,
which can be used by the aircraft to adjust the
approach. The approach 3D vector describes the point
to which the system should fly in normal flight mode
and then perform a landing sequence along the vector.
latitude : Latitude (WGS84), in degrees * 1E7 (int32_t)
longitude : Longitude (WGS84, in degrees * 1E7 (int32_t)
altitude : Altitude (AMSL), in meters * 1000 (positive for up) (int32_t)
x : Local X position of this position in the local coordinate frame (float)
y : Local Y position of this position in the local coordinate frame (float)
z : Local Z position of this position in the local coordinate frame (float)
q : World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground (float)
approach_x : Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. (float)
approach_y : Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. (float)
approach_z : Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. (float)
|
def home_position_send(self, latitude, longitude, altitude, x, y, z, q, approach_x, approach_y, approach_z, force_mavlink1=False):
'''
This message can be requested by sending the MAV_CMD_GET_HOME_POSITION
command. The position the system will return to and
land on. The position is set automatically by the
system during the takeoff in case it was not
explicitely set by the operator before or after. The
position the system will return to and land on. The
global and local positions encode the position in the
respective coordinate frames, while the q parameter
encodes the orientation of the surface. Under normal
conditions it describes the heading and terrain slope,
which can be used by the aircraft to adjust the
approach. The approach 3D vector describes the point
to which the system should fly in normal flight mode
and then perform a landing sequence along the vector.
latitude : Latitude (WGS84), in degrees * 1E7 (int32_t)
longitude : Longitude (WGS84, in degrees * 1E7 (int32_t)
altitude : Altitude (AMSL), in meters * 1000 (positive for up) (int32_t)
x : Local X position of this position in the local coordinate frame (float)
y : Local Y position of this position in the local coordinate frame (float)
z : Local Z position of this position in the local coordinate frame (float)
q : World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground (float)
approach_x : Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. (float)
approach_y : Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. (float)
approach_z : Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. (float)
'''
return self.send(self.home_position_encode(latitude, longitude, altitude, x, y, z, q, approach_x, approach_y, approach_z), force_mavlink1=force_mavlink1)
|
The position the system will return to and land on. The position is
set automatically by the system during the takeoff in
case it was not explicitely set by the operator before
or after. The global and local positions encode the
position in the respective coordinate frames, while
the q parameter encodes the orientation of the
surface. Under normal conditions it describes the
heading and terrain slope, which can be used by the
aircraft to adjust the approach. The approach 3D
vector describes the point to which the system should
fly in normal flight mode and then perform a landing
sequence along the vector.
target_system : System ID. (uint8_t)
latitude : Latitude (WGS84), in degrees * 1E7 (int32_t)
longitude : Longitude (WGS84, in degrees * 1E7 (int32_t)
altitude : Altitude (AMSL), in meters * 1000 (positive for up) (int32_t)
x : Local X position of this position in the local coordinate frame (float)
y : Local Y position of this position in the local coordinate frame (float)
z : Local Z position of this position in the local coordinate frame (float)
q : World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground (float)
approach_x : Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. (float)
approach_y : Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. (float)
approach_z : Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. (float)
|
def set_home_position_encode(self, target_system, latitude, longitude, altitude, x, y, z, q, approach_x, approach_y, approach_z):
'''
The position the system will return to and land on. The position is
set automatically by the system during the takeoff in
case it was not explicitely set by the operator before
or after. The global and local positions encode the
position in the respective coordinate frames, while
the q parameter encodes the orientation of the
surface. Under normal conditions it describes the
heading and terrain slope, which can be used by the
aircraft to adjust the approach. The approach 3D
vector describes the point to which the system should
fly in normal flight mode and then perform a landing
sequence along the vector.
target_system : System ID. (uint8_t)
latitude : Latitude (WGS84), in degrees * 1E7 (int32_t)
longitude : Longitude (WGS84, in degrees * 1E7 (int32_t)
altitude : Altitude (AMSL), in meters * 1000 (positive for up) (int32_t)
x : Local X position of this position in the local coordinate frame (float)
y : Local Y position of this position in the local coordinate frame (float)
z : Local Z position of this position in the local coordinate frame (float)
q : World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground (float)
approach_x : Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. (float)
approach_y : Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. (float)
approach_z : Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. (float)
'''
return MAVLink_set_home_position_message(target_system, latitude, longitude, altitude, x, y, z, q, approach_x, approach_y, approach_z)
|
The position the system will return to and land on. The position is
set automatically by the system during the takeoff in
case it was not explicitely set by the operator before
or after. The global and local positions encode the
position in the respective coordinate frames, while
the q parameter encodes the orientation of the
surface. Under normal conditions it describes the
heading and terrain slope, which can be used by the
aircraft to adjust the approach. The approach 3D
vector describes the point to which the system should
fly in normal flight mode and then perform a landing
sequence along the vector.
target_system : System ID. (uint8_t)
latitude : Latitude (WGS84), in degrees * 1E7 (int32_t)
longitude : Longitude (WGS84, in degrees * 1E7 (int32_t)
altitude : Altitude (AMSL), in meters * 1000 (positive for up) (int32_t)
x : Local X position of this position in the local coordinate frame (float)
y : Local Y position of this position in the local coordinate frame (float)
z : Local Z position of this position in the local coordinate frame (float)
q : World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground (float)
approach_x : Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. (float)
approach_y : Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. (float)
approach_z : Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. (float)
|
def set_home_position_send(self, target_system, latitude, longitude, altitude, x, y, z, q, approach_x, approach_y, approach_z, force_mavlink1=False):
'''
The position the system will return to and land on. The position is
set automatically by the system during the takeoff in
case it was not explicitely set by the operator before
or after. The global and local positions encode the
position in the respective coordinate frames, while
the q parameter encodes the orientation of the
surface. Under normal conditions it describes the
heading and terrain slope, which can be used by the
aircraft to adjust the approach. The approach 3D
vector describes the point to which the system should
fly in normal flight mode and then perform a landing
sequence along the vector.
target_system : System ID. (uint8_t)
latitude : Latitude (WGS84), in degrees * 1E7 (int32_t)
longitude : Longitude (WGS84, in degrees * 1E7 (int32_t)
altitude : Altitude (AMSL), in meters * 1000 (positive for up) (int32_t)
x : Local X position of this position in the local coordinate frame (float)
y : Local Y position of this position in the local coordinate frame (float)
z : Local Z position of this position in the local coordinate frame (float)
q : World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground (float)
approach_x : Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. (float)
approach_y : Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. (float)
approach_z : Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. (float)
'''
return self.send(self.set_home_position_encode(target_system, latitude, longitude, altitude, x, y, z, q, approach_x, approach_y, approach_z), force_mavlink1=force_mavlink1)
|
This interface replaces DATA_STREAM
message_id : The ID of the requested MAVLink message. v1.0 is limited to 254 messages. (uint16_t)
interval_us : The interval between two messages, in microseconds. A value of -1 indicates this stream is disabled, 0 indicates it is not available, > 0 indicates the interval at which it is sent. (int32_t)
|
def message_interval_send(self, message_id, interval_us, force_mavlink1=False):
'''
This interface replaces DATA_STREAM
message_id : The ID of the requested MAVLink message. v1.0 is limited to 254 messages. (uint16_t)
interval_us : The interval between two messages, in microseconds. A value of -1 indicates this stream is disabled, 0 indicates it is not available, > 0 indicates the interval at which it is sent. (int32_t)
'''
return self.send(self.message_interval_encode(message_id, interval_us), force_mavlink1=force_mavlink1)
|
Provides state for additional features
vtol_state : The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration. (uint8_t)
landed_state : The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown. (uint8_t)
|
def extended_sys_state_send(self, vtol_state, landed_state, force_mavlink1=False):
'''
Provides state for additional features
vtol_state : The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration. (uint8_t)
landed_state : The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown. (uint8_t)
'''
return self.send(self.extended_sys_state_encode(vtol_state, landed_state), force_mavlink1=force_mavlink1)
|
The location and information of an ADSB vehicle
ICAO_address : ICAO address (uint32_t)
lat : Latitude, expressed as degrees * 1E7 (int32_t)
lon : Longitude, expressed as degrees * 1E7 (int32_t)
altitude_type : Type from ADSB_ALTITUDE_TYPE enum (uint8_t)
altitude : Altitude(ASL) in millimeters (int32_t)
heading : Course over ground in centidegrees (uint16_t)
hor_velocity : The horizontal velocity in centimeters/second (uint16_t)
ver_velocity : The vertical velocity in centimeters/second, positive is up (int16_t)
callsign : The callsign, 8+null (char)
emitter_type : Type from ADSB_EMITTER_TYPE enum (uint8_t)
tslc : Time since last communication in seconds (uint8_t)
flags : Flags to indicate various statuses including valid data fields (uint16_t)
squawk : Squawk code (uint16_t)
|
def adsb_vehicle_encode(self, ICAO_address, lat, lon, altitude_type, altitude, heading, hor_velocity, ver_velocity, callsign, emitter_type, tslc, flags, squawk):
'''
The location and information of an ADSB vehicle
ICAO_address : ICAO address (uint32_t)
lat : Latitude, expressed as degrees * 1E7 (int32_t)
lon : Longitude, expressed as degrees * 1E7 (int32_t)
altitude_type : Type from ADSB_ALTITUDE_TYPE enum (uint8_t)
altitude : Altitude(ASL) in millimeters (int32_t)
heading : Course over ground in centidegrees (uint16_t)
hor_velocity : The horizontal velocity in centimeters/second (uint16_t)
ver_velocity : The vertical velocity in centimeters/second, positive is up (int16_t)
callsign : The callsign, 8+null (char)
emitter_type : Type from ADSB_EMITTER_TYPE enum (uint8_t)
tslc : Time since last communication in seconds (uint8_t)
flags : Flags to indicate various statuses including valid data fields (uint16_t)
squawk : Squawk code (uint16_t)
'''
return MAVLink_adsb_vehicle_message(ICAO_address, lat, lon, altitude_type, altitude, heading, hor_velocity, ver_velocity, callsign, emitter_type, tslc, flags, squawk)
|
The location and information of an ADSB vehicle
ICAO_address : ICAO address (uint32_t)
lat : Latitude, expressed as degrees * 1E7 (int32_t)
lon : Longitude, expressed as degrees * 1E7 (int32_t)
altitude_type : Type from ADSB_ALTITUDE_TYPE enum (uint8_t)
altitude : Altitude(ASL) in millimeters (int32_t)
heading : Course over ground in centidegrees (uint16_t)
hor_velocity : The horizontal velocity in centimeters/second (uint16_t)
ver_velocity : The vertical velocity in centimeters/second, positive is up (int16_t)
callsign : The callsign, 8+null (char)
emitter_type : Type from ADSB_EMITTER_TYPE enum (uint8_t)
tslc : Time since last communication in seconds (uint8_t)
flags : Flags to indicate various statuses including valid data fields (uint16_t)
squawk : Squawk code (uint16_t)
|
def adsb_vehicle_send(self, ICAO_address, lat, lon, altitude_type, altitude, heading, hor_velocity, ver_velocity, callsign, emitter_type, tslc, flags, squawk, force_mavlink1=False):
'''
The location and information of an ADSB vehicle
ICAO_address : ICAO address (uint32_t)
lat : Latitude, expressed as degrees * 1E7 (int32_t)
lon : Longitude, expressed as degrees * 1E7 (int32_t)
altitude_type : Type from ADSB_ALTITUDE_TYPE enum (uint8_t)
altitude : Altitude(ASL) in millimeters (int32_t)
heading : Course over ground in centidegrees (uint16_t)
hor_velocity : The horizontal velocity in centimeters/second (uint16_t)
ver_velocity : The vertical velocity in centimeters/second, positive is up (int16_t)
callsign : The callsign, 8+null (char)
emitter_type : Type from ADSB_EMITTER_TYPE enum (uint8_t)
tslc : Time since last communication in seconds (uint8_t)
flags : Flags to indicate various statuses including valid data fields (uint16_t)
squawk : Squawk code (uint16_t)
'''
return self.send(self.adsb_vehicle_encode(ICAO_address, lat, lon, altitude_type, altitude, heading, hor_velocity, ver_velocity, callsign, emitter_type, tslc, flags, squawk), force_mavlink1=force_mavlink1)
|
Information about a potential collision
src : Collision data source (uint8_t)
id : Unique identifier, domain based on src field (uint32_t)
action : Action that is being taken to avoid this collision (uint8_t)
threat_level : How concerned the aircraft is about this collision (uint8_t)
time_to_minimum_delta : Estimated time until collision occurs (seconds) (float)
altitude_minimum_delta : Closest vertical distance in meters between vehicle and object (float)
horizontal_minimum_delta : Closest horizontal distance in meteres between vehicle and object (float)
|
def collision_encode(self, src, id, action, threat_level, time_to_minimum_delta, altitude_minimum_delta, horizontal_minimum_delta):
'''
Information about a potential collision
src : Collision data source (uint8_t)
id : Unique identifier, domain based on src field (uint32_t)
action : Action that is being taken to avoid this collision (uint8_t)
threat_level : How concerned the aircraft is about this collision (uint8_t)
time_to_minimum_delta : Estimated time until collision occurs (seconds) (float)
altitude_minimum_delta : Closest vertical distance in meters between vehicle and object (float)
horizontal_minimum_delta : Closest horizontal distance in meteres between vehicle and object (float)
'''
return MAVLink_collision_message(src, id, action, threat_level, time_to_minimum_delta, altitude_minimum_delta, horizontal_minimum_delta)
|
Information about a potential collision
src : Collision data source (uint8_t)
id : Unique identifier, domain based on src field (uint32_t)
action : Action that is being taken to avoid this collision (uint8_t)
threat_level : How concerned the aircraft is about this collision (uint8_t)
time_to_minimum_delta : Estimated time until collision occurs (seconds) (float)
altitude_minimum_delta : Closest vertical distance in meters between vehicle and object (float)
horizontal_minimum_delta : Closest horizontal distance in meteres between vehicle and object (float)
|
def collision_send(self, src, id, action, threat_level, time_to_minimum_delta, altitude_minimum_delta, horizontal_minimum_delta, force_mavlink1=False):
'''
Information about a potential collision
src : Collision data source (uint8_t)
id : Unique identifier, domain based on src field (uint32_t)
action : Action that is being taken to avoid this collision (uint8_t)
threat_level : How concerned the aircraft is about this collision (uint8_t)
time_to_minimum_delta : Estimated time until collision occurs (seconds) (float)
altitude_minimum_delta : Closest vertical distance in meters between vehicle and object (float)
horizontal_minimum_delta : Closest horizontal distance in meteres between vehicle and object (float)
'''
return self.send(self.collision_encode(src, id, action, threat_level, time_to_minimum_delta, altitude_minimum_delta, horizontal_minimum_delta), force_mavlink1=force_mavlink1)
|
Message implementing parts of the V2 payload specs in V1 frames for
transitional support.
target_network : Network ID (0 for broadcast) (uint8_t)
target_system : System ID (0 for broadcast) (uint8_t)
target_component : Component ID (0 for broadcast) (uint8_t)
message_type : A code that identifies the software component that understands this message (analogous to usb device classes or mime type strings). If this code is less than 32768, it is considered a 'registered' protocol extension and the corresponding entry should be added to https://github.com/mavlink/mavlink/extension-message-ids.xml. Software creators can register blocks of message IDs as needed (useful for GCS specific metadata, etc...). Message_types greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase. (uint16_t)
payload : Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The entire content of this block is opaque unless you understand any the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the mavlink specification. (uint8_t)
|
def v2_extension_encode(self, target_network, target_system, target_component, message_type, payload):
'''
Message implementing parts of the V2 payload specs in V1 frames for
transitional support.
target_network : Network ID (0 for broadcast) (uint8_t)
target_system : System ID (0 for broadcast) (uint8_t)
target_component : Component ID (0 for broadcast) (uint8_t)
message_type : A code that identifies the software component that understands this message (analogous to usb device classes or mime type strings). If this code is less than 32768, it is considered a 'registered' protocol extension and the corresponding entry should be added to https://github.com/mavlink/mavlink/extension-message-ids.xml. Software creators can register blocks of message IDs as needed (useful for GCS specific metadata, etc...). Message_types greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase. (uint16_t)
payload : Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The entire content of this block is opaque unless you understand any the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the mavlink specification. (uint8_t)
'''
return MAVLink_v2_extension_message(target_network, target_system, target_component, message_type, payload)
|
Message implementing parts of the V2 payload specs in V1 frames for
transitional support.
target_network : Network ID (0 for broadcast) (uint8_t)
target_system : System ID (0 for broadcast) (uint8_t)
target_component : Component ID (0 for broadcast) (uint8_t)
message_type : A code that identifies the software component that understands this message (analogous to usb device classes or mime type strings). If this code is less than 32768, it is considered a 'registered' protocol extension and the corresponding entry should be added to https://github.com/mavlink/mavlink/extension-message-ids.xml. Software creators can register blocks of message IDs as needed (useful for GCS specific metadata, etc...). Message_types greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase. (uint16_t)
payload : Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The entire content of this block is opaque unless you understand any the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the mavlink specification. (uint8_t)
|
def v2_extension_send(self, target_network, target_system, target_component, message_type, payload, force_mavlink1=False):
'''
Message implementing parts of the V2 payload specs in V1 frames for
transitional support.
target_network : Network ID (0 for broadcast) (uint8_t)
target_system : System ID (0 for broadcast) (uint8_t)
target_component : Component ID (0 for broadcast) (uint8_t)
message_type : A code that identifies the software component that understands this message (analogous to usb device classes or mime type strings). If this code is less than 32768, it is considered a 'registered' protocol extension and the corresponding entry should be added to https://github.com/mavlink/mavlink/extension-message-ids.xml. Software creators can register blocks of message IDs as needed (useful for GCS specific metadata, etc...). Message_types greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase. (uint16_t)
payload : Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The entire content of this block is opaque unless you understand any the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the mavlink specification. (uint8_t)
'''
return self.send(self.v2_extension_encode(target_network, target_system, target_component, message_type, payload), force_mavlink1=force_mavlink1)
|
Send raw controller memory. The use of this message is discouraged for
normal packets, but a quite efficient way for testing
new messages and getting experimental debug output.
address : Starting address of the debug variables (uint16_t)
ver : Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below (uint8_t)
type : Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14 (uint8_t)
value : Memory contents at specified address (int8_t)
|
def memory_vect_encode(self, address, ver, type, value):
'''
Send raw controller memory. The use of this message is discouraged for
normal packets, but a quite efficient way for testing
new messages and getting experimental debug output.
address : Starting address of the debug variables (uint16_t)
ver : Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below (uint8_t)
type : Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14 (uint8_t)
value : Memory contents at specified address (int8_t)
'''
return MAVLink_memory_vect_message(address, ver, type, value)
|
Send a key-value pair as float. The use of this message is discouraged
for normal packets, but a quite efficient way for
testing new messages and getting experimental debug
output.
time_boot_ms : Timestamp (milliseconds since system boot) (uint32_t)
name : Name of the debug variable (char)
value : Floating point value (float)
|
def named_value_float_send(self, time_boot_ms, name, value, force_mavlink1=False):
'''
Send a key-value pair as float. The use of this message is discouraged
for normal packets, but a quite efficient way for
testing new messages and getting experimental debug
output.
time_boot_ms : Timestamp (milliseconds since system boot) (uint32_t)
name : Name of the debug variable (char)
value : Floating point value (float)
'''
return self.send(self.named_value_float_encode(time_boot_ms, name, value), force_mavlink1=force_mavlink1)
|
Send raw controller memory. The use of this message is discouraged for
normal packets, but a quite efficient way for testing
new messages and getting experimental debug output.
address : Starting address of the debug variables (uint16_t)
ver : Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below (uint8_t)
type : Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14 (uint8_t)
value : Memory contents at specified address (int8_t)
|
def memory_vect_send(self, address, ver, type, value, force_mavlink1=False):
'''
Send raw controller memory. The use of this message is discouraged for
normal packets, but a quite efficient way for testing
new messages and getting experimental debug output.
address : Starting address of the debug variables (uint16_t)
ver : Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below (uint8_t)
type : Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14 (uint8_t)
value : Memory contents at specified address (int8_t)
'''
return self.send(self.memory_vect_encode(address, ver, type, value), force_mavlink1=force_mavlink1)
|
Send a key-value pair as integer. The use of this message is
discouraged for normal packets, but a quite efficient
way for testing new messages and getting experimental
debug output.
time_boot_ms : Timestamp (milliseconds since system boot) (uint32_t)
name : Name of the debug variable (char)
value : Signed integer value (int32_t)
|
def named_value_int_send(self, time_boot_ms, name, value, force_mavlink1=False):
'''
Send a key-value pair as integer. The use of this message is
discouraged for normal packets, but a quite efficient
way for testing new messages and getting experimental
debug output.
time_boot_ms : Timestamp (milliseconds since system boot) (uint32_t)
name : Name of the debug variable (char)
value : Signed integer value (int32_t)
'''
return self.send(self.named_value_int_encode(time_boot_ms, name, value), force_mavlink1=force_mavlink1)
|
Status text message. These messages are printed in yellow in the COMM
console of QGroundControl. WARNING: They consume quite
some bandwidth, so use only for important status and
error messages. If implemented wisely, these messages
are buffered on the MCU and sent only at a limited
rate (e.g. 10 Hz).
severity : Severity of status. Relies on the definitions within RFC-5424. See enum MAV_SEVERITY. (uint8_t)
text : Status text message, without null termination character (char)
|
def statustext_send(self, severity, text, force_mavlink1=False):
'''
Status text message. These messages are printed in yellow in the COMM
console of QGroundControl. WARNING: They consume quite
some bandwidth, so use only for important status and
error messages. If implemented wisely, these messages
are buffered on the MCU and sent only at a limited
rate (e.g. 10 Hz).
severity : Severity of status. Relies on the definitions within RFC-5424. See enum MAV_SEVERITY. (uint8_t)
text : Status text message, without null termination character (char)
'''
return self.send(self.statustext_encode(severity, text), force_mavlink1=force_mavlink1)
|
Send a debug value. The index is used to discriminate between values.
These values show up in the plot of QGroundControl as
DEBUG N.
time_boot_ms : Timestamp (milliseconds since system boot) (uint32_t)
ind : index of debug variable (uint8_t)
value : DEBUG value (float)
|
def debug_send(self, time_boot_ms, ind, value, force_mavlink1=False):
'''
Send a debug value. The index is used to discriminate between values.
These values show up in the plot of QGroundControl as
DEBUG N.
time_boot_ms : Timestamp (milliseconds since system boot) (uint32_t)
ind : index of debug variable (uint8_t)
value : DEBUG value (float)
'''
return self.send(self.debug_encode(time_boot_ms, ind, value), force_mavlink1=force_mavlink1)
|
add in some more bytes
|
def accumulate_str(self, buf):
'''add in some more bytes'''
accum = self.crc
import array
bytes = array.array('B')
bytes.fromstring(buf)
self.accumulate(bytes)
|
add in some more bytes
|
def accumulate(self, buf):
'''add in some more bytes'''
accum = self.crc
for b in buf:
tmp = b ^ (accum & 0xff)
tmp = (tmp ^ (tmp<<4)) & 0xFF
accum = (accum>>8) ^ (tmp<<8) ^ (tmp<<3) ^ (tmp>>4)
self.crc = accum
|
Updates LaserData.
|
def update(self):
'''
Updates LaserData.
'''
if self.hasproxy():
irD = IRData()
received = 0
data = self.proxy.getIRData()
irD.received = data.received
self.lock.acquire()
self.ir = irD
self.lock.release()
|
Returns last LaserData.
@return last JdeRobotTypes LaserData saved
|
def getIRData(self):
'''
Returns last LaserData.
@return last JdeRobotTypes LaserData saved
'''
if self.hasproxy():
self.lock.acquire()
ir = self.ir
self.lock.release()
return ir
return None
|
Function to publish cmdvel.
|
def publish (self):
'''
Function to publish cmdvel.
'''
self.lock.acquire()
tw = cmdvel2Twist(self.data)
self.lock.release()
self.pub.publish(tw)
|
Sends CMDVel.
@param vel: CMDVel to publish
@type vel: CMDVel
|
def sendVelocities(self, vel):
'''
Sends CMDVel.
@param vel: CMDVel to publish
@type vel: CMDVel
'''
self.lock.acquire()
self.data = vel
self.lock.release()
|
Sends VX velocity.
@param vx: VX velocity
@type vx: float
|
def sendVX(self, vx):
'''
Sends VX velocity.
@param vx: VX velocity
@type vx: float
'''
self.lock.acquire()
self.data.vx = vx
self.lock.release()
|
Sends VY velocity.
@param vy: VY velocity
@type vy: float
|
def sendVY(self, vy):
'''
Sends VY velocity.
@param vy: VY velocity
@type vy: float
'''
self.lock.acquire()
self.data.vy = vy
self.lock.release()
|
Sends AZ velocity.
@param az: AZ velocity
@type az: float
|
def sendAZ(self, az):
'''
Sends AZ velocity.
@param az: AZ velocity
@type az: float
'''
self.lock.acquire()
self.data.az = az
self.lock.release()
|
Translates from ROS BumperScan to JderobotTypes BumperData.
@param event: ROS BumperScan to translate
@type event: BumperScan
@return a BumperData translated from event
# bumper
LEFT = 0
CENTER = 1
RIGHT = 2
# state
RELEASED = 0
PRESSED = 1
|
def bumperEvent2BumperData(event):
'''
Translates from ROS BumperScan to JderobotTypes BumperData.
@param event: ROS BumperScan to translate
@type event: BumperScan
@return a BumperData translated from event
# bumper
LEFT = 0
CENTER = 1
RIGHT = 2
# state
RELEASED = 0
PRESSED = 1
'''
bump = BumperData()
bump.state = event.state
bump.bumper = event.bumper
#bump.timeStamp = event.header.stamp.secs + (event.header.stamp.nsecs *1e-9)
return bump
|
Callback function to receive and save Bumper Scans.
@param event: ROS BumperScan received
@type event: BumperScan
|
def __callback (self, event):
'''
Callback function to receive and save Bumper Scans.
@param event: ROS BumperScan received
@type event: BumperScan
'''
bump = bumperEvent2BumperData(event)
if bump.state == 1:
self.lock.acquire()
self.time = current_milli_time()
self.data = bump
self.lock.release()
|
Starts (Subscribes) the client.
|
def start (self):
'''
Starts (Subscribes) the client.
'''
self.sub = rospy.Subscriber(self.topic, BumperEvent, self.__callback)
|
Returns last BumperData.
@return last JdeRobotTypes BumperData saved
|
def getBumperData(self):
'''
Returns last BumperData.
@return last JdeRobotTypes BumperData saved
'''
self.lock.acquire()
t = current_milli_time()
if (t - self.time) > 500:
self.data.state = 0
bump = self.data
self.lock.release()
return bump
|
show battery levels
|
def cmd_bat(self, args):
'''show battery levels'''
print("Flight battery: %u%%" % self.battery_level)
if self.settings.numcells != 0:
print("%.2f V/cell for %u cells - approx %u%%" % (self.per_cell,
self.settings.numcells,
self.vcell_to_battery_percent(self.per_cell)))
|
update battery level
|
def battery_update(self, SYS_STATUS):
'''update battery level'''
# main flight battery
self.battery_level = SYS_STATUS.battery_remaining
self.voltage_level = SYS_STATUS.voltage_battery
self.current_battery = SYS_STATUS.current_battery
if self.settings.numcells != 0:
self.per_cell = (self.voltage_level*0.001) / self.settings.numcells
|
handle a mavlink packet
|
def mavlink_packet(self, m):
'''handle a mavlink packet'''
mtype = m.get_type()
if mtype == "SYS_STATUS":
self.battery_update(m)
if mtype == "BATTERY2":
self.battery2_voltage = m.voltage * 0.001
if mtype == "POWER_STATUS":
self.power_status_update(m)
if self.battery_period.trigger():
self.battery_report()
|
Updates Image.
|
def update(self):
'''
Updates Image.
'''
if self.hasproxy():
img = Image()
imageData = self.proxy.getImageData(self.imgFormat)
img.height = imageData.description.height
img.width = imageData.description.width
img.format = imageData.description.format
img.data = np.frombuffer(imageData.pixelData, dtype=np.uint8)
img.data.shape = img.height, img.width, 3
img.timeStamp = imageData.timeStamp.seconds + imageData.timeStamp.useconds * 1e-9
self.lock.acquire()
self.image = img
self.lock.release()
|
Returns last Image.
@return last JdeRobotTypes Image saved
|
def getImage(self):
'''
Returns last Image.
@return last JdeRobotTypes Image saved
'''
img = Image()
if self.hasproxy():
self.lock.acquire()
img = self.image
self.lock.release()
return img
|
do a full 3D accel calibration
|
def cmd_accelcal(self, args):
'''do a full 3D accel calibration'''
mav = self.master
# ack the APM to begin 3D calibration of accelerometers
mav.mav.command_long_send(mav.target_system, mav.target_component,
mavutil.mavlink.MAV_CMD_PREFLIGHT_CALIBRATION, 0,
0, 0, 0, 0, 1, 0, 0)
self.accelcal_count = 0
self.accelcal_wait_enter = False
|
do a full gyro calibration
|
def cmd_gyrocal(self, args):
'''do a full gyro calibration'''
mav = self.master
mav.mav.command_long_send(mav.target_system, mav.target_component,
mavutil.mavlink.MAV_CMD_PREFLIGHT_CALIBRATION, 0,
1, 0, 0, 0, 0, 0, 0)
|
handle mavlink packets
|
def mavlink_packet(self, m):
'''handle mavlink packets'''
if self.accelcal_count != -1:
if m.get_type() == 'STATUSTEXT':
# handle accelcal packet
text = str(m.text)
if text.startswith('Place '):
self.accelcal_wait_enter = True
self.empty_input_count = self.mpstate.empty_input_count
if m.get_type() == 'MAG_CAL_PROGRESS':
while m.compass_id >= len(self.magcal_progess):
self.magcal_progess.append("")
self.magcal_progess[m.compass_id] = "%u%%" % m.completion_pct
self.console.set_status('Progress', 'Calibration Progress: ' + " ".join(self.magcal_progess), row=4)
if m.get_type() == 'MAG_CAL_REPORT':
if m.cal_status == mavutil.mavlink.MAG_CAL_SUCCESS:
result = "SUCCESS"
else:
result = "FAILED"
self.magcal_progess[m.compass_id] = result
self.console.set_status('Progress', 'Calibration Progress: ' + " ".join(self.magcal_progess), row=4)
print("Calibration of compass %u %s: fitness %.3f" % (m.compass_id, result, m.fitness))
|
handle mavlink packets
|
def idle_task(self):
'''handle mavlink packets'''
if self.accelcal_count != -1:
if self.accelcal_wait_enter and self.empty_input_count != self.mpstate.empty_input_count:
self.accelcal_wait_enter = False
self.accelcal_count += 1
# tell the APM that user has done as requested
self.master.mav.command_ack_send(self.accelcal_count, 1)
if self.accelcal_count >= 6:
self.accelcal_count = -1
if self.compassmot_running:
if self.mpstate.empty_input_count != self.empty_input_count:
# user has hit enter, stop the process
self.compassmot_running = False
print("sending stop")
self.master.mav.command_ack_send(0, 1)
|
do a compass/motor interference calibration
|
def cmd_compassmot(self, args):
'''do a compass/motor interference calibration'''
mav = self.master
print("compassmot starting")
mav.mav.command_long_send(mav.target_system, mav.target_component,
mavutil.mavlink.MAV_CMD_PREFLIGHT_CALIBRATION, 0,
0, 0, 0, 0, 0, 1, 0)
self.compassmot_running = True
self.empty_input_count = self.mpstate.empty_input_count
|
control magnetometer calibration
|
def cmd_magcal(self, args):
'''control magnetometer calibration'''
if len(args) < 1:
print("Usage: magcal <start|accept|cancel>")
return
if args[0] == 'start':
self.master.mav.command_long_send(
self.settings.target_system, # target_system
0, # target_component
mavutil.mavlink.MAV_CMD_DO_START_MAG_CAL, # command
0, # confirmation
0, # p1: mag_mask
0, # p2: retry
1, # p3: autosave
0, # p4: delay
0, # param5
0, # param6
0) # param7
elif args[0] == 'accept':
self.master.mav.command_long_send(
self.settings.target_system, # target_system
0, # target_component
mavutil.mavlink.MAV_CMD_DO_ACCEPT_MAG_CAL, # command
0, # confirmation
0, # p1: mag_mask
0, # param2
1, # param3
0, # param4
0, # param5
0, # param6
0) # param7
elif args[0] == 'cancel':
self.master.mav.command_long_send(
self.settings.target_system, # target_system
0, # target_component
mavutil.mavlink.MAV_CMD_DO_CANCEL_MAG_CAL, # command
0, # confirmation
0, # p1: mag_mask
0, # param2
1, # param3
0, # param4
0, # param5
0, # param6
0)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.