diff --git a/controller.py b/controller.py index 0ff8b88c4e95b26be769a9a27e5fbb7ee0cc7ec4..c91e4fdd4ec0048bf90a91b5dd4e8b7a94f93486 100644 --- a/controller.py +++ b/controller.py @@ -134,9 +134,9 @@ class Controller: :param bool moving: Indicates if the robot is moving """ distance = self._get_robust_distance(sensor, moving) - if distance < sensor.low: + if distance < sensor.sensor.low: return (HCSR04Event.DANGER, distance) - if distance < sensor.high: + if distance < sensor.sensor.high: return (HCSR04Event.WALL, distance) return (HCSR04Event.NOTHING, distance)