Ask Your Question

Could not get a map in navigation_2d

asked 2017-05-18 04:31:40 -0500

saba.k gravatar image

Hi everyone

We are trying to use the navigation_2d package and after spawning the robot, and pressing the button which should make the robot start mapping, we get this error: Could not get a map. After pressing the button which should make the robot start exploration, we get these errors: Could not get a map. Is the robot out of the map? Exploration failed, could not get current position.

We believe that the problem is from the odometry because when we print the world_x and world_y , we get the values of 0 also mMapHeight is 0. but mMapWidth has the value of 5539489. What do you think the problem might be?

edit retag flag offensive close merge delete


There could be a lot of reasons for this problem. Try to test the components one at a time. Does the mapping work when you drive the robot manually? If not, check if the scan topic connected to the mapper and scans are send by the laser scanner. Or if a map is build, maybe the robot cannot move?

Sebastian Kasperski gravatar image Sebastian Kasperski  ( 2017-05-18 07:18:23 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2017-06-18 07:15:34 -0500

saba.k gravatar image

So we got to solve this problem by changing the serviceName in the file RobotNavigator.cpp to "dynamic_map" because we are using gmapping and not the default mapper of the package. Thank you for your answer. We have now faced another problem with the robot. The exploration starts but then the robot sometimes just stops and keeps spinning around itself. Also it keeps spinning in circles and it seems like it wants to got to the beginning of the pink path. Videos of our run are uploaded here and here and here It would be appreciated if you could take a look at them and help us.


edit flag offensive delete link more

answered 2017-07-10 03:24:05 -0500

Sebastian Kasperski gravatar image

You should not make such changes in the source code directly. Use the parameter map_service (doc) to set the name for the service.

Your video looks like the robot is becoming unresponsive in times. (Keeps going in a direction too long.) Have you checked CPU load during the run?

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: 2017-05-18 04:31:40 -0500

Seen: 106 times

Last updated: Jul 10 '17