Jump to content

Connect Leeroopedia MCP: Equip your AI agents to search best practices, build plans, verify code, diagnose failures, and look up hyperparameter defaults.

Implementation:Isaac sim IsaacGymEnvs Load Asset Meshes In Warp

From Leeroopedia
Knowledge Sources
Domains Simulation, Manipulation
Last Updated 2026-02-15 00:00 GMT

Overview

API for loading URDF/OBJ mesh assets and constructing NVIDIA Warp mesh objects for GPU-accelerated SDF queries in IndustReal assembly tasks.

Description

This implementation provides two functions that form the asset preparation pipeline for contact-rich assembly environments. load_asset_mesh_in_warp() handles a single asset file: it parses the URDF to find the referenced OBJ mesh, loads vertices and faces via trimesh, samples surface points, and creates a Warp mesh object. load_asset_meshes_in_warp() is the batch wrapper that processes arrays of plug and socket asset files, returning paired Warp meshes ready for SDF reward computation.

Usage

Use these functions during environment initialization to prepare mesh data for SDF-based reward computation. They are called once at setup time, not during the training loop. The returned Warp mesh objects and sampled points are stored as environment attributes and reused every reward computation step.

Code Reference

Source Location

  • Repository: IsaacGymEnvs
  • File: isaacgymenvs/tasks/industreal/industreal_algo_utils.py, Lines 49-96

Signature

def load_asset_mesh_in_warp(urdf_path, sample_points, num_samples, device):
    """Load a single URDF/OBJ mesh and create a Warp mesh for SDF queries.

    Args:
        urdf_path: Path to the URDF file containing mesh reference.
        sample_points: Boolean, whether to sample surface points.
        num_samples: Number of surface points to sample.
        device: Warp device string (e.g., 'cuda:0').

    Returns:
        wp_mesh: Warp mesh object for SDF queries.
        sampled_points: Tensor of sampled surface points (if sample_points=True).
    """

def load_asset_meshes_in_warp(plug_files, socket_files, num_samples, device):
    """Load all plug and socket meshes as Warp mesh objects.

    Args:
        plug_files: List of URDF file paths for plug assets.
        socket_files: List of URDF file paths for socket assets.
        num_samples: Number of surface points to sample per mesh.
        device: Warp device string.

    Returns:
        wp_plug_meshes: List of Warp mesh objects for plugs.
        wp_socket_meshes: List of Warp mesh objects for sockets.
        wp_plug_meshes_sampled_points: List of sampled point tensors for plugs.
    """

Import

from isaacgymenvs.tasks.industreal.industreal_algo_utils import load_asset_meshes_in_warp

I/O Contract

Inputs

Name Type Required Description
urdf_path str Yes Path to URDF file containing the mesh reference
plug_files list[str] Yes List of URDF file paths for plug assets
socket_files list[str] Yes List of URDF file paths for socket assets
sample_points bool Yes Whether to sample surface points on the mesh
num_samples int Yes Number of surface points to uniformly sample
device str Yes Warp device string (e.g., 'cuda:0')

Outputs

Name Type Description
wp_mesh wp.Mesh Warp mesh object supporting SDF queries via wp.mesh_query_point()
sampled_points torch.Tensor Surface points sampled uniformly on the mesh (shape: [num_samples, 3])
wp_plug_meshes list[wp.Mesh] List of Warp mesh objects for all plug assets
wp_socket_meshes list[wp.Mesh] List of Warp mesh objects for all socket assets
wp_plug_meshes_sampled_points list[torch.Tensor] Sampled surface points for each plug mesh

Usage Examples

Loading Plug and Socket Meshes

from isaacgymenvs.tasks.industreal.industreal_algo_utils import load_asset_meshes_in_warp

# Asset file lists (one per object variant)
plug_files = [
    "assets/industreal/urdf/plug_round_8mm.urdf",
    "assets/industreal/urdf/plug_round_12mm.urdf",
]
socket_files = [
    "assets/industreal/urdf/socket_round_8mm.urdf",
    "assets/industreal/urdf/socket_round_12mm.urdf",
]

# Load meshes and sample surface points
wp_plug_meshes, wp_socket_meshes, wp_plug_sampled_pts = load_asset_meshes_in_warp(
    plug_files=plug_files,
    socket_files=socket_files,
    num_samples=1000,
    device="cuda:0",
)

# wp_plug_meshes[i] is a Warp mesh for SDF queries
# wp_plug_sampled_pts[i] has shape [1000, 3] - surface points on plug i

Related Pages

Implements Principle

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment