yahboom
HomeLearn
Solution
Blog
Online Store
About Us
EN/中文
YDLIDAR TW3📖
1.Basic course
  • 1.EAI official learn website
  • 2.PC software use course
2.ROS1 use course
  • 1.Lidar drive
  • 2.Handheld lidar mapping
3.ROS2 use course
  • 1.Lidar drive
  • 2.Handheld lidar mapping
Download
  • Code
  • VM_File
  • 3D_Model_File
  • DataSheet
Download ZIP

Welcome to YDLIDAR TW3 repository

1.Lidar drive

1. Environment Setup

Before starting the environment Settings, it is necessary to install the CP210X serial port driver first. For the installation tutorial, please refer to the PC software usage tutorial. If you use the virtual machine we provide, after installing the driver and connecting the radar to the computer, you can directly execute the fourth step of driving the radar without setting up the environment.

1. Installing the SDK Driver

Based on the specifications of the radar 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 radar. Since using the ROS package for this radar requires the SDK to be installed beforehand, the YDLidar-SDK folder contains the radar's driver files. Open a terminal in this folder and type:

mkdir build
cd build
cmake ..
make -j4
sudo make install

If no errors are reported during the process, it means that the driver has been successfully installed.

2. Creating a New Workspace and Compiling the Package

  • (Recommended) The first method involves extracting ydlidar_ros2_ws.zip from the source code to your root directory, and then directly using colcon build to compile.

xxxxxxxxxx
cd ydlidar_ros2_ws
colcon build

After successful compilation, add the workspace path to your .bashrc file.

xxxxxxxxxx
sudo gedit ~/.bashrc

Copy the following content to the end of the file:

xxxxxxxxxx
source ~/ydlidar_ros2_ws/devel/setup.bash --extend
  • The second method involves creating a self-named workspace. For example, let's say the name is ydlidar_ros2_ws. Enter the following in the terminal:

xxxxxxxxxx
mkdir ydlidar_ros2_ws
cd ydlidar_ros2_ws
mkdir src
cd src

Then copy the package files from the unzipped source code directory ydlidar_ros2_ws/src to the ydlidar_ros2_ws/src directory. Then, in the ydlidar_ros2_ws directory, use colcon build to compile.

xxxxxxxxxx
cd ydlidar_ros2_ws
colcon build

After successful compilation, add the workspace path to your .bashrc file.

xxxxxxxxxx
sudo gedit ~/.bashrc

Copy the following content to the end of the file:

xxxxxxxxxx
source ~/ydlidar_ros2_ws/devel/setup.bash --extend

3. Bind the radar port name

Open a terminal in the ydlidar_ros2_ws workspace and enter the following command:

xxxxxxxxxx
cd ~/ydlidar_ros2_ws/src/ydlidar_ros2_driver/startup/
sudo sh initenv.sh

image-20251201204211553

Then reconnect the radar serial port and enter ll /dev/ydlidar in the terminal.

xxxxxxxxxx
 ll /dev/ydlidar

image-20251201204306348

4. Driving the Radar

Save and exit, then open a new terminal. Enter the following command to activate the radar and display it in rviz. Terminal warnings can be ignored.

xxxxxxxxxx
ros2 launch ydlidar_ros2_driver ydlidar_launch_view.py

image-20251201205603166

The radar node data can be viewed through the following command.

xxxxxxxxxx
ros2 topic echo /scan

image-20251201204526597

Handheld lidar mapping
Handheld lidar mapping

COMPANY

  • About us
  • Team Style
  • Blog

LEARNING & EXPLORATION

  • Tutorials
  • Edge AI hardware
  • Educational robots
  • Embedded intelligent hardware

WHERE TO BUY

  • Yahboom Online Store
  • Amazon
  • Alibaba
  • AliExpress
  • Mercado

TECHNOLOGY SUPPORT

  • Email: support@yahboom.com

BE A DISTRIBUTOR

  • Email: sales@yahboom.com
QR Code

Copyright © 2017-2026 Yahboom. All Rights Reserved.

EN/中文