Welcome to DOGZILLA-Lite repository
10.Line tracking and obstacle removal
AI Voice Interaction: Line Patrol and Obstacle Removal
AI Voice Interaction: Line Patrol and Obstacle RemovalFunction IntroductionFunction ExperienceProgram source codeFunctional principle
Function Introduction
This case is how to play the startup program. You can say the color of the line that needs to be patrolled according to the words prompted on the screen, and the robot dog will patrol the line with the corresponding color. If there are obstacles of other colors during the patrol process, it will clear them. This function requires an Internet connection to work properly
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 line patrol and obstacle removal 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 enter a line patrol and obstacle clearance. When the grip is successful, voice interaction is required again.
Program source code
- First, log in to the robot dog system via VNC
- Then enter the terminal
x
#cm4cd /home/pi/RaspberryPi-CM4-main/demos/speech_AI_line/#cm5cd /home/pi/RaspberryPi-CM5/demos/speech_AI_line/tree -L 1- Directory structure description ├── audio.py #recording file ├── auto_platform.py #system environment dependency ├── language_recognize.py #speech recognition ├── libnyumaya.py #voice wake-up ├── speach_line.py #line patrol and obstacle removal ├── speech_AI_line.py #main voice interaction function ├── speech_picture.py #large model image analysis ├── xinghou_ImageAPI.py #image interface └── xinghou_tts.py #synthesized audio file
xif net: while True: open_AI_play() if detect_keyword(): clear_top() start_recording() content = test_one() if content != "": clear_top() speech_list = line_break(content) print(speech_list) if la == "en": english_only = ''.join(char for char in speech_list if ord(char) < 128) display_text = english_only else: display_text = speech_list lcd_draw_string( draw, 10, 110, display_text, color=(255, 255, 255), scale=font2, mono_space=False, ) display.ShowImage(splash) lines = len(display_text.split("\n")) tick = 0.3 if lines > 6: scroll_text_on_lcd(display_text, 10, 111, 6, tick) if not actions_AI(content): continue if content == 0: break time.sleep(0.1) else: draw_offline() while True: time.sleep(0.1)The program can clearly show the general process. After waking up, say the command word, and the result will be fed back to the screen after voice recognition, and enter the corresponding color patrol obstacle removal movement. If you want to add more colors, you can study the function of the python file in this directory and add it yourself.
Functional principle
The specific flow chart is as follows:
