Skip to content
This repository was archived by the owner on Feb 2, 2025. It is now read-only.

Commit 5070895

Browse files
committed
enhance parseImage.py Skydio support
1 parent 49571e0 commit 5070895

File tree

2 files changed

+27
-11
lines changed

2 files changed

+27
-11
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@
88
.DS_Store
99
DJI_*.JPG
1010
*.ATHENA
11+
skydio*.jpg

playground/parseImage.py

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,17 @@
55
66
This can be done in near real-time if images are automatically downloaded to a computer from the UAV's paired device
77
8-
Currently only photos from DJI-make drones are supported
9-
, and the only tested model(s) are below
10-
Support for more drone models can be added later with help from the OpenAthena
11-
user community
8+
Currently only photos from the following makes have been tested
129
13-
If your UAV make or model is not listed here, feel free to make a pull request:
10+
Support for more drone makes can be added later with help from the OpenAthena
11+
user community.
12+
13+
Please email photo examples, with intact metadata and a locate-able subject in the direct center of image to matthew (at) krupczak (dot) org
14+
15+
If your UAV make or model is not listed here, feel free to help out and make a pull request:
1416
Makes:
1517
DJI
16-
Models:
17-
DJI Mavic 2 Zoom
18+
Skydio
1819
1920
XMP:
2021
en.wikipedia.org/wiki/Extensible_Metadata_Platform
@@ -290,18 +291,32 @@ def handleSKYDIO( xmp_str ):
290291
# (i.e. "Yaw", "Pitch", etc.)
291292
# will need to parse differently :(
292293

294+
# print(xmp_str)
293295

294296
element = "drone-skydio:CameraOrientationNED"
295-
values = xmp_str[xmp_str.find(element) + len(element) : xmp_str.find(element) + len(element) + 100]
296-
theta = float(values.split('\"')[3])
297-
azimuth = float(values.split('\"')[5])
297+
startIndex = xmp_str.find(element)
298+
if startIndex == -1:
299+
element = "drone-skydio:CameraOrientationFLU"
300+
startIndex = xmp_str.find(element)
301+
if startIndex == -1:
302+
return None
303+
304+
values = xmp_str[startIndex + len(element) : startIndex + len(element) + 100]
305+
theta = values.split('\"')[3]
306+
azimuth = values.split('\"')[5]
307+
308+
try:
309+
theta = float(theta)
310+
azimuth = float(azimuth)
311+
except ValueError:
312+
return None
298313

299314
theta = abs(theta)
300315

301316
elements = ["drone-skydio:Latitude=",
302317
"drone-skydio:Longitude=",
303318
"drone-skydio:AbsoluteAltitude="]
304-
gpsDict = xmp_parse( xmp_str, elements)
319+
gpsDict = xmp_parse(xmp_str, elements)
305320

306321
y = gpsDict["drone-skydio:Latitude="]
307322
x = gpsDict["drone-skydio:Longitude="]

0 commit comments

Comments
 (0)