Welcome to Jetson ORIN NANO SUPER repository
当製品の日本語版マニュアル資料は、こちらからご取得ください。
8.AI large model online voice assistant
8.AI large model online voice assistant
8.AI large model online voice assistant1. Online Voice Configuration2. Create a Startup Service (Systemd)2.1 Create a Startup Script2.2 Creating the Systemd Service File2.3 Managing and Debugging Services
1. Online Voice Configuration
Before setting up automatic startup, we must ensure that the program itself can operate independently in an online state. This can be accomplished by modifying the configuration file.
- Locate the Configuration File: In your project code, find and open the configuration file:
config/yahboom.yaml
Modify Configuration Parameters: Please check the following parameters in the file and ensure that their values match those shown below. If the parameters do not exist, add them.
xasr#Voice node parametersros__parametersVAD_MODE2 #vad sensitivitysample_rate16000 #asr recording audio sampling rateframe_duration_ms30 #vad frame size in msuse_oline_asrTrue #Whether to use online ASR recognition (True uses online, False uses offline)mic_serial_port"/dev/ttyUSB0" #Microphone serial port aliasmic_index0 #Microphone Indexlanguage'zh' #asr languagemodel_service#Model server node parametersros__parameterslanguage'zh' #Large Model Interface LanguageuseolinettsTrue #Whether to use online speech synthesis (True uses online, False uses offline)# Large model configuration# llm_platform: 'ollama' # Optional platforms:'ollama', 'tongyi', 'spark', 'qianfan', 'openrouter'llm_platform'tongyi' # Here we take Tongyi as an exampleuse_oline_asranduseolinettsmust be set totongyi.llm_platformmust be set totongyi.
With this setup, everything is online.
Save the file and recompile the project to apply the changes:
xxxxxxxxxxcd ~/yahboom_wscolcon buildsource install/setup.bash
After completing this step, the program is now a fully online voice service.
2. Create a Startup Service (Systemd)
Now, we will create a systemd service to automatically run largemodel_control.launch.py at system startup.
2.1 Create a Startup Script
To ensure systemd can correctly load the ROS2 environment, it's best to create a simple bash script to encapsulate our startup commands.
Create a Script File: In the directory (
~/yahboom_ws/src/largemodel/), create a file namedstart_largemodel.sh.xxxxxxxxxxvim ~/yahboom_ws/src/largemodel/start_largemodel.shWrite the script: Copy and paste the following content into the script file.
xxxxxxxxxx# Source ROS2 Humble Environmentsource /opt/ros/humble/setup.bash# Source Yahboom Workspace environmentsource /home/jetson/yahboom_ws/install/set