diff --git a/kuukar/kuukar_motion.py b/kuukar/kuukar_motion.py index 1642565..a1a3d82 100644 --- a/kuukar/kuukar_motion.py +++ b/kuukar/kuukar_motion.py @@ -88,6 +88,22 @@ class motion: self.motor_write(MOTOR_RL_F, MOTOR_RL_R, lm_speed) self.motor_write(MOTOR_RR_F, MOTOR_RR_R, rm_speed) + def skt_drive(self, speed: float, turn: float, t=0): + speed *=100 + turn *=100 + leftSpeed = speed - turn + rightSpeed = speed + turn + if leftSpeed>100: leftSpeed=100 + elif leftSpeed<-100: leftSpeed= -100 + if rightSpeed>100: rightSpeed=100 + elif rightSpeed<-100: rightSpeed= -100 + + self.motor_write(MOTOR_FL_F, MOTOR_FL_R, speed) + self.motor_write(MOTOR_FR_F, MOTOR_FR_R, speed) + self.motor_write(MOTOR_RL_F, MOTOR_RL_R, speed) + self.motor_write(MOTOR_RR_F, MOTOR_RR_R, speed) + + def stop(self): self.leds.set_left_signal_led(False) self.leds.set_right_signal_led(False)