You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "/home/tve/Projects/Navigation/gopro-overlay/bin/gopro-dashboard.py", line 124, in <module>
timeseries.process_deltas(timeseries_process.calculate_gradient(), skip=10)
File "/home/Projects/Navigation/gopro-overlay/bin/../gopro_overlay/timeseries.py", line 186, in process_deltas
updates = processor(self.entries[a], self.entries[b], skip)
File "/home/Projects/Navigation/gopro-overlay/bin/../gopro_overlay/timeseries_process.py", line 64, in accept
gain = b.alt - a.alt
File "/usr/lib/python3.10/site-packages/pint/quantity.py", line 1095, in __rsub__
return -self._add_sub(other, operator.sub)
File "/usr/lib/python3.10/site-packages/pint/quantity.py", line 115, in wrapped
return f(self, *args, **kwargs)
File "/usr/lib/python3.10/site-packages/pint/quantity.py", line 984, in _add_sub
raise DimensionalityError(self._units, "dimensionless")
pint.errors.DimensionalityError: Cannot convert from 'meter' to 'dimensionless'
Debug:
def calculate_gradient():
def accept(a, b, c):
try:
gain = b.alt - a.alt
if a.odo and b.odo:
dist = b.odo - a.odo
if dist and dist.magnitude > 0:
return {"grad": (gain / dist) * 100.0}
except Exception: print(b.alt, a.alt)
Output:
Processing....
None -0.8 meter
None -0.8 meter
None -0.8 meter
None -0.8 meter
None -0.8 meter
None -0.8 meter
-0.4 meter None
-0.4 meter None
-0.4 meter None
-0.4 meter None
-0.6 meter None
-0.6 meter None
None -0.4 meter
None -0.4 meter
None -0.4 meter
None -0.6 meter
None -0.6 meter
None -0.6 meter
None -0.6 meter
...
Fix:
def calculate_gradient():
def accept(a, b, c):
if a.alt is None or b.alt is None:
return {"grad": 0.0}
gain = b.alt - a.alt
if a.odo and b.odo:
dist = b.odo - a.odo
if dist and dist.magnitude > 0:
return {"grad": (gain / dist) * 100.0}
return accept
The text was updated successfully, but these errors were encountered:
When using a gpx file...
Debug:
Output:
Fix:
The text was updated successfully, but these errors were encountered: