irsim.world.map.obstacle_map#
Attributes#
Classes#
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.ObjectBaseStatic 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
ObjectBaseconstructor.
- 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