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 = binaryOccupancyMap(randi([0,1], 10));
msg = rosmessage('nav_msgs/OccupancyGrid');
writeBinaryOccupancyGrid(msg, map);

Input Arguments

collapse all

Binary occupancy grid, specified as a binaryOccupancyMap 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