World and Grid Coordinates
When working with occupancy grids in MATLAB®, you can use either world or grid coordinates.
The absolute reference frame in which the robot operates is referred to as the world frame in the occupancy grid. Most Robotics System Toolbox™ operations are performed in the world frame, and it is the default selection when using MATLAB functions in this toolbox. World coordinates are used as an absolute coordinate frame with a fixed origin, and points can be specified with any resolution. However, all locations are converted to grid locations because of data storage and resolution limits on the map itself.
Grid coordinates define the actual resolution of the occupancy grid and the finite locations of obstacles. The origin of grid coordinates is in the top-left corner of the grid, with the first location having an index of (1,1). However, the GridLocationInWorld property of the occupancy grid in MATLAB defines the bottom-left corner of the grid in world coordinates. When creating an occupancy grid object, properties such as XWorldLimits and YWorldLimits are defined by the input width, height, and resolution. This figure shows a visual representation of these properties and the relation between world and grid coordinates.