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

Hector Slam Generated Map Does Not Appear in RVIZ

asked 2015-07-08 13:16:57 -0500

rafaelsoares gravatar image

updated 2015-07-09 20:55:57 -0500

allenh1 gravatar image

Hi,

I am trying to do a Hector Slam using the RPLidar by RoboPeak. I am not using any robot for now. I am using the RPLidar connected to my laptop. In the future I will use it on a UAV. I am using this launching file:

Blockquote

<launch>

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

<include file="$(find rplidar_ros)/launch/view_rplidar.launch" /> 




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

    <!-- 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>

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

<!-- this publishes the transform between the base and laser -->

<!--<node pkg="tf" type="static_transform_publisher" name="base_laser_broadcaster" args="0.0 0.0 0.0 0.0 0.0 0.0 /base_frame /laser_frame 40"/>-->

</launch<>

Blockquote

The Rviz opens, but doesn't show anything. On the Global Status there is the error :

"Fixed Frame
Fixed Frame [map] does not exist"

On the terminal keeping showing this message several times:

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

Please let me know if I need provide more information.

Thank you all in advance

EDIT

The Hector_mapping output is:

RPLidar health status : 0
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
[ INFO] [1436469131.808140071]: HectorSM p_base_frame_: /base_frame
[ INFO] [1436469131.808228798]: HectorSM p_map_frame_: /map
[ INFO] [1436469131.808258353]: HectorSM p_odom_frame_: /base_frame
[ INFO] [1436469131.808287733]: HectorSM p_scan_topic_: scan
[ INFO] [1436469131.808318149]: HectorSM p_use_tf_scan_transformation_: true
[ INFO] [1436469131.808347934]: HectorSM p_pub_map_odom_transform_: true
[ INFO] [1436469131.808377534]: HectorSM p_scan_subscriber_queue_size_: 5
[ INFO] [1436469131.808410540]: HectorSM p_map_pub_period_: 2.000000
[ INFO] [1436469131.808443056]: HectorSM p_update_factor_free_: 0.400000
[ INFO] [1436469131.808474554]: HectorSM p_update_factor_occupied_: 0.900000
[ INFO] [1436469131.808504963]: HectorSM p_map_update_distance_threshold_: 0.400000 
[ INFO] [1436469131.808535514]: HectorSM p_map_update_angle_threshold_: 0.060000
[ INFO] [1436469131.808564517]: HectorSM p_laser_z_min_value_: -1.000000
[ INFO] [1436469131.808593021]: HectorSM p_laser_z_max_value_: 1.000000

EDIT

The laser data I can get when I chose ... (more)

edit retag flag offensive close merge delete

Comments

1

Have you tried changing the frame to base_frame to verify that the laser data is coming in? What does Hector SLAM output?

allenh1 gravatar image allenh1  ( 2015-07-09 00:21:45 -0500 )edit

I changed

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

to

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

Now I can see the map, Thank you a lot.

rafaelsoares gravatar image rafaelsoares  ( 2015-07-09 14:30:22 -0500 )edit

The problem now is that the map is not "centered", I mean, when I move around my rectangular room, it made a uneven map, and when I came back to the start point it was in other point.

rafaelsoares gravatar image rafaelsoares  ( 2015-07-09 14:32:32 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2015-07-09 12:09:36 -0500

rafaelsoares gravatar image

updated 2015-07-09 20:52:48 -0500

allenh1 gravatar image

I changed

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

to

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

and I can see the map. Thank you a lot.

edit flag offensive delete link more

Comments

1

Could you please accept this as the correct answer?

allenh1 gravatar image allenh1  ( 2015-07-09 20:53:45 -0500 )edit

Sure, how?

rafaelsoares gravatar image rafaelsoares  ( 2015-07-10 11:53:08 -0500 )edit
1

Just click the check next beneath the up/down arrow. Just so I can close it.

allenh1 gravatar image allenh1  ( 2015-07-10 14:39:52 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2015-07-08 13:04:08 -0500

Seen: 2,564 times

Last updated: Jul 09 '15