Skip to content
Snippets Groups Projects
Commit 0e93333c authored by ROUE Simon, Claude, Yves's avatar ROUE Simon, Claude, Yves
Browse files

Update controller.py, droids.py

parent 7141ccb6
No related branches found
No related tags found
No related merge requests found
...@@ -160,6 +160,14 @@ class Controller: ...@@ -160,6 +160,14 @@ class Controller:
else: else:
return sum([i for i in measures if i!="inf"]) / 100 return sum([i for i in measures if i!="inf"]) / 100
###TESTING
def _get_sensor(name:int):
if name==0:
return self.left_sensor
elif name==1:
return self.front_sensor
else:
return self.right_sensor
class PIDController(Controller): class PIDController(Controller):
""" """
......
...@@ -225,9 +225,10 @@ class Droid3Sensors(Droid): ...@@ -225,9 +225,10 @@ class Droid3Sensors(Droid):
#TODO : Implement the maze exploration #TODO : Implement the maze exploration
import threading import threading
import time
def print_distance_and_state(self): def print_distance_and_state(self):
while True: while True:
print("yo", end="")
print(self.controller._get_robust_distance(self.controller.left_sensor)) print(self.controller._get_robust_distance(self.controller.left_sensor))
print(self.controller._get_robust_distance(self.controller.right_sensor)) print(self.controller._get_robust_distance(self.controller.right_sensor))
print(self.controller._get_robust_distance(self.controller.front_sensor)) print(self.controller._get_robust_distance(self.controller.front_sensor))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment