ROS Resources: Documentation | Support | Discussion Forum | Service Status | Q&A answers.ros.org
Ask Your Question
0

run hector_slam with LaserScan topic only

asked 2013-06-27 19:14:20 -0600

pseudobot gravatar image

updated 2014-01-28 17:17:05 -0600

ngrennan gravatar image

Hello, I am trying to get work with hector_slam using SICK Laser. I want to map a room with SICK laser only. I will carry my notebook with the SICK Laser.

What I have tried : 1. Record the /scan topic with rosbag record. 2. Play it again with rosbag play <filename.bag> --clock 3. Launch this file :

<launch>

    <node pkg="hector_mapping" type="hector_mapping" name="hector_mapping" output="screen">

        <param name="base_frame" value="base_link"/>
        <param name="odom_frame" value="base_link"/>
        <param name="pub_map_odom_transform" value="true"/>
        <param name="scan_subscriber_queue_size" value="25"/>

        <!-- Map size / start point -->
        <param name="map_resolution" value="0.050"/>
        <param name="map_size" value="2048"/>
        <param name="map_start_x" value="0.5"/>
        <param name="map_start_y" value="0.5" />
        <param name="map_multi_res_levels" value="2" />
    </node>

    <include file="$(find hector_geotiff)/launch/geotiff_mapper.launch"> </include>

    <node pkg="tf" type="static_transform_publisher" name="map_nav_broadcaster" args="0 0 0 0 0 0 base_link laser 100"/>

</launch>

But, I got this error :

[ INFO] [1372396116.210768520, 1372324835.547738080]: lookupTransform base_link to laser timed out. Could not transform laser scan into base_frame.
[ERROR] [1372396116.373757080, 1372324835.710765040]: Trajectory Server: Transform from /map to /base_link failed: Frame id /map does not exist! Frames (3): Frame /laser exists with parent /base_link.
Frame /base_link exists with parent NO_PARENT.

I am afraid that my launch file is wrong. Do anyone has .launch for hector_slam that can be use for handheld mapping only. Thank you :)

Update :

Here,it is my result from rosrun tf view_frames :

https_://dl.dropboxusercontent.com/u/32191086/Public%20Media/Selection_001.png

remove the _ for link

And my .bag file :

https_://dl.dropboxusercontent.com/u/32191086/Public%20Media/pioneer_laser_1.bag

Sorry my karma isn't enough to post the picture & link.

edit retag flag offensive close merge delete

Comments

please, post the output of the command "rosrun tf view_frames", so we can see how your frames are configured.

Procópio gravatar imageProcópio ( 2013-06-27 22:46:48 -0600 )edit

Here it is : https://dl.dropboxusercontent.com/u/32191086/Public%20Media/Selection_001.png

pseudobot gravatar imagepseudobot ( 2013-06-27 23:46:48 -0600 )edit

try putting <param name="map_frame" value="base_link"/> into your launch file

goetz.marc gravatar imagegoetz.marc ( 2013-06-27 23:52:52 -0600 )edit

when you start hector_slam it prints a bunch of stuff in the initialization phase, can you also post that, please? If your bag file is not too big I can try to process it here and tell you what you are missing.

Procópio gravatar imageProcópio ( 2013-06-28 00:17:19 -0600 )edit

@goetz.marc I have try that but still error :(

@Procopio : here it is my bag file, it contains LaserScan /scan topic only : https://dl.dropboxusercontent.com/u/32191086/Public%20Media/pioneer_laser_1.bag

pseudobot gravatar imagepseudobot ( 2013-06-28 06:16:45 -0600 )edit

1 Answer

Sort by » oldest newest most voted
1

answered 2013-06-28 06:51:56 -0600

Procópio gravatar image

updated 2013-06-28 06:55:30 -0600

So, it is actually quite simple, just add this line to your launch file:

<param name="/use_sim_time" value="true" />

and play your bag file with the --clock argument:

rosbag play pioneer_laser_1.bag --clock

this modifications will make the clock of your bag file to be used, instead of the current system time. Without them, you would have a large difference in time between the time you got your laser scans and the current time of your static transformation. Then the system would disregard your static transform because your scans were too old.

If you had recorded the static transformation together with the scan in the bag file, you would probably have it working in the first try.

cheers

edit flag offensive delete link more

Comments

Thanks, I can play that now & the map coming in the rviz. Btw, if I am using with realtime scanner, I must set that param value to "false" ?

pseudobot gravatar imagepseudobot ( 2013-06-28 20:02:14 -0600 )edit

I'm not sure, but I think it would work even if you left it as "true".

Procópio gravatar imageProcópio ( 2013-06-29 06:31:53 -0600 )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: 2013-06-27 19:14:20 -0600

Seen: 1,747 times

Last updated: Jun 28 '13