From 150399d63db0b548a9ababe8089fae94d5e77f63 Mon Sep 17 00:00:00 2001 From: Siwat Sirichai Date: Sun, 11 Dec 2022 14:51:17 +0700 Subject: [PATCH] MainRobotLane --- MainRobotLane.py | 8 ++++---- kuukar/kuukar_motion.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/MainRobotLane.py b/MainRobotLane.py index 930e08e..0d79296 100644 --- a/MainRobotLane.py +++ b/MainRobotLane.py @@ -18,7 +18,7 @@ def main(): img = WebcamModule.getImg() curveVal= getLaneCurve(img,2) - sen = 1.3 # SENSITIVITY + sen = 0.8 # SENSITIVITY maxVAl= 1.0 # MAX SPEED if curveVal>maxVAl:curveVal = maxVAl if curveVal<-maxVAl: curveVal =-maxVAl @@ -28,14 +28,14 @@ def main(): if curveVal<0.05: curveVal=0 else: if curveVal>-0.08: curveVal=0 - car.motion.skt_drive(0.15,-curveVal*sen,0.05) + car.motion.skt_drive(0.3,-curveVal*sen,0.05) print(curveVal) cv2.waitKey(1) if __name__ == '__main__': - initialTrackBarVals = [98, 141, 77, 220] + initialTrackBarVals = [70, 124, 4, 195] initializeTrackbars(initialTrackBarVals) while True: - main() \ No newline at end of file + main() diff --git a/kuukar/kuukar_motion.py b/kuukar/kuukar_motion.py index f3e5e9a..7cffff4 100644 --- a/kuukar/kuukar_motion.py +++ b/kuukar/kuukar_motion.py @@ -134,7 +134,7 @@ class motion: 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) - + time.sleep(t) def stop(self):