Skip to content

Commit

Permalink
Fixed raw_gps not existing when logging
Browse files Browse the repository at this point in the history
  • Loading branch information
KKalem committed Aug 23, 2023
1 parent 8cfc158 commit b1bf53c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions smarc_bt/src/mission_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,13 @@ def xround(num, precision=0):
except:
return num

try:
gps_lat = xround(v.raw_gps_obj.latitude, 6),
gps_lon = xround(v.raw_gps_obj.longitude, 6),
except:
gps_lat = None
gps_lon = None

record = [
int(time.time()),
annotation,
Expand All @@ -179,8 +186,8 @@ def xround(num, precision=0):
v.t2,
xround(v.batt_v, 1),
v.batt_percent,
xround(v.raw_gps_obj.latitude, 6),
xround(v.raw_gps_obj.longitude, 6),
gps_lat,
gps_lon,
tip.name,
status_strings.get(tip.status, "unknown")[0],
plan.plan_id
Expand Down

0 comments on commit b1bf53c

Please sign in to comment.