Skip to content

Commit 37131ad

Browse files
authored
Merge pull request #326 from mavlink/pr-update-v0.38.2
Update to MAVSDK v0.38.2
2 parents 3239936 + c267f31 commit 37131ad

11 files changed

+833
-37
lines changed

MAVSDK_SERVER_VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
v0.36.0
1+
v0.38.2
22

33

44

mavsdk/camera.py

+84-4
Original file line numberDiff line numberDiff line change
@@ -1563,17 +1563,42 @@ class Information:
15631563
model_name : std::string
15641564
Name of the camera model
15651565
1566+
focal_length_mm : float
1567+
Focal length
1568+
1569+
horizontal_sensor_size_mm : float
1570+
Horizontal sensor size
1571+
1572+
vertical_sensor_size_mm : float
1573+
Vertical sensor size
1574+
1575+
horizontal_resolution_px : uint32_t
1576+
Horizontal image resolution in pixels
1577+
1578+
vertical_resolution_px : uint32_t
1579+
Vertical image resolution in pixels
1580+
15661581
"""
15671582

15681583

15691584

15701585
def __init__(
15711586
self,
15721587
vendor_name,
1573-
model_name):
1588+
model_name,
1589+
focal_length_mm,
1590+
horizontal_sensor_size_mm,
1591+
vertical_sensor_size_mm,
1592+
horizontal_resolution_px,
1593+
vertical_resolution_px):
15741594
""" Initializes the Information object """
15751595
self.vendor_name = vendor_name
15761596
self.model_name = model_name
1597+
self.focal_length_mm = focal_length_mm
1598+
self.horizontal_sensor_size_mm = horizontal_sensor_size_mm
1599+
self.vertical_sensor_size_mm = vertical_sensor_size_mm
1600+
self.horizontal_resolution_px = horizontal_resolution_px
1601+
self.vertical_resolution_px = vertical_resolution_px
15771602

15781603
def __equals__(self, to_compare):
15791604
""" Checks if two Information are the same """
@@ -1582,7 +1607,12 @@ def __equals__(self, to_compare):
15821607
# Information object
15831608
return \
15841609
(self.vendor_name == to_compare.vendor_name) and \
1585-
(self.model_name == to_compare.model_name)
1610+
(self.model_name == to_compare.model_name) and \
1611+
(self.focal_length_mm == to_compare.focal_length_mm) and \
1612+
(self.horizontal_sensor_size_mm == to_compare.horizontal_sensor_size_mm) and \
1613+
(self.vertical_sensor_size_mm == to_compare.vertical_sensor_size_mm) and \
1614+
(self.horizontal_resolution_px == to_compare.horizontal_resolution_px) and \
1615+
(self.vertical_resolution_px == to_compare.vertical_resolution_px)
15861616

15871617
except AttributeError:
15881618
return False
@@ -1591,7 +1621,12 @@ def __str__(self):
15911621
""" Information in string representation """
15921622
struct_repr = ", ".join([
15931623
"vendor_name: " + str(self.vendor_name),
1594-
"model_name: " + str(self.model_name)
1624+
"model_name: " + str(self.model_name),
1625+
"focal_length_mm: " + str(self.focal_length_mm),
1626+
"horizontal_sensor_size_mm: " + str(self.horizontal_sensor_size_mm),
1627+
"vertical_sensor_size_mm: " + str(self.vertical_sensor_size_mm),
1628+
"horizontal_resolution_px: " + str(self.horizontal_resolution_px),
1629+
"vertical_resolution_px: " + str(self.vertical_resolution_px)
15951630
])
15961631

15971632
return f"Information: [{struct_repr}]"
@@ -1604,7 +1639,22 @@ def translate_from_rpc(rpcInformation):
16041639
rpcInformation.vendor_name,
16051640

16061641

1607-
rpcInformation.model_name
1642+
rpcInformation.model_name,
1643+
1644+
1645+
rpcInformation.focal_length_mm,
1646+
1647+
1648+
rpcInformation.horizontal_sensor_size_mm,
1649+
1650+
1651+
rpcInformation.vertical_sensor_size_mm,
1652+
1653+
1654+
rpcInformation.horizontal_resolution_px,
1655+
1656+
1657+
rpcInformation.vertical_resolution_px
16081658
)
16091659

16101660
def translate_to_rpc(self, rpcInformation):
@@ -1623,6 +1673,36 @@ def translate_to_rpc(self, rpcInformation):
16231673

16241674

16251675

1676+
1677+
1678+
rpcInformation.focal_length_mm = self.focal_length_mm
1679+
1680+
1681+
1682+
1683+
1684+
rpcInformation.horizontal_sensor_size_mm = self.horizontal_sensor_size_mm
1685+
1686+
1687+
1688+
1689+
1690+
rpcInformation.vertical_sensor_size_mm = self.vertical_sensor_size_mm
1691+
1692+
1693+
1694+
1695+
1696+
rpcInformation.horizontal_resolution_px = self.horizontal_resolution_px
1697+
1698+
1699+
1700+
1701+
1702+
rpcInformation.vertical_resolution_px = self.vertical_resolution_px
1703+
1704+
1705+
16261706

16271707

16281708

mavsdk/camera_pb2.py

+44-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

mavsdk/log_files.py

+8-5
Original file line numberDiff line numberDiff line change
@@ -370,14 +370,14 @@ async def get_entries(self):
370370
return entries
371371

372372

373-
async def download_log_file(self, id, path):
373+
async def download_log_file(self, entry, path):
374374
"""
375375
Download log file.
376376
377377
Parameters
378378
----------
379-
id : uint32_t
380-
ID of the log file to download
379+
entry : Entry
380+
Entry of the log file to download.
381381
382382
path : std::string
383383
Path of where to download log file to.
@@ -394,7 +394,10 @@ async def download_log_file(self, id, path):
394394
"""
395395

396396
request = log_files_pb2.SubscribeDownloadLogFileRequest()
397-
request.id = id
397+
398+
entry.translate_to_rpc(request.entry)
399+
400+
398401
request.path = path
399402
download_log_file_stream = self._stub.SubscribeDownloadLogFile(request)
400403

@@ -408,7 +411,7 @@ async def download_log_file(self, id, path):
408411
success_codes.append(LogFilesResult.Result.NEXT)
409412

410413
if result.result not in success_codes:
411-
raise LogFilesError(result, "download_log_file()", id, path)
414+
raise LogFilesError(result, "download_log_file()", entry, path)
412415

413416
if result.result is LogFilesResult.Result.SUCCESS:
414417
download_log_file_stream.cancel();

mavsdk/log_files_pb2.py

+18-17
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)