|
|
|
@ -33,6 +33,8 @@ def parse_gpx(filename, fps=30.0):
|
|
|
|
|
prev_elevation = None
|
|
|
|
|
max_speed = 0.0
|
|
|
|
|
max_elevation = 0.0
|
|
|
|
|
min_speed = 9999.0
|
|
|
|
|
min_elevation = 9999.0
|
|
|
|
|
|
|
|
|
|
print("Calculating interpolation at {} fps".format(fps))
|
|
|
|
|
for segment in track_data.findall('def:trkseg', ns):
|
|
|
|
@ -59,6 +61,12 @@ def parse_gpx(filename, fps=30.0):
|
|
|
|
|
if km_hour > max_speed:
|
|
|
|
|
max_speed = km_hour
|
|
|
|
|
|
|
|
|
|
if elevation < min_elevation:
|
|
|
|
|
min_elevation = elevation
|
|
|
|
|
|
|
|
|
|
if km_hour < min_speed:
|
|
|
|
|
min_speed = km_hour
|
|
|
|
|
|
|
|
|
|
# Begin interpolation
|
|
|
|
|
delta_v = (km_hour - prev_velocity) / fps
|
|
|
|
|
delta_e = (elevation - prev_elevation) / fps
|
|
|
|
@ -74,5 +82,7 @@ def parse_gpx(filename, fps=30.0):
|
|
|
|
|
|
|
|
|
|
data.set_maximum('speed', max_speed)
|
|
|
|
|
data.set_maximum('elevation', max_elevation)
|
|
|
|
|
data.set_minimum('speed', min_speed)
|
|
|
|
|
data.set_minimum('elevation', min_elevation)
|
|
|
|
|
|
|
|
|
|
return data
|
|
|
|
|