nav2d /StartExploration 2 fails (turtlebot2)
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:
header:
seq: 0
stamp:
secs: 1458916639
nsecs: 760211716
frame_id: map
goal_id:
stamp:
secs: 1458916639
nsecs: 760217219
id: /Explore-1-1458916639.760217219
goal:
---
EDIT 3:
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:
<launch>
<!-- 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" />
</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" >
</node>
And here is my launch file to start up the robot with the laser scanner and minimal.launch:
<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: https://github.com/ros/nodelet_core/issues/7 -->
<arg name="scan_topic" value="/scan" />
</include>
</launch>
Can anyone help me out?
Asked by pgigioli on 2016-03-23 14:26:47 UTC
Answers
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.
Asked by Sebastian Kasperski on 2016-03-30 02:40:45 UTC
Comments
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.
Asked by pgigioli on 2016-03-30 09:03:45 UTC
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.
Asked by Sebastian Kasperski on 2016-03-30 10:27:55 UTC
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.
Asked by pgigioli on 2016-03-30 12:01:31 UTC
Which exploration strategy are you using? (Default is NearestFrontier) Have you tried restarting the exploration after the robot moved out of this room?
Asked by Sebastian Kasperski on 2016-03-31 02:15:53 UTC
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.
Asked by pgigioli on 2016-03-31 09:00:08 UTC
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?
Asked by pgigioli on 2016-03-31 09:03:23 UTC
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.
Asked by Sebastian Kasperski on 2016-03-31 09:57:21 UTC
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.
Asked by Sebastian Kasperski on 2016-03-31 10:04:54 UTC
Thanks, I'll look into that. In the mean time, I would really like to get your implementation to work as I feel that I am so close. Is there any parameter that might limit the exploration boundary? Maybe the boundary is too small and no empty cells are found.
Asked by pgigioli on 2016-03-31 10:32:15 UTC
No, bounded exploration is not implemented. It will always continue until no reachable frontiers are found.
Asked by Sebastian Kasperski on 2016-04-03 08:49:28 UTC
So does Nav2D work, or is it recommended to just switch to frontier_exploration? I can't seem to find any answer on here, which got nav2d to run with the turtlebot
Asked by mengeler on 2017-01-30 08:40:50 UTC
I am facing a similar problem - I am using turtlebot3 on gazebo, and get the 'NO way between robot and goal' error, sometime during the autonomous exploration. I wanted to ask which map resolution should I try to increase - the local costmap or the mapper's resolution parameter... Also, I have set the robot_Radius to 0.3 and map_inflation_radius to 1.0, it'd be great if you could let me know if there's something wrong with these parameters.
Asked by aditi741997 on 2020-09-20 02:08:01 UTC
Comments
I am facing the same problem of map not getting published. How did you resolve it? Could you please help out?
Asked by ankur74 on 2016-04-24 20:47:58 UTC
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.
Asked by pgigioli on 2016-04-24 22:18:04 UTC