%% Read An OccupancyGrid Message from ROS
%
% Create a nav_msgs/OccupancyGrid ROS message.

msg = rosmessage('nav_msgs/OccupancyGrid');

%
% Populate the ROS occupancy grid message with data.

msg.Info.Height = 10;
msg.Info.Width = 10;
msg.Info.Resolution = 0.1;
msg.Data = 100*rand(100,1);

%
% Read the msg data and convert to an OccupancyGrid object.

map = readOccupancyGrid(msg);

% Copyright 2012 The MathWorks, Inc.