View: 338|Reply: 2

Adeept AWR speech.py backport

[Copy link]

3

Threads

7

Posts

84

Credits

Registered member

Rank: 2

Credits
84
Post time 2020-8-4 01:42:42 | Show all posts |Read mode
Hi.

Recently I`d try to backport Adeept picar-b speech functional to the Adeept AWR robot. After some try`n`fails it can turn left and right via voice commands. But I`m stuck with forward and backward modes. Can you please help?

Here is the code:
https://github.com/openbsod/Adee ... erver/speech.py#L50

Thank you in advance.


Reply

Use magic Report

0

Threads

23

Posts

73

Credits

Registered member

Rank: 2

Credits
73
Post time 2020-8-18 15:14:13 | Show all posts
Edited by 1597721285 at 2020-8-18 03:15 PM

Please try to modify the code on line 50:

"""
    if 'forward' in v_command:  # DOES NOT WORK YET
        move.move(speed_set, 'forward', 'no', rad)
        time.sleep(1)
        move.motorStop()

    elif 'backward' in v_command:
        move.move(speed_set, 'backward', 'no', rad)
        time.sleep(1)
        move.motorStop()
''""

intoļ¼š
"""
    if 'forward' in v_command:  # DOES NOT WORK YET
        move.motor_left(1, 0, speed_set)
        move.motor_right(1, 1, speed_set)
        time.sleep(1)
        move.motorStop()

    elif 'backward' in v_command:
        move.motor_left(1, 1, speed_set)
        move.motor_right(1, 0, speed_set)
        time.sleep(1)
        move.motorStop()
"""
Reply

Use magic Report

3

Threads

7

Posts

84

Credits

Registered member

Rank: 2

Credits
84
 Author| Post time 2021-1-22 07:10:17 | Show all posts
Thank you very much.

Correct forward / backward movementrs is

  1.     if 'backward' in v_command:
  2.         move.motor_left(1, 0, speed_set)
  3.         move.motor_right(1, 1, speed_set)
  4.         time.sleep(1)
  5.         move.motorStop()

  6.     elif 'forward' in v_command:
  7.         move.motor_left(1, 1, speed_set)
  8.         move.motor_right(1, 0, speed_set)
  9.         time.sleep(1)
  10.         move.motorStop()
Copy the Code


Now Adeept AWR has a Mars Rover PiCar-B speech recognition functions.
Reply

Use magic Report

You have to log in before you can reply Login | Sign Up

Points Rules