This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


Write values from grid to ROS message





writeBinaryOccupancyGrid(msg,map) writes occupancy values and other information to the ROS message, msg, from the binary occupancy grid, map.


collapse all

Create occupancy grid and message. Write the map onto the message.

map = robotics.BinaryOccupancyGrid(randi([0,1], 10));
msg = rosmessage('nav_msgs/OccupancyGrid');
writeBinaryOccupancyGrid(msg, map);

Input Arguments

collapse all

Binary occupancy grid, specified as a BinaryOccupancyGrid object handle. map is converted to a 'nav_msgs/OccupancyGrid' message on the ROS network. map is an object with a grid of binary values, where 1 indicates an occupied location and 0 indications an unoccupied location.

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

Introduced in R2015a