Main Content

rosReadOccupancyGrid

Read occupancy grid message

Description

map = rosReadOccupancyGrid(msg) returns an occupancyMap (Navigation Toolbox) object by reading the data inside a ROS message, msg, which must be a 'nav_msgs/OccupancyGrid' message. All message data values are converted to probabilities from 0 to 1. The unknown values (-1) in the message are set as 0.5 in the map.

Input Arguments

collapse all

'nav_msgs/OccupancyGrid' ROS message, specified as an OccupancyGrid ROS message object handle.

Output Arguments

collapse all

Occupancy map, returned as an occupancyMap (Navigation Toolbox) object handle.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Introduced in R2021a