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

10.RTAB 3D mapping and navigation

RTAB 3D mapping and navigation

The following workspace contains the function packages in the entire rplidar_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. It needs to be run with a depth camera. Rosmaster-X3 is run with an Astrapro depth camera.

Function package path: ~/ydlidar_ws/src/yahboomcar_nav

1. Introduction

This software package is the ROS function package of RTAB Map, which is an RGB-D SLAM method based on a global loop closure detector with real-time constraints. The software package can be used to generate a three-dimensional point cloud of the environment and create a two-dimensional occupancy grid map for navigation.

image-20221202160009093

As can be seen from the above figure, Monte Carlo positioning amcl is not required. RTAB Map has its own positioning function; if used, it will cause repeated positioning and positioning failure. When using the RTAB Map navigation core framework, the initialized map is provided by RTAB Map, not map_server.

2. Mapping and Use

Input following command:

roslaunch yahboomcar_nav laser_astrapro_bringup.launch
roslaunch yahboomcar_nav yahboomcar_rtabmap.launch use_rviz:=true
  • use_rviz parameter: whether to open rviz.

Keyboard control car:

xxxxxxxxxx
roslaunch yahboomcar_ctrl yahboom_keyboard.launch

After starting according to the above method, choose any one method to control the mapping;

The slower the speed when constructing the map, the better the effect (especially the angular speed); the robot fills the area to be mapped and the map is as closed as possible.

image-20221202160300886

When the map is completed, directly ctrl+c to exit the map node, the system will automatically save the map.

The default save path of the map is [~/.ros/rtabmap.db].

View tf tree:

xxxxxxxxxx
rosrun rqt_tf_tree rqt_tf_tree

image-20221202160418851

View node:

xxxxxxxxxx
rqt_graph

image-20221202160510487

As can be seen from the above figure, the information that the [rtabmap] node needs to subscribe to: radar data, camera data, and tf data.

3. Navigation and obstacle avoidance

Input the following command to start the underlying driver:

xxxxxxxxxx
roslaunch yahboomcar_nav laser_astrapro_bringup.launch

Input the following command to start mapping or navigation:

xxxxxxxxxx
roslaunch yahboomcar_nav yahboomcar_rtabmap_nav.launch use_rviz:=False
  • use_rviz parameter: whether to open rviz.

Keyboard control node:

xxxxxxxxxx
roslaunch yahboomcar_ctrl yahboom_keyboard.launch

When the navigation mode is turned on, the system automatically loads the 2D raster map.

It cannot directly load the 3D map and needs to be loaded manually.

image-20221202160710002

Load 3D map (1, 2, 3), 4 is to add the rviz debugging tool.

image-20221202160755263

At this time, you can manually add [MarkerArray] to facilitate multi-point navigation and observation, and adjust [rviz] display parameters according to needs, such as the size of lidar points.

3.1 Single point navigation

  • Use the [2D Pose Estimate] of the [rviz] tool to set the initial pose until the position of the car in the simulation is consistent with the actual position of the car.
  • Click [2D Nav Goal] of the [rviz] tool, and then select a target point on the map where there are no obstacles. Release the mouse to start navigation. You can only select one target point and stop when you reach it.

3.2 Multi-point navigation

  • Same as the first step of single-point navigation, first set the initial pose of the car.
  • Click [Publish Point] of the [rviz] tool, and then select the target point on the map where there are no obstacles. Release the mouse to start navigation. You can click [Publish Point] again, and then select the point. The robot Will cruise between points.
  • When using the [2D Pose Estimate] tool of the [rviz] tool to set the initial pose of the car, the multi-point navigation function is automatically canceled.

 

4. rtabmap node description

This is the master node for this package. It is a wrapper around the RTAB mapping core library. Here, when loop closure is detected, the map is incrementally built and optimized.

The node's online output is this map, which contains the latest data added to the map. The default location of the RTAB map database is [.ros/rtabmap.db], and the workspace is also set to [.ros].

4.1 Subscribed Topics

NameTypeAnalyze
odomnav_msgs/OdometryOdometry stream. Required if parameters subscribe_depth or subscribe_stereo are true and odom_frame_id is not set.
rgb/imagesensor_msgs/ImageRGB/Mono image
rgb/camera_infosensor_msgs/CameraInfoRGB camera metadata.
depth/imagesensor_msgs/ImageRegistered depth image.
scansensor_msgs/LaserScanLaser scan stream.
scan_cloudsensor_msgs/PointCloud2Laser scan point cloud stream.
left/image_rectsensor_msgs/ImageLeft RGB/Mono rectified image.
left/camera_infosensor_msgs/CameraInfoLeft camera metadata
right/image_rectsensor_msgs/ImageRight Mono rectified image.
right/camera_infosensor_msgs/CameraInfoRight camera metadata
goalgeometry_msgs/PoseStampedPlan a path to reach this goal using the current online map.
rgbd_imagertabmap_ros/RGBDImageRGB-D synchronized image, only when subscribe_rgbd is true.

4.2 Published Topics

NameTypeAnalyze
infortabmap_ros/InfoRTAB-Map's info.
mapDatartabmap_ros/MapDataRTAB-Map's graph and latest node data.
mapGraphrtabmap_ros/MapGraphRTAB-Map's graph only.
grid_mapnav_msgs/OccupancyGridOccupancy grid generated with laser scans
proj_mapnav_msgs/OccupancyGridDEPRECATED: use /grid_map topic instead with Grid/FromDepth=true.
cloud_mapsensor_msgs/PointCloud23D point cloud generated from the assembled local grids
cloud_obstaclessensor_msgs/PointCloud23D point cloud of obstacles generated from the assembled local grids
cloud_groundsensor_msgs/PointCloud23D point cloud of ground generated from the assembled local grids.
scan_mapsensor_msgs/PointCloud23D point cloud generated with the 2D scans or 3D scans
labelsvisualization_msgs/MarkerArrayConvenient way to show graph's labels in RVIZ.
global_pathnav_msgs/PathPoses of the planned global path. Published only once for each path planned.
local_pathnav_msgs/PathUpcoming local poses corresponding to those of the global path. Published on every map update.
goal_reachedstd_msgs/BoolStatus message if the goal is successfully reached or not.
goal_outgeometry_msgs/PoseStampedCurrent metric goal sent from the rtabmap's topological planner. For example, this can be connected move_base_simple/goal to move_base。
octomap_fulloctomap_msgs/OctomapGet an OctoMap. Available only if rtabmap_ros is built with octomap.
octomap_binaryoctomap_msgs/OctomapGet an OctoMap. Available only if rtabmap_ros is built with octomap.
octomap_occupied_spacesensor_msgs/PointCloud2A point cloud of the occupied space (obstacles and ground) of the OctoMap. Available only if rtabmap_ros is built with octomap.
octomap_obstaclessensor_msgs/PointCloud2A point cloud of the obstacles of the OctoMap. Available only if rtabmap_ros is built with octomap.
octomap_groundsensor_msgs/PointCloud2A point cloud of the ground of the OctoMap. Available only if rtabmap_ros is built with octomap.
octomap_empty_spacesensor_msgs/PointCloud2A point cloud of empty space of the OctoMap. Available only if rtabmap_ros is built with octomap.
octomap_gridnav_msgs/OccupancyGridThe projection of the OctoMap into a 2D occupancy grid map. Available only if rtabmap_ros is built with octomap.

 

4.3 Services

NameTypeAnalyze
get_maprtabmap_ros/GetMapCall this service to get the standard 2D occupancy grid
get_map_datartabmap_ros/GetMapCall this service to get the map data
publish_maprtabmap_ros/PublishMapCall this service to publish the map data
list_labelsrtabmap_ros/ListLabelsGet current labels of the graph.
update_parametersstd_srvs/EmptyThe node will update with current parameters of the rosparam server
resetstd_srvs/EmptyDelete the map
pausestd_srvs/EmptyPause mapping
resumestd_srvs/EmptyResume mapping
trigger_new_mapstd_srvs/EmptyThe node will begin a new map
backupstd_srvs/EmptyBackup the database to "database_path.back" (default ~/.ros/rtabmap.db.back)
set_mode_localizationstd_srvs/EmptySet localization mode
set_mode_mappingstd_srvs/EmptySet mapping mode
set_labelrtabmap_ros/SetLabelSet a label to latest node or a specified node.
set_goalrtabmap_ros/SetGoalSet a topological goal (a node id or a node label in the graph).
octomap_fulloctomap_msgs/GetOctomapGet an OctoMap. Available only if rtabmap_ros is built with octomap.
octomap_binaryoctomap_msgs/GetOctomapGet an OctoMap. Available only if rtabmap_ros is built with octomap.

4.4 Parameters

NameTypeDefault valueAnalyze
subscribe_depthbooltrueSubscribe to depth image
subscribe_scanboolfalseSubscribe to laser scan
subscribe_scan_cloudboolfalseSubscribe to laser scan point cloud
subscribe_stereoboolfalseSubscribe to stereo images
subscribe_rgbdboolfalseSubsribe to rgbd_image topic
frame_idstringbase_linkThe frame attached to the mobile base.
map_frame_idstringmapThe frame attached to the map.
odom_frame_idstring‘ ’The frame attached to odometry.
odom_tf_linear_variancedouble0.001When odom_frame_id is used, the first 3 values of the diagonal of the 6x6 covariance matrix are set to this value.
odom_tf_angular_variancedouble0.001When odom_frame_id is used, the last 3 values of the diagonal of the 6x6 covariance matrix are set to this value.
queue_sizeint10Size of message queue for each synchronized topic.
publish_tfbooltruePublish TF from /map to /odom.
tf_delaydouble0.05 
tf_prefixstring‘ ’Prefix to add to generated tf.
wait_for_transformbooltrueWait (maximum wait_for_transform_duration sec) for transform when a tf transform is not still available.
wait_for_transform_durationdouble0.1Wait duration for wait_for_transform.
config_pathstring‘ ’Path of a config files containing RTAB-Map's parameters. Parameters set in the launch file overwrite those in the config file.
database_pathstring.ros/rtabmap.dbPath of the RTAB-Map's database.
gen_scanboolfalseGenerate laser scans from depth images (using the middle horizontal line of the depth image). Not generated if subscribe_scan or subscribe_scan_cloud are true.
gen_scan_max_depthdouble4.0Maximum depth of the laser scans generated.
approx_syncboolfalseUse approximate time synchronization of input messages. If false, note that the odometry input must have also exactly the same timestamps than the input images.
rgbd_camerasint1Number of RGB-D cameras to use (when subscribe_rgbd is true). Well for now, a maximum of 4 cameras can be synchronized at the same time.
use_action_for_goalboolfalseUse actionlib to send the metric goals to move_base.
odom_sensor_syncboolfalseAdjust image and scan poses relatively to odometry pose for each node added to graph.
gen_depthboolfalseGenerate depth image from scan_cloud projection into RGB camera, taking into account displacement of the RGB camera accordingly to odometry and lidar frames.
gen_depth_decimationint1Scale down image size of the camera info received (creating smaller depth image).
gen_depth_fill_holes_sizeint0Fill holes of empty pixels up to this size. Values are interpolated from neighbor depth values. 0 means disabled.
gen_depth_fill_iterationsdouble0.1Maximum depth error (m) to interpolate.
gen_depth_fill_holes_errorint1Number of iterations to fill holes.
map_filter_radiusdouble0.0Filter nodes before creating the maps. Only load data for one node in the filter radius (the latest data is used) up to filter angle (map_filter_angle).
map_filter_angledouble30.0Angle used when filtering nodes before creating the maps. See also map_filter_radius. Used for all published maps.
map_cleanupbooltrueIf there is no subscription to any map cloud_map, grid_map or proj_map, clear the corresponding data.
latchbooltrueIf true, the last message published on the map topics will be saved and sent to new subscribers when they connect.
map_always_updatebooltrueAlways update the occupancy grid map even if the graph has not been updated
map_empty_ray_tracingbooltrueDo ray tracing to fill unknown space for invalid 2D scan's rays (assuming invalid rays to be infinite). Used only when map_always_update is also true.

 

4.5 TF transform

  • Preparation:

    • base_link → sensor
    • odom → base_link

    Provide:

    map → odom

APP Mapping and Navigation
Introduction to ROS2

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