ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Can I get and set the cell values of the master grid inside a plug-in costmap_2d layer?

asked 2021-06-21 13:04:36 -0500

Omair Khalid gravatar image

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.

edit retag flag offensive close merge delete

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.

Mike Scheutzow gravatar image Mike Scheutzow  ( 2021-06-27 16:20:18 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-06-27 16:13:14 -0500

Mike Scheutzow gravatar image

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().

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2021-06-21 13:04:36 -0500

Seen: 92 times

Last updated: Jun 27 '21