ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Problem setting up hector_slam (no map), please help

asked 2013-11-28 15:08:42 -0600

Vegeta gravatar image

updated 2014-01-27 11:58:16 -0600

tfoote gravatar image


I have been trying to make hector slam work on my turtlebot with a hokuyo 04lx laser. I am using ROS fuerte, ubuntu 12.04. Steps I followed: 1) Did rosmake to hector_slam package with no errors. 2) I already have a urdf of my turtlebot with laser installed. (I can use gmapping) 3) I did try the hector_turtlebot gazebo tutorials successfully.

I launched the files in this order.

1) turtlebot.launch file 2) hokuyo.launch file 3) hector_slam_launch tutorial.launch

The mapping_default.launch file is like this:

    <?xml version="1.0"?>
  <arg name="tf_map_scanmatch_transform_frame_name" default="scanmatcher_frame"/>
  <arg name="base_frame" default="base_footprint"/>
  <arg name="odom_frame" default="nav"/>
  <arg name="pub_map_odom_transform" default="true"/>
  <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_link" />
    <param name="odom_frame" value="odom" />

    <!-- 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="true"/>

    <!-- Map size / start point -->
    <param name="map_resolution" value="0.050"/>
    <param name="map_size" value="$(arg map_size)"/>
    <param name="map_start_x" value="0.5"/>
    <param name="map_start_y" value="0.5" />
    <param name="map_multi_res_levels" value="2" />

    <!-- Map update parameters -->
    <param name="update_factor_free" value="0.4"/>
    <param name="update_factor_occupied" value="0.9" />    
    <param name="map_update_distance_thresh" value="0.4"/>
    <param name="map_update_angle_thresh" value="0.06" />
    <param name="laser_z_min_value" value = "-1.0" />
    <param name="laser_z_max_value" value = "1.0" />

    <!-- Advertising config --> 
    <param name="advertise_map_service" value="true"/>

    <param name="scan_subscriber_queue_size" value="5"/>
    <param name="scan_topic" value="hokuyo_scan"/>

    <!-- Debug parameters -->
      <param name="output_timing" value="false"/>
      <param name="pub_drawings" value="true"/>
      <param name="pub_debug_output" value="true"/>
    <param name="tf_map_scanmatch_transform_frame_name" value="$(arg tf_map_scanmatch_transform_frame_name)" />

  <!--<node pkg="tf" type="static_transform_publisher" name="map_nav_broadcaster" args="0 0 0 0 0 0 map nav 100"/>-->

I can see the laser scan and robot model on rviz. But the fixed frame and target from gives error on /map topic. If I change both of them to /odom the laser scans are shown. Also the Map field gives error. I cannot see the map being built.

Also on the terminal in the tutorial.launch file I get strange errors like this:


 * /hector_geotiff_node/draw_background_checkerboard
 * /hector_geotiff_node/draw_free_space_grid
 * /hector_geotiff_node/geotiff_save_period
 * /hector_geotiff_node/map_file_base_name
 * /hector_geotiff_node/map_file_path
 * /hector_mapping/advertise_map_service
 * /hector_mapping/base_frame
 * /hector_mapping/laser_z_max_value
 * /hector_mapping/laser_z_min_value
 * /hector_mapping/map_frame
 * /hector_mapping/map_multi_res_levels
 * /hector_mapping/map_resolution
 * /hector_mapping/map_size
 * /hector_mapping/map_start_x
 * /hector_mapping/map_start_y
 * /hector_mapping/map_update_angle_thresh
 * /hector_mapping/map_update_distance_thresh
 * /hector_mapping/odom_frame
 * /hector_mapping/pub_map_odom_transform
 * /hector_mapping/scan_subscriber_queue_size
 * /hector_mapping/scan_topic
 * /hector_mapping/tf_map_scanmatch_transform_frame_name
 * /hector_mapping/update_factor_free
 * /hector_mapping/update_factor_occupied
 * /hector_mapping/use_tf_pose_start_estimate
 * /hector_mapping/use_tf_scan_transformation
 * /hector_trajectory_server/source_frame_name
 * /hector_trajectory_server/target_frame_name
 * /hector_trajectory_server/trajectory_publish_rate
 * /hector_trajectory_server/trajectory_update_rate
 * /rosdistro
 * /rosversion
 * /use_sim_time

    hector_geotiff_node (hector_geotiff/geotiff_node)
    hector_mapping (hector_mapping/hector_mapping)
    hector_trajectory_server (hector_trajectory_server/hector_trajectory_server)
    rviz (rviz/rviz)


core service [/rosout] found
process[rviz-1]: started with pid [16501]
process[hector_mapping-2]: started with pid [16502]
process[hector_trajectory_server-3]: started with pid [16563]
HectorSM map lvl 0: cellLength: 0.05 res x:2048 res y: 2048
HectorSM map lvl 1: cellLength: 0.1 res x:1024 res y: 1024 ...
edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2015-01-20 01:22:06 -0600

This sounds like the hector_mapping node isn't doing anything, which could be the case if the wrong scan topic is specified (e.g. hokuyo_node publishes to "/scan" but hector_mapping subscribes "/hokuyo_scan"). Can you verify you really publish the scan to the "hokuyo_scan" topic?

edit flag offensive delete link more

answered 2015-01-19 21:05:04 -0600

tanghz gravatar image

The status of the Map is Error, have you checked what the error is?

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2013-11-28 15:08:42 -0600

Seen: 1,546 times

Last updated: Jan 20 '15