99
1010import torch
1111from dataclasses import dataclass
12- from typing import TYPE_CHECKING
1312
14- if TYPE_CHECKING :
15- import warp as wp
13+ import warp as wp
1614
17- from isaaclab_arena .assets .object_base import ObjectBase
15+ from isaaclab_arena .assets .object_base import ObjectBase
1816
1917
2018@dataclass (slots = True )
2119class MeshPairCache :
22- """Precomputed per-pair collision data for the vectorized multi-mesh kernel."""
20+ """Precomputed per-pair collision data for the vectorized multi-mesh kernel.
21+
22+ Dimensions: P = num_pairs (ordered subject/obstacle pairs), B = batch_size (num envs),
23+ S = total_spheres (sum of sphere counts across all P pairs; each subject object is decomposed
24+ into multiple covering spheres via greedy_sphere_decomposition).
25+ """
2326
2427 all_centers_local : torch .Tensor
2528 """(S, 3) sphere centers in each subject's local frame, concatenated across pairs."""
@@ -28,34 +31,34 @@ class MeshPairCache:
2831 """(S,) sphere radii, concatenated across pairs."""
2932
3033 pair_subject_objs : list [ObjectBase ]
31- """Per-pair subject (sphere source) object reference."""
34+ """(P,) subject (sphere source) object reference per pair ."""
3235
3336 pair_obstacle_objs : list [ObjectBase ]
34- """Per-pair obstacle (mesh target) object reference."""
37+ """(P,) obstacle (mesh target) object reference per pair ."""
3538
3639 pair_is_anchor : list [bool ]
37- """Per-pair flag: True if the obstacle is a static anchor."""
40+ """(P,) True if the obstacle is a static anchor."""
3841
3942 pair_anchor_pos : list [torch .Tensor | None ]
40- """Per-pair world position for anchor obstacles (None for non-anchor obstacles )."""
43+ """(P,) world position for anchor obstacles (None for non-anchors )."""
4144
4245 pair_anchor_yaw : list [float ]
43- """Per-pair anchor yaw in radians (0.0 for non-anchor obstacles )."""
46+ """(P,) anchor yaw in radians (0.0 for non-anchors )."""
4447
4548 pair_subject_bbox_min : torch .Tensor
46- """(P, B, 3) subject bbox min corners for broadphase ."""
49+ """(P, B, 3) subject bbox min corners for overlap filtering ."""
4750
4851 pair_subject_bbox_max : torch .Tensor
49- """(P, B, 3) subject bbox max corners for broadphase ."""
52+ """(P, B, 3) subject bbox max corners for overlap filtering ."""
5053
5154 pair_obstacle_bbox_min : torch .Tensor
52- """(P, B, 3) obstacle bbox min corners for broadphase ."""
55+ """(P, B, 3) obstacle bbox min corners for overlap filtering ."""
5356
5457 pair_obstacle_bbox_max : torch .Tensor
55- """(P, B, 3) obstacle bbox max corners for broadphase ."""
58+ """(P, B, 3) obstacle bbox max corners for overlap filtering ."""
5659
5760 pair_max_radius : torch .Tensor
58- """(P,) max sphere radius per pair (broadphase margin)."""
61+ """(P,) max sphere radius per pair (overlap filter margin)."""
5962
6063 sphere_pair_id : torch .Tensor
6164 """(S,) maps each sphere to its pair index for segment reduction."""
@@ -67,7 +70,7 @@ class MeshPairCache:
6770 """(P,) number of spheres per pair (for mean reduction)."""
6871
6972 mesh_id_array : wp .array
70- """Warp uint64 array of mesh IDs for the multi-mesh kernel."""
73+ """(num_unique_meshes,) Warp uint64 array of mesh IDs for the multi-mesh kernel."""
7174
7275 num_pairs : int
7376 """Total number of active object pairs."""
0 commit comments