I have a simulation with a Turtlebot3 where I use the Gazebo RGB camera plugin to retrieve visual information about the environment. My goal is to record an RGB image, run inference to detect grass areas (I use SegFormer for the inference part) and then project these areas to the map (I assume the ground is flat) to avoid these areas. The detection part already works and I am publishing an inference costmap which represents that. This can be seen in the animation below (regarding the inference; green = asphalt, red = grass, black = background/wall/unknown):
In this animation you can also see the local_costmap from move_base. What I want is to fuse these two costmaps to one costmap which move_base uses for the path planning to avoid the grassy areas. I tried several things but have issues because (1) the inference_costmap is rotating with the robot while the local_costmap doesn't, (2) the costmaps are not the same size (would interpolation be suitable for that?).
Is there a way to fuse these costmaps? Does ROS provide a utility for that? What would your suggestions be to solve that?