Welcome to DOGZILLA-Lite repository
6.Intelligent interaction
AI Voice Interaction: Intelligent Interaction
AI Voice Interaction: Intelligent InteractionFunction IntroductionFunction ExperienceProgram source codeFunctional principle
Function Introduction
This case is the gameplay of the startup program. You can use fixed voice command words to make the robot dog do corresponding actions. This function needs to be connected to the network to run normally
Function Experience
- Turn on the robot dog first, press the button on the upper right of the "dog head" to enter the sample mode, and then select the voice recognition function.

- After entering the voice recognition function, wake up with voice first, "lulu".

- When you hear a ding, you can say the prompt word at the bottom of the screen.


- The robot dog will recognize the semantics and move.
Program source code
- First, log in to the robot dog system through VNC
- Then enter the terminal
xxxxxxxxxx#cm4 runcd /home/pi/RaspberryPi-CM4-main/demos/speech/#cm5 runcd /home/pi/RaspberryPi-CM5/demos/speech/tree- Directory structure description ├── audio.py #Recording file ├── auto_platform.py #System environment dependency ├── language_recognize.py #Speech recognition ├── libnyumaya.py #Speech wake-up └── speech.py #Speech interaction main function
xpython Main function analysisdef actions_dog(act): command_actions = { "cn": { "跳舞": 23, "俯卧撑": 21, "撒尿": 11, "伸懒腰": 14, "祈祷": 17, "找食物": 18, "鸡头":20, "向下抓取": 130, "波浪": 15,"拨浪":15, }, "en": { "dance": 23, "let's dance": 23, "push up": 21,"push": 21, "pee": 11, "take a pee": 11, "take": 11, "stretch": 14, "body": 14,"stretch body": 14, "pray": 17,"start": 17, "start pray": 17, "food": 18,"look": 18, "look for food": 18, "head": 20, "chicken": 20,"chicken head": 20, "pick": 130, "pick up": 130, "wave": 15,"do wave": 15, } } commands = command_actions.get(la, command_actions["en"])command_actions: defines the actions to be performed after speech recognition. If you want to add more command words, you can add one according to the action group in the protocol. For example: the dance action group id mentioned above is 23, which is checked from the action group table. You can also check the action group id according to the section of executing preset actions in Chapter 2.

Functional principle
The specific flow chart is as follows:
