Skip to main content

ROS OccupancyGrid

Adapter Type: "ros.occupancy-grid"

This adapter subscribes to a ROS OccupancyGrid topic.

Warning

The ROS component needs to be enabled within the agent for ROS adapters to function. For more information, see ROS.

Note

The source setting of an adapter which subscribes to a ROS topic is the topic path as presented in the live data viewer. This means for a ROS source of the form "/camera/rgb/points", the path is "/ros/camera/rgb/points".

The OccupancyGrid adapter is able to decode occupancy grid messages and convert them into 3D points that can be then ingested by the map component. It does this by iterating through each cell within the occupancy grid and deciding whether it belongs to one of three states; occupied, unoccupied, and unexplored. The adapter classifies cell values that are equal to -1 as unexplored, values equal to 0 as unoccupied, and values equal to 100 as occupied. By default only occupied cells are converted to points and ingested. However, the others can be enabled as desired.

Cells are converted to points based on the associated map meta data. X and Y positions for the corresponding point are calculated to the center of each cell. The points position in Z axis is fixed at 0.

Points are colored according to their classification. By default, unexplored points are colored white, unoccupied points are green, and occupied points are black. These colors can be configured.

When the adapter is writing a raster instead of voxels, the resolution can be left out of rasterSettings, in which case it is taken from the occupancy grid messages. If it is given, it must match the resolution of the grid to within 1%, or the message is dropped.

Note

The resolution of the occupancy grid is an important consideration when setting the resolution of the octree to be used in the map component. Ideally the octree should have the same or a slightly larger resolution. For example, if the occupancy grid resolution is 0.1 m then the octree resolution should be set to >= 0.1 m.

SettingTypeDescriptionDefault
sourcestringThe topic path of the OccupancyGrid message source.
ingestUnexploredboolShould the adapter ingest unexplored space when decoding the OccupancyGrid message? It is strongly not recommended to enable this for large maps.

Unexplored space is coded as cells with value == -1.
false
ingestUnoccupiedboolShould the adapter ingest unoccupied space when decoding the OccupancyGrid message.
It is not recommended to enable this for large maps.

Unoccupied space is coded as cells with value == 0.
false
ingestOccupiedboolShould the adapter ingest occupied space when decoding the OccupancyGrid message?

Occupied space is coded as cells with value == 100.
true
unexploredColor[int, int, int]The color that should be applied to points ingested as unexplored. Defaults to white.[255, 255, 255]
unoccupiedColor[int, int, int]The color that should be applied to points ingested as unoccupied. Defaults to green.[50, 255, 50]
occupiedColor[int, int, int]The color that should be applied to points ingested as occupied. Defaults to black.[20, 20, 20]

Example

"uniqueAdapterName": {
"enabled": true,
"type": "ros.occupancy-grid",
"settings": {
"source": "/ros/map",
"ingestOccupied": true,
"occupiedColor": [255, 50, 50]
}
}