Welcome to ROSMASTER A1 repository
9.Intention estimation + Multimodal visual understand + SLAM navigation + visual functions
Intention Estimation + Multimodal Visual Understand + SLAM Navigation + Visual Functions (Text Version)
Intention Estimation + Multimodal Visual Understand + SLAM Navigation + Visual Functions (Text Version)1. Course Content2. Preparation2.1 Content Description3. Document Configuration3.1 Creating a xlsx Document3.2 Uploading to the RAG Knowledge Base4. Run the Example4.1 Starting the Program4.1.1 Jetson Nano Board Startup Steps:4.1.2 RDKX5, Raspberry Pi PI5 and ORIN board startup steps:4.2 Test Cases4.2.1 Example 15. Source Code Analysis5.1 Example 1
1. Course Content
Note: This section requires you to first complete the map file configuration as described in the [Multimodal Visual Understand + SLAM Navigation] section.
Learning to Use the RAG Knowledge Base to Train Personal Intention Understanding
Course Review:
The RAG knowledge base can be used to expand the knowledge base of the large model. This section explains how to expand the RAG knowledge base so that the large model can understand personal intentions.
Important Note! ! !:
The expanded personal intention understanding function may vary from user to user, and the large model's responses are divergent, so the actual debugging results may not be exactly the same.
The expanded personal intention understanding function must comply with social norms and laws and regulations. Technical Support assumes no responsibility for the final debugging results or any impact of this course.
2. Preparation
2.1 Content Description
This course uses a Raspberry Pi 5 as an example. For Raspberry Pi and Jetson Nano boards, open a terminal on the host computer and enter the command to enter the Docker container. Once inside the Docker container, enter the commands mentioned in this lesson in the terminal. For instructions on entering the Docker container from the host computer, refer to [01. Robot Configuration and Operation Guide] -- [5.Enter Docker (For JETSON Nano and RPi 5)]. For Orin boards, simply open a terminal and enter the commands mentioned in this lesson.
📝 This example uses model:"qwen/qwen2.5-vl-72b-instruct:free","qwen-vl-latest"
⚠️ For the same test command, the model's responses may not be exactly the same and may differ slightly from the screenshots in the tutorial. To increase or decrease the diversity of the model's responses, refer to the section on configuring the decision-making model parameters in [04.AI Large Model Development] -- [5.Deploy the RAG knowledge base].
3. Document Configuration
3.1 Creating a xlsx Document
Open the [Intent Mapping] folder in this lesson's folder and select the corresponding [Intent Mapping_xx.xlsx] file based on your robot configuration.

(You can add multiple files and more customized information as needed.)
[Intent Mapping]: Stores personal intentions and expectations for the large language model to control the robot's actions.
3.2 Uploading to the RAG Knowledge Base
Please modify according to the instructions in the [04.AI Large Model Development] -- [5.Deploy the RAG knowledge base].
Access the IP address of the in-car system to enter the Dify backend.

Click on "Knowledge Base" and open the knowledge base for the corresponding camera.

Click on "Add File".

Add the prepared "Intent Mapping_xx.xlsx" file.

Click "Next", then "Save and Process".


Refresh the knowledge base; you can see that the intent mapping file has been added.

Click "Retrieval Test"; you can see that the imported intent mapping file has been successfully recalled.

Finally, go to the [Studio] interface, and select the application corresponding to your camera model. [yahboom-nuwa] is used as an example here.

Select [Task Routing] and add your custom intent mappings here.
Click to preview, for example: Send "I'm a little hungry."

Finally, click [Publish] in the upper right corner to republish the corresponding application.
4. Run the Example
4.1 Starting the Program
4.1.1 Jetson Nano Board Startup Steps:
Due to Nano performance issues, navigation-related nodes must be run on a virtual machine. Therefore, navigation performance is highly dependent on the network. We recommend running in an indoor environment with a good network connection. You must first configure the following:
Board Side (Requires Docker)
Open a terminal and enter
sudo vi /etc/chrony/chrony.conf
Add the following two lines to the end of the file: (Fill in 192.168.2.0/24 based on the actual network segment; this example uses the current board IP address of 192.168.2.41.)
xxxxxxxxxxallow 192.168.x.0/24 #x indicates the corresponding network segmentlocal stratum 10After saving and exiting, enter the following command to take effect:
xxxxxxxxxxsudo service chrony restart
Virtual Machine
Open a terminal and enter
xxxxxxxxxxecho "server 192.168.2.41 iburst" | sudo tee /etc/chrony/sources.d/jetson.sourcesThe 192.168.2.41 entry above is the board's IP address.
Enter the following command to take effect.
xxxxxxxxxxsudo chronyc reload sourcesEnter the following command again to check the latency. If the IP address appears, it's normal.
xxxxxxxxxxchronyc sources -v
Start the program
Open the host machine terminal and start the Dify environment:
xxxxxxxxxxsh ~/bringup_dify.sh
Open the terminal in Docker and enter the following command:
xxxxxxxxxxros2 launch multi_brains llm_agent_control.launch.py
After initialization, the following content will be displayed:

On the virtual machine, create a new terminal and start.
xxxxxxxxxxros2 launch yahboomcar_nav display_nav_launch.py
Wait for the navigation algorithm to start before displaying the map. Then open a VM terminal and enter:
xxxxxxxxxxros2 launch yahboomcar_nav navigation_teb_launch.py
Note: When running the car's mapping function, you must enter the save map command on the VM to save the navigation map.
After that, follow the navigation function startup process to initialize positioning. The rviz2 visualization interface will open. Click 2D Pose Estimate in the upper toolbar to select it. Roughly mark the robot's position and orientation on the map. After initializing positioning, preparations are complete.

4.1.2 RDKX5, Raspberry Pi PI5 and ORIN board startup steps:
Open the host terminal and start the Dify environment.
xxxxxxxxxxsh ~/bringup_dify.sh

For Raspberry Pi 5, you need to first enter the Docker container. For RDKX5 and Orin board, this is not necessary.
Open a terminal in Docker and enter the command:
xxxxxxxxxxros2 launch multi_brains llm_agent_control.launch.py
After initialization is complete, the following will be displayed:

Create a new terminal on the virtual machine and start it. (For RDKX5, Raspberry Pi and Jetson Nano, it is recommended to run visualization in the virtual machine)
xxxxxxxxxxros2 launch yahboomcar_nav display_nav_launch.py
Wait for the navigation algorithm to start and the image will be displayed. Then open the Docker terminal and enter
x#Choose one of the two navigation algorithms#Normal navigationros2 launch yahboomcar_nav navigation_teb_launch.py
#Fast Relocation Navigation (Not supported on RDKX5, Raspberry Pi 5, and Jetson Nano main controllers)ros2 launch yahboomcar_nav localization_imu_odom.launch.py use_rviz:=trueload_state_filename:=/home/jetson/yahboomcar_ros2_ws/yahboomcar_ws/src/yahboomcar_nav/maps/yahboomcar.pbstream
ros2 launch yahboomcar_nav navigation_cartodwb_launch.py maps:=/home/jetson/yahboomcar_ros2_ws/yahboomcar_ws/src/yahboomcar_nav/maps/yahboomcar.yamlNote: yahboomcar.yaml and yahboomcar.pbstream must be mapped simultaneously, meaning they are the same map. Refer to the cartograph mapping algorithm for saving maps.
After that, follow the navigation function startup process to initialize positioning. The rviz2 visualization interface will open. Click 2D Pose Estimate in the upper toolbar to enter the selection state. Roughly mark the robot's position and orientation on the map. After initializing positioning, preparations are complete.

Log into the same docker run from multiple terminals and start it.
xxxxxxxxxxros2 run text_chat text_chat

4.2 Test Cases
Here are some test cases for reference; users can create their own dialogue commands.
I'm in the office and feeling thirsty.
4.2.1 Example 1
Type "I'm in the office now, feeling a little thirsty" in the terminal. The terminal prints the following information:

The decision-making model outputs the planned task steps:

The execution model then executes the task steps:

A four-second screen appears after arriving at the kitchen.

After completing a task, the robot enters a waiting state. Instructions are passed directly to the execution layer model, and all conversation history is retained. You can press the ENTER key in the terminal and continue the conversation by entering the "End current task" command to terminate the current task cycle and start a new one.

5. Source Code Analysis
Source code is located at:
Jetson Orin Nano:
xxxxxxxxxx#NUWA Camera User/home/jetson/yahboomcar_ros2_ws/yahboomcar_ws/src/largemodel/largemodel/action_service_nuwa.py#USB Camera User/home/jetson/yahboomcar_ros2_ws/yahboomcar_ws/src/largemodel/largemodel/action_service_usb.pyJetson Nano, Raspberry Pi:
You need to first enter Docker
xxxxxxxxxx#NUWA Camera User/root/yahboomcar_ros2_ws/yahboomcar_ws/src/largemodel/largemodel/action_service_nuwa.py#USB Camera User/root/yahboomcar_ros2_ws/yahboomcar_ws/src/largemodel/largemodel/action_service_usb.pyRDKX5:
xxxxxxxxxx#NUWA Camera User/home/sunrise/yahboomcar_ros2_ws/yahboomcar_ws/src/multi_brains/multi_brains/action_service_nuwa.py#USB Camera User/home/sunrise/yahboomcar_ros2_ws/yahboomcar_ws/src/multi_brains/multi_brains/action_service_usb.py5.1 Example 1
action_service.py :
This example uses the seewhat, navigation, load_target_points, and get_dist methods in the CustomActionServer class. seewhat, navigation, load_target_points, and get_dist are described in the previous section [2.Multimodal visual understand], [6.Multimodal visual understand + Depth Camera Distance Question Answering], [7.Multimodal visual understand+SLAM navigation] have all been explained, and there are no new procedures in this chapter.