Ask Your Question
2

How can I merge scan topics

asked 2014-10-22 00:24:33 -0500

kost9 gravatar image

updated 2014-11-04 02:33:51 -0500

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.

edit retag flag offensive close merge delete

Comments

1

Could you post more about your progress in the future? Thank you.

2ROS0 gravatar image2ROS0 ( 2014-10-24 20:55:29 -0500 )edit

2 Answers

Sort by » oldest newest most voted
3

answered 2014-10-24 20:50:24 -0500

al-dev gravatar image

If you are talking about merging multiple laser scans to build a map using a mapping package like gmapping, you might want to check the laserscan_multi_merger node from the iralab (University of Milano Bicocca) : https://github.com/iralabdisco/ira_la...

edit flag offensive delete link more

Comments

1

1) Hi thank you for the reply! I successfully used the package you suggested on my ubuntu 12.04 computer. But when I tried to do the same thing on a different computer with same ubuntu 12.04 hydro ROS I keep getting this error ( node dies)

kost9 gravatar imagekost9 ( 2014-11-01 05:26:20 -0500 )edit

2) [laserscan_multi_merger-2] process has died [pid 3884, exit code -11, cmd /home/youbot/catkin_ws/devel/lib/ira_laser_tools/laserscan_multi_merger __name:=laserscan_multi_merger __log:=/home/youbot/.ros/log/17d2a87e-61b1-11e4-b568-000bab4510aa/laserscan_multi_merger-2.log].

kost9 gravatar imagekost9 ( 2014-11-01 05:26:50 -0500 )edit

3) log file: /home/youbot/.ros/log/17d2a87e-61b1-11e4-b568-000bab4510aa/laserscan_multi_merger-2*.log

I tried reinstalling the package but nothing helps. I would appreciate it so much if you could help me with this problem

kost9 gravatar imagekost9 ( 2014-11-01 05:27:48 -0500 )edit

Hi kost9, there could be a lot of different reasons for a node to crash, we need more details to help you. If the package worked on your first computer and it solved your problem, maybe you should create another question for this.

al-dev gravatar imageal-dev ( 2014-11-01 10:41:10 -0500 )edit

al-dev So I created new question with more detail http://answers.ros.org/question/19653...

kost9 gravatar imagekost9 ( 2014-11-03 01:38:06 -0500 )edit
4

answered 2014-10-22 02:32:43 -0500

Procópio gravatar image

updated 2014-10-23 03:27:20 -0500

I suggest you transform your laser scans into point clouds and then merge the two separate point clouds.

You can search for terms linke: point cloud merge (or combine, or fusion) to find the proper tools to accomplish it.

some resources:

laser_geometry

merging multiple pointcloud

concatenate point clouds

edit flag offensive delete link more

Comments

Thanks for the reply, I will try that!

kost9 gravatar imagekost9 ( 2014-10-23 00:35:48 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2014-10-22 00:24:33 -0500

Seen: 3,774 times

Last updated: Nov 04 '14