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. Install 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 function package for this radar requires prior SDK installation, the YDLidar-SDK folder contains the radar's driver files. Open a terminal within this folder and type:

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

If no errors occur during the process, the driver installation is successful.

2. Creating a new workspace and compiling the package

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

xxxxxxxxxx
cd ydlidar_ws
catkin_make

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_ws/devel/setup.bash --extend
  • The second method involves creating a self-named workspace. For example, let's say the name is ydlidar_ws. Enter the following in the terminal:

xxxxxxxxxx
mkdir ydlidar_ws
cd ydlidar_ws
mkdir src
cd src
catkin_init_workspace

Then copy the extracted source code from ydlidar_ws/src to the ydlidar_ws/src directory, and then compile it using catkin_make in the ydlidar_ws directory.

xxxxxxxxxx
cd ydlidar_ws
catkin_make

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 ~/oradar_ws/devel/setup.bash --extend

3. Bind the radar port name

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

xxxxxxxxxx
chmod 0777 src/ydlidar_ros_driver/startup/*
sudo sh src/ydlidar_ros_driver/startup/initenv.sh 

image-20240411185754554

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

image-20240411185845566

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. Driving the Radar

Save and exit, then open a new terminal and enter the following command to activate the radar and display it in rviz.

xxxxxxxxxx
roslaunch ydlidar_ros_driver lidar_view.launch

image-20240411190200652

If the above picture appears, it indicates that all the preparatory work has been completed.

 

PC software use course
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/中文