Agent Skills › isaac-sim/IsaacSim › occupancy-map

occupancy-map

GitHub

从USD场景生成ROS兼容的占用栅格地图,支持Nav2导航及感知训练。通过PhysX碰撞或USD投影两种路径导出,包含故障排查与脚本使用说明。

.claude/skills/occupancy-map/SKILL.md isaac-sim/IsaacSim

触发场景

需要为机器人导航系统生成占用地图 从USD场景导出ROS格式的occupancy grid 配置Nav2或MobilityGen的路径规划数据

安装

npx skills add isaac-sim/IsaacSim --skill occupancy-map -g -y
更多选项

非标准路径

npx skills add https://github.com/isaac-sim/IsaacSim/tree/develop/.claude/skills/occupancy-map -g -y

不安装直接使用

npx skills use isaac-sim/IsaacSim@occupancy-map

指定 Agent (Claude Code)

npx skills add isaac-sim/IsaacSim --skill occupancy-map -a claude-code -g -y

安装 repo 全部 skill

npx skills add isaac-sim/IsaacSim --all -g -y

预览 repo 内 skill

npx skills add isaac-sim/IsaacSim --list

SKILL.md

Frontmatter
{
    "name": "occupancy-map",
    "license": "Apache-2.0",
    "metadata": {
        "author": "Renato Gasoto <info@nvidia.com>"
    },
    "description": "Export ROS occupancy grids (map.yaml\/png) from USD for Nav2. Not for footprints, A*, or kinematics (use navigation-primitives)."
}

Warehouse Occupancy Map Generation

Purpose

Export ROS-compatible occupancy grids from USD scenes via the omap extension or a USD-projection fallback for Nav2, MobilityGen, and A* planners.

Prerequisites

  • Built Isaac Sim exposing isaacsim.asset.gen.omap (or a USD stage for the projection fallback).
  • $ISAAC_SIM_DIR pointing at _build/linux-x86_64/release; numpy, scipy, Pillow for the projection/export path.
  • For Path 1 (collider-based), prims must have Collisions Enabled and the timeline must be playing.

Limitations

  • Path 1 requires authored PhysX colliders; prototype scenes without CollisionAPI fall through to USD projection.
  • Output is a 2D top-down grid at a single height band; multi-floor or overhanging geometry is not represented.
  • Path 2 (projection) ignores physics collision approximations and is only a prototype substitute.

Troubleshooting

Error / symptom Cause Solution
_omap import fails isaacsim.asset.gen.omap not built or offline Use generate_occupancy_map.py — it falls back to USD projection
Zero occupied cells Prims lack colliders or timeline not playing Enable Collisions and play(commit=True), or use Path 2
Map extent clipped / empty Wrong origin or lower/upper bounds Set bounds to cover the facility; origin must be a free cell

Generate ROS-compatible occupancy maps from USD warehouse scenes for navigation and perception training. Two paths: the documented isaacsim.asset.gen.omap extension (PhysX-collider-based, GUI + Python), and a direct USD-projection fallback for prototypes or non-collider scenes.

Available Scripts

Script Purpose Arguments
scripts/generate_occupancy_map.py Unified entry point — tries colliders, falls back to USD projection see script --help
scripts/usd_projection_pipeline.py Direct USD-projection occupancy map pipeline (Path 2 only) see script --help

Running scripts

From agent runtimes that expose skill execution helpers, invoke helpers with run_script():

run_script("scripts/usd_projection_pipeline.py", args=["--help"])

From a built Isaac Sim tree, run the same file with ./python.sh (Linux) or python.bat (Windows) from _build/*/release, or execute shell helpers directly when they do not require the simulator.

When to use

  • Nav2 / MobilityGen / A* path planning setup.
  • Perception training data generation.
  • AMR fleet path planning validation.
  • Collision-avoidance buffer-zone calculation.

Automatic Fallback (recommended entry point)

Use scripts/generate_occupancy_map.py for all occupancy-map generation. It attempts the collider-based Path 1 first and automatically falls back to USD projection (Path 2) when:

  • The isaacsim.asset.gen.omap extension is not importable (offline / no runtime).
  • The PhysX overlap query returns zero occupied cells (prototype assets without CollisionAPI).
  • The generator raises any exception (missing stage, timeline not playing, etc.).
from generate_occupancy_map import generate_occupancy_map

grid = generate_occupancy_map("warehouse.usd", output_dir="./maps", resolution=0.1)

Or from the command line:

python generate_occupancy_map.py warehouse.usd --output_dir ./maps --resolution 0.1

Path 1 (recommended): isaacsim.asset.gen.omap extension

Documented in docs/isaacsim/digital_twin/ext_isaacsim_asset_generator_occupancy_map.rst (Mapping). The extension uses physics collision geometry, so every prim you want captured must have Collisions Enabled; the Start location cannot be occupied.

GUI workflow

  1. Open the stage.
  2. Tools > Robotics > Occupancy Map.
  3. Set Origin (free point inside the area), Lower/Upper Bound (clamp the mapped extent), Cell Size, optionally toggle Use PhysX Collision Geometry.
  4. CALCULATE, then VISUALIZE IMAGE to preview.
  5. From the visualization window: Save Image (PNG) and Save YAML (ROS occupancy-map parameters file).

Python (programmatic, simulation playing)

from isaacsim.asset.gen.omap.bindings import _omap
import omni.physx
import omni.usd

physx   = omni.physx.acquire_physx_interface()
stage_id = omni.usd.get_context().get_stage_id()

generator = _omap.Generator(physx, stage_id)
generator.update_settings(
    cell_size=0.1,         # meters per pixel
    z_min=0.1,             # height to map at (m above origin)
    z_max=0.0,             # 0 = use cell_size
    occupancy_threshold=0.5,
)
generator.set_transform(origin=(0, 0, 0), lo_offset=(-10, -10, 0), hi_offset=(10, 10, 0))
generator.generate2d()
buffer = generator.get_buffer()    # raw occupancy data

Requires the timeline to be playing for PhysX raycasts. For headless runs, pair with app_utils.play(commit=True).

Path 2 (fallback): direct USD projection

Use when the scene lacks colliders, you need a deterministic projection from authored geometry, or you are prototyping with placeholder cubes. Faster and reproducible for those cases but does not respect physics collision approximations.

1. Extract Obstacles from USD

Read all prims, project XY footprint onto 2D grid. Filter by height to separate navigable floor markings from solid obstacles.

extract_obstacles_from_usd(usd_path, resolution, facility_width, facility_depth, robot_height_min, robot_height_max, skip_prefixes) — returns a uint8 grid (1=free, 2=occupied).

See scripts/usd_projection_pipeline.py.

2. Apply Robot Buffer

from scipy.ndimage import binary_dilation

ROBOT_RADIUS = 0.5  # meters
buffer_px = int(ROBOT_RADIUS / RESOLUTION)
kernel_size = 2 * buffer_px + 1
kernel = np.zeros((kernel_size, kernel_size), dtype=bool)
for r in range(kernel_size):
    for c in range(kernel_size):
        if (r - buffer_px)**2 + (c - buffer_px)**2 <= buffer_px**2:
            kernel[r, c] = True
buffered = binary_dilation((grid == 2), structure=kernel)

3. Export ROS Format

export_ros_map(grid, output_dir, resolution) — writes map.png (grayscale, ROS standard) and map.yaml to output_dir.

See scripts/usd_projection_pipeline.py.

4. Generate Colored Visualization

color = np.zeros((grid_h, grid_w, 3), dtype=np.uint8)
color[grid == 1] = [255, 255, 255]  # white=free
color[grid == 2] = [0, 0, 0]        # black=occupied
color[buffered & (grid != 2)] = [255, 200, 200]  # pink=buffer
Image.fromarray(color, 'RGB').save("map_colored.png")

Key Design Decisions

What to Mark as Obstacles

  • INCLUDE: Racks, GSRC modules, docks, tables, pack stations, conveyors (they're elevated but have supports), VLMs, sort equipment, walls, columns
  • EXCLUDE: Floor plane, fire lane markings, AMR route overlays, human walkway markings, forklift lane markings, humans (they move), AMR robots (they move), exit signs, stairs (navigable)

Height Filtering

  • z_max < 0.05m → floor marking, skip (route overlays are at z=0.02-0.04)
  • z_min > 2.0m → above robot, skip (overhead conveyors at z=6+, HVAC at z=13+)
  • Everything else in the 0.05-2.0m band → obstacle

Resolution Selection

Use Case Resolution Grid Size (220×180m)
Coarse planning 0.5m/px 440×360
Standard nav 0.1m/px 2200×1800
Fine perception 0.05m/px 4400×3600

Robot Buffer Sizing

Robot Type Radius Buffer
Small AMR (e.g. MiR100) 0.3m 0.4m
Standard AMR (e.g. MiR250) 0.5m 0.6m
Forklift 1.0m 1.2m
Human (for walkway planning) 0.3m 0.5m

Isaac Sim OccupancyMap Class

For integration with MobilityGen path planning:

from isaacsim.replicator.mobility_gen.impl.occupancy_map import OccupancyMap
omap = OccupancyMap.from_ros_yaml("map.yaml")
omap_buffered = omap.buffered_meters(0.5)
# Use with A* planner, spawn placement, etc.

Coordinate Conventions

  • USD world: X=east, Y=north, Z=up (meters)
  • Image: row 0 = top = max Y (north), col 0 = left = min X (west)
  • ROS origin: [x, y, yaw] of bottom-left pixel in world coords
  • world_to_pixel: world_x / resolution = col, (max_y - world_y) / resolution = row

版本历史

  • 2469084 当前 2026-09-22 15:45

同 Skill 集合

.claude/skills/action-and-event-data-generation/SKILL.md
.claude/skills/actor-sdg-generate-lighting-variations/SKILL.md
.claude/skills/actor-sdg-sweep-config/SKILL.md
.claude/skills/behavior-tree-generation/SKILL.md
.claude/skills/calibrate-metropolis-camera/SKILL.md
.claude/skills/data-collection-sim/SKILL.md
.claude/skills/generate-incident-config/SKILL.md
.claude/skills/isaac-camera/SKILL.md
.claude/skills/isaac-sim-assets/SKILL.md
.claude/skills/isaac-sim-headless-deployment/SKILL.md
.claude/skills/isaac-sim-installation/SKILL.md
.claude/skills/isaac-sim-migration/SKILL.md
.claude/skills/isaac-sim-orchestrator/SKILL.md
.claude/skills/isaac-sim-remote/SKILL.md
.claude/skills/isaac-sim-rendering/SKILL.md
.claude/skills/isaac-sim-robot-navigation/SKILL.md
.claude/skills/isaac-sim-ros-workspaces/SKILL.md
.claude/skills/isaac-sim-ros2-bridge/SKILL.md
.claude/skills/isaac-sim-sensor/SKILL.md
.claude/skills/isaac-sim-troubleshooting/SKILL.md
.claude/skills/isaac-sim-validator/SKILL.md
.claude/skills/isaac-sim-workflow/SKILL.md
.claude/skills/manipulation-ik/SKILL.md
.claude/skills/meta-skills/SKILL.md
.claude/skills/mobility-gen/SKILL.md
.claude/skills/motion-generation/SKILL.md
.claude/skills/navigation-primitives/SKILL.md
.claude/skills/object-bin-packing/SKILL.md
.claude/skills/physics-simulation/SKILL.md
.claude/skills/place-camera-aim-at/SKILL.md
.claude/skills/place-camera-max-coverage/SKILL.md
.claude/skills/profile-isaac-sim/SKILL.md
.claude/skills/run-incident-events/SKILL.md
.claude/skills/skill-distillation/SKILL.md
.claude/skills/skills-eval-triage/SKILL.md
.claude/skills/spatial-reasoning/SKILL.md
.claude/skills/urdf-mjcf-to-usd-conversion/SKILL.md
.claude/skills/usd-articulation/SKILL.md
.claude/skills/usd-composition-architecture/SKILL.md
.claude/skills/usd-pipeline/SKILL.md
.claude/skills/validation-diff-gifs/SKILL.md
.claude/skills/vlm-scene-captioning/SKILL.md
skills/action-and-event-data-generation/SKILL.md
skills/actor-sdg-generate-lighting-variations/SKILL.md
skills/actor-sdg-sweep-config/SKILL.md
skills/behavior-tree-generation/SKILL.md
skills/calibrate-metropolis-camera/SKILL.md
skills/data-collection-sim/SKILL.md
skills/generate-incident-config/SKILL.md

元信息

文件数
0
版本
2469084
Hash
c43f929f
收录时间
2026-09-22 15:45

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-09-25 04:28
浙ICP备14020137号-1