Welcome to ROSMASTER M1 repository
10. Core module testing tools
Core Module Testing Tools
Core Module Testing Tools1. Course Content2. Starting the Dify Service3. Enter the test tool path4. Test the local speech synthesis function5. Test Local Speech Recognition Functionality6. Testing Robot Access to Dify7. Online Voice Service7.1 iFlytek Speech Recognition Service7.2 iFlytek Speech Synthesis Service
1. Course Content
- multi_brains provides minimal test programs for testing the core modules of a large model, used to quickly locate problems in abnormal situations.
2. Starting the Dify Service
Note: If using a 2025 image, you need to copy the test folder from the "Source Code" folder to your current board for testing. For Jetson Nano and Raspberry Pi 5 boards, you need to operate within Docker. The path is
cd ~/yahboom_ros2_ws/yahboomcar_ws/src/multi_brains/test
Replace the text folder in the path with the text folder from the "Source Code" folder.
- Connect to the car's infotainment system via VNC or SSH. Enter the following command in the terminal:
xxxxxxxxxxsh ~/bringup_dify.sh

3. Enter the test tool path
xxxxxxxxxxcd yahboomcar_ros2_ws/yahboomcar_ws/src/multi_brains/test/ls
- The test tool is as follows:

4. Test the local speech synthesis function
- Test the local speech synthesis function for Chinese and English in sequence.
xxxxxxxxxxpython3 test_PiperTTS.py
After running, it will play the Chinese and English speech synthesis results sequentially.

5. Test Local Speech Recognition Functionality
- After running, it will test the preset Chinese and English audio recordings sequentially.
xxxxxxxxxxpython3 test_SenseVoiceSmall.py
After running, it will print the speech recognition results of the test audio.

6. Testing Robot Access to Dify
- When the program displays "Model service unavailable," and it's unclear whether the robot's inability to access Dify is due to a network address error, you can test:
xxxxxxxxxxpython3 test_dify_connection.py
If the robot displays the following information normally, it proves that the robot's connection to Dify is normal. Otherwise, it may be that Dify is not started or the Dify program has crashed and needs to be restarted.

7. Online Voice Service
7.1 iFlytek Speech Recognition Service
- If online speech recognition encounters errors, you can test iFlytek's speech recognition service separately.
xxxxxxxxxxpython3 test_xunfeiASR.py
- After running, it will perform speech recognition tests on the preset test audio.

7.2 iFlytek Speech Synthesis Service
- If online speech synthesis encounters errors, you can test iFlytek's speech recognition service separately.
xxxxxxxxxxpython3 test_xunfeiTTS.py
After running, it will first perform speech synthesis on the default text, and then play the corresponding audio.
