Ask Your Question

how to use hector_slam?

asked 2013-09-09 07:17:15 -0600

Vegeta gravatar image

Hello All,

I am new to ROS and learning slowly. I am using ROS fuerte, ubuntu 12.04.

I downloaded the hector_slam package from the ros wiki page. After installing from the github repository, did a rosmake and got this error.

[ rosmake ] Output from build of package hector_geotiff_plugins written to:
[ rosmake ]    /home/turtlebot/.ros/rosmake/rosmake_output-20130910-013847/hector_geotiff_plugins/build_output.log
[rosmake-3] Finished <<< hector_geotiff_plugins [FAIL] [ 2.73 seconds ]         
[ rosmake ] Halting due to failure in package hector_geotiff_plugins. 
[ rosmake ] Waiting for other threads to complete.
[rosmake-2] Finished <<< hector_mapping [PASS] [ 39.46 seconds ]                
[ rosmake ] Results:                                                            
[ rosmake ] Cleaned 58 packages.                                                
[ rosmake ] Built 57 packages with 1 failures.                                  
[ rosmake ] Summary output to directory                                         
[ rosmake ] /home/turtlebot/.ros/rosmake/rosmake_output-20130910-013847

I have a hokuyo urg 04 lx for takin laser scans.

My question is - 1) How to get the hector_geotiff_plugins to build cleanly? 2) Which launch file I should use to run hector mapping (From the tutorial I assume the file is the tutorial.launch located in hector_slam_launch folder) , also in this case I will have to run the hokuyo node separately using hokuyo.launch, if I am correct? 3) I do not have an IMU to use with the hokuyo lidar but I have a turtlebot with gyro, can I launch the turtlebot launch file and use teleop to get the imu from the turtlebot utilizing its IMU? 4) Do I need to create a separate launch file as described in the tutorial or I have to edit the same tutorial.launch file.

My tutorial. launch file looks like this--- I do not understand which parameters to change, (sorry i am very new to ROS)

<?xml version="1.0"?>


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

  <node pkg="rviz" type="rviz" name="rviz" 
    args="-d $(find hector_slam_launch)/rviz_cfg/mapping_demo.vcg"/>

  <include file="$(find hector_mapping)/launch/mapping_default.launch"/>

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


And the mapping_default.launch file looks 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="$(arg base_frame)" />
    <param name="odom_frame" value="$(arg odom_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)"/>

    <!-- 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="$(arg scan_subscriber_queue_size)"/>
    <param name="scan_topic" value="$(arg scan_topic)"/>

    <!-- Debug parameters ...
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2013-09-09 22:54:42 -0600

jodafo gravatar image

updated 2013-09-09 22:55:22 -0600

1) dunno, wouldn't mind if i were you

2) mapping_default.launch. Yes, also launch hokuyo node and make sure the scan topics are the same.

3) Afaik hector mapping doesn't use imu data (might be that they added that over the last year though).

4)I think it's nicer to create a new launch file which includes hector mapping and sets the according args. However both ways will work.

Also make sure your tf tree is correct (i.e. do

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

1 follower


Asked: 2013-09-09 07:17:15 -0600

Seen: 5,145 times

Last updated: Sep 09 '13