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

2.Handheld lidar mapping

2. Handheld LiDAR Mapping

It is recommended to use our provided virtual machine, as it may not run due to environment differences.

1. Install dependency libraries. Taking the ros-melodic version as an example, enter the following in the terminal:

xxxxxxxxxx
sudo apt install ros-melodic-moveit ros-melodic-moveit-visual-tools ros-melodic-kdl-* ros-melodic-joint-state-publisher-gui ros-melodic-trac-ik liborocos-kdl-dev ros-melodic-teleop-twist-keyboard ros-melodic-moveit-resources ros-melodic-navigation ros-melodic-gmapping ros-melodic-hector-slam ros-melodic-slam-karto ros-melodic-robot-state-publisher ros-melodic-geographic-msgs ros-melodic-libuvc-* ros-melodic-rtabmap-ros libavformat-dev libavcodec-dev libswresample-dev libswscale-dev libavutil-dev libsdl1.2-dev ros-melodic-pointcloud-to-laserscan ros-melodic-mbf-msgs ros-melodic-mbf-costmap-core ros-melodic-costmap-converter ros-melodic-bfl ros-melodic-serial ros-melodic-teleop-twist-joy ros-melodic-laser-proc ros-melodic-rosserial-arduino ros-melodic-rosserial-python ros-melodic-rosserial-server ros-melodic-rosserial-client ros-melodic-rosserial-msgs ros-melodic-amcl ros-melodic-map-server ros-melodic-urdf ros-melodic-xacro ros-melodic-interactive-markers ros-melodic-octomap* ros-melodic-joy* ros-melodic-dwa-local-planner ros-melodic-multirobot-map-merge python-catkin-tools python3-dev python3-catkin-pkg-modules python3-numpy python3-yaml build-essential ros-melodic-imu-tools ros-melodic-cartographer*

2. Starting the Mapping Command

Taking gmapping as an example, enter the following in the terminal:

xxxxxxxxxx
roslaunch gmapping_test tw3_gmapping.launch 

It's normal to see this error message at the beginning of the program, because the TensorFlow conversion failed initially but will be successful later.

image-20251201154332566

The following screen indicates successful operation.

image-20251201161818158

3. Saving the Map

Taking gmapping as an example, the command to save the map is:

xxxxxxxxxx
rosrun map_server map_saver -f ~/ydlidar_ws/src/gmapping_test/maps/test_map

image-20251201161953580

The map will be saved to the folder /home/yahboom/ydlidar_ws/src/gmapping_test/maps/, consisting of a PGM image and a YAML file.

test_map.yaml

xxxxxxxxxx
image: /home/yahboom/ydlidar_ws/src/gmapping_test/maps/test_map.pgm
resolution: 0.050000
origin: [-20.000000, -20.000000, 0.000000]
negate: 0
occupied_thresh: 0.65
free_thresh: 0.196

Parameter Explanation:

  • image: Path to the map file, can be an absolute or relative path.

  • resolution: Map resolution, meters per pixel.

  • origin: 2D pose (x, y, yaw) of the bottom left corner of the map. Here, yaw represents a counter-clockwise rotation (yaw=0 indicates no rotation). Many parts of the current system ignore the yaw value.

  • negate: Whether to invert the meaning of white/black and free/occupied (the interpretation of the threshold is unaffected).

  • occupied_thresh: Pixels with an occupation probability greater than this threshold are considered fully occupied.

  • free_thresh: Pixels with an occupation probability less than this threshold are considered completely free.

4. Algorithm information reference website

4.1. Graphing algorithm

Gmapping: http://wiki.ros.org/gmapping/

hector_slam: http://wiki.ros.org/hector_slam

hector_slam/Tutorials: http://wiki.ros.org/hector_slam/Tutorials/SettingUpForYourRobot

hector_mapping: http://wiki.ros.org/hector_mapping

karto: http://wiki.ros.org/slam_karto

Cartographer: https://google-cartographer.readthedocs.io/en/latest/

Cartographer ROS: https://google-cartographer-ros.readthedocs.io/en/latest/

4.2 Autonomous Mapping and Navigation

rrt_exploration: http://wiki.ros.org/rrt_exploration

rrt_exploration/Tutorials: http://wiki.ros.org/rrt_exploration/Tutorials

4.3 Saving Maps

map_server: https://wiki.ros.org/map_server

Lidar drive
Lidar drive

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