# Nav2d call getmap service failed

Hello,

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;
if(!mGetMapClient.call(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?

edit retag close merge delete

Sort by » oldest newest most voted

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?

more

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: http://hpics.li/e0e94ff ( 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.

more