Map not received when using nav2d with gazebo
I'm trying to use nav2d to autonomously map out an environment in gazebo but I am unable to get the gmapping nav2d node "mapper" to publish a /map msg. First I launch the turtlebot_gazebo/turtlebot_world.launch to start the turtlebot in gazebo and then I launch a modified version of the nav2d tutorial3.launch file.
In RVIZ, I get an error message under the map section that says "no map received" and "No transform [] to [map]. The output of rostopic echo /map is "WARNING: no messages received and simulated time is active.Is /clock being published?" I checked /clock and it is publishing so that is not the issue.
Also, when I run turtlebot_gazebo/gmapping_demo instead of nav2d, a /map msg is published correctly so I don't think its an issue with my gazebo configuration. My guess is that the nav2d "mapper" node is connected to the wrong laser frame but I have tried changing the base frame from base_laser_link to base_laser and to camera_depth_frame and neither worked.
Rqt_graph shows a /scan msg being published to mapper and a /map msg being published to RVIZ.
Below are my launch file and ros.yaml file which defines the parameters for nav2d.
Here is my current launch file:
<launch>
<!-- Some general parameters -->
<param name="use_sim_time" value="true" />
<rosparam file="$(find nav2d_tutorials)/param/ros.yaml"/>
<!-- Start Stage simulator with a given environment -->
<!--<node name="Stage" pkg="stage_ros" type="stageros" args="$(find nav2d_t$
<param name="base_watchdog_timeout" value="0" />
</node>
-->
<!-- Start the Operator to control the simulated robot -->
<node name="Operator" pkg="nav2d_operator" type="operator" >
<!-- <remap from="scan" to="base_scan"/> -->
<remap from="cmd_vel" to="cmd_vel_mux/input/teleop" />
<rosparam file="$(find nav2d_tutorials)/param/operator.yaml"/>
<rosparam file="$(find nav2d_tutorials)/param/costmap.yaml" ns="loc$
</node>
<!-- Start Mapper to genreate map from laser scans -->
<node name="Mapper" pkg="nav2d_karto" type="mapper">
<!--<remap from="scan" to="base_scan"/>-->
<rosparam file="$(find nav2d_tutorials)/param/mapper.yaml"/>
</node>
<!-- Start the Navigator to move the robot autonomously -->
<node name="Navigator" pkg="nav2d_navigator" type="navigator">
<rosparam file="$(find nav2d_tutorials)/param/navigator.yaml"/>
</node>
<node name="GetMap" pkg="nav2d_navigator" type="get_map_client" />
<node name="Explore" pkg="nav2d_navigator" type="explore_client" />
<node name="SetGoal" pkg="nav2d_navigator" type="set_goal_client" />
<!-- Start the joystick-driver and remote-controller for operation-->
<!-- <node name="Joystick" pkg="joy" type="joy_node" />
<node name="Remote" pkg="nav2d_remote" type="remote_joy" />
-->
<!-- Pioneer model for fancy visualization -->
<!-- Comment this out if you do not have the package 'p2os' available! -->
<!-- <include file="$(find p2os_urdf)/launch/pioneer3at_urdf.launch" />
<node name="front_left_wheel" pkg="tf" type="static_transform_publisher" ar$
<node name="front_right_wheel" pkg="tf" type="static_transform_publisher" a$
<node name="back_left_wheel" pkg="tf" type="static_transform_publisher" arg$
<node name="back_right_wheel" pkg="tf" type="static_transform_publisher" ar$
-->
<!-- RVIZ to view the visualization -->
<node name="RVIZ" pkg="rviz" type="rviz" args=" -d $(find nav2d_tutorials)/$
</launch>
ros.yaml file:
###########################################################
# Defines topics services and frames for all modules
### TF frames #############################################
laser_frame: base_laser_link
robot_frame: base_link
odometry_frame: odom
offset_frame: offset
map_frame: map
### ROS topics ############################################
map_topic: map
laser_topic: scan ## ORIG = base_scan
### ROS services ##########################################
map_service: static_map
Were you able to resolve this issue, I am facing the same problem with my turtlebot.
Can you post the output from rqt_graph and "rosrun tf view_frames"? Are there any warnings or errors in rqt_console?
Did you solved this problem? I'm also getting this error, and I couldn't create map turtlebot3+gazebo+nav2d.