Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions pyulog/ulog2kml.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,13 @@ def _kml_add_camera_triggers(kml, ulog, camera_trigger_topic_name, altitude_offs
if len(cur_dataset) > 0:
cur_dataset = cur_dataset[0]

pos_lon = cur_dataset.data['lon']
pos_lat = cur_dataset.data['lat']
pos_alt = cur_dataset.data['alt']
# 'longitude_deg' is used in newer PX4 versions
pos_lon = (cur_dataset.data['lon'] if 'lon' in cur_dataset.data else
cur_dataset.data['longitude_deg'])
pos_lat = (cur_dataset.data['lat'] if 'lat' in cur_dataset.data else
cur_dataset.data['latitude_deg'])
pos_alt = (cur_dataset.data['alt'] if 'alt' in cur_dataset.data else
cur_dataset.data['altitude_msl_m'])
sequence = cur_dataset.data['seq']

for i in range(len(pos_lon)):
Expand All @@ -163,9 +167,13 @@ def _kml_add_position_data(kml, ulog, position_topic_name, colors, style,
cur_dataset = cur_dataset[0]


pos_lon = cur_dataset.data['lon']
pos_lat = cur_dataset.data['lat']
pos_alt = cur_dataset.data['alt']
# 'longitude_deg' is used in newer PX4 versions
pos_lon = (cur_dataset.data['lon'] if 'lon' in cur_dataset.data else
cur_dataset.data['longitude_deg'])
pos_lat = (cur_dataset.data['lat'] if 'lat' in cur_dataset.data else
cur_dataset.data['latitude_deg'])
pos_alt = (cur_dataset.data['alt'] if 'alt' in cur_dataset.data else
cur_dataset.data['altitude_msl_m'])
pos_t = cur_dataset.data['timestamp']

if 'fix_type' in cur_dataset.data:
Expand Down
Loading