We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 72e11c7 commit 14c73e1Copy full SHA for 14c73e1
1 file changed
mirte_robot/robot.py
@@ -500,11 +500,8 @@ def getDistance(self, sensor: str) -> float:
500
501
distance: float = range.range
502
503
- # FIXME: What to do about nan?
504
- if distance == math.inf:
505
- distance = range.max_range
506
- elif distance == -math.inf:
507
- distance = range.min_range
+ if distance == math.inf or distance == -math.inf or math.isnan(distance):
+ distance = -1
508
509
return distance
510
0 commit comments