ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

nav2d /StartExploration 2 fails (turtlebot2)

asked 2016-03-23 14:26:47 -0600

pgigioli gravatar image

updated 2016-03-30 09:02:03 -0600

I'm trying to implement the nav2d autonomous mapping with my turtlebot2 using this tutorial but I am having issues with my navigator node. So far, I am able to run the rosservice call /StartMapping 3 successfully and an initial map is generated. But when I run rosservice call /StartExploration 2, nothing happens and I receive no errors. I even get the message "success: True; message: Send ExploreGoal to Navigator"

Also, the sending a goal manually using the "2D Nav Goal" tool in rviz works.

EDIT: Using the rqt_console while running the services I get "Navigator is now initialized" when I run /StartMapping 3 and when I run /StartExploration 2 it says "Exploration has finished" even though the robot doesn't move at all.

EDIT 2: I ran rostopic echo on the "/Explore/goal" msg when I run /StartExploration and it looks like the Explore node isn't sending any goal to the navigator. The output is:

   seq: 0
       secs: 1458916639
       nsecs: 760211716
   frame_id: map
       secs: 1458916639
       nsecs: 760217219
   id: /Explore-1-1458916639.760217219



Here is the image of the initial map that is created after running /StartMapping 3


Here is my rqt_graph:


Here is my tf view_frames pdf:


Here is my customized tutorial3 launch file:


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

    <!-- 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="mobile_base/commands/velocity"/>
            <rosparam file="$(find nav2d_tutorials)/param/operator.yaml"/>
            <rosparam file="$(find nav2d_tutorials)/param/costmap.yaml" ns="local_map" />

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

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



And here is my launch file to start up the robot with the laser scanner and minimal.launch:

     <include file="$(find turtlebot_bringup)/launch/minimal.launch"/>
             <arg name="custom_param_file" default="$(find turtlebot_navigation)/param/dummy.yaml"/>
     <include file="$(find turtlebot_bringup)/launch/3dsensor.launch">
             <arg name="rgb_processing" value="false" />
             <arg name="depth_registration" value="false" />
             <arg name="depth_processing" value="false" />

     <!-- We must specify an absolute topic name because if not it will be prefixed by "$(arg camera)".
        Probably is a bug in the nodelet manager: -->
             <arg name="scan_topic" value="/scan" />


Can anyone help me out?

edit retag flag offensive close merge delete


I am facing the same problem of map not getting published. How did you resolve it? Could you please help out?

ankur74 gravatar image ankur74  ( 2016-04-24 20:47:58 -0600 )edit

I actually was never able to get nav2d working. Instead, I used the frontier_exploration package combined with standard gmapping to get autonomous mapping to work.

pgigioli gravatar image pgigioli  ( 2016-04-24 22:18:04 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2016-03-30 02:40:45 -0600

Sebastian Kasperski gravatar image

The Navigator says it has finished the exploration, that is why it is not sending any commands. (The robot is supposed to stop after the map has been fully explored.) Can you post the map that was generated so far? Most likely the robot_radius parameter in the Navigator is too large, so the robot cannot reach any unexplored areas in the map.

edit flag offensive delete link more


Thanks for your response! I have edited my original question with a picture of the map that is generated. The robot radius in the navigator.yaml is 0.2 and I am using a turtlebot 2. The map_inflation radius is 0.5.

pgigioli gravatar image pgigioli  ( 2016-03-30 09:03:45 -0600 )edit

0.2 seems okay, have you tried to move the robot out of this room by setting a move-goal in rviz? Also your map resolution is very low, which can be a problem when doors are only slightly broader then the robot. Try to a higher map resolution and then check the navigation by setting a goal.

Sebastian Kasperski gravatar image Sebastian Kasperski  ( 2016-03-30 10:27:55 -0600 )edit

I doubled the mapping resolution and tried setting a move-goal in rviz outside of the map and everything works fine. I am able to complete tutorials 1 and 2 successfully. It's only the explore node from tutorial 3 that doesnt seem to work for me.

pgigioli gravatar image pgigioli  ( 2016-03-30 12:01:31 -0600 )edit

Which exploration strategy are you using? (Default is NearestFrontier) Have you tried restarting the exploration after the robot moved out of this room?

Sebastian Kasperski gravatar image Sebastian Kasperski  ( 2016-03-31 02:15:53 -0600 )edit

I'm using NearestFrontier. I moved the robot out of the robot and still the same issue. I get the message "success: True" and "message: Send ExploreGoal to Navigator" but this goal is blank.

pgigioli gravatar image pgigioli  ( 2016-03-31 09:00:08 -0600 )edit

I'm considering replacing the explore node with this exploration package. The problem is that this algorithm sends geometry_msgs/poseStamped whereas your explore node sends simple goals. Any idea on how I could transform the actionlib interface?

pgigioli gravatar image pgigioli  ( 2016-03-31 09:03:23 -0600 )edit

It is perfectly fine that the goal is blank, it just tells the Navigator to start the exploration. (Check actionlib to see what "goal" means in this context)

You can use another exploration package and let it call the Navigator's MoveToPosition2D action.

Sebastian Kasperski gravatar image Sebastian Kasperski  ( 2016-03-31 09:57:21 -0600 )edit

Note that the different [*_client] nodes are just for convenience when using RVIZ or the command line. Every interaction between other nodes and the Navigator should be done via actionlib interface as described here.

Sebastian Kasperski gravatar image Sebastian Kasperski  ( 2016-03-31 10:04:54 -0600 )edit

Question Tools

1 follower


Asked: 2016-03-23 14:26:47 -0600

Seen: 640 times

Last updated: Mar 30 '16