yahboom
HomeLearn
Solution
Blog
Online Store
About Us
EN/中文
SDM18 Laser Ranging Module📖
Module Introduction
  • Module Introduction
1.Preparation before use
  • Preparation before use
2.Get distance information_Linux
  • Get distance information_Linux
3.Get distance information_ROS
  • Get distance information_ROS
4.Multiple master control tutorials
  • 1.Get distance information_MSPM0
  • 2.Get distance information_ESP32
  • 3.Get distance information_Jetson
  • 4.Get distance information_Raspberry Pi
  • 5.Get distance information_RDK
  • 6.Get distance information_STM32
  • 7.Get distance information_MSPM03519new
Download
  • Code
  • DataSheet
  • 3D_Model_File
  • PC_Software
Download ZIP

Welcome to SDM18 Laser Ranging Module repository

Preparation before use

1. Preparation before use

1、Install SDK

Unzip the YDLidar-SDK-master.zip file in the folder,Get a file YDLidar-SDK-master,Copy this file to your own file directory,Here, taking the installation in the/home directory as an example, and then entering it one by one,

cd YDLidar-SDK-master
mkdir build
cd build
cmake ..
make
sudo make install

2.Compile ROS feature package

ROS1

Unzip the ydlidar_ros_ws.rar file in the folder,get a file ydlidar_ros_ws,Copy this feature package to the root directory of your own environment, then open the terminal in the workspace and enter the following command to compile,

xxxxxxxxxx
cd ydlidar_ros_ws
catkin_make -DCATKIN_WHITELIST_PACKAGES=ydlidar_ros_driver
source install/setup.bash        #激活工作空间

ROS2

Extract the ydlidar_ros2_ws.rar file from the folder and obtain a file ydlidar_ros2_ws. Copy this feature package to the root directory of your own environment, then open the terminal in the workspace and enter the following command to compile,

xxxxxxxxxx
cd ydlidar_ros2_ws
colcon build --symlink-install

3. Create a serial port alias

To prevent recognition errors when multiple USB devices are connected, we create a module serial port alias.

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

The ~/catkin_ws/src/ydlidar_ros_driver here is the location for installing the feature pack and needs to be modified according to the actual situation. Take care:

After completing the previous operation, please reinsert the module again。

Enter the following command to check if the recognition was successfully created,

xxxxxxxxxx
ll /dev/ydlidar

If the following screen appears, it indicates success,

Note: This may not necessarily be ttyUSB0, the assigned serial number based on system identification shall prevail.

4. Running programs

Terminal input,

ROS1,

xxxxxxxxxx
roslaunch ydlidar_ros_driver SDM18.launch

The screenshot of successful operation is as follows,

image-20240411094934126

You can enter the following command to view specific data,

xxxxxxxxxx
rostopic echo /scan

image-20240411095028398

The data in ranges is the actual measured distance, measured in meters.

ROS2

xxxxxxxxxx
ros2 launch ydlidar_ros2_driver ydlidar_launch.py

The following screenshot appears when running successfully,

image-20240410143207682

You can enter the following command to view specific data,

xxxxxxxxxx
ros2 topic echo /scan

image-20240410143514105

The data in ranges is the actual measured distance, measured in meters.

 

 

Module Introduction
Get distance information_Linux

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/中文