Create occupancy map with probabilistic values

`occupancyMap`

creates a 2-D occupancy grid map object. Each
cell in the occupancy grid has a value representing the probability of the occupancy of
that cell. Values close to 1 represent a high probability that the cell contains an
obstacle. Values close to 0 represent a high probability that the cell is not occupied
and obstacle free.

Occupancy maps are used in navigation algorithms such as path planning (see `plannerRRT`

).
They are also used in mapping applications for finding collision-free paths, performing
collision avoidance, and calculating localization (see `monteCarloLocalization`

). You can modify your occupancy map to fit your
specific application.

The `occupancyMap`

objects support local coordinates, world
coordinates, and grid indices. The first grid location with index
`(1,1)`

begins in the top-left corner of the grid.

Use the `occupancyMap`

class to create 2-D maps of an environment
with probability values representing different obstacles in your world. You can specify
exact probability values of cells or include observations from sensors such as laser
scanners.

Probability values are stored using a binary Bayes filter to estimate the occupancy of
each grid cell. A log-odds representation is used, with values stored as
`int16`

to reduce the map storage size and allow for real-time
applications.

creates an occupancy map with a specified grid resolution in cells per meter.
`map`

= occupancyMap(`width`

,`height`

,`resolution`

)`resolution`

sets the Resolution property.

creates an occupancy map with the specified number of rows and columns and with
the resolution in cells per meter. The values of `map`

= occupancyMap(`rows`

,`cols`

,`resolution`

,'grid')`rows`

and
`cols`

sets the GridSize property.

creates an occupancy map from the values in matrix `map`

= occupancyMap(`p`

)`p`

. The
grid size matches the size of the matrix, with each cell probability value
interpreted from the matrix location.

creates an occupancy map from the specified matrix and resolution in cells per
meter.`map`

= occupancyMap(`p`

,`resolution`

)

`map = occupancyMap(`

creates an object using values from another `sourcemap`

)`occupancyMap`

object.

`map = occupancyMap(`

creates an object using values from another `sourcemap`

,`resolution`

)`occupancyMap`

object, but resamples the matrix to have the specified resolution.

`checkOccupancy` | Check locations for free, occupied, or unknown values |

`copy` | Create copy of occupancy grid |

`getOccupancy` | Get occupancy value of locations |

`grid2local` | Convert grid indices to local coordinates |

`grid2world` | Convert grid indices to world coordinates |

`inflate` | Inflate each occupied grid location |

`insertRay` | Insert ray from laser scan observation |

`local2grid` | Convert local coordinates to grid indices |

`local2world` | Convert local coordinates to world coordinates |

`move` | Move map in world frame |

`occupancyMatrix` | Convert occupancy grid to double matrix |

`raycast` | Compute cell indices along a ray |

`rayIntersection` | Find intersection points of rays and occupied map cells |

`setOccupancy` | Set occupancy value of locations |

`show` | Show grid values in a figure |

`syncWith` | Sync map with overlapping map |

`updateOccupancy` | Integrate probability observations at locations |

`world2grid` | Convert world coordinates to grid indices |

`world2local` | Convert world coordinates to local coordinates |

Occupancy values have a limited resolution of ±0.001. The values are stored as
`int16`

using a log-odds representation. This data type limits
resolution, but saves memory when storing large maps in MATLAB^{®}. When calling `setOccupancy`

and then
`getOccupancy`

, the value returned might not equal the value you
set. For more information, see the log-odds representations section in Occupancy Grids.

If memory size is a limitation, consider using `binaryOccupancyMap`

instead. The binary occupancy map uses less memory with binary values, but still works
with Navigation Toolbox™ algorithms and other applications.

`binaryOccupancyMap`

| `readOccupancyGrid`

| `writeOccupancyGrid`

| `controllerPurePursuit`

(Robotics System Toolbox) | `mobileRobotPRM`

(Robotics System Toolbox)