Welcome to T-mini Plus LiDAR repository
1.Preparation
Preparation
1. Install the SDK Driver
Based on the specifications of the lidar you purchased, locate the compressed file labeled "YDLidar-SDK" in the provided source code package. Extract the "YDLidar-SDK" folder; this folder contains the SDK files for this lidar. Since using the ROS function package for this lidar requires the SDK to be installed beforehand, the "YDLidar-SDK" folder contains the lidar's driver files. Open a terminal in this folder and type:
mkdir buildcd buildcmake ..make -j4sudo make installIf no errors are reported during the process, it means that the driver has been successfully installed.。
2. Creating a New Workspace and Compiling Packages
- (Recommended) The first method involves extracting the ydlidar_ws source code to your root directory and then directly using catkin_make to compile it.
xxxxxxxxxxcd ydlidar_wscatkin_makeAfter successful compilation, add the workspace path to your .bashrc file.
xxxxxxxxxxsudo gedit ~/.bashrcCopy the following content to the end of the file:
xxxxxxxxxxsource ~/ydlidar_ws/devel/setup.bash --extend- The second method involves creating a self-named workspace, for example, named oradar_ws. In the terminal, type:
xxxxxxxxxxmkdir oradar_wscd oradar_wsmkdir srccd srccatkin_init_workspaceThen copy the extracted source code from ydlidar_ws/src to the oradar_ws/src directory, and then compile it using catkin_make in the oradar_ws directory.
xxxxxxxxxxcd oradar_wscatkin_makeAfter successful compilation, add the workspace path to your .bashrc file.
xxxxxxxxxxsudo gedit ~/.bashrcCopy the following content to the end of the file:
xxxxxxxxxxsource ~/oradar_ws/devel/setup.bash --extend3. Bind lidar port name
Open a terminal in the ydlidar_ws workspace and enter the following command.
xxxxxxxxxxchmod 0777 src/ydlidar_ros_driver/startup/*sudo sh src/ydlidar_ros_driver/startup/initenv.sh #Tmini-plus-12m uses thissudo bash src/ydlidar_ros_driver/startup/initenv.sh #Tmini-plus-25m uses this
Then reconnect the lidar serial port and enter ll /dev/ydlidar in the terminal.

If the above content appears, it means that the binding was successful. The last character is not necessarily 0; it will change depending on the order in which the devices are inserted.
4. Drive lidar
Save and exit, then open a new terminal and enter the following command to enable lidar and display it in rviz.
xxxxxxxxxxroslaunch ydlidar_ros_driver lidar_view.launch

If the above screen appears, it means that all preparations are complete.