Skip to content

[ROS][feat] Always use multiLidar if provided

Julia Sanchez requested to merge ROS/feat/ForceMultiLidar into master

Goal

This MR has the same purpose as MR !280 (merged)

  • Trigger the SLAM process only when all LiDARs are received.
  • For now, one LiDAR sensor was considered as master and the others were added when available.
  • Most of the times, when various Lidars are used, it is to solve some missing degree of liberty in the independent LiDAR fields of view. So, if we allow the SLAM to process one only LiDAR frame (because it is all that it has at some point), it can fail and never recover.
  • Now, the SLAM outputs a pose each time it has gathered all frames (it will be based on the sensor with the lowest frequency)
  • A time parameter allows to drop frames if some have never been received

Changes

  • Add parameters MultiLidarsNum to indicate the number of LiDAR sensors used
  • Refact ScanCallback function to gather all frames from different LiDAR sensors
  • Remove SecondaryScanCallback function

Results

lidar_conversion:

rosrun lidar_conversions robosense_conversion_node __name:=rs1 _device_id:=0 _talker_topic_name:="/lidar_points_1" _listener_topic_name:="/lidars/bpearl_back_left"
rosrun lidar_conversions robosense_conversion_node __name:=rs2 _device_id:=1 _talker_topic_name:="/lidar_points_2" _listener_topic_name:="/lidars/bpearl_front_right"

lidar_slam:

roslaunch lidar_slam slam_velodyne.launch outdoor:=false

rosbag:

rosbag play --clock path/to/rosbag --topics /lidars/bpearl_back_left /lidars/bpearl_front_right

TODO:

  • Clean
  • Reenable removed features from previously master callback
  • Make it NLidars compatible (only two for now)
  • Test
Edited by Julia Sanchez

Merge request reports

Loading