Utils

Enums

MAVez.enums.get_mav_landed_state_string(state_code)
Return type:

str

MAVez.enums.get_mav_mission_result_string(result_code)
Return type:

str

MAVez.enums.get_mav_result_string(result_code)
Return type:

str

Safe Logger

A safe logger that only logs if the logger is properly initialized.

class MAVez.safe_logger.SafeLogger(logger)

Bases: object

A safe logger that only logs if the logger is properly initialized.

Parameters:

logger (logging.Logger | None) – The logger instance to use. If None, logging is disabled.

Returns:

An instance of the Safe_Logger class.

Return type:

Safe_Logger

critical(msg)
debug(msg)
error(msg)
info(msg)
warning(msg)
MAVez.safe_logger.configure_logging(level=20)

Configure logging to log messages to both a file and the console with colors.

Return type:

Logger

Translate Message

MAVez.translate_message.translate_message(csvm, topic='')

Convert a CSVMessage object to Python dictionary.

Parameters:

csvm (CSVMessage) – The CSVMessage object to convert.

Returns:

a uas_messenger Message object containing the data from the CSVMessage. If the message type is ‘UNKNOWN’, returns None.

Return type:

Message