Skip to content

Commit 108ef86

Browse files
authored
Merge pull request mavlink#455 from mavlink/pr-update
Update to latest proto and server
2 parents 3c2ad41 + 517901b commit 108ef86

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+4808
-29723
lines changed

MAVSDK_SERVER_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v0.50.0
1+
v1.1.0

examples/takeoff_and_land.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ async def run():
2727
print("-- Taking off")
2828
await drone.action.takeoff()
2929

30-
await asyncio.sleep(5)
30+
await asyncio.sleep(10)
3131

3232
print("-- Landing")
3333
await drone.action.land()

mavsdk/action.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,9 @@ class Result(Enum):
124124
PARAMETER_ERROR
125125
Error getting or setting parameter
126126
127+
UNSUPPORTED
128+
Action not supported
129+
127130
"""
128131

129132

@@ -139,6 +142,7 @@ class Result(Enum):
139142
VTOL_TRANSITION_SUPPORT_UNKNOWN = 9
140143
NO_VTOL_TRANSITION_SUPPORT = 10
141144
PARAMETER_ERROR = 11
145+
UNSUPPORTED = 12
142146

143147
def translate_to_rpc(self):
144148
if self == ActionResult.Result.UNKNOWN:
@@ -165,6 +169,8 @@ def translate_to_rpc(self):
165169
return action_pb2.ActionResult.RESULT_NO_VTOL_TRANSITION_SUPPORT
166170
if self == ActionResult.Result.PARAMETER_ERROR:
167171
return action_pb2.ActionResult.RESULT_PARAMETER_ERROR
172+
if self == ActionResult.Result.UNSUPPORTED:
173+
return action_pb2.ActionResult.RESULT_UNSUPPORTED
168174

169175
@staticmethod
170176
def translate_from_rpc(rpc_enum_value):
@@ -193,6 +199,8 @@ def translate_from_rpc(rpc_enum_value):
193199
return ActionResult.Result.NO_VTOL_TRANSITION_SUPPORT
194200
if rpc_enum_value == action_pb2.ActionResult.RESULT_PARAMETER_ERROR:
195201
return ActionResult.Result.PARAMETER_ERROR
202+
if rpc_enum_value == action_pb2.ActionResult.RESULT_UNSUPPORTED:
203+
return ActionResult.Result.UNSUPPORTED
196204

197205
def __str__(self):
198206
return self.name

mavsdk/action_pb2.py

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

mavsdk/action_server_pb2.py

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

mavsdk/calibration.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ class Result(Enum):
6161
FAILED_ARMED
6262
Calibration process failed since the vehicle is armed
6363
64+
UNSUPPORTED
65+
Functionality not supported
66+
6467
"""
6568

6669

@@ -75,6 +78,7 @@ class Result(Enum):
7578
TIMEOUT = 8
7679
CANCELLED = 9
7780
FAILED_ARMED = 10
81+
UNSUPPORTED = 11
7882

7983
def translate_to_rpc(self):
8084
if self == CalibrationResult.Result.UNKNOWN:
@@ -99,6 +103,8 @@ def translate_to_rpc(self):
99103
return calibration_pb2.CalibrationResult.RESULT_CANCELLED
100104
if self == CalibrationResult.Result.FAILED_ARMED:
101105
return calibration_pb2.CalibrationResult.RESULT_FAILED_ARMED
106+
if self == CalibrationResult.Result.UNSUPPORTED:
107+
return calibration_pb2.CalibrationResult.RESULT_UNSUPPORTED
102108

103109
@staticmethod
104110
def translate_from_rpc(rpc_enum_value):
@@ -125,6 +131,8 @@ def translate_from_rpc(rpc_enum_value):
125131
return CalibrationResult.Result.CANCELLED
126132
if rpc_enum_value == calibration_pb2.CalibrationResult.RESULT_FAILED_ARMED:
127133
return CalibrationResult.Result.FAILED_ARMED
134+
if rpc_enum_value == calibration_pb2.CalibrationResult.RESULT_UNSUPPORTED:
135+
return CalibrationResult.Result.UNSUPPORTED
128136

129137
def __str__(self):
130138
return self.name

mavsdk/calibration_pb2.py

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

mavsdk/camera.py

Lines changed: 104 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1074,6 +1074,12 @@ class Status:
10741074
storage_status : StorageStatus
10751075
Storage status
10761076
1077+
storage_id : uint32_t
1078+
Storage ID starting at 1
1079+
1080+
storage_type : StorageType
1081+
Storage type
1082+
10771083
"""
10781084

10791085

@@ -1129,6 +1135,74 @@ def translate_from_rpc(rpc_enum_value):
11291135
def __str__(self):
11301136
return self.name
11311137

1138+
1139+
class StorageType(Enum):
1140+
"""
1141+
Storage type.
1142+
1143+
Values
1144+
------
1145+
UNKNOWN
1146+
Storage type unknown
1147+
1148+
USB_STICK
1149+
Storage type USB stick
1150+
1151+
SD
1152+
Storage type SD card
1153+
1154+
MICROSD
1155+
Storage type MicroSD card
1156+
1157+
HD
1158+
Storage type HD mass storage
1159+
1160+
OTHER
1161+
Storage type other, not listed
1162+
1163+
"""
1164+
1165+
1166+
UNKNOWN = 0
1167+
USB_STICK = 1
1168+
SD = 2
1169+
MICROSD = 3
1170+
HD = 4
1171+
OTHER = 5
1172+
1173+
def translate_to_rpc(self):
1174+
if self == Status.StorageType.UNKNOWN:
1175+
return camera_pb2.Status.STORAGE_TYPE_UNKNOWN
1176+
if self == Status.StorageType.USB_STICK:
1177+
return camera_pb2.Status.STORAGE_TYPE_USB_STICK
1178+
if self == Status.StorageType.SD:
1179+
return camera_pb2.Status.STORAGE_TYPE_SD
1180+
if self == Status.StorageType.MICROSD:
1181+
return camera_pb2.Status.STORAGE_TYPE_MICROSD
1182+
if self == Status.StorageType.HD:
1183+
return camera_pb2.Status.STORAGE_TYPE_HD
1184+
if self == Status.StorageType.OTHER:
1185+
return camera_pb2.Status.STORAGE_TYPE_OTHER
1186+
1187+
@staticmethod
1188+
def translate_from_rpc(rpc_enum_value):
1189+
""" Parses a gRPC response """
1190+
if rpc_enum_value == camera_pb2.Status.STORAGE_TYPE_UNKNOWN:
1191+
return Status.StorageType.UNKNOWN
1192+
if rpc_enum_value == camera_pb2.Status.STORAGE_TYPE_USB_STICK:
1193+
return Status.StorageType.USB_STICK
1194+
if rpc_enum_value == camera_pb2.Status.STORAGE_TYPE_SD:
1195+
return Status.StorageType.SD
1196+
if rpc_enum_value == camera_pb2.Status.STORAGE_TYPE_MICROSD:
1197+
return Status.StorageType.MICROSD
1198+
if rpc_enum_value == camera_pb2.Status.STORAGE_TYPE_HD:
1199+
return Status.StorageType.HD
1200+
if rpc_enum_value == camera_pb2.Status.STORAGE_TYPE_OTHER:
1201+
return Status.StorageType.OTHER
1202+
1203+
def __str__(self):
1204+
return self.name
1205+
11321206

11331207
def __init__(
11341208
self,
@@ -1139,7 +1213,9 @@ def __init__(
11391213
total_storage_mib,
11401214
recording_time_s,
11411215
media_folder_name,
1142-
storage_status):
1216+
storage_status,
1217+
storage_id,
1218+
storage_type):
11431219
""" Initializes the Status object """
11441220
self.video_on = video_on
11451221
self.photo_interval_on = photo_interval_on
@@ -1149,6 +1225,8 @@ def __init__(
11491225
self.recording_time_s = recording_time_s
11501226
self.media_folder_name = media_folder_name
11511227
self.storage_status = storage_status
1228+
self.storage_id = storage_id
1229+
self.storage_type = storage_type
11521230

11531231
def __eq__(self, to_compare):
11541232
""" Checks if two Status are the same """
@@ -1163,7 +1241,9 @@ def __eq__(self, to_compare):
11631241
(self.total_storage_mib == to_compare.total_storage_mib) and \
11641242
(self.recording_time_s == to_compare.recording_time_s) and \
11651243
(self.media_folder_name == to_compare.media_folder_name) and \
1166-
(self.storage_status == to_compare.storage_status)
1244+
(self.storage_status == to_compare.storage_status) and \
1245+
(self.storage_id == to_compare.storage_id) and \
1246+
(self.storage_type == to_compare.storage_type)
11671247

11681248
except AttributeError:
11691249
return False
@@ -1178,7 +1258,9 @@ def __str__(self):
11781258
"total_storage_mib: " + str(self.total_storage_mib),
11791259
"recording_time_s: " + str(self.recording_time_s),
11801260
"media_folder_name: " + str(self.media_folder_name),
1181-
"storage_status: " + str(self.storage_status)
1261+
"storage_status: " + str(self.storage_status),
1262+
"storage_id: " + str(self.storage_id),
1263+
"storage_type: " + str(self.storage_type)
11821264
])
11831265

11841266
return f"Status: [{struct_repr}]"
@@ -1209,7 +1291,13 @@ def translate_from_rpc(rpcStatus):
12091291
rpcStatus.media_folder_name,
12101292

12111293

1212-
Status.StorageStatus.translate_from_rpc(rpcStatus.storage_status)
1294+
Status.StorageStatus.translate_from_rpc(rpcStatus.storage_status),
1295+
1296+
1297+
rpcStatus.storage_id,
1298+
1299+
1300+
Status.StorageType.translate_from_rpc(rpcStatus.storage_type)
12131301
)
12141302

12151303
def translate_to_rpc(self, rpcStatus):
@@ -1264,6 +1352,18 @@ def translate_to_rpc(self, rpcStatus):
12641352

12651353

12661354

1355+
1356+
1357+
rpcStatus.storage_id = self.storage_id
1358+
1359+
1360+
1361+
1362+
1363+
rpcStatus.storage_type = self.storage_type.translate_to_rpc()
1364+
1365+
1366+
12671367

12681368

12691369
class Option:

0 commit comments

Comments
 (0)