Welcome to ROSMASTER M3 repository
3.Multimodal visual understanding+SLAM navigation
Multimodal Visual Understanding + SLAM Navigation
Multimodal Visual Understanding + SLAM Navigation1. Course Content2. Start the Agent2.1 Configure Map Mapping File2.2 Configuring Map Mapping Variables in Dify3. Running the Case3.1 Startup Program3.2 Test Case
1. Course Content
- Run the example program to perform a comprehensive task using the robot's visual understanding capabilities combined with SLAM navigation through text interaction.
2. Start the Agent
Note: If it's already started, you don't need to start it again.
Enter the command on the vehicle terminal:
start_agent
The terminal will print the following information, indicating a successful connection:

[!NOTE]
Note: To experience this lesson, you need to build at least one grid map according to the LiDAR chapter.
2.1 Configure Map Mapping File
- Command to Start Navigation on the Vehicle Terminal
For Raspberry Pi 5 users, if the ROS container is not started, you need to start it first.
xxxxxxxxxxbringup_m3
Open the terminal inside the container.
xxxxxxxxxxexec_m3
(ORIN mainboard)
xxxxxxxxxxros2 launch m3_bringup nav2.launch.py(RDK & PI5 mainboard) Step-by-step execution, visualization is performed on the accompanying virtual machine Rosmaster-M3-Ubuntu22.04.
xxxxxxxxxx#Virtual machine siderviz2 -d /home/yahboom/yahboomM3_ws/user_ws/src/m3_bringup/rviz/nav2.rviz#Host sideros2 launch m3_bringup nav2.launch.py gui:=False[!TIP]
- This uses the AMCL positioning algorithm for navigation by default, suitable for most applicable scenarios. If higher positioning accuracy is required, refer to the product tutorial [02.Lidar Course]—[13.slam_toolbox localization and navigation] section to build a pose map and use the slam_toolbox pure positioning mode for navigation.
Next, the rviz2 visualization interface will open. Click on 2D Pose Estimate in the top toolbar to enter selection mode. Roughly mark the robot's location and orientation on the map.
The robot's model will be displayed on the map, as shown below:

We can name any precise point on the map. Here, we use "Master Bedroom" and "Kitchen" as examples.

As shown in the image below, we first click on Nav2 The Goal tool guides the vehicle's navigation system to the target location we need to mark.

Wait for the vehicle's navigation system to reach the target location to be marked.

- Run the following command in the terminal to obtain the robot's pose information in the map coordinate system:
xxxxxxxxxxros2 run tf2_ros tf2_echo map base_footprint
Open the map_mapping.yaml map mapping file (you can choose any method to open it, such as VNC, vscode, or command line):
- Here's an example of opening the file via command line:
xxxxxxxxxxnano ~/yahboomM3_ws/user_ws/src/m3_bringup/config/multi_brains/map_mapping.yaml

- Modify the symbolic pose under the
common_map_areasfield, wherenameis the location name, and fill in the previously obtained poses into thepositionandorientationfields.
x#根据实际的场景环境,自定义地图中的区域,可以添加任意个区域,注意和大模型的地图映射保持一致即可#According to the actual scene environment, customize the areas in the map. You can add any number of areas, just make sure they are consistent with the map mapping of the large model#地图映射Map mappingcommon_map_areas#常规导航 common navigation A name'Master bedroom' position x3.974 y-2.634 orientation x0.0 y0.0 z-0.688 w0.726 B name'xxx' position x1.488 y0.661 z0.0 orientation x0.0 y0.0 z0.725 w0.688
- Save the file after making changes for the changes to take effect immediately.
2.2 Configuring Map Mapping Variables in Dify
- After configuring the map mapping files mentioned above, we also need to ensure that the AI model knows the relationships between locations and symbols in these maps in advance.
- Start the Dify service (if it's already running, you don't need to start it again):
xxxxxxxxxxbringup_dify

- Enter the vehicle's IP address directly into your browser's address bar to access the Dify management page, then click to select the corresponding AI application.
[!NOTE]
- Domestic users: multi_brains_zh
- International users: multi_brains_en

- Click to select
Session Variablesin the upper right corner, then click the edit button for themap_mappingvariable.

- In the pop-up
Edit Session Variableswindow, edit the mapping relationship according to the settings in the previous map mapping file, then click Save.

- Finally, remember to click Publish -> Publish Update to save the changes.

3. Running the Case
3.1 Startup Program
For Raspberry Pi 5 users, if the ROS container is not running, you need to start it first.
xxxxxxxxxxbringup_m3
Open the terminal inside the container.
xxxxxxxxxxexec_m3
VNC connect to the robot desktop, open a terminal, and run the startup command:
xxxxxxxxxxros2 launch m3_bringup llm_agent_control.launch.py text_chat_mode:=True- Navigation startup command on the vehicle's infotainment system:
(ORIN & PI5 mainboard)
xxxxxxxxxxros2 launch m3_bringup nav2.launch.py(RDK mainboard) Step-by-step execution, visualization on the accompanying virtual machine Rosmaster-M3-Ubuntu22.04:
xxxxxxxxxx#Virtual machine side` rviz2 -d /home/yahboom/yahboomM3_ws/user_ws/src/m3_bringup/rviz/nav2.rviz# Host sideros2 launch m3_bringup nav2.launch.py gui:=FalseThen, follow the navigation startup procedure to initialize positioning. This will open the rviz2 visualization interface. Click 2D Pose Estimate in the top toolbar to enter selection mode. Roughly mark the robot's location and orientation on the map. After initializing positioning, the preparation is complete.

- Launch the text-based interactive program in the terminal:
xxxxxxxxxxros2 run m3_common_demo text_chat3.2 Test Case
Here is a sample test case. Users can create their own dialogue commands.
- Please remember your current location, then navigate to the kitchen and the master bedroom in that order, remembering the items you see in each room. Finally, return to your starting position and tell me what you saw in those two places.
Copy and enter the above test case into the text-based interactive terminal:

The decision-making AI outputs the planned task steps:

The execution layer AI will then execute the task according to these steps:
