CostMap2D no longer showing unknown space
Hello,
I am running ROS Hydro on Ubuntu 12.04.
I have written an application that runs alongside gmapping_demo.launch
but has its own Costmap2DROS object keeping track of the global costmap. While developing my app, I have been able to use the getCostmap()
function to get a copy of the character map. Relevant code is shown:
costmap_2d::Costmap2D* mymap = globalmap_->getCostmap();
boost::unique_lock< boost::shared_mutex > lock(*(mymap->getLock()));
mymap->saveMap("/tmp/map");
I then go through the "mymap" pointer and copy its cost values to a character array.
This used to work perfectly, but today I noticed that the saved map no longer keeps track of unknown space (cost = 255), instead just saving it as zeros, as though all unknown space was freespace. To illustrate this, here is the map generated by saveMap():
I have searched the file, and 255 does not appear anywhere.
I am quite stumped as to why this is happening. The only thing I can think of is that I allowed Ubuntu to install updates yesterday, and the navigation packages were included. Has something changed in the way they work? I am wondering if some bug was introduced.
Saving the map via rosrun map_server map_saver
still runs the way I expect it to.
If there is any more information I can provide, please let me know. Thanks in advance.
This is odd. If you run mymap->getCost(0,0) before saveMap what does it return?