Ask Your Question

Nav2d call getmap service failed

asked 2015-04-10 10:05:59 -0500

Furane gravatar image


I already asked a question here. I received no answer but I found a way to work around the problem. I'm currently still trying to use the exploration service provided by nav2d. I solved my problem of map building by changing the mapper node by the gmapping one. But now I'm still not able to call the StartMapping and StartExplore services. I got this message: "Could not get a map." I looked at the code to find the not respected condition and I found that:

ros::ServiceClient mGetMapClient = robotNode.serviceClient<nav_msgs::GetMap>(std::string("get_map"));
nav_msgs::GetMap srv;
ROS_INFO("Could not get a map.");
return false;

Have you any idea of what to do when a service doesn't work? And particularly this one?

Thank you in advance for any answer!

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2015-04-13 02:46:32 -0500

Sebastian Kasperski gravatar image

updated 2015-04-14 06:29:02 -0500

Have you checked whether the service names match? Gmapping names the service "dynamic_map", while the Navigator defaults to "get_map". You can use the Navigator's "map_service" parameter to tell it what service to call for the map.

Edit: Can you read my comments? Something seems broken... It helps to visualize both global map and local costmap in RVIZ to see what is actually happening.

Can you post a sceenshot from RVIZ with the map, costmap and the green/blue movement indicators? However, if your laser reports an obstacle, the Operator will try to avoid it. There is probably little you can do about that from the costmap-side. Maybe you can pre-filter the laser scan?

edit flag offensive delete link more

answered 2015-04-13 07:55:08 -0500

Furane gravatar image

updated 2015-04-15 07:21:19 -0500

Thank you very much, this solved my problem. But now the robot is easily stuck because of the obstacles. Which parameters can I change in the costmap and navigator configuration files to decrease the obstacle influence?

edit: I can only read your edit text and I see no comments. I used RVIZ to visualize the map as you said and I noticed two things: the turtlebot does a lot of circle because sometimes it isn't able to detect part of the map without obstacle: ( it's because of the bad laser quality) and it's not able to go between two obstacles (1m). The blue navigation line is good but not the green corrected line. I think it's because the costmap is too large for obstacles.

edit_2: Finally I changed of robot and I use an Hokuyo laser instead of the Kinect. All the nav2d packages are now working well and I'm able to use the default mapper node to build a map. Thank you very much for your answers.

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

1 follower


Asked: 2015-04-10 10:05:59 -0500

Seen: 474 times

Last updated: Apr 15 '15