This page offers insights into using the YDLIDAR T-mini Pro within the ROS 2 framework for mapping and navigation. It provides specifications of the T-mini Pro and instructions for launching and visualizing LIDAR data using ROS 2 and RViz. Additionally, it introduces Cartographer mapping, explaining its operation and providing steps for map creation and customization, enabling effective mapping and autonomous robot navigation.
YDLIDAR T-mini Pro lidar is a 360° 2D lidar (hereinafter referred to as T-mini Pro) developed by Shenzhen EAI Technology Co., Ltd. This product is based on the pulse ToF ranging principle, and is equipped with related optical, electrical, and algorithm designs to achieve high-frequency and high-precision distance measurement. At the same time, the mechanical structure rotates 360 degrees to continuously obtain angle information, thereby achieving 360-degree scanning ranging., output the point cloud data of the scanning environment.
| Items | Minimum | Default | Maximum | Unit | Remarks | | --- | --- | --- | --- | --- | --- | | Ranging frequency | / | 4000 | / | Hz | 4000 ranging times per second. | | Scanning frequency | 6 | 6 | 12 | Hz | PWM signal needs to be connected, and the recommended frequency is 6Hz. | | Ranging range | 0.02 | / | 12 | m | Indoor environment, and objects with 80% reflectivity. | | Scanning angle | / | 0-360 | / | Deg | / | | Ranging accuracy | / | 20 | / | mm | When 0.05m <ranging≤12m | | Pitch angle | 0 | 0.75 | 1.5 | Deg | / | | Angle resolution | 0.54 | | | Deg | |
Cartographer is a set of SLAM algorithms based on image optimization launched by Google. The main goal of this algorithm is to achieve low computing resource consumption and achieve the purpose of real-time SLAM. The algorithm is mainly divided into two parts. The first part is called Local SLAM. This part establishes and maintains a series of Submaps through each frame of the Laser Scan, and the so-called submap is a series of Grid Maps. The second part called Global
SLAM, is to perform closed-loop detection through Loop Closure to eliminate accumulated errors: when a submap is built, no new laser scans will be inserted into the submap. The algorithm will add the submap to the closed-loop detection.
Operation of cartographer mapping
<aside> 💡 Note: Before running the command, please make sure that the programs in other terminals have been terminated. The termination command is: Ctrl+c.
</aside>
<aside> 💡 Note: The speed of limo should be slow in the process of mapping. If the speed is too fast, the effect of mapping will be affected.
</aside>
First, start the LiDAR. Launch a new terminal and enter the command:
ros2 launch limo_bringup limo_start.launch.py
Then start the cartographer mapping algorithm. Open another new terminal and enter the command:
ros2 launch limo_bringup cartographer.launch.py
After launching successfully, the rviz visualization interface will be shown in the figure below:
After building the map, it is necessary to save it. Three following commands need to be entered in the terminal:
ros2 run nav2_map_server map_saver_cli -f map
If you need to customize the opened map, please open the limo_nav3.launch.py file to modify the parameters. The file directory is: ~/limo_ros2_ws/src/limo_ros/limo_bringup/launch. Please modify map02 to the name of the map that needs to be replaced.
cd ~/limo_ros2_ws/src/limo_ros/limo_bringup/launch
sudo gedit limo_nav2.launch.py