Answers for "self driving for line following"

0

self driving for line following

while(True):
           a, shift = get_vector()
           if a is None:
                # there is some code to recover the line if lost
                break
           turn_state, shift_state = check_shift_turn(a, shift)
           turn_dir, turn_val = get_turn(turn_state, shift_state)
           if turn_dir != 0:
               turn(turn_dir, turn_val)
               last_turn = turn_dir
           else:
               time.sleep(tconf.straight_run)
               last_turn = 0
           last_angle = a
Posted by: Guest on May-04-2021

Browse Popular Code Answers by Language