antioch-py 2.0.6__py3-none-any.whl → 2.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of antioch-py might be problematic. Click here for more details.
- antioch/session/__init__.py +15 -13
- antioch/session/ark.py +22 -26
- antioch/session/objects/__init__.py +40 -0
- antioch/session/{views → objects}/animation.py +25 -52
- antioch/session/{views → objects}/articulation.py +30 -95
- antioch/session/{views → objects}/basis_curve.py +18 -54
- antioch/session/{views → objects}/camera.py +12 -39
- antioch/session/objects/collision.py +46 -0
- antioch/session/{views → objects}/geometry.py +6 -22
- antioch/session/{views → objects}/ground_plane.py +5 -20
- antioch/session/{views → objects}/imu.py +10 -30
- antioch/session/{views → objects}/joint.py +5 -20
- antioch/session/{views → objects}/light.py +14 -66
- antioch/session/{views → objects}/pir_sensor.py +20 -62
- antioch/session/{views → objects}/radar.py +18 -29
- antioch/session/{views → objects}/rigid_body.py +25 -110
- antioch/session/{views → objects}/xform.py +24 -24
- antioch/session/scene.py +152 -162
- antioch/session/session.py +34 -43
- antioch/session/task.py +2 -16
- {antioch_py-2.0.6.dist-info → antioch_py-2.1.0.dist-info}/METADATA +1 -1
- {antioch_py-2.0.6.dist-info → antioch_py-2.1.0.dist-info}/RECORD +34 -48
- common/ark/hardware.py +13 -37
- common/ark/kinematics.py +1 -1
- common/core/agent.py +28 -0
- common/message/__init__.py +2 -0
- common/message/pir.py +7 -5
- common/message/velocity.py +11 -0
- common/session/__init__.py +1 -24
- common/session/config.py +390 -0
- common/session/sim.py +36 -147
- antioch/session/views/__init__.py +0 -40
- antioch/session/views/collision.py +0 -75
- common/session/views/__init__.py +0 -263
- common/session/views/animation.py +0 -73
- common/session/views/articulation.py +0 -184
- common/session/views/basis_curve.py +0 -102
- common/session/views/camera.py +0 -147
- common/session/views/collision.py +0 -59
- common/session/views/geometry.py +0 -102
- common/session/views/ground_plane.py +0 -41
- common/session/views/imu.py +0 -66
- common/session/views/joint.py +0 -81
- common/session/views/light.py +0 -96
- common/session/views/pir_sensor.py +0 -115
- common/session/views/radar.py +0 -82
- common/session/views/rigid_body.py +0 -236
- common/session/views/viewport.py +0 -21
- common/session/views/xform.py +0 -39
- {antioch_py-2.0.6.dist-info → antioch_py-2.1.0.dist-info}/WHEEL +0 -0
- {antioch_py-2.0.6.dist-info → antioch_py-2.1.0.dist-info}/entry_points.txt +0 -0
- {antioch_py-2.0.6.dist-info → antioch_py-2.1.0.dist-info}/top_level.txt +0 -0
antioch/session/scene.py
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
from typing import Literal, overload
|
|
2
2
|
|
|
3
3
|
from antioch.session.ark import Ark
|
|
4
|
-
from antioch.session.
|
|
5
|
-
from antioch.session.views import (
|
|
4
|
+
from antioch.session.objects import (
|
|
6
5
|
Animation,
|
|
7
6
|
Articulation,
|
|
8
7
|
BasisCurve,
|
|
@@ -22,40 +21,38 @@ from antioch.session.views import (
|
|
|
22
21
|
set_collision,
|
|
23
22
|
set_pir_material,
|
|
24
23
|
)
|
|
24
|
+
from antioch.session.session import SessionContainer
|
|
25
25
|
from common.core import ContainerSource, get_asset_path
|
|
26
26
|
from common.core.agent import Agent
|
|
27
27
|
from common.message import Pose, Vector3
|
|
28
|
-
from common.session.
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
28
|
+
from common.session.config import (
|
|
29
|
+
ArticulationConfig,
|
|
30
|
+
ArticulationJointConfig,
|
|
31
|
+
BodyType,
|
|
32
|
+
CameraConfig,
|
|
33
|
+
CameraMode,
|
|
34
|
+
DistortionModel,
|
|
35
|
+
GeometryConfig,
|
|
36
|
+
GeometryType,
|
|
37
|
+
GroundPlaneConfig,
|
|
38
|
+
ImuConfig,
|
|
39
|
+
JointAxis,
|
|
40
|
+
JointConfig,
|
|
41
|
+
JointType,
|
|
42
|
+
LightConfig,
|
|
43
|
+
LightType,
|
|
44
|
+
MeshApproximation,
|
|
45
|
+
PirSensorConfig,
|
|
46
|
+
RadarConfig,
|
|
47
|
+
RigidBodyConfig,
|
|
42
48
|
)
|
|
43
|
-
from common.session.
|
|
44
|
-
from common.session.
|
|
45
|
-
from common.session.views.geometry import GeometryConfig, GeometryType, MeshApproximation # noqa: F401
|
|
46
|
-
from common.session.views.ground_plane import GroundPlaneConfig
|
|
47
|
-
from common.session.views.imu import ImuConfig
|
|
48
|
-
from common.session.views.joint import JointAxis, JointConfig, JointType
|
|
49
|
-
from common.session.views.light import LightConfig, LightType
|
|
50
|
-
from common.session.views.pir_sensor import PirSensorConfig
|
|
51
|
-
from common.session.views.radar import RadarConfig
|
|
52
|
-
from common.session.views.rigid_body import BodyType, RigidBodyConfig
|
|
53
|
-
from common.session.views.viewport import SetActiveViewportCamera, SetCameraView
|
|
49
|
+
from common.session.environment import SessionEnvironment
|
|
50
|
+
from common.session.sim import PrimAttributeValue, SceneQueryResponse, SceneTarget, SimulationInfo, SimulationTime
|
|
54
51
|
|
|
55
52
|
|
|
56
53
|
class Scene(SessionContainer):
|
|
57
54
|
"""
|
|
58
|
-
Singleton wrapper for scene-level operations
|
|
55
|
+
Singleton wrapper for scene-level operations.
|
|
59
56
|
|
|
60
57
|
Uses a lazy singleton pattern - the first instantiation or call to get_current()
|
|
61
58
|
creates the instance, and all subsequent calls return the same instance.
|
|
@@ -67,9 +64,8 @@ class Scene(SessionContainer):
|
|
|
67
64
|
scene = Scene() # or Scene.get_current()
|
|
68
65
|
scene.clear()
|
|
69
66
|
scene.toggle_ui(show_ui=False)
|
|
70
|
-
scene.set_speed(1.0)
|
|
71
67
|
scene.play()
|
|
72
|
-
scene.step(
|
|
68
|
+
scene.step(dt_us=1_000_000)
|
|
73
69
|
|
|
74
70
|
# Add views
|
|
75
71
|
geometry = scene.add_geometry(path="/World/box", ...)
|
|
@@ -277,34 +273,28 @@ class Scene(SessionContainer):
|
|
|
277
273
|
|
|
278
274
|
self._session.query_sim_rpc(
|
|
279
275
|
endpoint="set_simulation_controls",
|
|
280
|
-
payload=
|
|
281
|
-
max_physics_dt_us
|
|
282
|
-
render_interval_us
|
|
283
|
-
|
|
276
|
+
payload={
|
|
277
|
+
"max_physics_dt_us": max_physics_dt_us,
|
|
278
|
+
"render_interval_us": render_interval_us,
|
|
279
|
+
},
|
|
284
280
|
)
|
|
285
281
|
|
|
286
282
|
def clear(self, timeout: float = 30.0) -> None:
|
|
287
283
|
"""
|
|
288
284
|
Clear and completely reset the scene.
|
|
289
285
|
|
|
290
|
-
Stops any running Ark before clearing the scene.
|
|
291
|
-
restarts it to reset telemetry with the same configuration.
|
|
286
|
+
Stops any running Ark before clearing the scene.
|
|
292
287
|
|
|
293
288
|
:param timeout: Timeout in seconds for stopping the Ark.
|
|
294
289
|
"""
|
|
295
290
|
|
|
296
|
-
from antioch.session.task import Task
|
|
297
|
-
|
|
298
291
|
# Always try to stop the Ark via the agent (idempotent)
|
|
299
292
|
self._agent.stop_ark(timeout=timeout)
|
|
300
293
|
self._ark = None
|
|
301
294
|
|
|
302
|
-
# Clear the simulation
|
|
295
|
+
# Clear the simulation scene completely
|
|
303
296
|
self._session.query_sim_rpc(endpoint="clear")
|
|
304
297
|
|
|
305
|
-
# Clear any existing task
|
|
306
|
-
Task.get_current().clear()
|
|
307
|
-
|
|
308
298
|
def restart(self) -> None:
|
|
309
299
|
"""
|
|
310
300
|
Restart the simulation container.
|
|
@@ -316,8 +306,6 @@ class Scene(SessionContainer):
|
|
|
316
306
|
Note: This function will not return as the process will be killed immediately.
|
|
317
307
|
"""
|
|
318
308
|
|
|
319
|
-
from antioch.session.task import Task
|
|
320
|
-
|
|
321
309
|
# Always try to stop the Ark via the agent (idempotent)
|
|
322
310
|
self._agent.stop_ark()
|
|
323
311
|
self._ark = None
|
|
@@ -325,9 +313,6 @@ class Scene(SessionContainer):
|
|
|
325
313
|
# Restart the RPC container
|
|
326
314
|
self._session.query_sim_rpc(endpoint="restart")
|
|
327
315
|
|
|
328
|
-
# Clear any existing task
|
|
329
|
-
Task.get_current().clear()
|
|
330
|
-
|
|
331
316
|
def toggle_ui(self, show_ui: bool) -> None:
|
|
332
317
|
"""
|
|
333
318
|
Toggle the Isaac Sim UI visibility.
|
|
@@ -337,7 +322,7 @@ class Scene(SessionContainer):
|
|
|
337
322
|
|
|
338
323
|
self._session.query_sim_rpc(
|
|
339
324
|
endpoint="toggle_ui",
|
|
340
|
-
payload=
|
|
325
|
+
payload={"show_ui": show_ui},
|
|
341
326
|
)
|
|
342
327
|
|
|
343
328
|
def set_camera_view(
|
|
@@ -356,11 +341,11 @@ class Scene(SessionContainer):
|
|
|
356
341
|
|
|
357
342
|
self._session.query_sim_rpc(
|
|
358
343
|
endpoint="set_camera_view",
|
|
359
|
-
payload=
|
|
360
|
-
eye
|
|
361
|
-
target
|
|
362
|
-
camera_prim_path
|
|
363
|
-
|
|
344
|
+
payload={
|
|
345
|
+
"eye": Vector3.from_any(eye),
|
|
346
|
+
"target": Vector3.from_any(target),
|
|
347
|
+
"camera_prim_path": camera_prim_path,
|
|
348
|
+
},
|
|
364
349
|
)
|
|
365
350
|
|
|
366
351
|
def set_active_viewport_camera(self, camera_prim_path: str) -> None:
|
|
@@ -372,7 +357,7 @@ class Scene(SessionContainer):
|
|
|
372
357
|
|
|
373
358
|
self._session.query_sim_rpc(
|
|
374
359
|
endpoint="set_active_viewport_camera",
|
|
375
|
-
payload=
|
|
360
|
+
payload={"camera_prim_path": camera_prim_path},
|
|
376
361
|
)
|
|
377
362
|
|
|
378
363
|
def get_prim_attribute(self, path: str, attribute_name: str) -> float | int | str | bool | list[float]:
|
|
@@ -388,9 +373,9 @@ class Scene(SessionContainer):
|
|
|
388
373
|
"""
|
|
389
374
|
|
|
390
375
|
return self._session.query_sim_rpc(
|
|
391
|
-
endpoint="get_prim_attribute_value",
|
|
376
|
+
endpoint="scene/get_prim_attribute_value",
|
|
392
377
|
response_type=PrimAttributeValue,
|
|
393
|
-
payload=
|
|
378
|
+
payload={"path": path, "attribute_name": attribute_name},
|
|
394
379
|
).value
|
|
395
380
|
|
|
396
381
|
def set_prim_attribute(self, path: str, attribute_name: str, value: float | int | str | bool | list[float]) -> None:
|
|
@@ -407,8 +392,8 @@ class Scene(SessionContainer):
|
|
|
407
392
|
"""
|
|
408
393
|
|
|
409
394
|
self._session.query_sim_rpc(
|
|
410
|
-
endpoint="set_prim_attribute_value",
|
|
411
|
-
payload=
|
|
395
|
+
endpoint="scene/set_prim_attribute_value",
|
|
396
|
+
payload={"path": path, "attribute_name": attribute_name, "value": value},
|
|
412
397
|
)
|
|
413
398
|
|
|
414
399
|
def query_scene(self, root_path: str = "/World", target: SceneTarget | None = None) -> SceneQueryResponse:
|
|
@@ -425,9 +410,9 @@ class Scene(SessionContainer):
|
|
|
425
410
|
"""
|
|
426
411
|
|
|
427
412
|
return self._session.query_sim_rpc(
|
|
428
|
-
endpoint="
|
|
413
|
+
endpoint="scene/query_hierarchy",
|
|
429
414
|
response_type=SceneQueryResponse,
|
|
430
|
-
payload=
|
|
415
|
+
payload={"root_path": root_path, "target": target},
|
|
431
416
|
)
|
|
432
417
|
|
|
433
418
|
def add_asset(
|
|
@@ -484,18 +469,18 @@ class Scene(SessionContainer):
|
|
|
484
469
|
if not asset_file_path:
|
|
485
470
|
raise ValueError("Asset file path is required")
|
|
486
471
|
self._session.query_sim_rpc(
|
|
487
|
-
endpoint="add_asset",
|
|
488
|
-
payload=
|
|
489
|
-
path
|
|
490
|
-
asset_file_path
|
|
491
|
-
asset_prim_path
|
|
492
|
-
remove_articulation
|
|
493
|
-
remove_rigid_body
|
|
494
|
-
remove_sensors
|
|
495
|
-
world_pose
|
|
496
|
-
local_pose
|
|
497
|
-
scale
|
|
498
|
-
|
|
472
|
+
endpoint="scene/add_asset",
|
|
473
|
+
payload={
|
|
474
|
+
"path": path,
|
|
475
|
+
"asset_file_path": asset_file_path,
|
|
476
|
+
"asset_prim_path": asset_prim_path,
|
|
477
|
+
"remove_articulation": remove_articulation,
|
|
478
|
+
"remove_rigid_body": remove_rigid_body,
|
|
479
|
+
"remove_sensors": remove_sensors,
|
|
480
|
+
"world_pose": Pose.from_any(world_pose) if world_pose is not None else None,
|
|
481
|
+
"local_pose": Pose.from_any(local_pose) if local_pose is not None else None,
|
|
482
|
+
"scale": Vector3.from_any(scale) if scale is not None else None,
|
|
483
|
+
},
|
|
499
484
|
)
|
|
500
485
|
return path
|
|
501
486
|
|
|
@@ -526,7 +511,6 @@ class Scene(SessionContainer):
|
|
|
526
511
|
|
|
527
512
|
:param path: USD path for the geometry.
|
|
528
513
|
:param geometry_type: Type of geometry (sphere, cube, cylinder, cone, capsule, mesh).
|
|
529
|
-
:param name: Optional unique name for the view.
|
|
530
514
|
:param radius: Radius for sphere/cylinder/cone/capsule.
|
|
531
515
|
:param height: Height for cylinder/cone/capsule.
|
|
532
516
|
:param size: Size for cube (uniform).
|
|
@@ -598,7 +582,6 @@ class Scene(SessionContainer):
|
|
|
598
582
|
Add an articulation to the scene.
|
|
599
583
|
|
|
600
584
|
:param path: USD path for the articulation.
|
|
601
|
-
:param name: Optional unique name for the view.
|
|
602
585
|
:param joint_configs: Per-joint configurations (stiffness, damping, limits, etc).
|
|
603
586
|
:param solver_position_iterations: Number of position iterations for the solver.
|
|
604
587
|
:param solver_velocity_iterations: Number of velocity iterations for the solver.
|
|
@@ -656,7 +639,6 @@ class Scene(SessionContainer):
|
|
|
656
639
|
:param path: USD path for the joint.
|
|
657
640
|
:param parent_path: USD path to parent body.
|
|
658
641
|
:param child_path: USD path to child body.
|
|
659
|
-
:param name: Optional unique name for the view.
|
|
660
642
|
:param pose: Joint pose relative to parent (defaults to identity).
|
|
661
643
|
:param joint_type: Type of joint motion (FIXED, REVOLUTE, PRISMATIC).
|
|
662
644
|
:param axis: Axis of motion for non-fixed joints.
|
|
@@ -714,7 +696,6 @@ class Scene(SessionContainer):
|
|
|
714
696
|
Add rigid body physics to the scene.
|
|
715
697
|
|
|
716
698
|
:param path: USD path for the rigid body.
|
|
717
|
-
:param name: Optional unique name for the view.
|
|
718
699
|
:param body_type: Body type (dynamic or kinematic).
|
|
719
700
|
:param mass: Mass in kg.
|
|
720
701
|
:param density: Density in kg/m³ (alternative to mass).
|
|
@@ -778,7 +759,6 @@ class Scene(SessionContainer):
|
|
|
778
759
|
Add a light to the scene.
|
|
779
760
|
|
|
780
761
|
:param path: USD path for the light.
|
|
781
|
-
:param name: Optional unique name for the view.
|
|
782
762
|
:param light_type: Type of light (sphere, rect, disk, cylinder, distant, dome).
|
|
783
763
|
:param intensity: Light intensity.
|
|
784
764
|
:param exposure: Light exposure value.
|
|
@@ -833,7 +813,6 @@ class Scene(SessionContainer):
|
|
|
833
813
|
Add an xform to the scene.
|
|
834
814
|
|
|
835
815
|
:param path: USD path for the xform.
|
|
836
|
-
:param name: Optional unique name for the view.
|
|
837
816
|
:param world_pose: Optional world pose as Pose (or dict with position/orientation lists).
|
|
838
817
|
:param local_pose: Optional local pose as Pose (or dict with position/orientation lists).
|
|
839
818
|
:param scale: Optional scale as Vector3 (or list/tuple of 3 floats).
|
|
@@ -944,8 +923,7 @@ class Scene(SessionContainer):
|
|
|
944
923
|
"""
|
|
945
924
|
Add a ground plane to the scene.
|
|
946
925
|
|
|
947
|
-
:param path: USD path for the ground plane
|
|
948
|
-
:param name: Optional unique name for the view.
|
|
926
|
+
:param path: USD path for the ground plane.
|
|
949
927
|
:param size: Size of the ground plane in meters.
|
|
950
928
|
:param z_position: Z position of the ground plane.
|
|
951
929
|
:param color: RGB color as Vector3 (or list/tuple of 3 floats) with values 0-1 (defaults to gray).
|
|
@@ -1003,7 +981,6 @@ class Scene(SessionContainer):
|
|
|
1003
981
|
Add a camera to the scene.
|
|
1004
982
|
|
|
1005
983
|
:param path: USD path for the camera.
|
|
1006
|
-
:param name: Optional unique name for the camera.
|
|
1007
984
|
:param config: Optional camera configuration (alternative to individual parameters).
|
|
1008
985
|
:param mode: Camera capture mode (RGB or depth).
|
|
1009
986
|
:param frequency: Camera update frequency in Hz.
|
|
@@ -1076,7 +1053,6 @@ class Scene(SessionContainer):
|
|
|
1076
1053
|
Add an IMU to the scene.
|
|
1077
1054
|
|
|
1078
1055
|
:param path: USD path for the IMU.
|
|
1079
|
-
:param name: Optional unique name for the IMU.
|
|
1080
1056
|
:param config: Optional IMU configuration (alternative to individual parameters).
|
|
1081
1057
|
:param frequency: Sensor update frequency in Hz (optional, defaults to physics rate).
|
|
1082
1058
|
:param linear_acceleration_filter_size: Filter window size for linear acceleration.
|
|
@@ -1132,7 +1108,6 @@ class Scene(SessionContainer):
|
|
|
1132
1108
|
Add a radar to the scene.
|
|
1133
1109
|
|
|
1134
1110
|
:param path: USD path for the radar.
|
|
1135
|
-
:param name: Optional unique name for the radar.
|
|
1136
1111
|
:param config: Optional radar configuration (alternative to individual parameters).
|
|
1137
1112
|
:param frequency: Sensor update frequency in Hz.
|
|
1138
1113
|
:param max_azimuth: Maximum azimuth angle in degrees (±FOV from center).
|
|
@@ -1281,41 +1256,6 @@ class Scene(SessionContainer):
|
|
|
1281
1256
|
|
|
1282
1257
|
return BasisCurve(path)
|
|
1283
1258
|
|
|
1284
|
-
def get_basis_curve_extents(self, path: str) -> tuple[Vector3, Vector3]:
|
|
1285
|
-
"""
|
|
1286
|
-
Get the extents of the basis curve.
|
|
1287
|
-
|
|
1288
|
-
:param path: USD path for the basis curve.
|
|
1289
|
-
:return: The extents of the basis curve.
|
|
1290
|
-
"""
|
|
1291
|
-
|
|
1292
|
-
return BasisCurve(path).get_extents()
|
|
1293
|
-
|
|
1294
|
-
def get_basis_curve_points(
|
|
1295
|
-
self, path: str, samples_per_segment: int = 10, sort_by: Literal["X", "Y", "Z"] | None = None, ascending: bool = True
|
|
1296
|
-
) -> list[Vector3]:
|
|
1297
|
-
"""
|
|
1298
|
-
Get the points of the basis curve.
|
|
1299
|
-
|
|
1300
|
-
:param path: USD path for the basis curve.
|
|
1301
|
-
:param samples_per_segment: The number of samples per segment.
|
|
1302
|
-
:param sort_by: The axis to sort the points by.
|
|
1303
|
-
:param ascending: Whether to sort the points in ascending order.
|
|
1304
|
-
:return: The points of the basis curve.
|
|
1305
|
-
"""
|
|
1306
|
-
|
|
1307
|
-
return BasisCurve(path).get_points(samples_per_segment=samples_per_segment, sort_by=sort_by, ascending=ascending)
|
|
1308
|
-
|
|
1309
|
-
def set_basis_curve_visibility(self, path: str, visible: bool) -> None:
|
|
1310
|
-
"""
|
|
1311
|
-
Set the visibility of the basis curve.
|
|
1312
|
-
|
|
1313
|
-
:param path: USD path for the basis curve.
|
|
1314
|
-
:param visible: True to make visible, False to hide.
|
|
1315
|
-
"""
|
|
1316
|
-
|
|
1317
|
-
BasisCurve(path).set_visibility(visible)
|
|
1318
|
-
|
|
1319
1259
|
def get_radar(self, path: str) -> Radar:
|
|
1320
1260
|
"""
|
|
1321
1261
|
Get existing radar from the scene.
|
|
@@ -1330,28 +1270,33 @@ class Scene(SessionContainer):
|
|
|
1330
1270
|
self,
|
|
1331
1271
|
path: str,
|
|
1332
1272
|
config: PirSensorConfig | None = None,
|
|
1333
|
-
update_rate_hz: float =
|
|
1334
|
-
max_range: float =
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1273
|
+
update_rate_hz: float = 60.0,
|
|
1274
|
+
max_range: float = 20.0,
|
|
1275
|
+
total_horiz_fov_deg: float = 150.0,
|
|
1276
|
+
sensor_side_fov_deg: float = 45.0,
|
|
1277
|
+
sensor_center_fov_deg: float = 45.0,
|
|
1278
|
+
sensor_rays_horiz: int = 128,
|
|
1279
|
+
sensor_rays_vert: int = 16,
|
|
1280
|
+
min_vertical_angle_center: float = -30.0,
|
|
1281
|
+
max_vertical_angle_center: float = 30.0,
|
|
1282
|
+
min_vertical_angle_side: float = -30.0,
|
|
1283
|
+
max_vertical_angle_side: float = 30.0,
|
|
1284
|
+
gain_center: float = 0.015,
|
|
1285
|
+
gain_sides: float = 0.01,
|
|
1286
|
+
hp_corner_hz: float = 0.4,
|
|
1287
|
+
lp_corner_hz: float = 10.0,
|
|
1342
1288
|
threshold: float | None = None,
|
|
1343
1289
|
threshold_scale: float = 1.0,
|
|
1344
|
-
|
|
1290
|
+
blind_time_s: float = 0.5,
|
|
1291
|
+
pulse_counter: int = 2,
|
|
1292
|
+
window_time_s: float = 2.0,
|
|
1293
|
+
count_mode: int = 0,
|
|
1345
1294
|
lens_transmission: float = 0.9,
|
|
1346
1295
|
lens_segments_h: int = 6,
|
|
1347
|
-
vertical_gain_falloff: float = 0.5,
|
|
1348
|
-
element_fov_overlap_deg: float = 20.0,
|
|
1349
|
-
element_scatter_gain: float = 0.1,
|
|
1350
|
-
element_fov_transition_deg: float = 15.0,
|
|
1351
1296
|
ambient_temp_c: float = 20.0,
|
|
1352
1297
|
thermal_time_constant_s: float = 0.2,
|
|
1353
|
-
pyro_responsivity: float =
|
|
1354
|
-
noise_amplitude: float =
|
|
1298
|
+
pyro_responsivity: float = 4000.0,
|
|
1299
|
+
noise_amplitude: float = 20e-6,
|
|
1355
1300
|
target_delta_t: float = 10.0,
|
|
1356
1301
|
target_distance: float = 5.0,
|
|
1357
1302
|
target_emissivity: float = 0.98,
|
|
@@ -1369,22 +1314,27 @@ class Scene(SessionContainer):
|
|
|
1369
1314
|
:param config: Optional PIR sensor configuration (alternative to individual parameters).
|
|
1370
1315
|
:param update_rate_hz: Sensor update frequency in Hz.
|
|
1371
1316
|
:param max_range: Maximum detection range in meters.
|
|
1372
|
-
:param
|
|
1373
|
-
:param
|
|
1374
|
-
:param
|
|
1375
|
-
:param
|
|
1376
|
-
:param
|
|
1317
|
+
:param total_horiz_fov_deg: Total horizontal coverage in degrees. Enables automatic fanning.
|
|
1318
|
+
:param sensor_side_fov_deg: Horizontal FOV for side sensors in degrees.
|
|
1319
|
+
:param sensor_center_fov_deg: Horizontal FOV for center sensor in degrees.
|
|
1320
|
+
:param sensor_rays_horiz: Number of rays per sensor in horizontal direction.
|
|
1321
|
+
:param sensor_rays_vert: Number of rays per sensor in vertical direction.
|
|
1322
|
+
:param min_vertical_angle_center: Minimum vertical angle for center sensor in degrees.
|
|
1323
|
+
:param max_vertical_angle_center: Maximum vertical angle for center sensor in degrees.
|
|
1324
|
+
:param min_vertical_angle_side: Minimum vertical angle for side sensors in degrees.
|
|
1325
|
+
:param max_vertical_angle_side: Maximum vertical angle for side sensors in degrees.
|
|
1326
|
+
:param gain_center: Amplifier gain for center sensor.
|
|
1327
|
+
:param gain_sides: Amplifier gain for side sensors.
|
|
1377
1328
|
:param hp_corner_hz: High-pass filter corner frequency in Hz.
|
|
1378
1329
|
:param lp_corner_hz: Low-pass filter corner frequency in Hz.
|
|
1379
1330
|
:param threshold: Detection threshold (auto-calibrated if None).
|
|
1380
1331
|
:param threshold_scale: Scale factor applied to auto-calibrated threshold.
|
|
1381
|
-
:param
|
|
1332
|
+
:param blind_time_s: Blind time after detection in seconds.
|
|
1333
|
+
:param pulse_counter: Number of pulses required to trigger detection (1-4).
|
|
1334
|
+
:param window_time_s: Window time for pulse counting in seconds.
|
|
1335
|
+
:param count_mode: Pulse counting mode (0 = sign change required, 1 = any crossing).
|
|
1382
1336
|
:param lens_transmission: Lens transmission coefficient (0-1).
|
|
1383
|
-
:param lens_segments_h: Number of horizontal lens segments (
|
|
1384
|
-
:param vertical_gain_falloff: Exponent for elevation-based gain reduction (0=uniform).
|
|
1385
|
-
:param element_fov_overlap_deg: Half-angle of center region where both elements see well (degrees).
|
|
1386
|
-
:param element_scatter_gain: Minimum gain for blocked element due to scatter/reflections (0-1).
|
|
1387
|
-
:param element_fov_transition_deg: Width of soft transition from full gain to scatter gain (degrees).
|
|
1337
|
+
:param lens_segments_h: Number of horizontal lens segments (facets).
|
|
1388
1338
|
:param ambient_temp_c: Ambient temperature in Celsius.
|
|
1389
1339
|
:param thermal_time_constant_s: Pyroelectric element thermal time constant in seconds.
|
|
1390
1340
|
:param pyro_responsivity: Pyroelectric responsivity scaling factor.
|
|
@@ -1402,22 +1352,27 @@ class Scene(SessionContainer):
|
|
|
1402
1352
|
config = PirSensorConfig(
|
|
1403
1353
|
update_rate_hz=update_rate_hz,
|
|
1404
1354
|
max_range=max_range,
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1355
|
+
total_horiz_fov_deg=total_horiz_fov_deg,
|
|
1356
|
+
sensor_side_fov_deg=sensor_side_fov_deg,
|
|
1357
|
+
sensor_center_fov_deg=sensor_center_fov_deg,
|
|
1358
|
+
sensor_rays_horiz=sensor_rays_horiz,
|
|
1359
|
+
sensor_rays_vert=sensor_rays_vert,
|
|
1360
|
+
min_vertical_angle_center=min_vertical_angle_center,
|
|
1361
|
+
max_vertical_angle_center=max_vertical_angle_center,
|
|
1362
|
+
min_vertical_angle_side=min_vertical_angle_side,
|
|
1363
|
+
max_vertical_angle_side=max_vertical_angle_side,
|
|
1364
|
+
gain_center=gain_center,
|
|
1365
|
+
gain_sides=gain_sides,
|
|
1410
1366
|
hp_corner_hz=hp_corner_hz,
|
|
1411
1367
|
lp_corner_hz=lp_corner_hz,
|
|
1412
1368
|
threshold=threshold,
|
|
1413
1369
|
threshold_scale=threshold_scale,
|
|
1414
|
-
|
|
1370
|
+
blind_time_s=blind_time_s,
|
|
1371
|
+
pulse_counter=pulse_counter,
|
|
1372
|
+
window_time_s=window_time_s,
|
|
1373
|
+
count_mode=count_mode,
|
|
1415
1374
|
lens_transmission=lens_transmission,
|
|
1416
1375
|
lens_segments_h=lens_segments_h,
|
|
1417
|
-
vertical_gain_falloff=vertical_gain_falloff,
|
|
1418
|
-
element_fov_overlap_deg=element_fov_overlap_deg,
|
|
1419
|
-
element_scatter_gain=element_scatter_gain,
|
|
1420
|
-
element_fov_transition_deg=element_fov_transition_deg,
|
|
1421
1376
|
ambient_temp_c=ambient_temp_c,
|
|
1422
1377
|
thermal_time_constant_s=thermal_time_constant_s,
|
|
1423
1378
|
pyro_responsivity=pyro_responsivity,
|
|
@@ -1484,12 +1439,7 @@ class Scene(SessionContainer):
|
|
|
1484
1439
|
|
|
1485
1440
|
return get_mesh_approximation(path)
|
|
1486
1441
|
|
|
1487
|
-
def set_pir_material(
|
|
1488
|
-
self,
|
|
1489
|
-
path: str,
|
|
1490
|
-
emissivity: float = 0.9,
|
|
1491
|
-
temperature_c: float | None = None,
|
|
1492
|
-
) -> None:
|
|
1442
|
+
def set_pir_material(self, path: str, emissivity: float = 0.9, temperature_c: float | None = None) -> None:
|
|
1493
1443
|
"""
|
|
1494
1444
|
Set PIR-specific thermal properties on a prim.
|
|
1495
1445
|
|
|
@@ -1507,6 +1457,46 @@ class Scene(SessionContainer):
|
|
|
1507
1457
|
|
|
1508
1458
|
set_pir_material(path, emissivity, temperature_c)
|
|
1509
1459
|
|
|
1460
|
+
def set_nonvisual_material(self, path: str, base: str, coating: str = "none", attribute: str = "none") -> int:
|
|
1461
|
+
"""
|
|
1462
|
+
Set non-visual material properties on all Material prims in a subtree.
|
|
1463
|
+
|
|
1464
|
+
These properties define how objects appear to RTX sensors (LiDAR and Radar).
|
|
1465
|
+
|
|
1466
|
+
Valid base materials:
|
|
1467
|
+
Metals: aluminum, steel, oxidized_steel, iron, oxidized_iron, silver, brass,
|
|
1468
|
+
bronze, oxidized_bronze_patina, tin
|
|
1469
|
+
Polymers: plastic, fiberglass, carbon_fiber, vinyl, plexiglass, pvc, nylon, polyester
|
|
1470
|
+
Glass: clear_glass, frosted_glass, one_way_mirror, mirror, ceramic_glass
|
|
1471
|
+
Other: asphalt, concrete, leaf_grass, dead_leaf_grass, rubber, wood, bark,
|
|
1472
|
+
cardboard, paper, fabric, skin, fur_hair, leather, marble, brick,
|
|
1473
|
+
stone, gravel, dirt, mud, water, salt_water, snow, ice, calibration_lambertion
|
|
1474
|
+
Default: none
|
|
1475
|
+
|
|
1476
|
+
Valid coatings: none, paint, clearcoat, paint_clearcoat
|
|
1477
|
+
|
|
1478
|
+
Valid attributes: none, emissive, retroreflective, single_sided, visually_transparent
|
|
1479
|
+
|
|
1480
|
+
Example:
|
|
1481
|
+
# Make a person visible to radar/lidar with skin material
|
|
1482
|
+
scene.set_nonvisual_material("/World/person", base="skin")
|
|
1483
|
+
|
|
1484
|
+
# Make a car with aluminum body and paint coating
|
|
1485
|
+
scene.set_nonvisual_material("/World/car", base="aluminum", coating="paint")
|
|
1486
|
+
|
|
1487
|
+
:param path: USD path of the root prim to configure.
|
|
1488
|
+
:param base: Base material type.
|
|
1489
|
+
:param coating: Coating type.
|
|
1490
|
+
:param attribute: Material attribute.
|
|
1491
|
+
:return: Number of Material prims modified.
|
|
1492
|
+
"""
|
|
1493
|
+
|
|
1494
|
+
return self._session.query_sim_rpc(
|
|
1495
|
+
endpoint="material/set_nonvisual",
|
|
1496
|
+
payload={"path": path, "base": base, "coating": coating, "attribute": attribute},
|
|
1497
|
+
response_type=int,
|
|
1498
|
+
)
|
|
1499
|
+
|
|
1510
1500
|
def _step_physics(self, dt_us: int) -> None:
|
|
1511
1501
|
"""
|
|
1512
1502
|
Step physics by dt_us.
|
|
@@ -1517,5 +1507,5 @@ class Scene(SessionContainer):
|
|
|
1517
1507
|
if dt_us > 0:
|
|
1518
1508
|
self._session.query_sim_rpc(
|
|
1519
1509
|
endpoint="step",
|
|
1520
|
-
payload=
|
|
1510
|
+
payload={"dt_us": dt_us},
|
|
1521
1511
|
)
|