Ask Your Question

hokuyo_node using 2 hokuyos at the same time

asked 2014-10-05 23:47:58 -0500

kost9 gravatar image

I have 2 hokuyo lasers which I want to use for mapping with hector_slam. I want both of them to map simultaneously so I could get a 360' view at once. What would be a good way to do this? Should both lasers publish to 1 topic? or should they use 2 different topics, and if so would I be able to incorporate 2 topics into 1 map? Thanks!

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2014-10-06 09:57:52 -0500

paulbovbel gravatar image

updated 2014-10-06 09:59:03 -0500

I'm not familiar with how hector_slam works, but you may be able to get away with publishing both scans on the same topic but with different tf frames for orientation.

Otherwise, you could create an intermediary node using a time sync message filter, convert both to pointclouds, add the two clouds, and then turn the combined cloud back into a laserscan.

edit flag offensive delete link more


Thanks for the answer, I shall try the first method you suggested. I now only need to figure out how to manipulate tf frames.

kost9 gravatar image kost9  ( 2014-10-06 22:36:49 -0500 )edit

So far I wrote a simple launch file that runs two hokuyo_nodes with different names and usb ports connected. Both of them publish to /scan. I can see data from 2 lasers in rviz (which reads /scan via hector_slam but maps are inconsistent) Now how can I transform the frame of one laser into second?

kost9 gravatar image kost9  ( 2014-10-08 02:59:41 -0500 )edit

You can't easily, since laserscans use polar coordinates. I'm not sure about your setup - I assume both lasers publishing to different frames that are properly connected to the tf tree.

paulbovbel gravatar image paulbovbel  ( 2014-10-08 08:38:11 -0500 )edit

You can try the method I suggested where you turn the laserscans into pointclouds, which are Cartesian and can be transformed using tf.

paulbovbel gravatar image paulbovbel  ( 2014-10-08 08:38:22 -0500 )edit

Yes, I have 2 frames: laser and laser_1; the parent for both is base_link; So I added to the launch file this: <node pkg="tf" type="static_transform_publisher" name="base_to_laser_broadcaster" args="0 0 0 pi 0 0 base_link laser_1 1"/>
where pi is 3.14.... for 180 degrees of yaw.

kost9 gravatar image kost9  ( 2014-10-10 02:32:39 -0500 )edit

When mapping I get a 360 degree view but it's very very inconsistent and the map is very strange, it looks like several maps overlapping, any ideas on that?

kost9 gravatar image kost9  ( 2014-10-10 02:34:43 -0500 )edit

You should ask a new question, providing details on your setup (tf an otherwise), pictures of the laserscans overlaid on each other in rviz to show that your odometry is decent, pictures of your maps, and more details on your issue.

paulbovbel gravatar image paulbovbel  ( 2014-10-13 11:20:52 -0500 )edit

answered 2014-10-06 03:14:59 -0500

Hamid Didari gravatar image

you must create a node that subscribe two hokuyo node and publish one new msg that include two msg details for mapping. note you must updte some of msg field such as min angel and max angel and ....

edit flag offensive delete link more

Your Answer

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

Add Answer

Question Tools



Asked: 2014-10-05 23:47:58 -0500

Seen: 302 times

Last updated: Oct 06 '14