File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414from Camera import Camera
1515
1616class Car :
17- def __init__ (self , driving_strategy = Driver (). farthest_distants ):
17+ def __init__ (self , driver ):
1818 """Initialize the car's components."""
1919
2020 def _initialize_speed_limits ():
@@ -96,9 +96,7 @@ def _initialize_camera():
9696
9797 _initialize_camera ()
9898
99- self .driving = driving_strategy
100-
101-
99+ self .driver = driver
102100
103101 log .info ("Car initialization complete" )
104102
@@ -174,7 +172,7 @@ def main(self):
174172 lidar_data = self .lidar .rDistance
175173 camera_data = self .camera .camera_matrix () # just some random size
176174 t0 = time .time ()
177- angle , vitesse = self .driving (lidar_data , camera_data )
175+ angle , vitesse = self .driver . ai (lidar_data , camera_data )
178176 t = time .time ()
179177 print ("ai duration" , t - t0 )
180178
@@ -194,7 +192,7 @@ def main(self):
194192 log .info ("Obstacle rouge détecté" )
195193 if color == 1 :
196194 log .info ("Obstacle vert détecté" )
197- angle = - color * MAX_ANGLE * 1.5
195+ angle = - color * MAX_ANGLE
198196 self .set_direction_degre (angle )
199197 self .recule ()
200198
You can’t perform that action at this time.
0 commit comments