Understand the key precautions before LiDAR mapping and navigation, avoid common failure scenarios, and ensure that the mapping and navigation experiments proceed smoothly.
2. Experiment Principle
1. Explanation of Key Terms
Keyword
Description
LiDAR
A sensor that uses laser ranging to obtain distance data of the surrounding environment. This document uses the T-mini Plus 2D LiDAR, which outputs 360° scan data (/scan topic)
/scan topic
The standard topic name in ROS2 on which the LiDAR publishes scan data; it contains distance and angle information and is the core data source for mapping and navigation
T-mini Plus
The 2D LiDAR model used in this document; it supports 360° scanning with a measuring range of 0.03–12 m, and communicates with the Raspberry Pi via a USB serial port
SLAM
Simultaneous Localization and Mapping; building a map while determining its own position in an unknown environment
Nav2
The ROS2 navigation framework (Navigation2); it implements path planning, obstacle avoidance, and autonomous navigation based on an existing map
3. Experiment Steps
1. Hardware Preparation
Hardware
Requirement
PTZ version
✅ Supported
No-PTZ version
✅ Supported
Required peripheral
T-mini Plus LiDAR
2. Pre-Mapping Checks
The LiDAR rotates normally, and ros2 topic echo /scan outputs data
The car is placed in the center of the environment, with at least 2 m of space around it
The ground is flat to reduce vibration
Unnecessary ROS2 nodes are shut down to save CPU
3. Pre-Navigation Checks
The map files (.yaml + .pgm) exist in the maps directory
The /scan topic has real-time data
The TF tree is complete (odom → base_footprint → base_link → laser_Link)
The initial pose matches the actual position (if not, manual relocation is required)
4. Environmental Requirements
Avoid large areas of glass or mirrors (laser light will pass through / be reflected)
Avoid empty halls (a lack of feature points is not conducive to scan matching)
Avoid too many moving objects (people moving around will interfere with SLAM)
4. Experimental Phenomena
During mapping, the map in RViz2 expands gradually
During navigation, the robot can plan a path and avoid obstacles
When the environmental requirements are met, the mapping quality and navigation stability improve significantly
5. Program Analysis
This section contains general precautions and does not involve any specific program. For the program analysis of each function, please refer to the corresponding chapters: