Ask Your Question
0

Hector mapping generates empty map

asked 2014-09-21 14:49:27 -0500

serdar gravatar image

updated 2014-10-08 07:18:30 -0500

I use following launch file to run hector mapping on turtlebot. It don't gives any error also don't create any map. When I enter rosrun map_server map_saver -f ~/mymap mymap.pgm is light gray image.

Original launch file

<launch>
  <include file="$(find turtlebot_gazebo)/launch/turtlebot_empty_world.launch" />
  <include file="$(find hector_mapping)/launch/mapping_default.launch">
    <arg name="pub_map_odom_transform" value="true" />
    <arg name="base_frame" value="base_footprint" />
    <arg name="odom_frame" value="odom" />
  </include>
  <include file="$(find hector_geotiff)/launch/geotiff_mapper.launch">
    <arg name="trajectory_publish_rate" value="4" />
  </include>
  <node pkg="hector_pose_estimation" type="pose_estimation" name="hector_pose_estimation" output="screen" />
  <include file="$(find turtlebot_rviz_launchers)/launch/view_robot.launch" />
</launch>

Graph of this launch file is like this. I couldn't find the problem. rqt_graph rqt_graph

tf view_frames tf view_frames

Latest launch file

<launch>
    <include file="$(find turtlebot_gazebo)/launch/turtlebot_empty_world.launch" />
    <include file="$(find turtlebot_rviz_launchers)/launch/view_robot.launch" />
    <include file="$(find hector_mapping)/launch/mapping_default.launch">
        <arg name="pub_map_odom_transform" value="false" />
    </include>
    <include file="$(find hector_geotiff)/launch/geotiff_mapper.launch">
        <arg name="trajectory_publish_rate" value="4" />
    </include>
    <node pkg="tf" type="static_transform_publisher" name="odom_to_map" args="0 0 0 0 0 0 /map /odom 100"/>
</launch>

Bag file with /scan and /tf topics

All of the sollutions are merged as a package at Github

edit retag flag offensive close merge delete

Comments

1

cross check laser is published in base_footprint frame.

bvbdort gravatar image bvbdort  ( 2014-09-21 16:06:05 -0500 )edit

@bvbdort Is it wrong that laserscan_nodelet_manager is publishing scan? In rviz I can see laser scan in /scan topic.

serdar gravatar image serdar  ( 2014-09-22 02:32:43 -0500 )edit
1

check the frame id of laser scan it should be base_footprint or any other frame which has tf with base_footprint. Can you share your rosrun tf view_frames output.

bvbdort gravatar image bvbdort  ( 2014-09-22 02:45:41 -0500 )edit

@bvbdort I added rosrun tf view_frames output to question body.

serdar gravatar image serdar  ( 2014-09-22 03:50:30 -0500 )edit
1

what is the frame id of laser; you can view it from rostopic echo /scan

bvbdort gravatar image bvbdort  ( 2014-09-22 03:57:29 -0500 )edit
1

Also use <arg name="pub_map_odom_transform" value="false"/>

bvbdort gravatar image bvbdort  ( 2014-09-22 04:12:38 -0500 )edit

@bvbdort frame id of scan is /camera_depth_frame.

serdar gravatar image serdar  ( 2014-09-22 08:32:12 -0500 )edit
1

use <arg name="pub_map_odom_transform" value="false"/> , hope it works

bvbdort gravatar image bvbdort  ( 2014-09-22 08:35:34 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2014-09-22 14:43:13 -0500

bvbdort gravatar image

updated 2014-09-23 04:22:58 -0500

use <arg name="pub_map_odom_transform" value="false"/>

and add static tf between /map and /odom in your .launch file

<node pkg="tf" type="static_transform_publisher" name="odom_to_map" args="0 0 0 0 0 0 /map /odom 100"/>

Edit :

remove running hector_pose_estimation from launch file. Pose not required for hector slam.

<node pkg="hector_pose_estimation" type="pose_estimation" name="hector_pose_estimation" output="screen" />
edit flag offensive delete link more

Comments

Now map rotates with movement but map is empty again.

serdar gravatar image serdar  ( 2014-09-23 03:58:26 -0500 )edit

I added latest launch file to question. It is not working.

serdar gravatar image serdar  ( 2014-09-23 09:39:43 -0500 )edit

can you share your bag file with /tf and /scan topics

bvbdort gravatar image bvbdort  ( 2014-09-23 10:32:33 -0500 )edit

I added bag file to question.

serdar gravatar image serdar  ( 2014-09-23 23:20:53 -0500 )edit

@serdar i am able to see the map screen shot here but it was not proper. I used default launch file tutorial.launch in hector_slam_launch . try moving view_robot.launch before maping.launch

bvbdort gravatar image bvbdort  ( 2014-09-24 11:02:50 -0500 )edit

I don't know what problem is. First I run rosbag play hector_mapping_turtlebot.bag then roslaunch hector_slam_launch tutorial.launch. When rviz opens I add map from by topic section. There is no error but, there is no map.

serdar gravatar image serdar  ( 2014-09-25 03:50:12 -0500 )edit

first run roslaunch hector_slam_launch tutorial.launch and then rosbag play hector_mapping_turtlebot.bag --clock

bvbdort gravatar image bvbdort  ( 2014-09-25 04:35:55 -0500 )edit

@bvbdort Thanks. I see some inaccurate map. Did you have any idea what is problem and why I cannot generate map from my launch file?

serdar gravatar image serdar  ( 2014-09-25 13:03:58 -0500 )edit

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

Stats

Asked: 2014-09-21 14:49:27 -0500

Seen: 934 times

Last updated: Oct 08 '14