Skip to content

Commit

Permalink
Merge pull request #6 from icns-distributed-cloud/pi
Browse files Browse the repository at this point in the history
round robin for smooth rotating movement
  • Loading branch information
sybahk authored Oct 15, 2021
2 parents d6ee0c1 + 9f25719 commit 07888ec
Showing 1 changed file with 33 additions and 4 deletions.
37 changes: 33 additions & 4 deletions aigo_serial/src/aigo_serial.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,42 @@ def calculate_pose():
global right_vel
#in STM32, MOTOR_SPEED = OUTPUT * 15 (MOTOR_SPEED < 9000)
#turn right
mode = 0
if(left > right+50):
left_vel = 600
right_vel = -600
if (mode = 0):
left_vel = 600
right_vel = -600
mode = 1
elif (mode = 1):
left_vel = 200
right_vel = 200
mode = 2
elif (mode = 2):
left_vel = 600
right_vel = -600
mode = 3
elif (mode = 3):
left_vel = -200
right_vel = -200
mode = 0
#turn left
elif(left+50 < right):
left_vel = -600
right_vel = 600
if (mode = 0):
left_vel = -600
right_vel = 600
mode = 1
elif (mode = 1):
left_vel = 200
right_vel = 200
mode = 2
elif (mode = 2):
left_vel = -600
right_vel = 600
mode = 3
elif (mode = 3):
left_vel = -200
right_vel = -200
mode = 0
elif(left > 0 and right > 0):
left_vel = 300
right_vel = 300
Expand Down

0 comments on commit 07888ec

Please sign in to comment.