Ask Your Question

Using Hector Slam with Hokuyo laser range finder

asked 2013-03-21 21:17:20 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.


So I'm kinda new to ROS. I ran the tutorial launch file with the bag file and I was able to see it working in rviz. What I am having trouble with right now is how to get hokuyo_node and hector_slam nodes communicating such that a map is generated in rviz. I would like to generate a map using the hokuyo laser range finder and would like to see the generated map on rviz. I'm guessing I have to modify the tutorial launch file in order to get hector_slam working with the laser range finder instead of bag files.

Thanks, appreciate the help!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2013-03-22 03:21:25 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

It's a advisable that you use an IMU to estimate the attitude (roll/pitch) angles of the LIDAR. But provided you keep the scan plane parallel to the ground, things can also work without one.

What you will want to do is starting the Hokuyo node, a static publisher for the transformation of the base frame of your "robot" to your laser scanner frame and a properly set up mapping node. The latter two you can start with this launch file:


  <include file="$(find hector_mapping)/launch/mapping_default.launch">
    <arg name="base_frame" value="base_frame"/>
    <arg name="odom_frame" value="base_frame"/>

  <include file="$(find hector_geotiff)/launch/geotiff_mapper.launch">
    <arg name="trajectory_source_frame_name" value="base_frame"/> 

  <node pkg="tf" type="static_transform_publisher" name="base_frame_to_laser_broadcaster" args="0 0 0 0 0 0 base_frame laser 100"/>


Provided your scanner publishes on the "scan" topic and uses the "laser" frame_id, this launch file should work.

edit flag offensive delete link more


Thanks for the quick reply I will try this out and get back to you.

One more question, do you a recommend any good/cheap IMU?

Thanks once again

hesh8 gravatar image hesh8  ( 2013-03-23 05:15:54 -0500 )edit

Hi, have you figure it out how to do it? i have a hokuyo URG-04LX and an imu ,however the mapping is not very good:)

elva gravatar image elva  ( 2013-03-29 20:43:30 -0500 )edit

We are still working on it. What imu are you using and how do you integrate it to this launch file?

hesh8 gravatar image hesh8  ( 2013-04-03 11:56:33 -0500 )edit

i use a hector_imu_attitude_to_tf_nodein hector_slam package,but imu seems only provide pitch and roll angle to hector_mapping, i also want to use it with yaw angle, because when i held the hokuyo in hand and turn the slowly in a cirlce, the map did not match

elva gravatar image elva  ( 2013-04-03 21:27:20 -0500 )edit

Can you publish your launch file code?

hesh8 gravatar image hesh8  ( 2013-04-07 12:46:37 -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


Asked: 2013-03-21 21:17:20 -0500

Seen: 2,083 times

Last updated: Mar 23 '13