Hector mapping generates empty map
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
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
cross check laser is published in base_footprint frame.
@bvbdort Is it wrong that laserscan_nodelet_manager is publishing scan? In rviz I can see laser scan in /scan topic.
check the frame id of laser scan it should be
base_footprint
or any other frame which has tf withbase_footprint
. Can you share yourrosrun tf view_frames
output.@bvbdort I added
rosrun tf view_frames
output to question body.what is the frame id of laser; you can view it from
rostopic echo /scan
Also use <arg name="pub_map_odom_transform" value="false"/>
@bvbdort frame id of scan is /camera_depth_frame.
use
<arg name="pub_map_odom_transform" value="false"/
> , hope it works