Isaac Sim¶
Runs inside Isaac Sim (see Simulators). Importing
twinrobo.plugins.isaac works without Isaac; its classes need a running SimulationApp.
IsaacCameraTwin
¶
IsaacCameraTwin(twin: CameraTwin, camera: str | None = None, match_fov: bool = True, resolution: tuple[int, int] | None = None, device: str | device | None = None, rectify: bool = False, rt_subframes: int = 1, near_clip_m: float = 0.01, render: str = 'psf', rays_per_pixel: int = 8, pupil_views: int = 7, shading: str = 'corrected', view_oversample: float = 1.0)
A CameraTwin rendering from an Isaac Sim (USD) camera prim.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
twin
|
CameraTwin
|
The CameraTwin ( |
required |
camera
|
str | None
|
Path of a |
None
|
match_fov
|
bool
|
Render with the twin's FoV. |
True
|
resolution
|
tuple[int, int] | None
|
|
None
|
device
|
str | device | None
|
Torch device for the CameraTwin pipeline (default: the PSF bank's). |
None
|
rectify
|
bool
|
Undistort the output like vendor SDKs (see |
False
|
rt_subframes
|
int
|
RTX subframes per rendered frame (more: less ghosting after large motions, slower). |
1
|
near_clip_m
|
float
|
Near clipping distance in meters. USD's default near clip is 1 scene unit (1 m on a meter stage), which would hide what a robot camera sees up close, so the view uses this instead of the camera's. |
0.01
|
render
|
str
|
|
'psf'
|
rays_per_pixel
|
int
|
Rays traced per pixel and wavelength (ray cast). |
8
|
pupil_views
|
int
|
Shading views rendered across the lens' entrance pupil (ray cast). |
7
|
shading
|
str
|
|
'corrected'
|
view_oversample
|
float
|
Resolution of the pupil views relative to the sensor; above 1 resolves detail thinner than a pixel (ray cast). |
1.0
|
render_ideal
¶
The pinhole view: (rgb linear [1, 3, H, W], depth m [1, 1, H, W]), upright.
step renders a new frame first (omni.replicator.core.orchestrator.step,
without advancing the timeline). Pass False if your loop already rendered
this frame, e.g. with world.step(render=True).
get_frame
¶
get_frame(timestamp: float | None = None, step: bool = True, force_depth: bool = False) -> CameraFrame
Render and process one frame. frame.rgb is linear [1, 3, H, W] on device.
frame.depth is readable only if the camera's depth output is simulated
(outputs.depth in its spec) or with force_depth=True (simulator ground truth).
lens
¶
Lens-ray rendering in Isaac Sim: a USD camera as a lens scene.
The ray-cast method ("raycast") is simulator independent
(twinrobo.optics.lensrender); this module supplies Isaac's side:
- shading views across the pupil: child cameras of the camera prim (
TwinRoboPupil<i>), each shifted in the camera's own frame to a pupil cell center, with the views' wide FoV, each with a Replicator render product (rgb+distance_to_image_plane). They render in the same Replicator step as the main view. - camera pose: the camera prim's world transform (stage units -> meters).
- scene triangles: every visible gprim of the stage (meshes, cubes, spheres, cylinders, capsules, cones, planes, including instance proxies), posed per frame from USD transforms into one Warp BVH.
Limits: poses are read from USD, so a simulation must write them there (Isaac's default for scripted and physics prims); deforming meshes keep their first shape; point instancers are not ray cast.
UsdSceneMesh
¶
Bases: TriangleMesh
Every visible gprim of a USD stage as ray-cast triangles, posed per frame from USD.
IsaacLensScene
¶
IsaacLensScene(camera: str, views: PupilViews, near_clip_m: float = 0.01)
A USD camera as a lens scene (twinrobo.optics.lensrender.LensRayRenderer.render_scene).
Creates the pupil-view cameras and their render products under camera;
close removes them. The caller renders (one Replicator step renders the main
view and every pupil view) before LensRayRenderer.render_scene.
set_pinhole
¶
Give a UsdGeom.Camera a centered pinhole: fx_px pixels at width x height.
prim_triangles
¶
Local-frame triangles of a USD gprim (as RTX draws it), or None if unsupported.