Welcome to ROSMASTER X3 Plus repository
12.13 APP mapping and navigation
13、APP Mapping and Navigation
How to download mapping APP
For Android users, open the mobile browser and scan following QR code to download and install Yahboom ROS Robot APP.
For iOS users, please search [Yahboom ROS Robot] on App store, or open camera or brower, scan following QR code to download and install Yahboom ROS Robot APP.

13.1.1、start up
NOTE:
1. When creating a map, the slower the speed, the better the effect (note: if the rotation speed is slower). If the speed is too fast, the effect will be very poor 2. Before creating a map, you must first close the self starting large program
According to different vehicle models, you only need to set the purchased model in [. bashrc], such as X1 (ordinary four-wheel drive), X3 (wheel drive), X3plus (wheel mechanical arm), R2 (Ackermann differential), etc. This section takes X3 as an example
#Raspberry Pi 5 master needs to enter docker first, please perform this step#If running the script into docker fails, please refer to ROS/07, Docker tutorial~/run_docker.shOpen the [. bashrc] file
xxxxxxxxxxsudo vim .bashrc
Search for the ROBOT_TYPE parameter and modify the corresponding vehicle model
xxxxxxxxxxexport ROBOT_TYPE=X3 # ROBOT_TYPE: X1 X3 X3plus R2 X7Start the driver command (on the robot side). For ease of operation, this section takes [mono+laser+ yahboomcar] as an example. Laser+Transbot cannot set the camera screen.
xxxxxxxxxxroslaunch yahboomcar_nav laser_bringup.launch # laser + yahboomcarroslaunch yahboomcar_nav laser_usb_bringup.launch # mono + laser + yahboomcarStart the mapping function (robot side)
<PI5 needs to open another terminal and enter the same docker container

xxxxxxxxxxroslaunch yahboomcar_nav yahboomcar_map.launch use_rviz:=false map_type:=gmappingStart the radar data transfer point cloud node and rosbridge and other nodes (Raspberry Pi version)
xxxxxxxxxxsource /home/pi/ROS/laser_app/devel/setup.bashroslaunch /home/pi/ROS/laser_app/laser_app.launch#PI5source /root/ROS/laser_app/devel/setup.bashroslaunch /root/ROS/laser_app/laser_app.launchStart converting radar data to point cloud nodes and nodes such as rosbridge (Jetson nano version)
xxxxxxxxxxsource /home/jetson/ROS/laser_app/devel/setup.bashroslaunch /home/jetson/ROS/laser_app/laser_app.launch
13.1.2、usage
After the robot is started, click APP

To ensure that the mobile phone and the robot are in the same LAN, enter the robot [IP] in the input box, select ROS1 by default, select 【en】 as the default language, and click [Connect] to log in.

Enter the ip displayed on the oled of the car, and the radar scanning map will appear after the connection is successful, as shown in the figure below:

At this time, slide the joystick in the lower right corner. When sliding the joystick, the slower the speed, the better the effect (especially the rotation speed), and control the robot to move until the map is created.
13.1.3、save map
When the map is created, click the Save Map button
Click on the top of the input box, enter the name [house] to save the map, and click [Submit] (English only, no symbols), and save the map.

The directory for saving the map is as follows:
Raspberry Pie:
xxxxxxxxxx/home/pi/yahboom_ws/src/yahboom_nav/maps#PI5/root/yahboomcar_ws/src/yahboomcar_nav/mapsjetsin nano:
xxxxxxxxxx/home/jetson/yahboom_ws/src/yahboom_nav/maps
13.2、Navigation obstacle avoidance
Note: [R2] of the remote controller has the function of canceling the navigation target point! ! ! When navigating [Full] Do not use the joystick control! ! !
13.2.1、start up
Start the driver command (on the robot side). For ease of operation, this section takes [mono+laser+RosMaster] as an example. Laser+RosMaster cannot set the camera screen.
xxxxxxxxxxroslaunch yahboomcar_nav laser_bringup.launch # laser + yahboomcarroslaunch yahboomcar_nav laser_usb_bringup.launch # mono + laser + yahboomcarStart navigation obstacle avoidance function (robot side)
xxxxxxxxxxroslaunch yahboomcar_nav yahboomcar_navigation.launch use_rviz:=false map:=house
- Use_ Rviz parameter: whether to turn on rviz.
- map:Load a map file named 'house'.
Start the radar data to point cloud node and rosbridge and other nodes (raspberry pie version)
xxxxxxxxxxsource /home/pi/ROS/laser_app/devel/setup.bashroslaunch /home/pi/ROS/laser_app/laser_app.launch#PI5source /root/ROS/laser_app/devel/setup.bashroslaunch /root/ROS/laser_app/laser_app.launch
Start the radar data to point cloud node and rosbridge and other nodes (Jetson nano version)
xxxxxxxxxxsource /home/jetson/ROS/laser_app/devel/setup.bashroslaunch /home/jetson/ROS/laser_app/laser_app.launch
The login method is the same as above. After login, you will directly enter the map building interface. At this time, you need to click the Settings button to open the menu bar and drop down to select the navigation. Click the navigation button to enter the navigation interface.


Click Set Initialization Point to enter the interface for setting initialization point.
Because the origin of the robot is not consistent with the current location of the robot when it is building the map, the scanned points do not coincide with the map. At this time, we need to set the initial pose of the robot. First, click the Set Initialization Point button, select the approximate position of the robot on the map, and keep sliding to the approximate pose of the robot without releasing it. Make the scanned points coincide with the map as much as possible.

Click the Set Navigation Point button to enter the navigation interface.

Select the target position of the robot on the map, do not release it, continue sliding towards the posture that the robot wants to maintain, and once released, the robot will move towards the target position.