lidarslam_ros2: scanmatcher_node-1 process has died

Hi all.

Currently I’m using ROS2 humble, and using LS Lidar C32. I have recorded a pointcloud in a ros bag and try to play it back in our office.

First I run lidarslam. It run as normal

ros2 launch lidarslam lidarslam.launch.py

Screenshot from 2023-05-30 13-38-09

Next, I run RVIZ2 to visualise the path and modified_path. Also, have no issue.

Screenshot from 2023-05-30 13-38-20

Screenshot from 2023-05-30 13-39-45

After running lidarslam and rviz2, I play the ros2 bag. The way I play the ros bag is as following:

ros2 bag play file.bag

Screenshot from 2023-05-30 13-38-37

After few seconds, the vehicle is moving and now we can see the path.

Screenshot from 2023-05-30 13-41-42

Suddenly, there is an error occured in lidarslam. The error is as following:

[scanmatcher_node-1] [pcl::VoxelGrid::applyFilter] Leaf size is too small for the input dataset. Integer indices would overflow.
[ERROR] [scanmatcher_node-1]: process has died [pid 121510, exit code -8, cmd '/home/reka/ros2_ws/install/scanmatcher/lib/scanmatcher/scanmatcher_node --ros-args --params-file /home/reka/ros2_ws/install/lidarslam/share/lidarslam/param/lidarslam.yaml -r /input_cloud:=/c32/lslidar_point_cloud'].

Screenshot from 2023-05-30 13-41-53

Now, the lidarslam is crash. and the path is not moving anymore. Can I know what the reason behind this and how to fix it?

I tried to fix it by increasing the leaf size in params.yaml, but seems not working.

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Reactions: 1
  • Comments: 15 (7 by maintainers)

Most upvoted comments

The parameter is documented here: https://github.com/rsasaki0109/lidarslam_ros2/blob/develop/README.md?plain=1#L85 You can set the value in the ROS parameter file that is configuring the scan matching node, as in here: https://github.com/rsasaki0109/lidarslam_ros2/blob/develop/lidarslam/param/lidarslam.yaml#L11

I had the same issue for my custom recordings with an OS1-64. I just needed to adjust the parameters vg_size_for_input and vg_size_for_map. In my case, increasing vg_size_for_map to 0.5 solved the crash.

I am facing the same problem, whenever I play rosbag2 play bag file command the bag is getting closed and rviz is not showing any map

I apologize for the inconvenience, but due to recent busyness and the complexity of the issue, I would appreciate some time to address it.

I apologize, it slipped my mind. At a glance, it seems that the voxel grid filter inside updateMap, which is running in parallel, might be the issue. https://github.com/rsasaki0109/lidarslam_ros2/blob/humble/scanmatcher/src/scanmatcher_component.cpp#L422

Due to time constraints, I’ll check again on a weekday evening or weekend.

@rsasaki0109 Here is my YAML file.

scan_matcher:
  ros__parameters:
    global_frame_id: "map"
    robot_frame_id: "base_link"
    registration_method: "NDT"
    ndt_resolution: 2.0
    ndt_num_threads: 2
    gicp_corr_dist_threshold: 5.0
    trans_for_mapupdate: 1.5
    vg_size_for_input: 0.5
    vg_size_for_map: 0.1
    use_min_max_filter: true
    scan_min_range: 1.0
    scan_max_range: 200.0
    scan_period: 0.2
    map_publish_period: 15.0
    num_targeted_cloud: 20
    set_initial_pose: true
    initial_pose_x: 0.0
    initial_pose_y: 0.0
    initial_pose_z: 0.0
    initial_pose_qx: 0.0
    initial_pose_qy: 0.0
    initial_pose_qz: 0.0
    initial_pose_qw: 1.0
    use_imu: false
    use_odom: false
    debug_flag: true

graph_based_slam:
    ros__parameters:
      registration_method: "NDT"
      ndt_resolution: 1.0
      ndt_num_threads: 2
      voxel_leaf_size: 0.1
      loop_detection_period: 3000
      threshold_loop_closure_score: 0.7
      distance_loop_closure: 100.0
      range_of_searching_loop_closure: 20.0
      search_submap_num: 2
      num_adjacent_pose_cnstraints: 5
      use_save_map_in_loop: true
      debug_flag: true