Ask Your Question
1

Map not received when using nav2d with gazebo

asked 2016-03-20 13:50:06 -0500

pgigioli gravatar image

updated 2016-03-22 16:01:36 -0500

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
edit retag flag offensive close merge delete

Comments

1

Were you able to resolve this issue, I am facing the same problem with my turtlebot.

ankur74 gravatar imageankur74 ( 2016-04-24 21:02:11 -0500 )edit

Can you post the output from rqt_graph and "rosrun tf view_frames"? Are there any warnings or errors in rqt_console?

Sebastian Kasperski gravatar imageSebastian Kasperski ( 2016-04-26 02:14:57 -0500 )edit

Did you solved this problem? I'm also getting this error, and I couldn't create map turtlebot3+gazebo+nav2d.

gokhan.acer gravatar imagegokhan.acer ( 2019-07-09 10:18:57 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
1

answered 2017-08-20 07:07:41 -0500

Caesarion gravatar image

Hi, I probably faced the same problem (TurtleBot + Gazebo + nav2d) and this solved it:

<param name="/laser_frame" value="base_footprint" />

Just add this line to your modified tutorial3.launch file. Mapper should be able to process the scan data now.

edit flag offensive delete link more

Comments

Your solution doen not work me. I still have same issue .

gokhan.acer gravatar imagegokhan.acer ( 2019-07-09 10:20:04 -0500 )edit

Setting the laser_frame to base_footprint doesn't seem right to me. It should be the frame where your laser device (the origin of the generated scans) sits on your robot.

Sebastian Kasperski gravatar imageSebastian Kasperski ( 2019-07-12 06:51:33 -0500 )edit
0

answered 2019-07-12 07:05:54 -0500

gokhan.acer gravatar image

I've solved using gmapping instead of nav2d. And also, I changed "static_map" to "dynamic_map" in ros.yaml. I'm using Turtlebot3 simulation. But it couldn't create all map in turtlebot3_house.launch environment. I think, the area of world is big. Robot sometimes lost . Maybe costmap parameters can be tunning.

This is main launch file:

<launch>

<!-- Some general parameters -->
<param name="use_sim_time" value="true" />
<param name="/laser_frame" value="base_footprint" />
<rosparam file="$(find nav2d_tutorials)/param/ros.yaml"/>

<!-- Turtlebot3 -->
<arg name="model" default="$(env TURTLEBOT3_MODEL)" doc="model type [burger, waffle, waffle_pi]"/>

<include file="$(find turtlebot3_bringup)/launch/turtlebot3_remote.launch">
    <arg name="model" value="$(arg model)" />
</include>

<!-- Start Gazebo simulator with a given environment -->
<include file="$(find turtlebot3_gazebo)/launch/turtlebot3_house.launch"></include>

<!-- Start Stage simulator with a given environment >
<node name="Stage" pkg="stage_ros" type="stageros" args="$(find nav2d_tutorials)/world/tutorial.world">
    <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="/base_scan" to="/scan"/-->
    <rosparam file="$(find nav2d_tutorials)/param/operator.yaml"/>
    <rosparam file="$(find nav2d_tutorials)/param/costmap.yaml" ns="local_map" />
</node>

<!--SLAM: Gmapping, Cartographer, Hector, Karto, Frontier_exploration, RTAB-Map -->
<include file="$(find turtlebot3_slam)/launch/turtlebot3_gmapping.launch">
    <rosparam file="$(find nav2d_launch)/param/mapper.yaml"/>
</include>

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

<!-- RVIZ to view the visualization -->
<node name="RVIZ" pkg="rviz" type="rviz" args=" -d $(find nav2d_tutorials)/param/tutorial3.rviz" />

</launch>

This is 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: dynamic_map # static_map
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

3 followers

Stats

Asked: 2016-03-20 13:50:06 -0500

Seen: 869 times

Last updated: Jul 12