hector slam not generating map

asked 2016-04-07 07:46:11 -0500

wmorlan gravatar image

updated 2016-04-07 09:35:33 -0500

For some reason, when I run hector_mapping, no map is generated. In rviz, no map appears when I try to view the /map topic. when I run "rosrun map_server map_saver", the result is a solid dark grey image. I have followed the instructions here when setting up my robot. http://wiki.ros.org/hector_slam/Tutor...

Edor: When building from logged data, the map builds fine. I therefore assume I am not generating the correct data somehow. Here is the launch file I am using to start everything; if somebody could tell me what I am doing wrong, that would be much appriciated

<?xml version="1.0"?>
<launch>
    <include file="$(find openni2_launch)/launch/openni2.launch"/>
    <node pkg="depthimage_to_laserscan" type="depthimage_to_laserscan" name="depthimage_to_laserscan"> 
        <remap from="image" to="/camera/depth/image_raw"/>
    </node>

    <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="camera_link" />
        <param name="odom_frame" value="camera_link" />

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

        <!-- 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" />
        <param name="laser_max_dist" value = "10" />

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

        <param name="scan_subscriber_queue_size" value="5"/>
        <param name="scan_topic" value="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="scanmatcher_frame" />
    </node>
</launch>
edit retag flag offensive close merge delete

Comments

Are you sure the scan topic has been published? Hector slam node is subscribing to topic called scan. So you need to make sure some node (probably depthimage_to_laserscan in your case) is publishing LaserScan msg to scan. Check details of scan by rostopic info /scan and rostopic echo /scan

DavidN gravatar imageDavidN ( 2016-04-10 21:29:36 -0500 )edit