diff --git a/kuukar/kuukar_motion.py b/kuukar/kuukar_motion.py index db951e9..f3e5e9a 100644 --- a/kuukar/kuukar_motion.py +++ b/kuukar/kuukar_motion.py @@ -87,7 +87,8 @@ class motion: self.motor_write(MOTOR_FR_F, MOTOR_FR_R, rm_speed) 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 @@ -115,6 +116,24 @@ 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) + ''' + + def skt_drive(self, speed: float, turn: float, t=0): + speed *=100 + turn *=100 + leftSpeed = speed - turn + rightSpeed = speed + turn + if leftSpeed>99: leftSpeed=99 + elif leftSpeed<-99: leftSpeed= -99 + if rightSpeed>99: rightSpeed=99 + elif rightSpeed<-99: rightSpeed= -99 + if speed>99: speed=99 + elif speed<-99: speed= -99 + + 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)