irsim.world.map.obstacle_map#

Attributes#

Classes#

ObstacleMap

Static obstacle object backed by map line segments and optional grid data.

Module Contents#

irsim.world.map.obstacle_map.OCCUPANCY_THRESHOLD = 50#
irsim.world.map.obstacle_map.CELL_CENTER_OFFSET = 0.5#
irsim.world.map.obstacle_map.COLLISION_RADIUS_FACTOR = 0.5#
class irsim.world.map.obstacle_map.ObstacleMap(shape: dict | None = None, color: str = 'k', static: bool = True, grid_map: numpy.ndarray | None = None, grid_reso: numpy.ndarray | None = None, world_offset: list[float] | None = None, **kwargs: Any)[source]#

Bases: irsim.world.object_base.ObjectBase

Static obstacle object backed by map line segments and optional grid data.

Create an obstacle map object from a set of line segments.

Parameters:
  • shape (dict | None) – Map shape configuration with keys like {"name": "map", "reso": float, "points": array}.

  • color (str) – Display color. Default β€œk”.

  • static (bool) – Whether the object is static. Default True.

  • grid_map (np.ndarray | None) – Grid map array for fast collision detection.

  • grid_reso (np.ndarray | None) – Resolution [x_reso, y_reso] of the grid.

  • world_offset (list | None) – World offset [x, y].

  • **kwargs – Forwarded to ObjectBase constructor.

linestrings#
geometry_tree#
grid_map = None#
grid_reso#
world_offset#
check_grid_collision(geometry) bool[source]#

Check collision using grid array lookup.

Uses a two-phase approach: 1. Quick bounding box check for early rejection 2. Precise check: verify if geometry actually intersects occupied cells

Parameters:

geometry – Shapely geometry object to check collision for.

Returns:

True if collision detected, False otherwise.

Return type:

bool

is_collision(geometry) bool[source]#

Check collision against grid (if present) and map geometry.