diff --git a/mavsdk/generated/core.py b/mavsdk/generated/core.py index fb2e340a..19171d43 100644 --- a/mavsdk/generated/core.py +++ b/mavsdk/generated/core.py @@ -227,5 +227,9 @@ async def list_running_plugins(self): - return [PluginInfo].translate_from_rpc(response.plugin_info) - \ No newline at end of file + plugin_info = [] + for plugin_info_rpc in response.plugin_info: + plugin_info.append(PluginInfo.translate_from_rpc(plugin_info_rpc)) + + return plugin_info + \ No newline at end of file diff --git a/mavsdk/generated/mission.py b/mavsdk/generated/mission.py index 5407b34e..4ccfabe9 100644 --- a/mavsdk/generated/mission.py +++ b/mavsdk/generated/mission.py @@ -631,8 +631,12 @@ async def download_mission(self): raise MissionError(result, "download_mission()") - return [MissionItem].translate_from_rpc(response.mission_items) - + mission_items = [] + for mission_items_rpc in response.mission_items: + mission_items.append(MissionItem.translate_from_rpc(mission_items_rpc)) + + return mission_items + async def cancel_mission_download(self): """ diff --git a/other/templates/request.j2 b/other/templates/request.j2 index 47c747e1..09ae3e8c 100644 --- a/other/templates/request.j2 +++ b/other/templates/request.j2 @@ -53,5 +53,13 @@ async def {{ name.lower_snake_case }}(self{% for param in params %}, {{ param.na {% if return_type.is_primitive -%} return response.{{ return_name.lower_snake_case }} {% else -%} - return {{ return_type.name }}.translate_from_rpc(response.{{ return_name.lower_snake_case }}) + {% if return_type.is_repeated -%} + {{ return_name.lower_snake_case }} = [] + for {{ return_name.lower_snake_case }}_rpc in response.{{ return_name.lower_snake_case }}: + {{ return_name.lower_snake_case }}.append({{ return_type.inner_name }}.translate_from_rpc({{ return_name.lower_snake_case }}_rpc)) + + return {{ return_name.lower_snake_case }} + {% else -%} + return {{ return_type.inner_name }}.translate_from_rpc(response.{{ return_name.lower_snake_case }}) + {% endif -%} {% endif %}