Skip to content

Commit 2c59ade

Browse files
authored
Merge pull request #680 from mavlink/pr-v2.9.0
Update to mavsdk_server v2.9.0
2 parents 0d4caa6 + b73ab00 commit 2c59ade

File tree

5 files changed

+100
-20
lines changed

5 files changed

+100
-20
lines changed

MAVSDK_SERVER_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v2.8.1
1+
v2.9.0

mavsdk/info.py

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -891,4 +891,28 @@ async def get_speed_factor(self):
891891

892892

893893
return response.speed_factor
894-
894+
895+
896+
async def flight_information(self):
897+
"""
898+
Subscribe to 'flight information' updates.
899+
900+
Yields
901+
-------
902+
flight_info : FlightInfo
903+
The next flight information
904+
905+
906+
"""
907+
908+
request = info_pb2.SubscribeFlightInformationRequest()
909+
flight_information_stream = self._stub.SubscribeFlightInformation(request)
910+
911+
try:
912+
async for response in flight_information_stream:
913+
914+
915+
916+
yield FlightInfo.translate_from_rpc(response.flight_info)
917+
finally:
918+
flight_information_stream.cancel()

mavsdk/info_pb2.py

Lines changed: 39 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

mavsdk/info_pb2_grpc.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ def __init__(self, channel):
4040
request_serializer=info_dot_info__pb2.GetSpeedFactorRequest.SerializeToString,
4141
response_deserializer=info_dot_info__pb2.GetSpeedFactorResponse.FromString,
4242
)
43+
self.SubscribeFlightInformation = channel.unary_stream(
44+
'/mavsdk.rpc.info.InfoService/SubscribeFlightInformation',
45+
request_serializer=info_dot_info__pb2.SubscribeFlightInformationRequest.SerializeToString,
46+
response_deserializer=info_dot_info__pb2.FlightInformationResponse.FromString,
47+
)
4348

4449

4550
class InfoServiceServicer(object):
@@ -81,6 +86,13 @@ def GetSpeedFactor(self, request, context):
8186
context.set_details('Method not implemented!')
8287
raise NotImplementedError('Method not implemented!')
8388

89+
def SubscribeFlightInformation(self, request, context):
90+
"""Subscribe to 'flight information' updates.
91+
"""
92+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
93+
context.set_details('Method not implemented!')
94+
raise NotImplementedError('Method not implemented!')
95+
8496

8597
def add_InfoServiceServicer_to_server(servicer, server):
8698
rpc_method_handlers = {
@@ -109,6 +121,11 @@ def add_InfoServiceServicer_to_server(servicer, server):
109121
request_deserializer=info_dot_info__pb2.GetSpeedFactorRequest.FromString,
110122
response_serializer=info_dot_info__pb2.GetSpeedFactorResponse.SerializeToString,
111123
),
124+
'SubscribeFlightInformation': grpc.unary_stream_rpc_method_handler(
125+
servicer.SubscribeFlightInformation,
126+
request_deserializer=info_dot_info__pb2.SubscribeFlightInformationRequest.FromString,
127+
response_serializer=info_dot_info__pb2.FlightInformationResponse.SerializeToString,
128+
),
112129
}
113130
generic_handler = grpc.method_handlers_generic_handler(
114131
'mavsdk.rpc.info.InfoService', rpc_method_handlers)
@@ -204,3 +221,20 @@ def GetSpeedFactor(request,
204221
info_dot_info__pb2.GetSpeedFactorResponse.FromString,
205222
options, channel_credentials,
206223
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
224+
225+
@staticmethod
226+
def SubscribeFlightInformation(request,
227+
target,
228+
options=(),
229+
channel_credentials=None,
230+
call_credentials=None,
231+
insecure=False,
232+
compression=None,
233+
wait_for_ready=None,
234+
timeout=None,
235+
metadata=None):
236+
return grpc.experimental.unary_stream(request, target, '/mavsdk.rpc.info.InfoService/SubscribeFlightInformation',
237+
info_dot_info__pb2.SubscribeFlightInformationRequest.SerializeToString,
238+
info_dot_info__pb2.FlightInformationResponse.FromString,
239+
options, channel_credentials,
240+
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

proto

Submodule proto updated from e3f50d4 to debaacd

0 commit comments

Comments
 (0)