Beluga named requirements: OccupancyGrid2d
Occupancy grids model obstacle probability. These grids also define their own frame in the grid embedding space, adding so called global coordinates to regular (aka local) coordinates. Occupancy grids as defined in Beluga are linear grids, meaning they satisfy Beluga named requirements: LinearGrid2 requirements.
A type G satisfies OccupancyGrid2d requirements if it satisfies Beluga named requirements: LinearGrid2 and given g a possible const instance of G:
g.value_traits()returns a valuetof typeTsuch that given a grid cell data valuev:t.is_free(v)returns true if the value is consistent with a free grid cell;t.is_occupied(v)returns true if the value is consistent with an occupied grid cell;
g.origin()returns the transform, ofSophus::SE2dtype, from the global to local frame in the grid embedding space;given possibly const grid cell index
iofstd::size_ttype,g.free_at(i)returns true if such cell is free;given possibly const grid cell coordinates
xiandyiof typeint,g.free_at(xi, yi)returns true if such cell is free;given possibly const grid cell coordinates
piofEigen::Vector2itype,g.free_at(p)returns true if such cell is free;given possibly const embedding space coordinates
xandyof typedouble,g.free_near(x, y)returns true if the nearest cell is free;given possibly const embedding space coordinates
pofEigen::Vector2dtype,g.free_near(p)returns true if the nearest cell is free;given possibly const grid cell index
iofstd::size_ttype and framef,g.coordinates_at(i, f)returns embedding space coordinates in the corresponding frame as anEigen::Vector2dvalue;given a possibly const range
rof grid cell coordinates or indices and framef,g.coordinates_for(r, f)returns a range of embedding space coordinates in the corresponding frame asEigen::Vector2dvalues;g.free_cells()returns a range ofstd::size_tindices to free grid cells;g.obstacle_mask()returns a range ofboolvalues, representing grid cell occupancy;g.unknown_mask()returns a range ofboolvalues, representing the unkwnown space of the grid cells;