Events¶
- class mavsdk.events.Event(compid, message, description, log_level, event_namespace, event_name)¶
Bases:
object
Event type
- Parameters:
compid (uint32_t) – The source component ID of the event
message (std::string) – Short, single-line message
description (std::string) – Detailed description (optional, might be multiple lines)
log_level (LogLevel) – Log level of message
event_namespace (std::string) – Namespace, e.g. “px4”
event_name (std::string) – Event name (unique within the namespace)
- class mavsdk.events.Events(async_plugin_manager)¶
Bases:
AsyncBase
Get event notifications, such as takeoff, or arming checks
Generated by dcsdkgen - MAVSDK Events API
- async events()¶
Subscribe to event updates.
- Yields:
event (Event) – The event
- async get_health_and_arming_checks_report()¶
Get the latest report.
- Returns:
report – The report
- Return type:
- Raises:
EventsError – If the request fails. The error contains the reason for the failure.
- async health_and_arming_checks()¶
Subscribe to arming check updates.
- Yields:
report (HealthAndArmingCheckReport) – The report
- name = 'Events'¶
- exception mavsdk.events.EventsError(result, origin, *params)¶
Bases:
Exception
Raised when a EventsResult is a fail code
- class mavsdk.events.EventsResult(result, result_str)¶
Bases:
object
Result type.
- Parameters:
result (Result) – Result enum value
result_str (std::string) – Human-readable English string describing the result
- class Result(value)¶
Bases:
Enum
Possible results returned
Values¶
- SUCCESS
Successful result
- NOT_AVAILABLE
Not available
- CONNECTION_ERROR
Connection error
- UNSUPPORTED
Unsupported
- DENIED
Denied
- FAILED
Failed
- TIMEOUT
Timeout
- NO_SYSTEM
No system available
- UNKNOWN
Unknown result
- CONNECTION_ERROR = 2¶
- DENIED = 4¶
- FAILED = 5¶
- NOT_AVAILABLE = 1¶
- NO_SYSTEM = 7¶
- SUCCESS = 0¶
- TIMEOUT = 6¶
- UNKNOWN = 8¶
- UNSUPPORTED = 3¶
- class mavsdk.events.HealthAndArmingCheckMode(mode_name, can_arm_or_run, problems)¶
Bases:
object
Arming checks for a specific mode
- Parameters:
mode_name (std::string) – Mode name, e.g. “Position”
can_arm_or_run (bool) – If disarmed: indicates if arming is possible. If armed: indicates if the mode can be selected
problems ([HealthAndArmingCheckProblem]) – List of reported problems for the mode
- class mavsdk.events.HealthAndArmingCheckProblem(message, description, log_level, health_component)¶
Bases:
object
Health and arming check problem type
- Parameters:
message (std::string) – Short, single-line message
description (std::string) – Detailed description (optional, might be multiple lines)
log_level (LogLevel) – Log level of message
health_component (std::string) – Associated health component, e.g. “gps”
- class mavsdk.events.HealthAndArmingCheckReport(current_mode_intention, health_components, all_problems)¶
Bases:
object
Health and arming check report type
- Parameters:
current_mode_intention (HealthAndArmingCheckMode) – Report for currently intended mode
health_components ([HealthComponentReport]) – Health components list (e.g. for “gps”)
all_problems ([HealthAndArmingCheckProblem]) – Complete list of problems
- class mavsdk.events.HealthComponentReport(name, label, is_present, has_error, has_warning)¶
Bases:
object
Health component report type
- Parameters:
name (std::string) – Unique component name, e.g. “gps”
label (std::string) – Human readable label of the component, e.g. “GPS” or “Accelerometer”
is_present (bool) – If the component is present
has_error (bool) – If the component has errors
has_warning (bool) – If the component has warnings