Ejemplo n.º 1
0
def move_thread():
    global step_set
    stand_stu = 1
    while 1:
        if not steadyMode:
            if direction_command == 'forward' and turn_command == 'no':
                if SmoothMode:
                    move.dove(step_set, 35, 0.001, DPI, 'no')
                    step_set += 1
                    if step_set == 5:
                        step_set = 1
                    continue
                else:
                    move.move(step_set, 35, 'no')
                    time.sleep(0.1)
                    step_set += 1
                    if step_set == 5:
                        step_set = 1
                    continue
            elif direction_command == 'backward' and turn_command == 'no':
                if SmoothMode:
                    move.dove(step_set, -35, 0.001, DPI, 'no')
                    step_set += 1
                    if step_set == 5:
                        step_set = 1
                    continue
                else:
                    move.move(step_set, -35, 'no')
                    time.sleep(0.1)
                    step_set += 1
                    if step_set == 5:
                        step_set = 1
                    continue
            else:
                pass

            if turn_command != 'no':
                if SmoothMode:
                    move.dove(step_set, 35, 0.001, DPI, turn_command)
                    step_set += 1
                    if step_set == 5:
                        step_set = 1
                    continue
                else:
                    move.move(step_set, 35, turn_command)
                    time.sleep(0.1)
                    step_set += 1
                    if step_set == 5:
                        step_set = 1
                    continue
            else:
                pass

            if turn_command == 'no' and direction_command == 'stand':
                move.stand()
                step_set = 1
            pass
        else:
            move.steady_X()
            move.steady()
Ejemplo n.º 2
0
def move_thread():
    global step_set
    stand_stu = 1
    while 1:
        if not steadyMode:
            if direction_command == 'forward' and turn_command == 'no':
                stand_stu = 0
                move.dove_move_tripod(step_set, 150, 'forward')
                step_set += 1
                if step_set == 9:
                    step_set = 1
                continue

            elif direction_command == 'backward' and turn_command == 'no':
                stand_stu = 0
                move.dove_move_tripod(step_set, 150, 'backward')
                step_set += 1
                if step_set == 9:
                    step_set = 1
                continue

            else:
                pass

            if turn_command != 'no':
                stand_stu = 0
                move.dove_move_diagonal(step_set, 150, turn_command)
                step_set += 1
                if step_set == 9:
                    step_set = 1
                continue
            else:
                pass

            if turn_command == 'no' and direction_command == 'stand':
                if stand_stu == 0:
                    move.robot_stand(150)
                    step_set = 1
                    stand_stu = 1
                else:
                    time.sleep(0.01)
                    pass

            pass
        else:
            pass
            move.robot_X(150, 100)
            move.steady()