Can I get and set the cell values of the master grid inside a plug-in costmap_2d layer?
I know that I can modify the plugin layer itself, which can then be used by LayeredCostmap object to aggregate with other layers to produce a master grid.
However, my question is that do I have access to the master grid and its functions (setCost(), getCost()) from within the costmap_2d plugin layer? If so, which parent class enables us to access the master grid?
Thanking in anticipation.
Asked by Omair Khalid on 2021-06-21 13:04:36 UTC
Answers
My advice is to clone the navigation package, choose a simple plugin (e.g. static_layer
) and begin reading code to understand the class inheritance that has been established. A hint: within the context of the plugin, you usually obtain access to the Costmap2D
object by calling getCostmap()
.
Asked by Mike Scheutzow on 2021-06-27 16:13:14 UTC
Comments
I am not sure what you mean by "master grid". Each plugin layer is independent, so you can not reach into a different layer plugin to modify its data. The user controls the final costmap by specifying the order and characteristics of the layers.
Asked by Mike Scheutzow on 2021-06-27 16:20:18 UTC