Read Occupancy Grid
Libraries:
ROS Toolbox /
ROS
Description
The Read Occupancy Grid block extracts map data from a ROS occupancy grid message. It accepts a
nav_msgs/OccupancyGrid message at the Msg input port and
outputs the grid as a matrix. Based on the selected output type, the Grid port
returns a probability occupancy grid with values in the range [0 1] or a
binary occupancy grid with cell values of 0 and
1.
The block can also output an ErrorCode that indicates the conversion status, including whether the message is truncated or the occupancy map is empty. Use block parameters to specify the maximum expected grid size, set replacement values for unknown cells, and define the threshold for binary conversion.
You can enable variable-size signals when the map dimensions change at run time. To configure grid size and message details automatically, use the Configure using ROS option with an active topic on a ROS network.
The ROS Read Occupancy Grid block follows the same workflow as the ROS 2 Read Occupancy Grid
block. For reference, see Visualize Occupancy Grid in Simulink from ROS 2 Message.
Ports
Input
Output
Parameters
Extended Capabilities
Version History
Introduced in R2026a