Skip to content

Commit

Permalink
substitute inf with -10000 so firmware don't crash our db
Browse files Browse the repository at this point in the history
  • Loading branch information
MCLiii committed Mar 13, 2024
1 parent 42c2818 commit 309626f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Backend/core/comms.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ def unpack_data(data):
unpacked_data = struct.unpack(format_string, data)
for i in range(len(properties)):
fields[properties[i]] = unpacked_data[i]
# if the data is -inf or inf, we set it to -10000
if fields[properties[i]] == float('inf') or fields[properties[i]] == float('-inf'):
fields[properties[i]] = -10000
return fields


Expand Down

0 comments on commit 309626f

Please sign in to comment.