antioch-py 2.0.6__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/__init__.py +0 -0
- antioch/message.py +87 -0
- antioch/module/__init__.py +53 -0
- antioch/module/clock.py +62 -0
- antioch/module/execution.py +278 -0
- antioch/module/input.py +127 -0
- antioch/module/module.py +218 -0
- antioch/module/node.py +357 -0
- antioch/module/token.py +42 -0
- antioch/session/__init__.py +150 -0
- antioch/session/ark.py +504 -0
- antioch/session/asset.py +65 -0
- antioch/session/error.py +80 -0
- antioch/session/record.py +158 -0
- antioch/session/scene.py +1521 -0
- antioch/session/session.py +220 -0
- antioch/session/task.py +323 -0
- antioch/session/views/__init__.py +40 -0
- antioch/session/views/animation.py +189 -0
- antioch/session/views/articulation.py +245 -0
- antioch/session/views/basis_curve.py +186 -0
- antioch/session/views/camera.py +92 -0
- antioch/session/views/collision.py +75 -0
- antioch/session/views/geometry.py +74 -0
- antioch/session/views/ground_plane.py +63 -0
- antioch/session/views/imu.py +73 -0
- antioch/session/views/joint.py +64 -0
- antioch/session/views/light.py +175 -0
- antioch/session/views/pir_sensor.py +140 -0
- antioch/session/views/radar.py +73 -0
- antioch/session/views/rigid_body.py +282 -0
- antioch/session/views/xform.py +119 -0
- antioch_py-2.0.6.dist-info/METADATA +115 -0
- antioch_py-2.0.6.dist-info/RECORD +99 -0
- antioch_py-2.0.6.dist-info/WHEEL +5 -0
- antioch_py-2.0.6.dist-info/entry_points.txt +2 -0
- antioch_py-2.0.6.dist-info/top_level.txt +2 -0
- common/__init__.py +0 -0
- common/ark/__init__.py +60 -0
- common/ark/ark.py +128 -0
- common/ark/hardware.py +121 -0
- common/ark/kinematics.py +31 -0
- common/ark/module.py +85 -0
- common/ark/node.py +94 -0
- common/ark/scheduler.py +439 -0
- common/ark/sim.py +33 -0
- common/assets/__init__.py +3 -0
- common/constants.py +47 -0
- common/core/__init__.py +52 -0
- common/core/agent.py +296 -0
- common/core/auth.py +305 -0
- common/core/registry.py +331 -0
- common/core/task.py +36 -0
- common/message/__init__.py +59 -0
- common/message/annotation.py +89 -0
- common/message/array.py +500 -0
- common/message/base.py +517 -0
- common/message/camera.py +91 -0
- common/message/color.py +139 -0
- common/message/frame.py +50 -0
- common/message/image.py +171 -0
- common/message/imu.py +14 -0
- common/message/joint.py +47 -0
- common/message/log.py +31 -0
- common/message/pir.py +16 -0
- common/message/point.py +109 -0
- common/message/point_cloud.py +63 -0
- common/message/pose.py +148 -0
- common/message/quaternion.py +273 -0
- common/message/radar.py +58 -0
- common/message/types.py +37 -0
- common/message/vector.py +786 -0
- common/rome/__init__.py +9 -0
- common/rome/client.py +430 -0
- common/rome/error.py +16 -0
- common/session/__init__.py +54 -0
- common/session/environment.py +31 -0
- common/session/sim.py +240 -0
- common/session/views/__init__.py +263 -0
- common/session/views/animation.py +73 -0
- common/session/views/articulation.py +184 -0
- common/session/views/basis_curve.py +102 -0
- common/session/views/camera.py +147 -0
- common/session/views/collision.py +59 -0
- common/session/views/geometry.py +102 -0
- common/session/views/ground_plane.py +41 -0
- common/session/views/imu.py +66 -0
- common/session/views/joint.py +81 -0
- common/session/views/light.py +96 -0
- common/session/views/pir_sensor.py +115 -0
- common/session/views/radar.py +82 -0
- common/session/views/rigid_body.py +236 -0
- common/session/views/viewport.py +21 -0
- common/session/views/xform.py +39 -0
- common/utils/__init__.py +4 -0
- common/utils/comms.py +571 -0
- common/utils/logger.py +123 -0
- common/utils/time.py +42 -0
- common/utils/usd.py +12 -0
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
from enum import Enum
|
|
2
|
+
|
|
3
|
+
from pydantic import Field
|
|
4
|
+
|
|
5
|
+
from common.message import Message, Pose
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class JointType(str, Enum):
|
|
9
|
+
"""
|
|
10
|
+
Types of joints supported by the simulator.
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
REVOLUTE = "revolute"
|
|
14
|
+
PRISMATIC = "prismatic"
|
|
15
|
+
FIXED = "fixed"
|
|
16
|
+
SPHERICAL = "spherical"
|
|
17
|
+
DISTANCE = "distance"
|
|
18
|
+
GENERIC = "generic"
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class JointAxis(str, Enum):
|
|
22
|
+
"""
|
|
23
|
+
Axis of motion for joints.
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
X = "x"
|
|
27
|
+
Y = "y"
|
|
28
|
+
Z = "z"
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class JointConfig(Message):
|
|
32
|
+
"""
|
|
33
|
+
Configuration for a joint object that connects two bodies.
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
# Joint relationships
|
|
37
|
+
parent_path: str = Field(description="USD path to parent body")
|
|
38
|
+
child_path: str = Field(description="USD path to child body")
|
|
39
|
+
|
|
40
|
+
# Transform
|
|
41
|
+
pose: Pose = Field(default_factory=Pose.identity, description="Joint pose relative to parent")
|
|
42
|
+
|
|
43
|
+
# Joint properties
|
|
44
|
+
joint_type: JointType = Field(default=JointType.FIXED, description="Type of joint motion allowed")
|
|
45
|
+
axis: JointAxis = Field(default=JointAxis.X, description="Axis of motion for non-fixed joints")
|
|
46
|
+
|
|
47
|
+
# Motion limits (for revolute: degrees, for prismatic: meters)
|
|
48
|
+
lower_limit: float | None = Field(default=None, description="Lower motion limit")
|
|
49
|
+
upper_limit: float | None = Field(default=None, description="Upper motion limit")
|
|
50
|
+
|
|
51
|
+
# Physics properties
|
|
52
|
+
friction: float = Field(default=0.01, description="Joint friction (unitless)")
|
|
53
|
+
armature: float = Field(default=0.1, description="Joint armature (kg for prismatic, kg-m^2 for revolute)")
|
|
54
|
+
|
|
55
|
+
# Special properties
|
|
56
|
+
exclude_from_articulation: bool = Field(default=False, description="Whether to exclude this joint from articulation")
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
class GetJoint(Message):
|
|
60
|
+
"""
|
|
61
|
+
Get an existing joint.
|
|
62
|
+
"""
|
|
63
|
+
|
|
64
|
+
path: str | None = Field(default=None, description="USD path of the joint prim")
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
class GetJointResponse(Message):
|
|
68
|
+
"""
|
|
69
|
+
Response from getting a joint.
|
|
70
|
+
"""
|
|
71
|
+
|
|
72
|
+
path: str
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
class AddJoint(Message):
|
|
76
|
+
"""
|
|
77
|
+
Add a joint connecting two bodies.
|
|
78
|
+
"""
|
|
79
|
+
|
|
80
|
+
path: str = Field(description="USD path for the joint")
|
|
81
|
+
config: JointConfig
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
from enum import Enum
|
|
2
|
+
|
|
3
|
+
from pydantic import Field
|
|
4
|
+
|
|
5
|
+
from common.message import Message, Pose, Vector3
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class LightType(str, Enum):
|
|
9
|
+
"""
|
|
10
|
+
Supported light types.
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
SPHERE = "sphere"
|
|
14
|
+
RECT = "rect"
|
|
15
|
+
DISK = "disk"
|
|
16
|
+
CYLINDER = "cylinder"
|
|
17
|
+
DISTANT = "distant"
|
|
18
|
+
DOME = "dome"
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class LightConfig(Message):
|
|
22
|
+
"""
|
|
23
|
+
Configuration for creating a light.
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
light_type: LightType = Field(default=LightType.SPHERE, description="Light type")
|
|
27
|
+
intensity: float = Field(default=30000.0, description="Light intensity")
|
|
28
|
+
exposure: float = Field(default=10.0, description="Light exposure")
|
|
29
|
+
color: Vector3 = Field(default_factory=Vector3.ones, description="RGB color (0-1)")
|
|
30
|
+
radius: float = Field(default=0.1, description="Radius for sphere lights (meters)")
|
|
31
|
+
width: float | None = Field(default=None, description="Width for rect lights (meters)")
|
|
32
|
+
height: float | None = Field(default=None, description="Height for rect/cylinder lights (meters)")
|
|
33
|
+
length: float | None = Field(default=None, description="Length for cylinder lights (meters)")
|
|
34
|
+
angle: float | None = Field(default=None, description="Angle for distant lights (degrees)")
|
|
35
|
+
texture_file: str | None = Field(default=None, description="Texture file for dome lights")
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
class GetLight(Message):
|
|
39
|
+
"""
|
|
40
|
+
Get an existing light source.
|
|
41
|
+
"""
|
|
42
|
+
|
|
43
|
+
path: str | None = Field(default=None, description="USD path of the light prim")
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
class GetLightResponse(Message):
|
|
47
|
+
"""
|
|
48
|
+
Response from getting a light.
|
|
49
|
+
"""
|
|
50
|
+
|
|
51
|
+
path: str
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
class AddLight(Message):
|
|
55
|
+
"""
|
|
56
|
+
Add a light source.
|
|
57
|
+
"""
|
|
58
|
+
|
|
59
|
+
path: str = Field(description="USD path for the light")
|
|
60
|
+
config: LightConfig
|
|
61
|
+
world_pose: Pose | None = Field(default=None, description="World pose (position and orientation)")
|
|
62
|
+
local_pose: Pose | None = Field(default=None, description="Local pose (translation and orientation)")
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
class SetLightIntensity(Message):
|
|
66
|
+
"""
|
|
67
|
+
Set light intensity.
|
|
68
|
+
"""
|
|
69
|
+
|
|
70
|
+
path: str
|
|
71
|
+
intensity: float
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
class SetLightColor(Message):
|
|
75
|
+
"""
|
|
76
|
+
Set light color.
|
|
77
|
+
"""
|
|
78
|
+
|
|
79
|
+
path: str
|
|
80
|
+
color: Vector3
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
class EnableLight(Message):
|
|
84
|
+
"""
|
|
85
|
+
Enable light.
|
|
86
|
+
"""
|
|
87
|
+
|
|
88
|
+
path: str
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
class DisableLight(Message):
|
|
92
|
+
"""
|
|
93
|
+
Disable light.
|
|
94
|
+
"""
|
|
95
|
+
|
|
96
|
+
path: str
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
from pydantic import Field
|
|
2
|
+
|
|
3
|
+
from common.message import Message, Pose
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class PirSensorConfig(Message):
|
|
7
|
+
"""
|
|
8
|
+
Configuration for PIR (Passive Infrared) motion sensor.
|
|
9
|
+
|
|
10
|
+
PIR sensors detect infrared radiation changes caused by moving warm objects.
|
|
11
|
+
The sensor uses a dual-element design with interleaved zones for motion detection.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
# Core sensor parameters
|
|
15
|
+
update_rate_hz: float = Field(default=60.0, description="Sensor update frequency in Hz")
|
|
16
|
+
max_range: float = Field(default=12.0, description="Maximum detection range in meters")
|
|
17
|
+
|
|
18
|
+
# Field of view
|
|
19
|
+
horiz_fov_deg: float = Field(default=90.0, description="Horizontal field of view in degrees")
|
|
20
|
+
vert_fov_deg: float = Field(default=60.0, description="Vertical field of view in degrees")
|
|
21
|
+
|
|
22
|
+
# Ray configuration
|
|
23
|
+
rays_per_h: int = Field(default=128, description="Number of rays in horizontal direction")
|
|
24
|
+
rays_per_v: int = Field(default=16, description="Number of rays in vertical direction")
|
|
25
|
+
|
|
26
|
+
# DSP / electronics parameters
|
|
27
|
+
gain: float = Field(default=0.01, description="Amplifier gain")
|
|
28
|
+
hp_corner_hz: float = Field(default=0.1, description="High-pass filter corner frequency in Hz")
|
|
29
|
+
lp_corner_hz: float = Field(default=1.0, description="Low-pass filter corner frequency in Hz")
|
|
30
|
+
|
|
31
|
+
hold_time_s: float = Field(default=2.0, description="Detection hold time in seconds")
|
|
32
|
+
|
|
33
|
+
# Lens parameters
|
|
34
|
+
lens_transmission: float = Field(default=0.9, description="Lens transmission coefficient (0-1)")
|
|
35
|
+
lens_segments_h: int = Field(default=6, description="Number of horizontal lens segments (facets)")
|
|
36
|
+
vertical_gain_falloff: float = Field(default=0.5, description="Exponent for elevation-based gain reduction (0=uniform)")
|
|
37
|
+
|
|
38
|
+
# Element vignetting parameters (models window blocking effect)
|
|
39
|
+
element_fov_overlap_deg: float = Field(default=20.0, description="Half-angle of center region where both elements see well (degrees)")
|
|
40
|
+
element_scatter_gain: float = Field(default=0.1, description="Minimum gain for blocked element due to scatter/reflections (0-1)")
|
|
41
|
+
element_fov_transition_deg: float = Field(default=15.0, description="Width of soft transition from full gain to scatter gain (degrees)")
|
|
42
|
+
|
|
43
|
+
# Environment parameters
|
|
44
|
+
ambient_temp_c: float = Field(default=20.0, description="Ambient temperature in Celsius")
|
|
45
|
+
|
|
46
|
+
# Hard-coded theshold (if not none) overrides auto-calibration
|
|
47
|
+
threshold: float | None = Field(default=None, description="Detection threshold (auto-calibrated if None)")
|
|
48
|
+
threshold_scale: float = Field(default=1.0, description="Scale factor applied to auto-calibrated threshold")
|
|
49
|
+
|
|
50
|
+
# Pyroelectric element parameters
|
|
51
|
+
thermal_time_constant_s: float = Field(default=0.2, description="Element thermal time constant in seconds")
|
|
52
|
+
pyro_responsivity: float = Field(default=1.0, description="Pyroelectric responsivity scaling factor")
|
|
53
|
+
noise_amplitude: float = Field(default=0.0, description="Thermal/electronic noise amplitude")
|
|
54
|
+
|
|
55
|
+
# Auto-threshold calibration parameters
|
|
56
|
+
target_delta_t: float = Field(default=10.0, description="Target temperature difference for threshold calibration in Celsius")
|
|
57
|
+
target_distance: float = Field(default=5.0, description="Target distance for threshold calibration in meters")
|
|
58
|
+
target_emissivity: float = Field(default=0.98, description="Target emissivity for threshold calibration")
|
|
59
|
+
target_velocity_mps: float = Field(default=1.0, description="Target velocity for threshold calibration in m/s")
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
class GetPirSensor(Message):
|
|
63
|
+
"""
|
|
64
|
+
Get an existing PIR sensor.
|
|
65
|
+
"""
|
|
66
|
+
|
|
67
|
+
path: str | None = Field(default=None, description="USD path of the PIR sensor prim")
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
class GetPirSensorResponse(Message):
|
|
71
|
+
"""
|
|
72
|
+
Response from getting a PIR sensor.
|
|
73
|
+
"""
|
|
74
|
+
|
|
75
|
+
path: str
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
class AddPirSensor(Message):
|
|
79
|
+
"""
|
|
80
|
+
Add a PIR sensor.
|
|
81
|
+
"""
|
|
82
|
+
|
|
83
|
+
path: str = Field(description="USD path for the PIR sensor")
|
|
84
|
+
config: PirSensorConfig = Field(default_factory=PirSensorConfig)
|
|
85
|
+
world_pose: Pose | None = Field(default=None, description="World pose (position and orientation)")
|
|
86
|
+
local_pose: Pose | None = Field(default=None, description="Local pose (translation and orientation)")
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
class GetPirDetectionStatus(Message):
|
|
90
|
+
"""
|
|
91
|
+
Get PIR sensor detection status.
|
|
92
|
+
"""
|
|
93
|
+
|
|
94
|
+
path: str
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
class SetPirDebugMode(Message):
|
|
98
|
+
"""
|
|
99
|
+
Enable or disable debug visualization for a PIR sensor.
|
|
100
|
+
"""
|
|
101
|
+
|
|
102
|
+
path: str
|
|
103
|
+
enabled: bool = Field(description="Whether to enable debug ray visualization")
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
class SetPirMaterial(Message):
|
|
107
|
+
"""
|
|
108
|
+
Set PIR-specific thermal properties on a prim.
|
|
109
|
+
|
|
110
|
+
These properties define how the prim appears to PIR sensors.
|
|
111
|
+
"""
|
|
112
|
+
|
|
113
|
+
path: str = Field(description="USD path of the prim to configure")
|
|
114
|
+
emissivity: float = Field(default=0.9, description="Material emissivity (0-1)")
|
|
115
|
+
temperature_c: float | None = Field(default=None, description="Surface temperature in Celsius")
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
from pydantic import Field
|
|
2
|
+
|
|
3
|
+
from common.message import Message, Pose
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class RadarConfig(Message):
|
|
7
|
+
"""
|
|
8
|
+
Configuration for RTX radar sensor.
|
|
9
|
+
|
|
10
|
+
All parameters can be customized with sensible defaults provided.
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
# Core sensor parameters
|
|
14
|
+
frequency: int = Field(default=10, description="Sensor update frequency in Hz")
|
|
15
|
+
|
|
16
|
+
# Field of view (degrees from center, so total FOV is 2x these values)
|
|
17
|
+
max_azimuth: float = Field(default=66.0, description="Maximum azimuth angle in degrees (±FOV from center)")
|
|
18
|
+
max_elevation: float = Field(default=20.0, description="Maximum elevation angle in degrees (±FOV from center)")
|
|
19
|
+
|
|
20
|
+
# Range parameters
|
|
21
|
+
max_range: float = Field(default=200.0, description="Maximum detection range in meters")
|
|
22
|
+
range_resolution: float = Field(default=0.4, description="Range resolution in meters")
|
|
23
|
+
|
|
24
|
+
# Angular resolution at boresight (center of FOV)
|
|
25
|
+
azimuth_resolution: float = Field(default=1.3, description="Azimuth resolution at boresight in degrees")
|
|
26
|
+
elevation_resolution: float = Field(default=5.0, description="Elevation resolution at boresight in degrees")
|
|
27
|
+
|
|
28
|
+
# Noise parameters (standard deviation for Gaussian noise)
|
|
29
|
+
azimuth_noise: float = Field(default=0.0, description="Azimuth measurement noise standard deviation in radians")
|
|
30
|
+
range_noise: float = Field(default=0.0, description="Range measurement noise standard deviation in meters")
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class GetRadar(Message):
|
|
34
|
+
"""
|
|
35
|
+
Get an existing radar sensor.
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
path: str | None = Field(default=None, description="USD path of the radar prim")
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
class GetRadarResponse(Message):
|
|
42
|
+
"""
|
|
43
|
+
Response from getting a radar.
|
|
44
|
+
"""
|
|
45
|
+
|
|
46
|
+
path: str
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
class AddRadar(Message):
|
|
50
|
+
"""
|
|
51
|
+
Add a radar sensor.
|
|
52
|
+
"""
|
|
53
|
+
|
|
54
|
+
path: str = Field(description="USD path for the radar")
|
|
55
|
+
config: RadarConfig
|
|
56
|
+
world_pose: Pose | None = Field(default=None, description="World pose (position and orientation)")
|
|
57
|
+
local_pose: Pose | None = Field(default=None, description="Local pose (translation and orientation)")
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
class GetRadarScan(Message):
|
|
61
|
+
"""
|
|
62
|
+
Get radar scan data.
|
|
63
|
+
"""
|
|
64
|
+
|
|
65
|
+
path: str
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
class BufferRadarRead(Message):
|
|
69
|
+
"""
|
|
70
|
+
Request to buffer current radar scan at simulation time.
|
|
71
|
+
"""
|
|
72
|
+
|
|
73
|
+
path: str
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
class GetBufferedRadarRead(Message):
|
|
77
|
+
"""
|
|
78
|
+
Request to get buffered radar scan at or before simulation time.
|
|
79
|
+
"""
|
|
80
|
+
|
|
81
|
+
path: str
|
|
82
|
+
read_sim_time: float
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
from enum import Enum
|
|
2
|
+
|
|
3
|
+
from pydantic import Field
|
|
4
|
+
|
|
5
|
+
from common.message import Message, Pose, Vector3
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class BodyType(str, Enum):
|
|
9
|
+
"""
|
|
10
|
+
Type of rigid body.
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
DYNAMIC = "dynamic"
|
|
14
|
+
KINEMATIC = "kinematic"
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class RigidBodyConfig(Message):
|
|
18
|
+
"""
|
|
19
|
+
Configuration for rigid body physics properties.
|
|
20
|
+
|
|
21
|
+
Note: Collision properties (friction, restitution, mesh approximation) are configured
|
|
22
|
+
on the geometry, not the rigid body.
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
body_type: BodyType = Field(default=BodyType.DYNAMIC, description="Type of rigid body")
|
|
26
|
+
mass: float = Field(default=1.0, description="Mass in kg")
|
|
27
|
+
density: float | None = Field(default=None, description="Density in kg/m³ (alternative to mass)")
|
|
28
|
+
center_of_mass: Vector3 | None = Field(default=None, description="Center of mass offset in body frame")
|
|
29
|
+
diagonal_inertia: Vector3 | None = Field(default=None, description="Diagonal inertia values (Ixx, Iyy, Izz)")
|
|
30
|
+
principal_axes: Vector3 | None = Field(default=None, description="Principal axes orientation as RPY")
|
|
31
|
+
sleep_threshold: float | None = Field(default=None, description="Mass-normalized kinetic energy threshold for sleeping")
|
|
32
|
+
linear_velocity: Vector3 | None = Field(default=None, description="Initial linear velocity")
|
|
33
|
+
angular_velocity: Vector3 | None = Field(default=None, description="Initial angular velocity")
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
class GetRigidBody(Message):
|
|
37
|
+
"""
|
|
38
|
+
Get an existing rigid body view from a prim with RigidBodyAPI already applied.
|
|
39
|
+
"""
|
|
40
|
+
|
|
41
|
+
path: str | None = Field(default=None, description="USD path of the rigid body prim")
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
class GetRigidBodyResponse(Message):
|
|
45
|
+
"""
|
|
46
|
+
Response from getting a rigid body.
|
|
47
|
+
"""
|
|
48
|
+
|
|
49
|
+
path: str
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
class AddRigidBody(Message):
|
|
53
|
+
"""
|
|
54
|
+
Add or apply rigid body physics to a prim.
|
|
55
|
+
|
|
56
|
+
Note: The prim should already exist (e.g., added as geometry first).
|
|
57
|
+
Collision properties are configured on the geometry, not here.
|
|
58
|
+
"""
|
|
59
|
+
|
|
60
|
+
path: str = Field(description="USD path of prim to apply physics to")
|
|
61
|
+
config: RigidBodyConfig
|
|
62
|
+
world_pose: Pose | None = Field(default=None, description="World pose (position and orientation)")
|
|
63
|
+
local_pose: Pose | None = Field(default=None, description="Local pose (translation and orientation)")
|
|
64
|
+
scale: Vector3 | None = Field(default=None, description="Scale (x, y, z)")
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
class BodyVelocity(Message):
|
|
68
|
+
"""
|
|
69
|
+
Body velocity.
|
|
70
|
+
"""
|
|
71
|
+
|
|
72
|
+
linear: Vector3
|
|
73
|
+
angular: Vector3
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
class GetBodyVelocity(Message):
|
|
77
|
+
"""
|
|
78
|
+
Get body velocity.
|
|
79
|
+
"""
|
|
80
|
+
|
|
81
|
+
path: str
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
class SetBodyVelocity(Message):
|
|
85
|
+
"""
|
|
86
|
+
Set body velocity.
|
|
87
|
+
"""
|
|
88
|
+
|
|
89
|
+
path: str
|
|
90
|
+
velocity: BodyVelocity
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
class BoundingBox(Message):
|
|
94
|
+
"""
|
|
95
|
+
Axis-aligned bounding box.
|
|
96
|
+
"""
|
|
97
|
+
|
|
98
|
+
min: Vector3
|
|
99
|
+
max: Vector3
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
class GetBodyBoundingBox(Message):
|
|
103
|
+
"""
|
|
104
|
+
Get body bounding box.
|
|
105
|
+
"""
|
|
106
|
+
|
|
107
|
+
path: str
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
class ApplyForce(Message):
|
|
111
|
+
"""
|
|
112
|
+
Apply force to body.
|
|
113
|
+
"""
|
|
114
|
+
|
|
115
|
+
path: str
|
|
116
|
+
force: Vector3
|
|
117
|
+
is_global: bool = True
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
class ApplyTorque(Message):
|
|
121
|
+
"""
|
|
122
|
+
Apply torque to body.
|
|
123
|
+
"""
|
|
124
|
+
|
|
125
|
+
path: str
|
|
126
|
+
torque: Vector3
|
|
127
|
+
is_global: bool = True
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
class ApplyForceAtPosition(Message):
|
|
131
|
+
"""
|
|
132
|
+
Apply force at a specific position on the body.
|
|
133
|
+
"""
|
|
134
|
+
|
|
135
|
+
path: str
|
|
136
|
+
force: Vector3
|
|
137
|
+
position: Vector3
|
|
138
|
+
is_global: bool = True
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
class BodyDistance(Message):
|
|
142
|
+
"""
|
|
143
|
+
Distance between two bodies.
|
|
144
|
+
"""
|
|
145
|
+
|
|
146
|
+
distance: float
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
class GetDistanceBetweenBodies(Message):
|
|
150
|
+
"""
|
|
151
|
+
Get distance between bodies.
|
|
152
|
+
"""
|
|
153
|
+
|
|
154
|
+
path1: str
|
|
155
|
+
path2: str
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
class GetBodyMass(Message):
|
|
159
|
+
"""
|
|
160
|
+
Get body mass.
|
|
161
|
+
"""
|
|
162
|
+
|
|
163
|
+
path: str
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
class BodyMass(Message):
|
|
167
|
+
"""
|
|
168
|
+
Body mass.
|
|
169
|
+
"""
|
|
170
|
+
|
|
171
|
+
mass: float
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
class GetBodyInertia(Message):
|
|
175
|
+
"""
|
|
176
|
+
Get body inertia tensor.
|
|
177
|
+
"""
|
|
178
|
+
|
|
179
|
+
path: str
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
class BodyInertia(Message):
|
|
183
|
+
"""
|
|
184
|
+
Body inertia tensor (3x3 matrix as 9 values).
|
|
185
|
+
"""
|
|
186
|
+
|
|
187
|
+
inertia: list[float]
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
class GetBodyCenterOfMass(Message):
|
|
191
|
+
"""
|
|
192
|
+
Get body center of mass.
|
|
193
|
+
"""
|
|
194
|
+
|
|
195
|
+
path: str
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
class BodyCenterOfMass(Message):
|
|
199
|
+
"""
|
|
200
|
+
Body center of mass position and orientation.
|
|
201
|
+
"""
|
|
202
|
+
|
|
203
|
+
position: Vector3
|
|
204
|
+
orientation: Vector3
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
class EnableGravity(Message):
|
|
208
|
+
"""
|
|
209
|
+
Enable gravity on rigid body.
|
|
210
|
+
"""
|
|
211
|
+
|
|
212
|
+
path: str
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
class DisableGravity(Message):
|
|
216
|
+
"""
|
|
217
|
+
Disable gravity on rigid body.
|
|
218
|
+
"""
|
|
219
|
+
|
|
220
|
+
path: str
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
class EnablePhysics(Message):
|
|
224
|
+
"""
|
|
225
|
+
Enable rigid body physics.
|
|
226
|
+
"""
|
|
227
|
+
|
|
228
|
+
path: str
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
class DisablePhysics(Message):
|
|
232
|
+
"""
|
|
233
|
+
Disable rigid body physics.
|
|
234
|
+
"""
|
|
235
|
+
|
|
236
|
+
path: str
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
from pydantic import Field
|
|
2
|
+
|
|
3
|
+
from common.message import Message, Vector3
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class SetCameraView(Message):
|
|
7
|
+
"""
|
|
8
|
+
Set the viewport camera view position and target.
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
eye: Vector3 = Field(description="Eye position (camera location) in world coordinates")
|
|
12
|
+
target: Vector3 = Field(description="Target position (look-at point) in world coordinates")
|
|
13
|
+
camera_prim_path: str | None = Field(default=None, description="Optional USD path to the camera prim to configure")
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class SetActiveViewportCamera(Message):
|
|
17
|
+
"""
|
|
18
|
+
Set which camera is active in the viewport.
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
camera_prim_path: str = Field(description="USD path to the camera prim to make active")
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
from pydantic import Field
|
|
2
|
+
|
|
3
|
+
from common.message import Message, Pose, Vector3
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class GetXForm(Message):
|
|
7
|
+
"""
|
|
8
|
+
Get an existing XForm prim.
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
path: str | None = Field(default=None, description="USD path of the XForm prim")
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class GetXFormResponse(Message):
|
|
15
|
+
"""
|
|
16
|
+
Response from getting an XForm.
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
path: str
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class AddXForm(Message):
|
|
23
|
+
"""
|
|
24
|
+
Add an XForm prim with optional pose and scale.
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
path: str = Field(description="USD path for the XForm")
|
|
28
|
+
world_pose: Pose | None = Field(None, description="World pose to set on creation")
|
|
29
|
+
local_pose: Pose | None = Field(None, description="Local pose to set on creation")
|
|
30
|
+
scale: Vector3 | None = Field(None, description="Scale to set on creation")
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class SetXformVisibility(Message):
|
|
34
|
+
"""
|
|
35
|
+
Set xform visibility.
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
path: str
|
|
39
|
+
visible: bool
|
common/utils/__init__.py
ADDED