From 57f939d6c5d61aaaf90629d6456310f766bd1f54 Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Fri, 12 Sep 2025 10:24:16 +1200 Subject: [PATCH] Remove component_information(_server) This has been replaced by component_metadata(_server). --- mavsdk/component_information.py | 386 ---------------- mavsdk/component_information_pb2.py | 151 ------ mavsdk/component_information_pb2_grpc.py | 132 ------ mavsdk/component_information_server.py | 435 ------------------ mavsdk/component_information_server_pb2.py | 155 ------- .../component_information_server_pb2_grpc.py | 132 ------ .../source/plugins/component_information.rst | 8 - .../plugins/component_information_server.rst | 8 - mavsdk/source/plugins/index.rst | 6 - mavsdk/system.py | 22 - 10 files changed, 1435 deletions(-) delete mode 100644 mavsdk/component_information.py delete mode 100644 mavsdk/component_information_pb2.py delete mode 100644 mavsdk/component_information_pb2_grpc.py delete mode 100644 mavsdk/component_information_server.py delete mode 100644 mavsdk/component_information_server_pb2.py delete mode 100644 mavsdk/component_information_server_pb2_grpc.py delete mode 100644 mavsdk/source/plugins/component_information.rst delete mode 100644 mavsdk/source/plugins/component_information_server.rst diff --git a/mavsdk/component_information.py b/mavsdk/component_information.py deleted file mode 100644 index 342e8471..00000000 --- a/mavsdk/component_information.py +++ /dev/null @@ -1,386 +0,0 @@ -# -*- coding: utf-8 -*- -# DO NOT EDIT! This file is auto-generated from -# https://github.com/mavlink/MAVSDK-Python/tree/main/other/templates/py -from ._base import AsyncBase -from . import component_information_pb2, component_information_pb2_grpc -from enum import Enum - - -class FloatParam: - """ - Meta information for parameter of type float. - - Parameters - ---------- - name : std::string - Name (max 16 chars) - - short_description : std::string - Short description - - long_description : std::string - Long description - - unit : std::string - Unit - - decimal_places : int32_t - Decimal places for user to show - - start_value : float - Current/starting value - - default_value : float - Default value - - min_value : float - Minimum value - - max_value : float - Maximum value - - """ - - def __init__( - self, - name, - short_description, - long_description, - unit, - decimal_places, - start_value, - default_value, - min_value, - max_value, - ): - """Initializes the FloatParam object""" - self.name = name - self.short_description = short_description - self.long_description = long_description - self.unit = unit - self.decimal_places = decimal_places - self.start_value = start_value - self.default_value = default_value - self.min_value = min_value - self.max_value = max_value - - def __eq__(self, to_compare): - """Checks if two FloatParam are the same""" - try: - # Try to compare - this likely fails when it is compared to a non - # FloatParam object - return ( - (self.name == to_compare.name) - and (self.short_description == to_compare.short_description) - and (self.long_description == to_compare.long_description) - and (self.unit == to_compare.unit) - and (self.decimal_places == to_compare.decimal_places) - and (self.start_value == to_compare.start_value) - and (self.default_value == to_compare.default_value) - and (self.min_value == to_compare.min_value) - and (self.max_value == to_compare.max_value) - ) - - except AttributeError: - return False - - def __str__(self): - """FloatParam in string representation""" - struct_repr = ", ".join( - [ - "name: " + str(self.name), - "short_description: " + str(self.short_description), - "long_description: " + str(self.long_description), - "unit: " + str(self.unit), - "decimal_places: " + str(self.decimal_places), - "start_value: " + str(self.start_value), - "default_value: " + str(self.default_value), - "min_value: " + str(self.min_value), - "max_value: " + str(self.max_value), - ] - ) - - return f"FloatParam: [{struct_repr}]" - - @staticmethod - def translate_from_rpc(rpcFloatParam): - """Translates a gRPC struct to the SDK equivalent""" - return FloatParam( - rpcFloatParam.name, - rpcFloatParam.short_description, - rpcFloatParam.long_description, - rpcFloatParam.unit, - rpcFloatParam.decimal_places, - rpcFloatParam.start_value, - rpcFloatParam.default_value, - rpcFloatParam.min_value, - rpcFloatParam.max_value, - ) - - def translate_to_rpc(self, rpcFloatParam): - """Translates this SDK object into its gRPC equivalent""" - - rpcFloatParam.name = self.name - - rpcFloatParam.short_description = self.short_description - - rpcFloatParam.long_description = self.long_description - - rpcFloatParam.unit = self.unit - - rpcFloatParam.decimal_places = self.decimal_places - - rpcFloatParam.start_value = self.start_value - - rpcFloatParam.default_value = self.default_value - - rpcFloatParam.min_value = self.min_value - - rpcFloatParam.max_value = self.max_value - - -class FloatParamUpdate: - """ - A float param that has been updated. - - Parameters - ---------- - name : std::string - Name of param that changed - - value : float - New value of param - - """ - - def __init__(self, name, value): - """Initializes the FloatParamUpdate object""" - self.name = name - self.value = value - - def __eq__(self, to_compare): - """Checks if two FloatParamUpdate are the same""" - try: - # Try to compare - this likely fails when it is compared to a non - # FloatParamUpdate object - return (self.name == to_compare.name) and (self.value == to_compare.value) - - except AttributeError: - return False - - def __str__(self): - """FloatParamUpdate in string representation""" - struct_repr = ", ".join( - ["name: " + str(self.name), "value: " + str(self.value)] - ) - - return f"FloatParamUpdate: [{struct_repr}]" - - @staticmethod - def translate_from_rpc(rpcFloatParamUpdate): - """Translates a gRPC struct to the SDK equivalent""" - return FloatParamUpdate(rpcFloatParamUpdate.name, rpcFloatParamUpdate.value) - - def translate_to_rpc(self, rpcFloatParamUpdate): - """Translates this SDK object into its gRPC equivalent""" - - rpcFloatParamUpdate.name = self.name - - rpcFloatParamUpdate.value = self.value - - -class ComponentInformationResult: - """ - Result type. - - Parameters - ---------- - result : Result - Result enum value - - result_str : std::string - Human-readable English string describing the result - - """ - - class Result(Enum): - """ - Possible results returned for param requests. - - Values - ------ - UNKNOWN - Unknown result - - SUCCESS - Request succeeded - - NO_SYSTEM - No system is connected - - """ - - UNKNOWN = 0 - SUCCESS = 1 - NO_SYSTEM = 2 - - def translate_to_rpc(self): - if self == ComponentInformationResult.Result.UNKNOWN: - return ( - component_information_pb2.ComponentInformationResult.RESULT_UNKNOWN - ) - if self == ComponentInformationResult.Result.SUCCESS: - return ( - component_information_pb2.ComponentInformationResult.RESULT_SUCCESS - ) - if self == ComponentInformationResult.Result.NO_SYSTEM: - return component_information_pb2.ComponentInformationResult.RESULT_NO_SYSTEM - - @staticmethod - def translate_from_rpc(rpc_enum_value): - """Parses a gRPC response""" - if ( - rpc_enum_value - == component_information_pb2.ComponentInformationResult.RESULT_UNKNOWN - ): - return ComponentInformationResult.Result.UNKNOWN - if ( - rpc_enum_value - == component_information_pb2.ComponentInformationResult.RESULT_SUCCESS - ): - return ComponentInformationResult.Result.SUCCESS - if ( - rpc_enum_value - == component_information_pb2.ComponentInformationResult.RESULT_NO_SYSTEM - ): - return ComponentInformationResult.Result.NO_SYSTEM - - def __str__(self): - return self.name - - def __init__(self, result, result_str): - """Initializes the ComponentInformationResult object""" - self.result = result - self.result_str = result_str - - def __eq__(self, to_compare): - """Checks if two ComponentInformationResult are the same""" - try: - # Try to compare - this likely fails when it is compared to a non - # ComponentInformationResult object - return (self.result == to_compare.result) and ( - self.result_str == to_compare.result_str - ) - - except AttributeError: - return False - - def __str__(self): - """ComponentInformationResult in string representation""" - struct_repr = ", ".join( - ["result: " + str(self.result), "result_str: " + str(self.result_str)] - ) - - return f"ComponentInformationResult: [{struct_repr}]" - - @staticmethod - def translate_from_rpc(rpcComponentInformationResult): - """Translates a gRPC struct to the SDK equivalent""" - return ComponentInformationResult( - ComponentInformationResult.Result.translate_from_rpc( - rpcComponentInformationResult.result - ), - rpcComponentInformationResult.result_str, - ) - - def translate_to_rpc(self, rpcComponentInformationResult): - """Translates this SDK object into its gRPC equivalent""" - - rpcComponentInformationResult.result = self.result.translate_to_rpc() - - rpcComponentInformationResult.result_str = self.result_str - - -class ComponentInformationError(Exception): - """Raised when a ComponentInformationResult is a fail code""" - - def __init__(self, result, origin, *params): - self._result = result - self._origin = origin - self._params = params - - def __str__(self): - return f"{self._result.result}: '{self._result.result_str}'; origin: {self._origin}; params: {self._params}" - - -class ComponentInformation(AsyncBase): - """ - Access component information such as parameters. - - Generated by dcsdkgen - MAVSDK ComponentInformation API - """ - - # Plugin name - name = "ComponentInformation" - - def _setup_stub(self, channel): - """Setups the api stub""" - self._stub = component_information_pb2_grpc.ComponentInformationServiceStub( - channel - ) - - def _extract_result(self, response): - """Returns the response status and description""" - return ComponentInformationResult.translate_from_rpc( - response.component_information_result - ) - - async def access_float_params(self): - """ - List available float params. - - Returns - ------- - params : [FloatParam] - Float param definitions - - Raises - ------ - ComponentInformationError - If the request fails. The error contains the reason for the failure. - """ - - request = component_information_pb2.AccessFloatParamsRequest() - response = await self._stub.AccessFloatParams(request) - - result = self._extract_result(response) - - if result.result != ComponentInformationResult.Result.SUCCESS: - raise ComponentInformationError(result, "access_float_params()") - - params = [] - for params_rpc in response.params: - params.append(FloatParam.translate_from_rpc(params_rpc)) - - return params - - async def float_param(self): - """ - Subscribe to float param changes/updates. - - Yields - ------- - param_update : FloatParamUpdate - A param update - - - """ - - request = component_information_pb2.SubscribeFloatParamRequest() - float_param_stream = self._stub.SubscribeFloatParam(request) - - try: - async for response in float_param_stream: - yield FloatParamUpdate.translate_from_rpc(response.param_update) - finally: - float_param_stream.cancel() diff --git a/mavsdk/component_information_pb2.py b/mavsdk/component_information_pb2.py deleted file mode 100644 index c45b6e73..00000000 --- a/mavsdk/component_information_pb2.py +++ /dev/null @@ -1,151 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: component_information/component_information.proto -"""Generated protocol buffer code.""" - -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from . import mavsdk_options_pb2 as mavsdk__options__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( - b'\n1component_information/component_information.proto\x12 mavsdk.rpc.component_information\x1a\x14mavsdk_options.proto"\xc7\x01\n\nFloatParam\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x11short_description\x18\x02 \x01(\t\x12\x18\n\x10long_description\x18\x03 \x01(\t\x12\x0c\n\x04unit\x18\x04 \x01(\t\x12\x16\n\x0e\x64\x65\x63imal_places\x18\x05 \x01(\x05\x12\x13\n\x0bstart_value\x18\x06 \x01(\x02\x12\x15\n\rdefault_value\x18\x07 \x01(\x02\x12\x11\n\tmin_value\x18\x08 \x01(\x02\x12\x11\n\tmax_value\x18\t \x01(\x02"\x1a\n\x18\x41\x63\x63\x65ssFloatParamsRequest"\xbd\x01\n\x19\x41\x63\x63\x65ssFloatParamsResponse\x12\x62\n\x1c\x63omponent_information_result\x18\x01 \x01(\x0b\x32<.mavsdk.rpc.component_information.ComponentInformationResult\x12<\n\x06params\x18\x02 \x03(\x0b\x32,.mavsdk.rpc.component_information.FloatParam"/\n\x10\x46loatParamUpdate\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x02"\x1c\n\x1aSubscribeFloatParamRequest"^\n\x12\x46loatParamResponse\x12H\n\x0cparam_update\x18\x01 \x01(\x0b\x32\x32.mavsdk.rpc.component_information.FloatParamUpdate"\xcd\x01\n\x1a\x43omponentInformationResult\x12S\n\x06result\x18\x01 \x01(\x0e\x32\x43.mavsdk.rpc.component_information.ComponentInformationResult.Result\x12\x12\n\nresult_str\x18\x02 \x01(\t"F\n\x06Result\x12\x12\n\x0eRESULT_UNKNOWN\x10\x00\x12\x12\n\x0eRESULT_SUCCESS\x10\x01\x12\x14\n\x10RESULT_NO_SYSTEM\x10\x03\x32\xc6\x02\n\x1b\x43omponentInformationService\x12\x92\x01\n\x11\x41\x63\x63\x65ssFloatParams\x12:.mavsdk.rpc.component_information.AccessFloatParamsRequest\x1a;.mavsdk.rpc.component_information.AccessFloatParamsResponse"\x04\x80\xb5\x18\x01\x12\x91\x01\n\x13SubscribeFloatParam\x12<.mavsdk.rpc.component_information.SubscribeFloatParamRequest\x1a\x34.mavsdk.rpc.component_information.FloatParamResponse"\x04\x80\xb5\x18\x00\x30\x01\x42<\n\x1fio.mavsdk.component_informationB\x19\x43omponentInformationProtob\x06proto3' -) - - -_FLOATPARAM = DESCRIPTOR.message_types_by_name["FloatParam"] -_ACCESSFLOATPARAMSREQUEST = DESCRIPTOR.message_types_by_name["AccessFloatParamsRequest"] -_ACCESSFLOATPARAMSRESPONSE = DESCRIPTOR.message_types_by_name[ - "AccessFloatParamsResponse" -] -_FLOATPARAMUPDATE = DESCRIPTOR.message_types_by_name["FloatParamUpdate"] -_SUBSCRIBEFLOATPARAMREQUEST = DESCRIPTOR.message_types_by_name[ - "SubscribeFloatParamRequest" -] -_FLOATPARAMRESPONSE = DESCRIPTOR.message_types_by_name["FloatParamResponse"] -_COMPONENTINFORMATIONRESULT = DESCRIPTOR.message_types_by_name[ - "ComponentInformationResult" -] -_COMPONENTINFORMATIONRESULT_RESULT = _COMPONENTINFORMATIONRESULT.enum_types_by_name[ - "Result" -] -FloatParam = _reflection.GeneratedProtocolMessageType( - "FloatParam", - (_message.Message,), - { - "DESCRIPTOR": _FLOATPARAM, - "__module__": "component_information.component_information_pb2", - # @@protoc_insertion_point(class_scope:mavsdk.rpc.component_information.FloatParam) - }, -) -_sym_db.RegisterMessage(FloatParam) - -AccessFloatParamsRequest = _reflection.GeneratedProtocolMessageType( - "AccessFloatParamsRequest", - (_message.Message,), - { - "DESCRIPTOR": _ACCESSFLOATPARAMSREQUEST, - "__module__": "component_information.component_information_pb2", - # @@protoc_insertion_point(class_scope:mavsdk.rpc.component_information.AccessFloatParamsRequest) - }, -) -_sym_db.RegisterMessage(AccessFloatParamsRequest) - -AccessFloatParamsResponse = _reflection.GeneratedProtocolMessageType( - "AccessFloatParamsResponse", - (_message.Message,), - { - "DESCRIPTOR": _ACCESSFLOATPARAMSRESPONSE, - "__module__": "component_information.component_information_pb2", - # @@protoc_insertion_point(class_scope:mavsdk.rpc.component_information.AccessFloatParamsResponse) - }, -) -_sym_db.RegisterMessage(AccessFloatParamsResponse) - -FloatParamUpdate = _reflection.GeneratedProtocolMessageType( - "FloatParamUpdate", - (_message.Message,), - { - "DESCRIPTOR": _FLOATPARAMUPDATE, - "__module__": "component_information.component_information_pb2", - # @@protoc_insertion_point(class_scope:mavsdk.rpc.component_information.FloatParamUpdate) - }, -) -_sym_db.RegisterMessage(FloatParamUpdate) - -SubscribeFloatParamRequest = _reflection.GeneratedProtocolMessageType( - "SubscribeFloatParamRequest", - (_message.Message,), - { - "DESCRIPTOR": _SUBSCRIBEFLOATPARAMREQUEST, - "__module__": "component_information.component_information_pb2", - # @@protoc_insertion_point(class_scope:mavsdk.rpc.component_information.SubscribeFloatParamRequest) - }, -) -_sym_db.RegisterMessage(SubscribeFloatParamRequest) - -FloatParamResponse = _reflection.GeneratedProtocolMessageType( - "FloatParamResponse", - (_message.Message,), - { - "DESCRIPTOR": _FLOATPARAMRESPONSE, - "__module__": "component_information.component_information_pb2", - # @@protoc_insertion_point(class_scope:mavsdk.rpc.component_information.FloatParamResponse) - }, -) -_sym_db.RegisterMessage(FloatParamResponse) - -ComponentInformationResult = _reflection.GeneratedProtocolMessageType( - "ComponentInformationResult", - (_message.Message,), - { - "DESCRIPTOR": _COMPONENTINFORMATIONRESULT, - "__module__": "component_information.component_information_pb2", - # @@protoc_insertion_point(class_scope:mavsdk.rpc.component_information.ComponentInformationResult) - }, -) -_sym_db.RegisterMessage(ComponentInformationResult) - -_COMPONENTINFORMATIONSERVICE = DESCRIPTOR.services_by_name[ - "ComponentInformationService" -] -if _descriptor._USE_C_DESCRIPTORS == False: - DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = ( - b"\n\037io.mavsdk.component_informationB\031ComponentInformationProto" - ) - _COMPONENTINFORMATIONSERVICE.methods_by_name["AccessFloatParams"]._options = None - _COMPONENTINFORMATIONSERVICE.methods_by_name[ - "AccessFloatParams" - ]._serialized_options = b"\200\265\030\001" - _COMPONENTINFORMATIONSERVICE.methods_by_name["SubscribeFloatParam"]._options = None - _COMPONENTINFORMATIONSERVICE.methods_by_name[ - "SubscribeFloatParam" - ]._serialized_options = b"\200\265\030\000" - _FLOATPARAM._serialized_start = 110 - _FLOATPARAM._serialized_end = 309 - _ACCESSFLOATPARAMSREQUEST._serialized_start = 311 - _ACCESSFLOATPARAMSREQUEST._serialized_end = 337 - _ACCESSFLOATPARAMSRESPONSE._serialized_start = 340 - _ACCESSFLOATPARAMSRESPONSE._serialized_end = 529 - _FLOATPARAMUPDATE._serialized_start = 531 - _FLOATPARAMUPDATE._serialized_end = 578 - _SUBSCRIBEFLOATPARAMREQUEST._serialized_start = 580 - _SUBSCRIBEFLOATPARAMREQUEST._serialized_end = 608 - _FLOATPARAMRESPONSE._serialized_start = 610 - _FLOATPARAMRESPONSE._serialized_end = 704 - _COMPONENTINFORMATIONRESULT._serialized_start = 707 - _COMPONENTINFORMATIONRESULT._serialized_end = 912 - _COMPONENTINFORMATIONRESULT_RESULT._serialized_start = 842 - _COMPONENTINFORMATIONRESULT_RESULT._serialized_end = 912 - _COMPONENTINFORMATIONSERVICE._serialized_start = 915 - _COMPONENTINFORMATIONSERVICE._serialized_end = 1241 -# @@protoc_insertion_point(module_scope) diff --git a/mavsdk/component_information_pb2_grpc.py b/mavsdk/component_information_pb2_grpc.py deleted file mode 100644 index 185bf578..00000000 --- a/mavsdk/component_information_pb2_grpc.py +++ /dev/null @@ -1,132 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" - -import grpc - -from . import ( - component_information_pb2 as component__information_dot_component__information__pb2, -) - - -class ComponentInformationServiceStub(object): - """Access component information such as parameters.""" - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.AccessFloatParams = channel.unary_unary( - "/mavsdk.rpc.component_information.ComponentInformationService/AccessFloatParams", - request_serializer=component__information_dot_component__information__pb2.AccessFloatParamsRequest.SerializeToString, - response_deserializer=component__information_dot_component__information__pb2.AccessFloatParamsResponse.FromString, - ) - self.SubscribeFloatParam = channel.unary_stream( - "/mavsdk.rpc.component_information.ComponentInformationService/SubscribeFloatParam", - request_serializer=component__information_dot_component__information__pb2.SubscribeFloatParamRequest.SerializeToString, - response_deserializer=component__information_dot_component__information__pb2.FloatParamResponse.FromString, - ) - - -class ComponentInformationServiceServicer(object): - """Access component information such as parameters.""" - - def AccessFloatParams(self, request, context): - """ - List available float params. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def SubscribeFloatParam(self, request, context): - """ - Subscribe to float param changes/updates. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - -def add_ComponentInformationServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - "AccessFloatParams": grpc.unary_unary_rpc_method_handler( - servicer.AccessFloatParams, - request_deserializer=component__information_dot_component__information__pb2.AccessFloatParamsRequest.FromString, - response_serializer=component__information_dot_component__information__pb2.AccessFloatParamsResponse.SerializeToString, - ), - "SubscribeFloatParam": grpc.unary_stream_rpc_method_handler( - servicer.SubscribeFloatParam, - request_deserializer=component__information_dot_component__information__pb2.SubscribeFloatParamRequest.FromString, - response_serializer=component__information_dot_component__information__pb2.FloatParamResponse.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - "mavsdk.rpc.component_information.ComponentInformationService", - rpc_method_handlers, - ) - server.add_generic_rpc_handlers((generic_handler,)) - - -# This class is part of an EXPERIMENTAL API. -class ComponentInformationService(object): - """Access component information such as parameters.""" - - @staticmethod - def AccessFloatParams( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, - target, - "/mavsdk.rpc.component_information.ComponentInformationService/AccessFloatParams", - component__information_dot_component__information__pb2.AccessFloatParamsRequest.SerializeToString, - component__information_dot_component__information__pb2.AccessFloatParamsResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - ) - - @staticmethod - def SubscribeFloatParam( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_stream( - request, - target, - "/mavsdk.rpc.component_information.ComponentInformationService/SubscribeFloatParam", - component__information_dot_component__information__pb2.SubscribeFloatParamRequest.SerializeToString, - component__information_dot_component__information__pb2.FloatParamResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - ) diff --git a/mavsdk/component_information_server.py b/mavsdk/component_information_server.py deleted file mode 100644 index 9e8fd789..00000000 --- a/mavsdk/component_information_server.py +++ /dev/null @@ -1,435 +0,0 @@ -# -*- coding: utf-8 -*- -# DO NOT EDIT! This file is auto-generated from -# https://github.com/mavlink/MAVSDK-Python/tree/main/other/templates/py -from ._base import AsyncBase -from . import component_information_server_pb2, component_information_server_pb2_grpc -from enum import Enum - - -class FloatParam: - """ - Meta information for parameter of type float. - - Parameters - ---------- - name : std::string - Name (max 16 chars) - - short_description : std::string - Short description - - long_description : std::string - Long description - - unit : std::string - Unit - - decimal_places : int32_t - Decimal places for user to show - - start_value : float - Current/starting value - - default_value : float - Default value - - min_value : float - Minimum value - - max_value : float - Maximum value - - """ - - def __init__( - self, - name, - short_description, - long_description, - unit, - decimal_places, - start_value, - default_value, - min_value, - max_value, - ): - """Initializes the FloatParam object""" - self.name = name - self.short_description = short_description - self.long_description = long_description - self.unit = unit - self.decimal_places = decimal_places - self.start_value = start_value - self.default_value = default_value - self.min_value = min_value - self.max_value = max_value - - def __eq__(self, to_compare): - """Checks if two FloatParam are the same""" - try: - # Try to compare - this likely fails when it is compared to a non - # FloatParam object - return ( - (self.name == to_compare.name) - and (self.short_description == to_compare.short_description) - and (self.long_description == to_compare.long_description) - and (self.unit == to_compare.unit) - and (self.decimal_places == to_compare.decimal_places) - and (self.start_value == to_compare.start_value) - and (self.default_value == to_compare.default_value) - and (self.min_value == to_compare.min_value) - and (self.max_value == to_compare.max_value) - ) - - except AttributeError: - return False - - def __str__(self): - """FloatParam in string representation""" - struct_repr = ", ".join( - [ - "name: " + str(self.name), - "short_description: " + str(self.short_description), - "long_description: " + str(self.long_description), - "unit: " + str(self.unit), - "decimal_places: " + str(self.decimal_places), - "start_value: " + str(self.start_value), - "default_value: " + str(self.default_value), - "min_value: " + str(self.min_value), - "max_value: " + str(self.max_value), - ] - ) - - return f"FloatParam: [{struct_repr}]" - - @staticmethod - def translate_from_rpc(rpcFloatParam): - """Translates a gRPC struct to the SDK equivalent""" - return FloatParam( - rpcFloatParam.name, - rpcFloatParam.short_description, - rpcFloatParam.long_description, - rpcFloatParam.unit, - rpcFloatParam.decimal_places, - rpcFloatParam.start_value, - rpcFloatParam.default_value, - rpcFloatParam.min_value, - rpcFloatParam.max_value, - ) - - def translate_to_rpc(self, rpcFloatParam): - """Translates this SDK object into its gRPC equivalent""" - - rpcFloatParam.name = self.name - - rpcFloatParam.short_description = self.short_description - - rpcFloatParam.long_description = self.long_description - - rpcFloatParam.unit = self.unit - - rpcFloatParam.decimal_places = self.decimal_places - - rpcFloatParam.start_value = self.start_value - - rpcFloatParam.default_value = self.default_value - - rpcFloatParam.min_value = self.min_value - - rpcFloatParam.max_value = self.max_value - - -class FloatParamUpdate: - """ - A float param that has been updated. - - Parameters - ---------- - name : std::string - Name of param that changed - - value : float - New value of param - - """ - - def __init__(self, name, value): - """Initializes the FloatParamUpdate object""" - self.name = name - self.value = value - - def __eq__(self, to_compare): - """Checks if two FloatParamUpdate are the same""" - try: - # Try to compare - this likely fails when it is compared to a non - # FloatParamUpdate object - return (self.name == to_compare.name) and (self.value == to_compare.value) - - except AttributeError: - return False - - def __str__(self): - """FloatParamUpdate in string representation""" - struct_repr = ", ".join( - ["name: " + str(self.name), "value: " + str(self.value)] - ) - - return f"FloatParamUpdate: [{struct_repr}]" - - @staticmethod - def translate_from_rpc(rpcFloatParamUpdate): - """Translates a gRPC struct to the SDK equivalent""" - return FloatParamUpdate(rpcFloatParamUpdate.name, rpcFloatParamUpdate.value) - - def translate_to_rpc(self, rpcFloatParamUpdate): - """Translates this SDK object into its gRPC equivalent""" - - rpcFloatParamUpdate.name = self.name - - rpcFloatParamUpdate.value = self.value - - -class ComponentInformationServerResult: - """ - Result type. - - Parameters - ---------- - result : Result - Result enum value - - result_str : std::string - Human-readable English string describing the result - - """ - - class Result(Enum): - """ - Possible results returned for param requests. - - Values - ------ - UNKNOWN - Unknown result - - SUCCESS - Request succeeded - - DUPLICATE_PARAM - Duplicate param - - INVALID_PARAM_START_VALUE - Invalid start param value - - INVALID_PARAM_DEFAULT_VALUE - Invalid default param value - - INVALID_PARAM_NAME - Invalid param name - - NO_SYSTEM - No system is connected - - """ - - UNKNOWN = 0 - SUCCESS = 1 - DUPLICATE_PARAM = 2 - INVALID_PARAM_START_VALUE = 3 - INVALID_PARAM_DEFAULT_VALUE = 4 - INVALID_PARAM_NAME = 5 - NO_SYSTEM = 6 - - def translate_to_rpc(self): - if self == ComponentInformationServerResult.Result.UNKNOWN: - return component_information_server_pb2.ComponentInformationServerResult.RESULT_UNKNOWN - if self == ComponentInformationServerResult.Result.SUCCESS: - return component_information_server_pb2.ComponentInformationServerResult.RESULT_SUCCESS - if self == ComponentInformationServerResult.Result.DUPLICATE_PARAM: - return component_information_server_pb2.ComponentInformationServerResult.RESULT_DUPLICATE_PARAM - if ( - self - == ComponentInformationServerResult.Result.INVALID_PARAM_START_VALUE - ): - return component_information_server_pb2.ComponentInformationServerResult.RESULT_INVALID_PARAM_START_VALUE - if ( - self - == ComponentInformationServerResult.Result.INVALID_PARAM_DEFAULT_VALUE - ): - return component_information_server_pb2.ComponentInformationServerResult.RESULT_INVALID_PARAM_DEFAULT_VALUE - if self == ComponentInformationServerResult.Result.INVALID_PARAM_NAME: - return component_information_server_pb2.ComponentInformationServerResult.RESULT_INVALID_PARAM_NAME - if self == ComponentInformationServerResult.Result.NO_SYSTEM: - return component_information_server_pb2.ComponentInformationServerResult.RESULT_NO_SYSTEM - - @staticmethod - def translate_from_rpc(rpc_enum_value): - """Parses a gRPC response""" - if ( - rpc_enum_value - == component_information_server_pb2.ComponentInformationServerResult.RESULT_UNKNOWN - ): - return ComponentInformationServerResult.Result.UNKNOWN - if ( - rpc_enum_value - == component_information_server_pb2.ComponentInformationServerResult.RESULT_SUCCESS - ): - return ComponentInformationServerResult.Result.SUCCESS - if ( - rpc_enum_value - == component_information_server_pb2.ComponentInformationServerResult.RESULT_DUPLICATE_PARAM - ): - return ComponentInformationServerResult.Result.DUPLICATE_PARAM - if ( - rpc_enum_value - == component_information_server_pb2.ComponentInformationServerResult.RESULT_INVALID_PARAM_START_VALUE - ): - return ComponentInformationServerResult.Result.INVALID_PARAM_START_VALUE - if ( - rpc_enum_value - == component_information_server_pb2.ComponentInformationServerResult.RESULT_INVALID_PARAM_DEFAULT_VALUE - ): - return ( - ComponentInformationServerResult.Result.INVALID_PARAM_DEFAULT_VALUE - ) - if ( - rpc_enum_value - == component_information_server_pb2.ComponentInformationServerResult.RESULT_INVALID_PARAM_NAME - ): - return ComponentInformationServerResult.Result.INVALID_PARAM_NAME - if ( - rpc_enum_value - == component_information_server_pb2.ComponentInformationServerResult.RESULT_NO_SYSTEM - ): - return ComponentInformationServerResult.Result.NO_SYSTEM - - def __str__(self): - return self.name - - def __init__(self, result, result_str): - """Initializes the ComponentInformationServerResult object""" - self.result = result - self.result_str = result_str - - def __eq__(self, to_compare): - """Checks if two ComponentInformationServerResult are the same""" - try: - # Try to compare - this likely fails when it is compared to a non - # ComponentInformationServerResult object - return (self.result == to_compare.result) and ( - self.result_str == to_compare.result_str - ) - - except AttributeError: - return False - - def __str__(self): - """ComponentInformationServerResult in string representation""" - struct_repr = ", ".join( - ["result: " + str(self.result), "result_str: " + str(self.result_str)] - ) - - return f"ComponentInformationServerResult: [{struct_repr}]" - - @staticmethod - def translate_from_rpc(rpcComponentInformationServerResult): - """Translates a gRPC struct to the SDK equivalent""" - return ComponentInformationServerResult( - ComponentInformationServerResult.Result.translate_from_rpc( - rpcComponentInformationServerResult.result - ), - rpcComponentInformationServerResult.result_str, - ) - - def translate_to_rpc(self, rpcComponentInformationServerResult): - """Translates this SDK object into its gRPC equivalent""" - - rpcComponentInformationServerResult.result = self.result.translate_to_rpc() - - rpcComponentInformationServerResult.result_str = self.result_str - - -class ComponentInformationServerError(Exception): - """Raised when a ComponentInformationServerResult is a fail code""" - - def __init__(self, result, origin, *params): - self._result = result - self._origin = origin - self._params = params - - def __str__(self): - return f"{self._result.result}: '{self._result.result_str}'; origin: {self._origin}; params: {self._params}" - - -class ComponentInformationServer(AsyncBase): - """ - Provide component information such as parameters. - - Generated by dcsdkgen - MAVSDK ComponentInformationServer API - """ - - # Plugin name - name = "ComponentInformationServer" - - def _setup_stub(self, channel): - """Setups the api stub""" - self._stub = ( - component_information_server_pb2_grpc.ComponentInformationServerServiceStub( - channel - ) - ) - - def _extract_result(self, response): - """Returns the response status and description""" - return ComponentInformationServerResult.translate_from_rpc( - response.component_information_server_result - ) - - async def provide_float_param(self, param): - """ - Provide a param of type float. - - Parameters - ---------- - param : FloatParam - Float param definition - - Raises - ------ - ComponentInformationServerError - If the request fails. The error contains the reason for the failure. - """ - - request = component_information_server_pb2.ProvideFloatParamRequest() - - param.translate_to_rpc(request.param) - - response = await self._stub.ProvideFloatParam(request) - - result = self._extract_result(response) - - if result.result != ComponentInformationServerResult.Result.SUCCESS: - raise ComponentInformationServerError( - result, "provide_float_param()", param - ) - - async def float_param(self): - """ - Subscribe to float param updates. - - Yields - ------- - param_update : FloatParamUpdate - A param update - - - """ - - request = component_information_server_pb2.SubscribeFloatParamRequest() - float_param_stream = self._stub.SubscribeFloatParam(request) - - try: - async for response in float_param_stream: - yield FloatParamUpdate.translate_from_rpc(response.param_update) - finally: - float_param_stream.cancel() diff --git a/mavsdk/component_information_server_pb2.py b/mavsdk/component_information_server_pb2.py deleted file mode 100644 index 912a840c..00000000 --- a/mavsdk/component_information_server_pb2.py +++ /dev/null @@ -1,155 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: component_information_server/component_information_server.proto -"""Generated protocol buffer code.""" - -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from . import mavsdk_options_pb2 as mavsdk__options__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( - b'\n?component_information_server/component_information_server.proto\x12\'mavsdk.rpc.component_information_server\x1a\x14mavsdk_options.proto"\xc7\x01\n\nFloatParam\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x11short_description\x18\x02 \x01(\t\x12\x18\n\x10long_description\x18\x03 \x01(\t\x12\x0c\n\x04unit\x18\x04 \x01(\t\x12\x16\n\x0e\x64\x65\x63imal_places\x18\x05 \x01(\x05\x12\x13\n\x0bstart_value\x18\x06 \x01(\x02\x12\x15\n\rdefault_value\x18\x07 \x01(\x02\x12\x11\n\tmin_value\x18\x08 \x01(\x02\x12\x11\n\tmax_value\x18\t \x01(\x02"^\n\x18ProvideFloatParamRequest\x12\x42\n\x05param\x18\x01 \x01(\x0b\x32\x33.mavsdk.rpc.component_information_server.FloatParam"\x93\x01\n\x19ProvideFloatParamResponse\x12v\n#component_information_server_result\x18\x01 \x01(\x0b\x32I.mavsdk.rpc.component_information_server.ComponentInformationServerResult"/\n\x10\x46loatParamUpdate\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x02"\x1c\n\x1aSubscribeFloatParamRequest"e\n\x12\x46loatParamResponse\x12O\n\x0cparam_update\x18\x01 \x01(\x0b\x32\x39.mavsdk.rpc.component_information_server.FloatParamUpdate"\xea\x02\n ComponentInformationServerResult\x12`\n\x06result\x18\x01 \x01(\x0e\x32P.mavsdk.rpc.component_information_server.ComponentInformationServerResult.Result\x12\x12\n\nresult_str\x18\x02 \x01(\t"\xcf\x01\n\x06Result\x12\x12\n\x0eRESULT_UNKNOWN\x10\x00\x12\x12\n\x0eRESULT_SUCCESS\x10\x01\x12\x1a\n\x16RESULT_DUPLICATE_PARAM\x10\x02\x12$\n RESULT_INVALID_PARAM_START_VALUE\x10\x03\x12&\n"RESULT_INVALID_PARAM_DEFAULT_VALUE\x10\x04\x12\x1d\n\x19RESULT_INVALID_PARAM_NAME\x10\x05\x12\x14\n\x10RESULT_NO_SYSTEM\x10\x06\x32\xe8\x02\n!ComponentInformationServerService\x12\xa0\x01\n\x11ProvideFloatParam\x12\x41.mavsdk.rpc.component_information_server.ProvideFloatParamRequest\x1a\x42.mavsdk.rpc.component_information_server.ProvideFloatParamResponse"\x04\x80\xb5\x18\x01\x12\x9f\x01\n\x13SubscribeFloatParam\x12\x43.mavsdk.rpc.component_information_server.SubscribeFloatParamRequest\x1a;.mavsdk.rpc.component_information_server.FloatParamResponse"\x04\x80\xb5\x18\x00\x30\x01\x42I\n&io.mavsdk.component_information_serverB\x1f\x43omponentInformationServerProtob\x06proto3' -) - - -_FLOATPARAM = DESCRIPTOR.message_types_by_name["FloatParam"] -_PROVIDEFLOATPARAMREQUEST = DESCRIPTOR.message_types_by_name["ProvideFloatParamRequest"] -_PROVIDEFLOATPARAMRESPONSE = DESCRIPTOR.message_types_by_name[ - "ProvideFloatParamResponse" -] -_FLOATPARAMUPDATE = DESCRIPTOR.message_types_by_name["FloatParamUpdate"] -_SUBSCRIBEFLOATPARAMREQUEST = DESCRIPTOR.message_types_by_name[ - "SubscribeFloatParamRequest" -] -_FLOATPARAMRESPONSE = DESCRIPTOR.message_types_by_name["FloatParamResponse"] -_COMPONENTINFORMATIONSERVERRESULT = DESCRIPTOR.message_types_by_name[ - "ComponentInformationServerResult" -] -_COMPONENTINFORMATIONSERVERRESULT_RESULT = ( - _COMPONENTINFORMATIONSERVERRESULT.enum_types_by_name["Result"] -) -FloatParam = _reflection.GeneratedProtocolMessageType( - "FloatParam", - (_message.Message,), - { - "DESCRIPTOR": _FLOATPARAM, - "__module__": "component_information_server.component_information_server_pb2", - # @@protoc_insertion_point(class_scope:mavsdk.rpc.component_information_server.FloatParam) - }, -) -_sym_db.RegisterMessage(FloatParam) - -ProvideFloatParamRequest = _reflection.GeneratedProtocolMessageType( - "ProvideFloatParamRequest", - (_message.Message,), - { - "DESCRIPTOR": _PROVIDEFLOATPARAMREQUEST, - "__module__": "component_information_server.component_information_server_pb2", - # @@protoc_insertion_point(class_scope:mavsdk.rpc.component_information_server.ProvideFloatParamRequest) - }, -) -_sym_db.RegisterMessage(ProvideFloatParamRequest) - -ProvideFloatParamResponse = _reflection.GeneratedProtocolMessageType( - "ProvideFloatParamResponse", - (_message.Message,), - { - "DESCRIPTOR": _PROVIDEFLOATPARAMRESPONSE, - "__module__": "component_information_server.component_information_server_pb2", - # @@protoc_insertion_point(class_scope:mavsdk.rpc.component_information_server.ProvideFloatParamResponse) - }, -) -_sym_db.RegisterMessage(ProvideFloatParamResponse) - -FloatParamUpdate = _reflection.GeneratedProtocolMessageType( - "FloatParamUpdate", - (_message.Message,), - { - "DESCRIPTOR": _FLOATPARAMUPDATE, - "__module__": "component_information_server.component_information_server_pb2", - # @@protoc_insertion_point(class_scope:mavsdk.rpc.component_information_server.FloatParamUpdate) - }, -) -_sym_db.RegisterMessage(FloatParamUpdate) - -SubscribeFloatParamRequest = _reflection.GeneratedProtocolMessageType( - "SubscribeFloatParamRequest", - (_message.Message,), - { - "DESCRIPTOR": _SUBSCRIBEFLOATPARAMREQUEST, - "__module__": "component_information_server.component_information_server_pb2", - # @@protoc_insertion_point(class_scope:mavsdk.rpc.component_information_server.SubscribeFloatParamRequest) - }, -) -_sym_db.RegisterMessage(SubscribeFloatParamRequest) - -FloatParamResponse = _reflection.GeneratedProtocolMessageType( - "FloatParamResponse", - (_message.Message,), - { - "DESCRIPTOR": _FLOATPARAMRESPONSE, - "__module__": "component_information_server.component_information_server_pb2", - # @@protoc_insertion_point(class_scope:mavsdk.rpc.component_information_server.FloatParamResponse) - }, -) -_sym_db.RegisterMessage(FloatParamResponse) - -ComponentInformationServerResult = _reflection.GeneratedProtocolMessageType( - "ComponentInformationServerResult", - (_message.Message,), - { - "DESCRIPTOR": _COMPONENTINFORMATIONSERVERRESULT, - "__module__": "component_information_server.component_information_server_pb2", - # @@protoc_insertion_point(class_scope:mavsdk.rpc.component_information_server.ComponentInformationServerResult) - }, -) -_sym_db.RegisterMessage(ComponentInformationServerResult) - -_COMPONENTINFORMATIONSERVERSERVICE = DESCRIPTOR.services_by_name[ - "ComponentInformationServerService" -] -if _descriptor._USE_C_DESCRIPTORS == False: - DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = ( - b"\n&io.mavsdk.component_information_serverB\037ComponentInformationServerProto" - ) - _COMPONENTINFORMATIONSERVERSERVICE.methods_by_name[ - "ProvideFloatParam" - ]._options = None - _COMPONENTINFORMATIONSERVERSERVICE.methods_by_name[ - "ProvideFloatParam" - ]._serialized_options = b"\200\265\030\001" - _COMPONENTINFORMATIONSERVERSERVICE.methods_by_name[ - "SubscribeFloatParam" - ]._options = None - _COMPONENTINFORMATIONSERVERSERVICE.methods_by_name[ - "SubscribeFloatParam" - ]._serialized_options = b"\200\265\030\000" - _FLOATPARAM._serialized_start = 131 - _FLOATPARAM._serialized_end = 330 - _PROVIDEFLOATPARAMREQUEST._serialized_start = 332 - _PROVIDEFLOATPARAMREQUEST._serialized_end = 426 - _PROVIDEFLOATPARAMRESPONSE._serialized_start = 429 - _PROVIDEFLOATPARAMRESPONSE._serialized_end = 576 - _FLOATPARAMUPDATE._serialized_start = 578 - _FLOATPARAMUPDATE._serialized_end = 625 - _SUBSCRIBEFLOATPARAMREQUEST._serialized_start = 627 - _SUBSCRIBEFLOATPARAMREQUEST._serialized_end = 655 - _FLOATPARAMRESPONSE._serialized_start = 657 - _FLOATPARAMRESPONSE._serialized_end = 758 - _COMPONENTINFORMATIONSERVERRESULT._serialized_start = 761 - _COMPONENTINFORMATIONSERVERRESULT._serialized_end = 1123 - _COMPONENTINFORMATIONSERVERRESULT_RESULT._serialized_start = 916 - _COMPONENTINFORMATIONSERVERRESULT_RESULT._serialized_end = 1123 - _COMPONENTINFORMATIONSERVERSERVICE._serialized_start = 1126 - _COMPONENTINFORMATIONSERVERSERVICE._serialized_end = 1486 -# @@protoc_insertion_point(module_scope) diff --git a/mavsdk/component_information_server_pb2_grpc.py b/mavsdk/component_information_server_pb2_grpc.py deleted file mode 100644 index e1676d0d..00000000 --- a/mavsdk/component_information_server_pb2_grpc.py +++ /dev/null @@ -1,132 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" - -import grpc - -from . import ( - component_information_server_pb2 as component__information__server_dot_component__information__server__pb2, -) - - -class ComponentInformationServerServiceStub(object): - """Provide component information such as parameters.""" - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.ProvideFloatParam = channel.unary_unary( - "/mavsdk.rpc.component_information_server.ComponentInformationServerService/ProvideFloatParam", - request_serializer=component__information__server_dot_component__information__server__pb2.ProvideFloatParamRequest.SerializeToString, - response_deserializer=component__information__server_dot_component__information__server__pb2.ProvideFloatParamResponse.FromString, - ) - self.SubscribeFloatParam = channel.unary_stream( - "/mavsdk.rpc.component_information_server.ComponentInformationServerService/SubscribeFloatParam", - request_serializer=component__information__server_dot_component__information__server__pb2.SubscribeFloatParamRequest.SerializeToString, - response_deserializer=component__information__server_dot_component__information__server__pb2.FloatParamResponse.FromString, - ) - - -class ComponentInformationServerServiceServicer(object): - """Provide component information such as parameters.""" - - def ProvideFloatParam(self, request, context): - """ - Provide a param of type float. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def SubscribeFloatParam(self, request, context): - """ - Subscribe to float param updates. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - -def add_ComponentInformationServerServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - "ProvideFloatParam": grpc.unary_unary_rpc_method_handler( - servicer.ProvideFloatParam, - request_deserializer=component__information__server_dot_component__information__server__pb2.ProvideFloatParamRequest.FromString, - response_serializer=component__information__server_dot_component__information__server__pb2.ProvideFloatParamResponse.SerializeToString, - ), - "SubscribeFloatParam": grpc.unary_stream_rpc_method_handler( - servicer.SubscribeFloatParam, - request_deserializer=component__information__server_dot_component__information__server__pb2.SubscribeFloatParamRequest.FromString, - response_serializer=component__information__server_dot_component__information__server__pb2.FloatParamResponse.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - "mavsdk.rpc.component_information_server.ComponentInformationServerService", - rpc_method_handlers, - ) - server.add_generic_rpc_handlers((generic_handler,)) - - -# This class is part of an EXPERIMENTAL API. -class ComponentInformationServerService(object): - """Provide component information such as parameters.""" - - @staticmethod - def ProvideFloatParam( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, - target, - "/mavsdk.rpc.component_information_server.ComponentInformationServerService/ProvideFloatParam", - component__information__server_dot_component__information__server__pb2.ProvideFloatParamRequest.SerializeToString, - component__information__server_dot_component__information__server__pb2.ProvideFloatParamResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - ) - - @staticmethod - def SubscribeFloatParam( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_stream( - request, - target, - "/mavsdk.rpc.component_information_server.ComponentInformationServerService/SubscribeFloatParam", - component__information__server_dot_component__information__server__pb2.SubscribeFloatParamRequest.SerializeToString, - component__information__server_dot_component__information__server__pb2.FloatParamResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - ) diff --git a/mavsdk/source/plugins/component_information.rst b/mavsdk/source/plugins/component_information.rst deleted file mode 100644 index e2276fbb..00000000 --- a/mavsdk/source/plugins/component_information.rst +++ /dev/null @@ -1,8 +0,0 @@ -ComponentInformation -==== - -.. automodule:: mavsdk.component_information - :members: - :undoc-members: - :show-inheritance: - :exclude-members: translate_from_rpc, translate_to_rpc \ No newline at end of file diff --git a/mavsdk/source/plugins/component_information_server.rst b/mavsdk/source/plugins/component_information_server.rst deleted file mode 100644 index f9aa02ee..00000000 --- a/mavsdk/source/plugins/component_information_server.rst +++ /dev/null @@ -1,8 +0,0 @@ -ComponentInformationServer -==== - -.. automodule:: mavsdk.component_information_server - :members: - :undoc-members: - :show-inheritance: - :exclude-members: translate_from_rpc, translate_to_rpc \ No newline at end of file diff --git a/mavsdk/source/plugins/index.rst b/mavsdk/source/plugins/index.rst index 53dcc038..f70fe78a 100644 --- a/mavsdk/source/plugins/index.rst +++ b/mavsdk/source/plugins/index.rst @@ -10,8 +10,6 @@ Plugins calibration camera camera_server - component_information - component_information_server component_metadata component_metadata_server core @@ -42,9 +40,5 @@ Plugins transponder tune winch - arm_authorizer_server - component_metadata - component_metadata_server - log_streaming events mavlink_direct diff --git a/mavsdk/system.py b/mavsdk/system.py index f1f9e03a..c2ab5e91 100644 --- a/mavsdk/system.py +++ b/mavsdk/system.py @@ -12,8 +12,6 @@ from . import calibration from . import camera from . import camera_server -from . import component_information -from . import component_information_server from . import component_metadata from . import component_metadata_server from . import core @@ -203,12 +201,6 @@ async def _init_plugins(self, host, port): self._plugins["calibration"] = calibration.Calibration(plugin_manager) self._plugins["camera"] = camera.Camera(plugin_manager) self._plugins["camera_server"] = camera_server.CameraServer(plugin_manager) - self._plugins["component_information"] = ( - component_information.ComponentInformation(plugin_manager) - ) - self._plugins["component_information_server"] = ( - component_information_server.ComponentInformationServer(plugin_manager) - ) self._plugins["component_metadata"] = component_metadata.ComponentMetadata( plugin_manager ) @@ -295,20 +287,6 @@ def camera_server(self) -> camera_server.CameraServer: raise RuntimeError(self.error_uninitialized("CameraServer")) return self._plugins["camera_server"] - @property - def component_information(self) -> component_information.ComponentInformation: - if "component_information" not in self._plugins: - raise RuntimeError(self.error_uninitialized("ComponentInformation")) - return self._plugins["component_information"] - - @property - def component_information_server( - self, - ) -> component_information_server.ComponentInformationServer: - if "component_information_server" not in self._plugins: - raise RuntimeError(self.error_uninitialized("ComponentInformationServer")) - return self._plugins["component_information_server"] - @property def component_metadata(self) -> component_metadata.ComponentMetadata: if "component_metadata" not in self._plugins: