How can I merge scan topics
Hi all! I am trying to get a map from using 2 hokuyo lidars at the same time(for a 360 degree view). So far i did 2 tries: 1)I used a launch file that uses two hokuyo_node's to publish to the same 'scan' topic. I rotated one laser's frame 180 degrees around base_link. But that gave me inconsistent maps with a lot of drifting (maps would overlap, jump from 1 place to another and so on). Changing parameters didnt really help.
2)Then I tried to use 1 hokuyo_node to publish to 'scan' and another hokuyo_node to publish to 'scan_1'. (Again I roatated one lasers frame around the base_link). I also used two hector_mapping nodes that subscribed to those 'scan' and 'scan_1' separately but published to the same 'map' topic which is used by rviz. However in rviz I can only see 1 map at a time (they switch between each other in time) with no jumping or drifting.
So now I want to use two hokuyo_nodes that publish to 'scan' and 'scan_1' separately with frames rotated correctly. After that I need to merge those scan and scan_1 topics into one topic which will be used by one hector_mapping node. My question is how can I do that? Do I have to write a c++ code ? and can anyone help me with that? I am not very experienced in programming
Update: I was finally able to merge scan topics. there is a really good package provided by ira labs as al-dev mentioned in the answer. That package basically does what I needed. Now my problem is that I cant run that package on my robot computer, however it worked on my PC.
Could you post more about your progress in the future? Thank you.