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 valuet
of typeT
such 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::SE2d
type, from the global to local frame in the grid embedding space;given possibly const grid cell index
i
ofstd::size_t
type,g.free_at(i)
returns true if such cell is free;given possibly const grid cell coordinates
xi
andyi
of typeint
,g.free_at(xi, yi)
returns true if such cell is free;given possibly const grid cell coordinates
pi
ofEigen::Vector2i
type,g.free_at(p)
returns true if such cell is free;given possibly const embedding space coordinates
x
andy
of typedouble
,g.free_near(x, y)
returns true if the nearest cell is free;given possibly const embedding space coordinates
p
ofEigen::Vector2d
type,g.free_near(p)
returns true if the nearest cell is free;given possibly const grid cell index
i
ofstd::size_t
type and framef
,g.coordinates_at(i, f)
returns embedding space coordinates in the corresponding frame as anEigen::Vector2d
value;given a possibly const range
r
of grid cell coordinates or indices and framef
,g.coordinates_for(r, f)
returns a range of embedding space coordinates in the corresponding frame asEigen::Vector2d
values;g.free_cells()
returns a range ofstd::size_t
indices to free grid cells;g.obstacle_mask()
returns a range ofbool
values, representing grid cell occupancy;g.unknown_mask()
returns a range ofbool
values, representing the unkwnown space of the grid cells;