Rosanswers logo

Hi to all,

I'm trying to build a map in RVIZ by using hector_slam and my SICK laser, but I'm having lots of problems. What I would like to do is to move around the laser inside my room and build a map in real-time. For this reason, I won't have a robot with odometry topic since I'll physically move the laser around the environment.

I've already read the hector_slam tutorial (http://wiki.ros.org/hector_slam/Tutorials/SettingUpForYourRobot) and I think I should use tips at point (2), but I don't know in which launch file I have to insert this code. The problem is that I don't know which launch file I should use and how to modify it in order to specify the correct frame to use. For example, if I run roslaunch hector_slam_launch mapping_box.launch, I get this error:

[INFO] [1463570714.703498474]: lookupTransform base_frame to laser timed out. Could not transform laser scan into base_frame.

Can you suggest me what kind of launch file I need to use and how I have to modify it, please? I could not find any good tutorial on how to do this..

EDIT: I've already tried to understand the source code of mapping_default.launch but it comes with no comments or explanations inside and so I really can't understand what it does.

     <arg name="tf_map_scanmatch_transform_frame_name" default="scanmatcher_frame"/>
      <arg name="base_frame" default="base_footprint"/> # what is the meaning of base_footprint?
      <arg name="odom_frame" default="nav"/>  # what I have to specify here?
      <arg name="pub_map_odom_transform" default="true"/> # this has to be set to false?
      <arg name="scan_subscriber_queue_size" default="5"/>
      <arg name="scan_topic" default="scan"/>
      <arg name="map_size" default="2048"/>
      <node pkg="hector_mapping" type="hector_mapping" name="hector_mapping" output="screen">
        <!-- Frame names -->
        <param name="map_frame" value="map" />
        <param name="base_frame" value="base_frame" />
        <param name="odom_frame" value="base_frame" />
        <!-- Tf use -->
        <param name="use_tf_scan_transformation" value="true"/>
        <param name="use_tf_pose_start_estimate" value="false"/>
        <param name="pub_map_odom_transform" value="$(arg pub_map_odom_transform)"/>
<node pkg="tf" type="static_transform_publisher" name="map_nav_broadcaster" args="0 0 0 0 0 0 base_frame laser 100" />

Originally posted by Marcus Barnet on ROS Answers with karma: 287 on 2016-05-18

Post score: 0


1 Answer 1


Rosanswers logo

You have to publish a static transform between scan and base_frame to solve that error. Have a look at this project hector_slam_example . This project uses Hokuyo UTM-30LX with Hector_slam. You can use the launch file "hector_hokuyo.launch" in the launch folder. You will have to replace the hokuyo related parts with SICK i.e. initialising SICK sensor related node. Both of these sensors publish their laser scans on /scan topic so that should not be a problem.

Originally posted by gp with karma: 166 on 2016-05-19

This answer was ACCEPTED on the original site

Post score: 1


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.