This commit is contained in:
Siwat Sirichai 2022-12-12 16:10:23 +07:00
parent db0de37387
commit 8e31b4c159
3 changed files with 43 additions and 35 deletions

View file

@ -10,8 +10,8 @@ class cv:
def __init__(self, lcd: lcd, leds: leds) -> None:
self.lcd = lcd
self.leds = leds
self.camera = cv2.VideoCapture(0)
threading.Thread(target=self._cv_loop).start()
#self.camera = cv2.VideoCapture(0)
#threading.Thread(target=self._cv_loop).start()
def _cv_loop(self):
while True:
@ -31,3 +31,4 @@ class cv:
gray_img=cv2.cvtColor(image,cv2.COLOR_BGR2GRAY)
found_stopsigns=stopsign_cascade.detectMultiScale(gray_img,1.1,5)
return found_stopsigns

View file

@ -132,8 +132,8 @@ class motion:
self.motor_write(MOTOR_FL_F, MOTOR_FL_R, abs(leftSpeed))
self.motor_write(MOTOR_FR_F, MOTOR_FR_R, abs(rightSpeed))
self.motor_write(MOTOR_RL_F, MOTOR_RL_R, speed)
self.motor_write(MOTOR_RR_F, MOTOR_RR_R, speed)
#self.motor_write(MOTOR_RL_F, MOTOR_RL_R, speed)
#self.motor_write(MOTOR_RR_F, MOTOR_RR_R, speed)
time.sleep(t)