yahboom
HomeLearn
Solution
Blog
Online Store
About Us
EN/中文
T-mini Plus LiDAR📖
01.Linux basic course
  • 1.Introduction to Linux system
  • 2.Ubuntu file system
  • 3.Ubuntu common commands
  • 4.Ubuntu common editors
  • 5.Ubuntu software operation commands
  • 6.Virtual machine installation
  • 7.SSH remote control
  • 8.VNC remote control
  • 9.Transfer files remotely
  • 10.Driver library and communication
  • 11.Static IP and hotspot mode
  • 12.Bind device ID
  • 13.Capacity expansion and resource allocation
  • 14.Update system software sources
  • 15.Set root user password
  • 16.sudo free password
  • 17.Connect to WiFi network
  • 18.View system version
  • 19.Customized service management
  • 20.Back up system image
02.ROS1 basic course
  • 1.ROS introduction
  • 2.ROS installation
  • 3.ROS common command tools
  • 4.ROS workspace
  • 5.ROS function package
  • 6.ROS node
  • 7.ROS topic publisher
  • 8.ROS topic subscribers
  • 9.ROS service client
  • 10.ROS service server
  • 11.ROS action client
  • 12.ROS action server
  • 13.ROS custom message reception
  • 14.ROS-launch file
  • 15.ROS-TF transformation
  • 16.ROS parameter service
  • 17.ROS-rviz use
  • 18.ROS-rqt tool usage
  • 19.Topic message recording and playback
  • 20.urdf model introduction
  • 21.gazebo introduction
  • 22.ROS distributed communication
03.ROS1 lidar course
  • 0.Instructions before use
  • 1.Preparation
  • 2.Handheld lidar mapping
  • 3.Lidar avoiding
  • 4.Lidar guard
  • 5.Lidar follow
  • 6.Lidar mapping
  • 7.rrt_exploration mapping algorithm
  • 8.Navigation
  • 9.APP Mapping and Navigation
  • 10.RTAB 3D mapping and navigation
04.ROS2 basic course
  • 1. Introduction to ROS2
  • 2.ROS2 install Humble
  • 3.ROS2 development environment
  • 4.ROS2 workspace
  • 5.ROS2 function package
  • 6.ROS2 node
  • 7.ROS2 topic communication
  • 8.ROS2 service communication
  • 9.ROS2 action communication
  • 10.ROS2 custom interface message
  • 11.ROS2 parameter service case
  • 12.ROS2 meta-function package
  • 13.ROS2 distributed communication
  • 14.ROS2 DDS
  • 15.ROS2 time related API
  • 16.ROS2 common command tools
  • 17.ROS2 rviz2 use
  • 18.ROS2 rqt toolbox
  • 19.ROS2 Launch startup file configuration
  • 20.ROS2 recording and playback tool
  • 21.ROS2 URDF model
  • 22.ROS2 Gazebo simulation platform
  • 23.ROS2 TF2 coordinate transformation
05.ROS2 lidar course
  • 0.ReadMe
  • 1.Preparation
  • 2.Handheld lidar mapping
  • 3.Lidar avoiding
  • 4.Lidar follow
  • 5.Lidar guard
  • 6.Lidar patrol
  • 7.gmapping mapping
  • 8.cartographer mapping
  • 9.Navigation and avoiding
  • 10.APP Mapping and Navigation
  • 11.RTAB 3D mapping and navigation
06.Raspberry Pi5 course
2.ROS1 lidar course
  • 0.Instructions before use
  • 1.Preparation
  • 2.Handheld lidar mapping
  • 3.Lidar avoiding
  • 4.Lidar guard
  • 5.Lidar follow
  • 6.Lidar mapping
  • 7.rrt_exploration mapping algorithm
  • 8.Navigation
  • 9.APP Mapping and Navigation
  • 10.RTAB 3D mapping and navigation
3.ROS2 lidar course
  • 0.ReadMe
  • 1.Preparation
  • 2.Handheld lidar mapping
  • 3.Lidar avoiding
  • 4.Lidar follow
  • 5.Lidar guard
  • 6.Lidar patrol
  • 7.gmapping mapping
  • 8.cartographer mapping
  • 9.Navigation and avoiding
  • 10.APP Mapping and Navigation
  • 11.RTAB 3D mapping and navigation
1.Docker course
  • 1. Overview and installation
  • 2. Common commands
  • 3. Docker images deeply understand and publish images
  • 4. Docker hardware interaction and data processing
  • 5. Enter the robot's docker container
Download
  • Code
  • VM_File
  • RPi5_SystemFile
  • Data Sheet
  • 3D_Model_File
  • PC_Software
  • ROS2_Basic_VM
Download ZIP

Welcome to T-mini Plus LiDAR repository

6.Lidar mapping

Lidar mapping

The following workspace contains the function packages in the entire ydlidar_ws. If you need to transplant it to your own development board, you need to copy all the function packages to the src of the workspace for compilation, and install the relevant environment.

Note: This course uses Rosmaster-X3Plus as an example. Users need to modify it according to their own motion model.

Different from the handheld lidar mapping content, this mapping adds odom data, so if you use your own motion model, you also need to have odom data.

Function package path: ~ydlidar_ws/src/yahboomcar_nav

This section focuses on several commonly used mapping algorithms: gampping、hector、karto、cartographer.

1. Start mapping

Input following command:

roslaunch yahboomcar_nav laser_bringup.launch
roslaunch yahboomcar_nav yahboomcar_map.launch map_type:=gmapping

Note: When building a map, the slower the speed, the better the effect (note that the rotation speed should be slower). If the speed is too fast, the effect will be poor.

  • Parameter map_type: mapping algorithm, you can choose gmapping, hector, karto, cartographer, the default is gmapping

Keyboard control robot:

xxxxxxxxxx
roslaunch yahboomcar_ctrl yahboom_keyboard.launch

Make the robot cover the area to be mapped and the map should be as closed as possible.

image-20221130180626862

 

2. Save map

几种建图算法保存地图的方式是不同的,

  • cartographer: Input following command

    xxxxxxxxxx
    bash ~/ydlidar_ws/src/yahboomcar_nav/maps/carto_map.sh
  • gampping、hector、karto:Input following command

    xxxxxxxxxx
    bash ~/ydlidar_ws/src/yahboomcar_nav/maps/map.sh

The map will be saved to the ~/ydlidar_ws/src/yahboomcar_nav/map folder, a pgm image and a yaml file.

3. Mapping algorithm

3.1 gmapping

1)Topics and services
Subscribe to topicsTypeDescription
tftf/tfMessageUsed for conversion between lidar coordinate system, base coordinate system and odometer coordinate system
scansensor_msgs/LaserScanLidar scan data
TopicTypeDescription
map_metadatanav_msgs/MapMetaDataPublish map Meta data
mapnav_msgs/OccupancyGridPublish map raster data
~entropystd_msgs/Float64Release the estimation of robot pose distribution entropy
ServiceTypeDescription
dynamic_mapnav_msgs/GetMapGet map data

View node

xxxxxxxxxx
rqt_graph

image-20221130182706710

2)TF Transforms
Required tf Transforms TFDescription
laser-->base_linksually a fixed value, broadcast periodically by a robot_state_publisher, or a tf static_transform_publisher.
base_link-->odomusually provided by the odometry system (e.g., the driver for the mobile base)
Provided tf TransformsDescription
map-->odomthe current estimate of the robot's pose within the map frame

View TF tree

xxxxxxxxxx
rosrun rqt_tf_tree rqt_tf_tree

image-20221130182938624

3) Website:

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

3.2 hector

1)Introduction

Features: hector_slam does not need to subscribe to the odometer/odom message, uses the Gauss Newton method, and directly uses the lidar to estimate the odometer information. However, when the robot speed is faster, it will cause deviations in the mapping effect, and the requirements for sensors are high.

2) Topics and services
Topic subscriptionTypeDescription
scansensor_msgs/LaserScanThe laser scan used by the SLAM system.
syscommandstd_msgs/StringSystem command. If the string equals "reset" the map and robot pose are reset to their inital state.
Published TopicsTypeDescription
map_metadatanav_msgs/MapMetaDataGet the map data from this topic
mapnav_msgs/OccupancyGridGet the map data from this topic
slam_out_posegeometry_msgs/PoseStampedThe estimated robot pose without covariance
poseupdategeometry_msgs /PoseWithCovarianceStampedThe estimated robot pose with an gaussian estimate of uncertainty
ServicesTypeDescription
dynamic_mapnav_msgs/GetMapCall this service to get the map data.
reset_mapstd_srvs/TriggerCall this service to reset the map, and hector will start a whole new map from scratch. Notice that this doesn't restart the robot's pose, and it will restart from the last recorded pose.
pause_mappingstd_srvs/SetBoolCall this service to stop/start processing laser scans.
restart_mapping_with_new_posehector_mapping/ResetMappingCall this service to reset the map, the robot's pose, and resume mapping (if paused)

View nodes

xxxxxxxxxx
rqt_graph

image-20221201110343916

View TF tree

xxxxxxxxxx
rosrun rqt_tf_tree rqt_tf_tree

image-20221201110458180

3) TF Transforms
Required tf TransformsDescription
laser-->base_linkusually a fixed value, broadcast periodically by a robot_state_publisher, or a tf static_transform_publisher.
Provided tf TransformsDescription
map-->odomthe current estimate of the robot's pose within the map frame (only provided if parameter "pub_map_odom_transform" is true).
4) Website:

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

3.3 karto

1) Introduction

Karto is a 2D laser SLAM solution, which is based on a sparse graph optimization method with closed loop detection. Karto uses the spa (karto_slam) or g2o (nav2d) optimization library, and the front-end and back-end uses a single-threaded process. It uses odom to predict the initial position.

2) Topics and Services
Subscribed TopicsTypeDescription
scansensor_msgs/LaserScanTransforms necessary to relate frames for laser, base, and odometry
tftf/tfMessageLaser scans to create the map from
Published TopicsTypeDescription
map_metadatanav_msgs/MapMetaDataGet the metadata of the map data (resolution, width, height, ...)
mapnav_msgs/OccupancyGridGet the map data from this topic, which is latched, and updated periodically
visualization_marker_arrayvisualisation_msgs / MarkerArrayGet the pose graph from this topic, which is updated periodically
Published TopicsTypeDescription
dynamic_mapnav_msgs/GetMapCall this service to get the map data

View node

xxxxxxxxxx
rqt_graph

image-20221201120250507

 

3) TF Transforms
Required tf TransformsDescription
laser-->base_linkusually a fixed value, broadcast periodically by a robot_state_publisher, or a tf static_transform_publisher.
base_link-->odomusually provided by the odometry system (e.g., the driver for the mobile base)
Provided tf TransformsTFDescription
map-->odomthe current estimate of the robot's pose within the map frame

View TF tree

xxxxxxxxxx
rosrun rqt_tf_tree rqt_tf_tree

image-20221201115719801

4) Website:

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

3.4 cartographer

1)Introduction

Cartographer is a 2D and 3D SLAM (simultaneous localization and mapping) library supported by a ROS system open sourced by Google. A graph-building algorithm based on graph optimization (multi-threaded back-end optimization, problem optimization built by cere). Data from multiple sensors (for example, LIDAR, IMU, and camera) can be combined to calculate the position of the sensor simultaneously and map the environment around the sensor.

2) View node
xxxxxxxxxx
rqt_graph

image-20221201121219449

3) View TF transformation
xxxxxxxxxx
rosrun rqt_tf_tree rqt_tf_tree

image-20221201121251666

4) Parameters lua file
ParametersDescription
map_frameMap coordinate system
tracking_frameConvert all sensor data to this coordinate system
published_frameThe map points to coordinate system the
odom_frameIf true, the tf tree is map->odom->footprint; if false, the tf tree is map->footprint
provide_odom_frameIf true, the local, non-loop-closed, continuous pose will be published as odom_frame in map_frame
publish_frame_projected_to_2dIf enabled, the published pose will restrict 2D poses
use_odometryWhether to use the odometer, if you use it, you must have odom tf
use_nav_satWhether to use gps
use_landmarksWhether to use landmark
num_laser_scansWhether to use single-line laser data
num_multi_echo_laser_scansWhether to use multi_echo_laser_scans data
num_subdivisions_per_laser_scan1 frame of data is divided into several processings, in generally it is 1
num_point_cloudsWhether to use point cloud data
lookup_transform_timeout_secFind the timeout of tf
submap_publish_period_secTime interval for publishing submap (seconds)
pose_publish_period_secThe time interval for posting pose, when the value is 5e-3, it is 200HZ
trajectory_publish_period_secThe time interval for publishing trajectory markers (trajectory nodes), the value is 30e-3 to 30ms
rangefinder_sampling_ratioFixed sampling frequency of lidar messages
odometry_sampling_ratioFixed sampling frequency of odometer messages
fixed_frame_pose_sampling_ratioFixed sampling frequency of fixed coordinate system messages
imu_sampling_ratioFixed sampling frequency of IMU messages
landmarks_sampling_ratioFixed sampling frequency for road sign messages
5) Website

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

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

 

Lidar follow
rrt_exploration mapping algorithm

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