nav2d can't find path [closed]
Hello, I am currently tring to use the nav2d package to make my turtlebot robot do an autonomous exploration of a unknown room. I am using ROS Indigo with Ubuntu 14.04. I am using the tutorial3.launch file with some modificaitons to adapt the topics to the turtlebot, and both the costmap and the global map ( on /map topic ) are created. But when i try to use the rosservice call /StartMapping 3, i obtain
response: 0
and it goes back to command line Here are my files : tutorial3.launch
<launch>
<!-- Some general parameters -->
<param name="use_sim_time" value="false" />
<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_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" >
<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">
<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">
<remap from="goal" to="move_base_simple/goal"/>
</node>
<!-- 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" args="0 0 0 0 0 0 p3at_front_left_hub p3at_front_left_wheel 100" />
<node name="front_right_wheel" pkg="tf" type="static_transform_publisher" args="0 0 0 0 0 0 p3at_front_right_hub p3at_front_right_wheel 100" />
<node name="back_left_wheel" pkg="tf" type="static_transform_publisher" args="0 0 0 0 0 0 p3at_back_left_hub p3at_back_left_wheel 100" />
<node name="back_right_wheel" pkg="tf" type="static_transform_publisher" args="0 0 0 0 0 0 p3at_back_right_hub p3at_back_right_wheel 100" />
-->
<!-- RVIZ to view the visualization
<node name="RVIZ" pkg="rviz" type="rviz" args=" -d $(find nav2d_tutorials)/param/tutorial3.rviz" />-->
</launch>
rqt-graph http://hpics.li/b05718e
EDIT :
I tried running the rqt_console while calling the services :
When i run rosservice call /StartMapping 3
, i have an Info message saying Navigator is now initialised.
But when i run rosservice call /StartExploration 2
, i obtain a Warning message saying
Navigator is busy!
Location:
/tmp/binarydeb/ros-indigo-nav2d-navigator-0.1.4/src/RobotNavigator.cpp:receiveExploreGoal:798
then 5 min after , every second :
Robot cannot move further in this direction!
Location:
/tmp/binarydeb/ros-indigo-nav2d-operator-0.1.4/src/RobotOperator.cpp:executeCommand:268
So i tried to move the robot with Rviz, and it show an error message saying
no way between robot and goal
no way between robot and goal
The "response: 0" is normal behaviour, it just sends the command to the Navigator and returns. If nothing happens, check the ROS-Console (rqt_console) for additional hints. Make sure that the Operator can move the robot. (Add joy_node and remote_joy or manually send a msg to "cmd"-topic)
Oh, so this output is normal. As nothing happened, i though it was an error message. I will check and edit my question when i have the results from the ROS-Console. Thanks a lot for answering
When setting a goal in RVIZ, make sure to set the goal into explored and free terrain. After calling StartMapping, does the robot move? (It should move forward a bit and then turn 360°.) If not, check if the robot can move.
After calling StartMapping, nothing happen to the robot, so i think the problem comes from here. The robot can physically move ( already did mapping with gmapping before ), but is seems it cant move with nav2d. I am currently trying to add more debug messages to understand why it doesn't move.
Only the Operator is responsible for moving the robot, so you should start there. Send messages to "/cmd" and check the output on "/cmd_vel".
Thanks a lot, it was indeed a problem about /cmd_vel, who is called in my case /cmd_vel_mux/input/teleop. I changed the define in RobotOperator.h and it works.
No need to change the source code. You can just remap the topic in your launch-file...
Indeed, that's a better way, thanks for reminding me :)