Welcome to MicroROS-Pi5 repository
当製品の日本語版マニュアル資料は、こちらからご取得ください。
4. Map navigation and APP control
APP mapping control
Note: The ROS_DOMAIN_ID of the Raspberry Pi and the microROS control board need to be consistent. You can check [MicroROS Control Board Parameter Configuration] to set the microROS control board ROS_DOMAIN_ID. Check the tutorial [Connect MicroROS Agent] to determine whether the IDs are consistent.
1. Program function description
The car connects to the agent, runs the program, opens the [ROS Robot] app downloaded on the mobile phone, enters the IP address of the car, selects ROS2, and clicks connect to connect to the car. You can control the car by sliding the wheel on the interface, and slowly control the car to complete the mapped area. Finally, click Save Map, and the car will save the currently constructed map.
2. Query car information
2.1. Start and connect to the agent
After the Raspberry Pi is successfully powered on, open the terminal and enter the following command to open the agent:
sh ~/start_agent_rpi5.sh

Press the reset button on the microROS control board and wait for the car to connect to the agent. The connection is successful as shown in the figure below.

2.2. Enter the car docker
Open another terminal and enter the following command to enter docker:
xxxxxxxxxxsh ros2_humble.sh
When the following interface appears, you have successfully entered docker. Now you can control the car through commands.

Enter the following command in the terminal to query the agent node:
xxxxxxxxxxros2 node list

3. Start the program
First, start the car to process the underlying data program and enter the terminal.
xxxxxxxxxxros2 launch yahboomcar_bringup yahboomcar_bringup_launch.py
Start the APP mapping command. Before entering this command, you need to enter the same docker terminal. The steps are as follows:
Reopen a new terminal in the Raspberry Pi and enter the command,
xxxxxxxxxxdocker ps -a
You can see the ID number and docker version you entered into docker. Whichever item you see up is the currently started docker.

You can enter the same docker based on this ID number. Note that the ID number is different every time you enter the docker. Enter the command.
xxxxxxxxxxdocker exec -it ef0e1b7da319 /bin/bash

When this screen appears, we have entered the same docker.
Enter the command to start mapping.
xxxxxxxxxxros2 launch yahboomcar_nav map_gmapping_app_launch.xml

Open another terminal and enter the command to start the camera screen(You need to enter the same docker terminal as above),
xxxxxxxxxxros2 launch usb_cam camera.launch.py

The mobile APP displays as shown below, enter the IP address of the car, [zh] means Chinese, [en] means English; select ROS2, select /usb_cam/image_raw/compressed below, and finally click [Connect]
After successful connection, the following is displayed.

Use the sliding wheel to control the car to move slowly through the area that needs to be mapped, then click to save the map, enter the map name and click submit to save the map.

The location path where the map is saved is as follows
xxxxxxxxxx/root/yahboomcar_ws/src/yahboomcar_nav/maps
This tutorial is mainly used to use the mobile phone APP to control the car, while observing the camera screen and testing the point cloud data of the radar. After the map building is completed, you can refer to the tutorial on mobile APP navigation later.