ROS Robot APP mapping

Note: The VM must be in the same LAN as the trolley, and the ROS_DOMAIN_ID must be the same. You can set the IP address and ROS_DOMAIN_ID on the board by referring to the Required Read Before Using the VM.

1、Program function specification

Connect the car to the agent, run the program, open the [ROS Robot] app downloaded on the mobile phone, enter the IP address of the car, select ROS2, click Connect, and then connect the car. The car can be controlled by sliding the roulette wheel in the interface, and the car can be slowly controlled to complete the area of map construction. At last, click Save map, and the car will save the map currently built.

2、Start and connect to the agent

Take the matching VM as an example, enter the following command to start the agent (the agent can be started once without shutting down, do not need to start again).

image-20240102120120341

Then, open the car switch and wait for the car to connect to the agent. The connection is successful as shown in the figure below,

image-20231219100456522

3、Initiating program

First start the car to process the underlying data program, terminal input,

image-20231219101637748

Start the APP drawing command, enter the terminal,

The mobile APP shows the following picture. Enter the IP address of the car, 【zh】 indicates Chinese, 【en】 indicates English; Select ROS2, Video Tpoic select /usb_cam/image_raw/compressed, and click "Connect". image-20231219143224710

After the connection is successful, the following information is displayed,

image-20231219143427091

By sliding the roulette wheel control car slowly move through the area that needs to be built, then click save map, enter the map name and click submit, you can save the map

image-20231219143658951

Where the map is saved is,

image-20231219143847102

4、Code parsing

This section describes how to start the launch file for creating an APP diagram. The gmapping diagram is used as an example,

map_gmapping_app_launch.xml

The following launch files and Node nodes are run: