lidarslam_ros2 icon indicating copy to clipboard operation
lidarslam_ros2 copied to clipboard

Perfomance in real time drone systems

Open moralessP opened this issue 9 months ago • 18 comments

First of all, I want to thank you for your great work. I am currently developing a drone for a specific task, and I need to be able to localize it using data from my Velodyne 16 Puck Lite LiDAR. I am currently in simulation using Gazebo version Harmonic and ROS 2 Humble. I have tried this repository on my system simulation, and it seems to have errors in the x and y position estimation. I'm not sure why z is working fine but not the other two dimensions. Should the data from my 3D LiDAR be without NaN values? How should the frame of my LiDAR be related to my base_link? Screenshot from 2024-05-04 16-13-27

moralessP avatar May 04 '24 14:05 moralessP

Could you capture the screen when localization is not working well? I'm interested in seeing the terminal output, the scan point clouds and what the SLAM estimated trajectory looks like in rviz.

rsasaki0109 avatar May 08 '24 08:05 rsasaki0109

Hi, sorry the long waiting time. Your code works well when the drone up or forward but it doesn't give me a good estimation when I turn left or right. I don't know why and what parameters I need to change in order to get a good estimation. Screenshot from 2024-05-13 09-23-18 Screenshot from 2024-05-13 09-24-19 Screenshot from 2024-05-13 09-30-40

moralessP avatar May 13 '24 07:05 moralessP

This is the terminal output, everything looks work well. [INFO] [launch]: All log files can be found below /home/localadm/.ros/log/2024-05-13-09-36-23-105927-lFRS31509-12800 [INFO] [launch]: Default logging verbosity is set to INFO [INFO] [scanmatcher_node-1]: process started with pid [12807] [INFO] [graph_based_slam_node-2]: process started with pid [12809] [scanmatcher_node-1] [INFO] [1715585783.255104294] [scan_matcher]: initialization start [scanmatcher_node-1] registration_method:NDT [scanmatcher_node-1] ndt_resolution[m]:2 [scanmatcher_node-1] ndt_num_threads:2 [scanmatcher_node-1] gicp_corr_dist_threshold[m]:5 [scanmatcher_node-1] trans_for_mapupdate[m]:1.5 [scanmatcher_node-1] vg_size_for_input[m]:0.5 [scanmatcher_node-1] vg_size_for_map[m]:0.1 [scanmatcher_node-1] use_min_max_filter:true [scanmatcher_node-1] scan_min_range[m]:1 [scanmatcher_node-1] scan_max_range[m]:100 [scanmatcher_node-1] set_initial_pose:true [scanmatcher_node-1] publish_tf:false [scanmatcher_node-1] use_odom:false [scanmatcher_node-1] use_imu:false [scanmatcher_node-1] scan_period[sec]:0.1 [scanmatcher_node-1] debug_flag:false [scanmatcher_node-1] map_publish_period[sec]:15 [scanmatcher_node-1] num_targeted_cloud:20 [scanmatcher_node-1] ------------------ [scanmatcher_node-1] [INFO] [1715585783.255741037] [scan_matcher]: initialize Publishers and Subscribers [scanmatcher_node-1] [INFO] [1715585783.259079612] [scan_matcher]: set initial pose [scanmatcher_node-1] [INFO] [1715585783.259120218] [scan_matcher]: initialization end [graph_based_slam_node-2] [INFO] [1715585783.304962446] [graph_based_slam]: initialization start [graph_based_slam_node-2] registration_method:NDT [graph_based_slam_node-2] voxel_leaf_size[m]:0.1 [graph_based_slam_node-2] ndt_resolution[m]:1 [graph_based_slam_node-2] ndt_num_threads:2 [graph_based_slam_node-2] loop_detection_period[Hz]:3000 [graph_based_slam_node-2] threshold_loop_closure_score:0.7 [graph_based_slam_node-2] distance_loop_closure[m]:100 [graph_based_slam_node-2] range_of_searching_loop_closure[m]:20 [graph_based_slam_node-2] search_submap_num:2 [graph_based_slam_node-2] num_adjacent_pose_cnstraints:5 [graph_based_slam_node-2] use_save_map_in_loop:true [graph_based_slam_node-2] debug_flag:true [graph_based_slam_node-2] ------------------ [graph_based_slam_node-2] [INFO] [1715585783.305794386] [graph_based_slam]: initialize Publishers and Subscribers [graph_based_slam_node-2] [INFO] [1715585783.311001802] [graph_based_slam]: initialization end [scanmatcher_node-1] [INFO] [1715585783.505627123] [scan_matcher]: initial_cloud is received [scanmatcher_node-1] [INFO] [1715585783.505683250] [scan_matcher]: create a first map [graph_based_slam_node-2] [INFO] [1715585795.308566704] [graph_based_slam]: searching Loop, num_submaps:2 [scanmatcher_node-1] [INFO] [1715585801.606700657] [scan_matcher]: publish a map, number of points in the map : 16931 [graph_based_slam_node-2] [INFO] [1715585804.308521267] [graph_based_slam]: searching Loop, num_submaps:5 [graph_based_slam_node-2] [INFO] [1715585810.308691856] [graph_based_slam]: searching Loop, num_submaps:6

moralessP avatar May 13 '24 07:05 moralessP

It seems that the issue with unsuccessful matching in the XY direction is due to insufficient feature points. Is it possible to place some objects with geometric features in the simulation to prevent degeneration?

rsasaki0109 avatar May 14 '24 08:05 rsasaki0109

Yes you are right. I placed my LiDAR horizontally, which resulted in more features and improved performance on the XY axis. It's a shame that it doesn't work with the vertical positioning of my LiDAR. Thank you anyway.

moralessP avatar May 14 '24 13:05 moralessP

Hi @rsasaki0109, I have one question. I would like to use this repository (scanmatcher package) only for localization for my drone, do you recommend me this repository or lidar_localization_ros2?

moralessP avatar May 23 '24 09:05 moralessP

If you already have a map, you should use lidar_localization_ros2. If you don't have a map, then you should use lidarslam_ros2.

rsasaki0109 avatar May 23 '24 09:05 rsasaki0109

Okay thank you, and what is the difference between scanmatcher package and lidar_localization_ros2 package?

moralessP avatar May 23 '24 12:05 moralessP

I tried the lidar_localization_ros2 package, but it doesn't work. That's why I want to know the difference with scanmatcher since it works with my system.

moralessP avatar May 23 '24 12:05 moralessP

Scanmatcher assumes that there is no pre-existing map and generates a map incrementally from the input scans. On the other hand, lidar_localization_ros2 requires a pre-made map to be input. The input scans are used for localization and not for mapping, making the process lighter.

If lidar_localization_ros2 is not working, I would like to know the details. Did you properly input the map?

rsasaki0109 avatar May 27 '24 05:05 rsasaki0109

Okay right, now I understand more clearly thank you. And I didn't give the map as input, so it's normal it's didn't work properly. Last question, when I use lidar_localization_ros2 do you know how should I adapt the scan_period parameter when I activate use_imu? Because when I activate use_imu, I get an error message.

moralessP avatar May 27 '24 07:05 moralessP

If the LiDAR frequency is 10 Hz, then the scan_period is 0.1 sec. What error are you encountering when you activate use_imu?

rsasaki0109 avatar May 27 '24 07:05 rsasaki0109

This error : [INFO] [launch]: All log files can be found below /home/localadm/.ros/log/2024-05-27-10-03-06-958154-lFRS31509-9335 [INFO] [launch]: Default logging verbosity is set to INFO [INFO] [scanmatcher_node-1]: process started with pid [9336] [scanmatcher_node-1] [INFO] [1716796987.172534837] [localization_node]: initialization start [scanmatcher_node-1] registration_method:NDT [scanmatcher_node-1] ndt_resolution[m]:2.5 [scanmatcher_node-1] ndt_num_threads:4 [scanmatcher_node-1] gicp_corr_dist_threshold[m]:5 [scanmatcher_node-1] trans_for_mapupdate[m]:1.5 [scanmatcher_node-1] vg_size_for_input[m]:0.5 [scanmatcher_node-1] vg_size_for_map[m]:0.075 [scanmatcher_node-1] use_min_max_filter:true [scanmatcher_node-1] scan_min_range[m]:0.5 [scanmatcher_node-1] scan_max_range[m]:100 [scanmatcher_node-1] set_initial_pose:true [scanmatcher_node-1] publish_tf:false [scanmatcher_node-1] use_odom:false [scanmatcher_node-1] use_imu:true [scanmatcher_node-1] scan_period[sec]:0.1 [scanmatcher_node-1] debug_flag:false [scanmatcher_node-1] map_publish_period[sec]:15 [scanmatcher_node-1] num_targeted_cloud:50 [scanmatcher_node-1] ------------------ [scanmatcher_node-1] [INFO] [1716796987.174524734] [localization_node]: initialize Publishers and Subscribers [scanmatcher_node-1] [INFO] [1716796987.179819020] [localization_node]: set initial pose [scanmatcher_node-1] [INFO] [1716796987.179868576] [localization_node]: initialization end [scanmatcher_node-1] [INFO] [1716796987.365891293] [localization_node]: initial_cloud is received [scanmatcher_node-1] [INFO] [1716796987.365931419] [localization_node]: create a first map [ERROR] [scanmatcher_node-1]: process has died [pid 9336, exit code -8, cmd '/home/localadm/ros2_ws/install/scanmatcher/lib/scanmatcher/scanmatcher_node --ros-args -r __node:=localization_node --params-file /home/localadm/ros2_ws/install/drone_bringup/share/drone_bringup/config/slam.yaml -r /input_cloud:=/lidar'].

moralessP avatar May 27 '24 08:05 moralessP

It looks like I need to debug to understand this. I'll add it to the task list.

If you're going to use an IMU, please use the improved version, li_slam_ros2.

rsasaki0109 avatar May 27 '24 14:05 rsasaki0109

Hi, it's me again. Do you think this package can be run on Raspberry Pi 5 with 8 GB RAM ?

moralessP avatar Jun 28 '24 06:06 moralessP

I remember it was just barely manageable when I tested it with 16GB RAM, so with only 8GB, it could be challenging.

rsasaki0109 avatar Jun 28 '24 07:06 rsasaki0109

It's possible to do just localization as shown below, but since SLAM accumulates point cloud maps over time, some ingenuity is required.

https://x.com/naokiakai/status/1806542391631110299

rsasaki0109 avatar Jun 28 '24 09:06 rsasaki0109

I remember it was just barely manageable when I tested it with 16GB RAM, so with only 8GB, it could be challenging.

Owh Okay I see, thanks for your quick answer! :)

moralessP avatar Jun 28 '24 19:06 moralessP