Using two static layered costmaps to make restricted areas
Hi there!
I have a small question, that seems to be simple, but it's been bothering me a lot for weeks on end. I've been working trying to make a robot capable of navigating autonomously, and it's been working fine. However, I'd like to restrict some parts of the map, even if the robot theorically should be able to navigate through them, for the sake of making a better navigation and creating restricted spaces.
I've struggled a lot with that recently, until I stumbled into that the solution might be using layered costmaps. I've been using layered costmaps (VoxelLayer for dynamic obstacles, StaticLayer for the map, Inflation, etc), but not for this purpose. I'd like to make a map for dynamic obstacles, that won't be detected by the LIDAR but they will still be restricted. And, for this, I've read that I can make a second costmap with my restricted map.
However, how do I do this? As far as I understand, I'd need to call the map from another topic that's not /map, but how do I publish the second map in this new topic? I've been using the map_server in the launch for the /map to run, and I don't know how to make that work to another topic in a new map. Besides, is this really the right approach? Will the use of two layered static costmaps help my case?
Thanks in advance!
Hi, did you manage to stack the two static_layer ? I'm trying the exact same approach in ROS2 Foxy, but the resulting global_costmap only uses one of the static_layer (the last one published it seems) (while both map can be visualized correctly independently in rviz2 and used correctly in the costmap if there is only one static_layer) Setting the
map_topic
anduse_maximum
as suggested below and here for ROS1 did not solve the problem... Did you succeed ?