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 | |
Here's how to use it:
Launch a new terminal and enter the command:
ros2 launch ydlidar_ros2_driver ydlidar.launch.py
After launching successfully, the terminal will output the following log information, as shown in the figure:
Then launch a new terminal and enter the command in the terminal:
rviz2
After launching the rviz, click 'Add' , choose 'Laserscan', and click 'ok'.
After the rviz visualization software runs successfully, the green data displayed is the laser data scanned by LiDAR
Message type of scan topic: sensor_msgs/msg/LaserScan.
header : Message header, including timestamp, frame ID and other information.
angle_min : The minimum angle for laser scanning. angle_max : The maximum angle of laser scanning. angle_increment : Angle increment of laser scanning. time_increment : Time increment for each laser scan. scan_time : Total time of laser scanning.
range_min : the minimum range of laser ranging.
range_max : The maximum range of laser ranging.
ranges : an array of laser ranging data, representing the distance value corresponding to each angle.
intensities : array of laser ranging intensity data, optional field.
By subscribing to the topic, other nodes can receive and process lidar scan data. Common applications include mapping, obstacle detection, navigation and path planning.
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.
<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 limo_cartographer.launch.py