Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version


I think your problem is (if i correctly understood you) that you are using two different maps, the one generated with ROS in the map_server (probably from some of your nav topics) and the one generated with Matlab. The thing is as you said, that when you try to publish your Matlab map in the /map topic it gets overwritten by the one generated with map_server, since map_server is always sending map messges through that topic. So you have different options:

  1. If you want to use both maps, just create a new topic for the Matlab map (/mat_map for example) and send there your map. Then you just need to change the subscribed topics for the nodes that you want to use that map from "/map" to "/mat_map".
  2. If you want to use only the map from matlab, you can just change the topic where map_server poublish the map (/map), to some weird name that no node is gonna use like (/junk_topic). This is a quite bad not optimal solution but is an easy one and works :D. Other option is just delete de map_server node.

Both options asuumes that the map generated with Matlab is in the correct format in ROS (nav_msgs/OccupancyGrid.msg for example).

I hope this helps! :D