Hi @dave.m.mckay,
A good way of ignoring laser values with infinite is checking whether the laser value is inf
.
In your code below:
distance = float(laser)
if biggest < distance:
biggest = distance
this could be achieved with (note and distance != inf
):
inf = float('inf')
…
distance = float(laser)
if biggest < distance and distance != inf:
biggest = distance
This should solve the problem.
Please let us know in case you have more questions.