ROS study notes (6): ROS laser SLAM

table of Contents

7 ROS laser SLAM

7.1 Map

7.2 Comparison of commonly used laser SLAM algorithms

7.2.1 Gmapping SLAM calculation chart

7.2.2 Karto SLAM calculation chart

7.2.3 Hector SLAM calculation chart


7 ROS laser SLAM

The main problems of robot navigation can be divided into three parts: mapping, localization, and path planning. The problem of simultaneous positioning and mapping (SLAM) is at the intersection of positioning and mapping. SLAM requires the robot to gradually build a map in an unknown environment, and then determine its own position based on the map to further locate.

SLAM can be divided into three categories: laser, vision, laser + vision. This chapter mainly studies the laser SLAM algorithm.

7.1 Map

The map in ROS is an ordinary grayscale image, usually in pgm format. Black pixels on this image indicate obstacles, white pixels indicate feasible areas, and gray is unexplored areas. As shown below:

 

The map is maintained and presented in the form of a topic in ROS. The topic name is / map, and its message type is nav_msgs / OccupancyGrid

You can view the message format through rosmsg show nav_msgs / OccupancyGrid:

std_msgs/Header header #消息的报头
    uint32 seq
    time stamp
    string frame_id #地图消息绑定在TF的哪个frame上,一般为map
nav_msgs/MapMetaData info #地图相关信息
    time map_load_time #加载时间
    float32 resolution #分辨率 单位:m/pixel
    uint32 width #宽 单位:pixel
    uint32 height #高 单位:pixel
    geometry_msgs/Pose origin #原点
    geometry_msgs/Point position
        float64 x
        float64 y
        float64 z
    geometry_msgs/Quaternion orientation
        float64 x
        float64 y
        float64 z
        float64 w
int8[] data #地图具体信息

 

The above defines the data structure of the / map topic, which contains three main parts: header, info and data. The header is the header of the message, which stores general information such as sequence number, time stamp, frame, etc. info is the configuration information of the map, it reflects the attributes of the map, and data is the part that actually stores the map data, it is a variable-length array , [] Is added after int8, which can be understood as a vector-like container, which stores width * height int8 type data, which is each pixel on this map.

For the map of the unknown area, the robot can be dynamically constructed using the SLAM algorithm in motion.

For a map of a known area, you can first start the SLAM algorithm node, move the robot to scan the surrounding environment and build a map, and then use map_server ( $ rosrun map_server map_saver -f map ) to save the map. Use the saved map for future navigation.

7.2 Comparison of commonly used laser SLAM algorithms

The laser SLAM algorithms commonly used in ROS are Gmapping, Karto, Hector and other algorithms.

The specific comparison is shown in the following table:

 

gmapping

Karto

Hector

Required sensor

Lidar

Odometer

Lidar

Odometer

Lidar (requires high frequency radar)

Enter topic

  • / tf and / tf_static: coordinate transformation, tf / tfMessage or tf2_msgs / TFMessage. Two tf must be provided, one is the tf between the base_frame and laser_frame, that is, the transformation between the robot chassis and the lidar; the other is the tf between the base_frame and odom_frame, that is, the coordinates between the chassis and the odometer origin Transform. odom_frame can be understood as the coordinate system where the origin of the odometer is located.
  • / scan: Lidar data, type sensor_msgs / LaserScan
  • / tf and / tf_static: coordinate transformation, tf / tfMessage or tf2_msgs / TFMessage. Two tf must be provided, one is the tf between the base_frame and laser_frame, that is, the transformation between the robot chassis and the lidar; the other is the tf between the base_frame and odom_frame, that is, the coordinates between the chassis and the odometer origin Transform. odom_frame can be understood as the coordinate system where the origin of the odometer is located.
  • / scan: Lidar data, type sensor_msgs / LaserScan
  • / tf and / tf_static: coordinate transformation, tf / tfMessage or tf2_msgs / TFMessage. Two tf must be provided, one is the tf between the base_frame and laser_frame, that is, the transformation between the robot chassis and the lidar; the other is the tf between the base_frame and odom_frame, that is, the coordinates between the chassis and the odometer origin Transform. odom_frame can be understood as the coordinate system where the origin of the odometer is located.
  • / scan: Lidar data, type sensor_msgs / LaserScan
  • / syscommand: When the reset message is received, the map and robot positions are initialized to their original positions.

Output topic

  • / tf: mainly output the transformation between map_frame and odom_frame
  • / slam_gmapping / entropy: std_msgs / Float64 type, reflecting the degree of dispersion of robot pose estimation
  • / map: The map created by slam_gmapping
  • / map_metadata: information about the map
  • / tf: mainly output the transformation between map_frame and odom_frame
  • / map: The map created by slam_gmapping
  • / map_metadata: information about the map
  • / tf: mainly output the transformation between map_frame and odom_frame
  • / map: The map created by slam_gmapping
  • / map_metadata: information about the map
  • / poseupdate: robot pose estimation with covariance
  • / slam_out_pose: Pose estimation without covariance.

Provided service

/ dynamic_map: The type is nav_msgs / GetMap, used to get the current map.

/ dynamic_map: The type is nav_msgs / GetMap, used to get the current map

/ dynamic_map: The type is nav_msgs / GetMap, used to get the current map

Technical realization

Particle filter

Graph-based optimization

scan-matching(Gaussian-Newton equation)

effect

Mature, reliable, and stable effects, many ROS-based robots run gmapping_slam

Similar to gmapping, more suitable for large map environment

The effect is not as good as Gmapping and Karto, because it only uses lidar information

      (1) The odometer includes a photoelectric code wheel on the wheel, an inertial navigation unit (IMU), and a visual odometer. You can use only one of them for odom, or you can select multiple for data fusion, and the fusion result is used as odom.

      (2)https://blog.csdn.net/dddxxxx/article/details/78460636

      (3)Refer to《An evaluation of 2D SLAM techniques available in robot operating system》

7.2.1 Gmapping SLAM calculation chart

7.2.2 Karto SLAM calculation chart

7.2.3 Hector SLAM calculation chart

 

Published 31 original articles · Like 3 · Visits 2028

Guess you like

Origin blog.csdn.net/lclfans1983/article/details/105399567