simulo.RayCaster
Virtual ray-casting sensor for terrain/environment scanning.
Uses GPU-accelerated ray-casting (via NVIDIA Warp) to measure distances to specified meshes. Commonly used as a height scanner for locomotion.
Attributes:
pattern— Ray pattern configurationoffset— Sensor offset relative to parent framemesh_paths— List of mesh prim paths to cast rays againstray_alignment— How rays align (“yaw” or “none”)
Example:
import simulo
# Create height scannerscanner = simulo.RayCaster( pattern=simulo.RayPattern(resolution=0.1, size=(1.6, 1.0)), offset=simulo.SensorOffset(pos=(0.0, 0.0, 20.0)), ray_alignment="yaw", mesh_paths=["/World/defaultGroundPlane"], debug_vis=True,)
# Add to scenescene.add(scanner, at="/World/Robot/base/height_scanner")
# Read datahits = scanner.read_hits() # (num_envs, num_rays, 3) xyz positionsdistances = scanner.read_distances() # (num_envs, num_rays)simulo.RayCaster( path: Optional[str] = None, pattern: Optional[RayPattern] = None, offset: Optional[SensorOffset] = None, mesh_paths: Optional[List[str]] = None, ray_alignment: str = 'yaw', update_period: float = 0.02, enabled: bool = True, debug_vis: bool = False,)read_hits()
Section titled “read_hits()”RayCaster.read_hits() -> torch.TensorGet ray hit positions in world frame.
Returns:
Hit positions tensor of shape (num_envs, num_rays, 3). Each row is (x, y, z) world position where ray hit mesh.
Raises:
RuntimeError— If sensor not initialized
read_distances()
Section titled “read_distances()”RayCaster.read_distances() -> torch.TensorGet distances from sensor to hit points.
Returns:
Distances tensor of shape (num_envs, num_rays). Values are float32 in meters.
Raises:
RuntimeError— If sensor not initialized