ComponentMetadata¶
- class mavsdk.component_metadata.ComponentMetadata(async_plugin_manager)¶
Bases:
AsyncBase
Access component metadata json definitions, such as parameters.
Generated by dcsdkgen - MAVSDK ComponentMetadata API
- async get_metadata(compid, metadata_type)¶
Access metadata. This can be used if you know the metadata is available already, otherwise use the subscription to get notified when it becomes available.
- Parameters:
compid (uint32_t) – The component ID to request
metadata_type (MetadataType) – The metadata type
- Returns:
response – The response
- Return type:
- Raises:
ComponentMetadataError – If the request fails. The error contains the reason for the failure.
- async metadata_available()¶
Register a callback that gets called when metadata is available
- Yields:
data (MetadataUpdate) – The metadata data
- name = 'ComponentMetadata'¶
- async request_autopilot_component()¶
Request metadata from the autopilot component. This is used to start requesting metadata from the autopilot. The metadata can later be accessed via subscription (see below) or GetMetadata.
- async request_component(compid)¶
Request metadata from a specific component. This is used to start requesting metadata from a component. The metadata can later be accessed via subscription (see below) or GetMetadata.
- Parameters:
compid (uint32_t) – The component ID to request
- exception mavsdk.component_metadata.ComponentMetadataError(result, origin, *params)¶
Bases:
Exception
Raised when a ComponentMetadataResult is a fail code
- class mavsdk.component_metadata.ComponentMetadataResult(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
Success
- NOT_AVAILABLE
Not available
- CONNECTION_ERROR
Connection error
- UNSUPPORTED
Unsupported
- DENIED
Denied
- FAILED
Failed
- TIMEOUT
Timeout
- NO_SYSTEM
No system
- NOT_REQUESTED
Not requested
- CONNECTION_ERROR = 2¶
- DENIED = 4¶
- FAILED = 5¶
- NOT_AVAILABLE = 1¶
- NOT_REQUESTED = 8¶
- NO_SYSTEM = 7¶
- SUCCESS = 0¶
- TIMEOUT = 6¶
- UNSUPPORTED = 3¶
- class mavsdk.component_metadata.MetadataData(json_metadata)¶
Bases:
object
Metadata response
- Parameters:
json_metadata (std::string) – The JSON metadata
- class mavsdk.component_metadata.MetadataType(value)¶
Bases:
Enum
The metadata type
Values¶
- ALL_COMPLETED
This is set in the subscription callback when all metadata types completed for a given component ID
- PARAMETER
Parameter metadata
- EVENTS
Event definitions
- ACTUATORS
Actuator definitions
- ACTUATORS = 3¶
- ALL_COMPLETED = 0¶
- EVENTS = 2¶
- PARAMETER = 1¶
- class mavsdk.component_metadata.MetadataUpdate(compid, type, json_metadata)¶
Bases:
object
Metadata for a given component and type
- Parameters:
compid (uint32_t) – The component ID
type (MetadataType) – The metadata type
json_metadata (std::string) – The JSON metadata