Rosanswers logo


Im trying to create a map from a bag file using the gmapping. I have done everything using the tutorial http://www.ros.org/wiki/slam_gmapping/Tutorials/MappingFromLoggedData but when I tried to save the map with the map server it was just waited for the map and nothing happened. My bag file has camera, imu and laser scans. The topics are imu/data and scan.

Here is my launch file

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

<node name="rosplay" pkg="rosbag" type="play" args="/home/2011-04-01-14-19-39.bag  --clock"/>

    <node pkg="tf" type="static_transform_publisher" name="baselink_laser" args="0 0 0 0 0 0 /scanmatcher_frame /laser 10"/>
    <node pkg="tf" type="static_transform_publisher" name="laser_imu" args="0 0 0 0 0 0 /laser /base_imu 10"/>

    <node pkg="gmapping" type="slam_gmapping" name="slam_gmapping" output="screen">
    <param name="base_frame" value="scanmatcher_frame"/>
        <param name="odom_frame" value="scanmatcher_frame"/>
    <param name="map_frame" value="map"/>

<!-- Start an rviz node with a custom configuration for the viewpoint, map_server, trajectory, laser scans, etc -->
<node pkg="rviz" type="rviz" output="screen" name="rviz" args="-d $(find pow_analyzer)/launch/pow_rviz.vcg"/>

Any help

Originally posted by Astronaut on ROS Answers with karma: 330 on 2013-04-11

Post score: 0

Original comments

Comment by felix k on 2013-04-12:
Does your gmapping work? What output does it give?

Comment by Astronaut on 2013-04-16:
No . I can not get work . I attached the launch file.


1 Answer 1


Rosanswers logo

You are missing odometry in the bag file. gmapping requires that to work.

You can try hector_mapping for a SLAM approach that works without odometry or provide some to gmapping.

Originally posted by dornhege with karma: 31395 on 2013-04-17

This answer was ACCEPTED on the original site

Post score: 2

Original comments

Comment by Astronaut on 2013-04-17:
so I need like virtual odometry. I can provide virtual odometry from hector_mapping and feed that to gmapping or??

Comment by dornhege on 2013-04-17:
Ideally you need real odometry. If you already have hector_mapping, you shouldn't need to run gmapping on top of that?

Comment by Astronaut on 2013-04-17:
Yes, I already have hector_mapping. So What do you mean to run gmapping on the top of that?? So what do I need??

Comment by dornhege on 2013-04-17:
Only one of those. They solve the same problem.

Comment by Astronaut on 2013-04-17:
I do not understand how to run gmapping on the top of hector_mapping. Please can you tell me that??

Comment by dornhege on 2013-04-17:
My point is that you should NOT need to do that, unless you know what you want to achieve. The default is to use either one.

Comment by Astronaut on 2013-04-17:
I just wont to compare the two maps from gmapping and hector_mapping and use AMCL and robot_pose_ekf with both of them and also compare the estimated pose. OK?

Comment by dornhege on 2013-04-18:
The easiest would be to run them one after another on the same log.

Comment by Astronaut on 2013-04-18:
Ok. Just a comment, normally which methods gives a better map??Hector or Gmapping?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.