Welcome to T-mini Plus LiDAR repository
1.Preparation
1.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. Create a new workspace and compile the package.
- (Recommended) The first method is to extract the yahboomcar_ws source code to your own root directory, and then directly use colcon build to compile it.
xxxxxxxxxxcd yahboomcar_wscolcon build
After successful compilation, add the workspace path to your .bashrc file.
xxxxxxxxxxsudo gedit ~/.bashrc
Copy the following content to the end of the file:
xxxxxxxxxxsource ~/yahboomcar_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_workspace
Then copy the extracted source code packages from yahboomcar_ws/src to the oradar_ws/src directory. Then, in the oradar_ws directory, use colcon build to compile.
xxxxxxxxxxcd oradar_wscolcon build
After successful compilation, add the workspace path to your .bashrc file.
xxxxxxxxxxsudo gedit ~/.bashrc
Copy the following content to the end of the file:
xxxxxxxxxxsource ~/oradar_ws/devel/setup.bash --extend
3. Bind lidar port name
Open a terminal in the yahboomcar_ws workspace and enter the following command.
x#Tmini-plus-12m Run the following commandsudo chmod 777 src/ydlidar_ros2_driver-humble/startup/*sudo sh src/ydlidar_ros2_driver-humble/startup/initenv.sh#Tmini-plus-25m Run the following commandsudo chmod 777 src/ydlidar_ros2_driver/startup/*sudo sh src/ydlidar_ros2_driver/startup/initenv.sh
Then reconnect the lidar serial port and enter ll /dev/ydlidar in the terminal.
xxxxxxxxxxll /dev/ydlidar

4. Drive lidar
Save and exit, then open a new terminal and enter the following command to enable lidar and display it in rviz.
xxxxxxxxxxros2 launch ydlidar_ros2_driver ydlidar_launch_view.py
The following commands can be used to view lidar node data.
xxxxxxxxxxros2 topic echo /scan