antioch-py 2.0.7__py3-none-any.whl → 2.2.1__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 +48 -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/objects/radar.py +62 -0
- antioch/session/{views → objects}/rigid_body.py +25 -110
- antioch/session/{views → objects}/xform.py +24 -24
- antioch/session/scene.py +116 -134
- antioch/session/session.py +34 -43
- antioch/session/task.py +2 -16
- {antioch_py-2.0.7.dist-info → antioch_py-2.2.1.dist-info}/METADATA +1 -1
- antioch_py-2.2.1.dist-info/RECORD +85 -0
- common/ark/ark.py +2 -0
- common/ark/hardware.py +1 -5
- common/ark/kinematics.py +1 -1
- common/constants.py +16 -2
- common/core/agent.py +28 -0
- common/core/auth.py +1 -3
- common/message/__init__.py +2 -0
- 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 -42
- antioch/session/views/collision.py +0 -75
- antioch/session/views/material.py +0 -54
- antioch/session/views/radar.py +0 -131
- antioch_py-2.0.7.dist-info/RECORD +0 -101
- 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/material.py +0 -25
- common/session/views/pir_sensor.py +0 -119
- common/session/views/radar.py +0 -107
- 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.7.dist-info → antioch_py-2.2.1.dist-info}/WHEEL +0 -0
- {antioch_py-2.0.7.dist-info → antioch_py-2.2.1.dist-info}/entry_points.txt +0 -0
- {antioch_py-2.0.7.dist-info → antioch_py-2.2.1.dist-info}/top_level.txt +0 -0
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
from typing import Literal
|
|
2
|
-
|
|
3
|
-
from pydantic import Field
|
|
4
|
-
|
|
5
|
-
from common.message import Message, Vector3
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class AddAnimationFromWaypoints(Message):
|
|
9
|
-
"""
|
|
10
|
-
Add an animation to the scene using waypoints.
|
|
11
|
-
"""
|
|
12
|
-
|
|
13
|
-
path: str = Field(description="USD path for the animation")
|
|
14
|
-
waypoints: list[Vector3] = Field(description="List of waypoints")
|
|
15
|
-
loop: bool = Field(default=True, description="Whether to loop the animation")
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
class AddAnimationFromBasisCurve(Message):
|
|
19
|
-
"""
|
|
20
|
-
Add an animation to the scene using a basis curve.
|
|
21
|
-
"""
|
|
22
|
-
|
|
23
|
-
path: str = Field(description="USD path for the animation")
|
|
24
|
-
basis_curve: str = Field(description="Path to the basis curve to use for the animation")
|
|
25
|
-
samples_per_segment: int = Field(default=10, description="The number of samples per segment to use from the basis curve")
|
|
26
|
-
sort_by: Literal["X", "Y", "Z"] | None = Field(default=None, description="The axis to sort the points by")
|
|
27
|
-
ascending: bool = Field(default=True, description="Whether to sort the points in ascending order")
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
class UpdateAnimationWaypoints(Message):
|
|
31
|
-
"""
|
|
32
|
-
Update the animation waypoints.
|
|
33
|
-
"""
|
|
34
|
-
|
|
35
|
-
path: str = Field(description="USD path for the animation")
|
|
36
|
-
waypoints: list[Vector3] = Field(description="List of waypoints")
|
|
37
|
-
loop: bool = Field(default=True, description="Whether to loop the animation")
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
class UpdateAnimationBasisCurve(Message):
|
|
41
|
-
"""
|
|
42
|
-
Update the animation using a basis curve.
|
|
43
|
-
"""
|
|
44
|
-
|
|
45
|
-
path: str = Field(description="USD path for the animation")
|
|
46
|
-
basis_curve: str = Field(description="Path to the basis curve to use for the animation")
|
|
47
|
-
samples_per_segment: int = Field(default=10, description="The number of samples per segment to use from the basis curve")
|
|
48
|
-
sort_by: Literal["X", "Y", "Z"] | None = Field(default=None, description="The axis to sort the points by")
|
|
49
|
-
ascending: bool = Field(default=True, description="Whether to sort the points in ascending order")
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
class GetAnimation(Message):
|
|
53
|
-
"""
|
|
54
|
-
Get an existing animation view from a prim.
|
|
55
|
-
"""
|
|
56
|
-
|
|
57
|
-
path: str = Field(description="USD path for the animation")
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
class GetAnimationResponse(Message):
|
|
61
|
-
"""
|
|
62
|
-
Response from getting an animation view.
|
|
63
|
-
"""
|
|
64
|
-
|
|
65
|
-
path: str
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
class RemoveAnimation(Message):
|
|
69
|
-
"""
|
|
70
|
-
Remove an animation from the scene (deletes the prim).
|
|
71
|
-
"""
|
|
72
|
-
|
|
73
|
-
path: str = Field(description="USD path for the animation")
|
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
from pydantic import Field
|
|
2
|
-
|
|
3
|
-
from common.message import JointState, JointTarget, Message, Pose, Vector3
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
class ArticulationJointConfig(Message):
|
|
7
|
-
"""
|
|
8
|
-
Complete configuration for a single joint in an articulation.
|
|
9
|
-
"""
|
|
10
|
-
|
|
11
|
-
path: str = Field(description="Name of the joint/DOF")
|
|
12
|
-
stiffness: float | None = Field(default=None, description="PD controller stiffness (Kp)")
|
|
13
|
-
damping: float | None = Field(default=None, description="PD controller damping (Kd)")
|
|
14
|
-
lower_limit: float | None = Field(default=None, description="Lower joint limit")
|
|
15
|
-
upper_limit: float | None = Field(default=None, description="Upper joint limit")
|
|
16
|
-
armature: float | None = Field(default=None, description="Joint armature")
|
|
17
|
-
friction_coefficient: float | None = Field(default=None, description="Joint friction coefficient")
|
|
18
|
-
max_velocity: float | None = Field(default=None, description="Maximum joint velocity")
|
|
19
|
-
max_effort: float | None = Field(default=None, description="Maximum joint effort")
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
class ArticulationConfig(Message):
|
|
23
|
-
"""
|
|
24
|
-
Configuration for applying articulation root to a prim.
|
|
25
|
-
"""
|
|
26
|
-
|
|
27
|
-
solver_position_iterations: int = Field(default=32, description="Number of position iterations for the solver")
|
|
28
|
-
solver_velocity_iterations: int = Field(default=1, description="Number of velocity iterations for the solver")
|
|
29
|
-
sleep_threshold: float = Field(default=0.005, description="Sleep threshold for the articulation")
|
|
30
|
-
stabilization_threshold: float = Field(default=0.001, description="Stabilization threshold for the articulation")
|
|
31
|
-
enable_self_collisions: bool = Field(default=False, description="Whether to enable self-collisions")
|
|
32
|
-
joint_configs: list[ArticulationJointConfig] = Field(default_factory=list, description="Per-joint configurations")
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
class GetArticulation(Message):
|
|
36
|
-
"""
|
|
37
|
-
Get an existing articulation view from a prim with ArticulationRootAPI already applied.
|
|
38
|
-
"""
|
|
39
|
-
|
|
40
|
-
path: str | None = Field(default=None, description="USD path of the articulation prim")
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
class GetArticulationResponse(Message):
|
|
44
|
-
"""
|
|
45
|
-
Response from getting an articulation.
|
|
46
|
-
"""
|
|
47
|
-
|
|
48
|
-
path: str
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
class AddArticulation(Message):
|
|
52
|
-
"""
|
|
53
|
-
Add an articulation by applying ArticulationRootAPI to a prim.
|
|
54
|
-
"""
|
|
55
|
-
|
|
56
|
-
path: str = Field(description="USD path of prim to apply articulation to")
|
|
57
|
-
config: ArticulationConfig
|
|
58
|
-
world_pose: Pose | None = Field(default=None, description="World pose (position and orientation)")
|
|
59
|
-
local_pose: Pose | None = Field(default=None, description="Local pose (translation and orientation)")
|
|
60
|
-
scale: Vector3 | None = Field(default=None, description="Scale (x, y, z)")
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
class ArticulationJointStates(Message):
|
|
64
|
-
"""
|
|
65
|
-
Response containing joint states.
|
|
66
|
-
"""
|
|
67
|
-
|
|
68
|
-
joint_states: list[JointState]
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
class ArticulationJointTargets(Message):
|
|
72
|
-
"""
|
|
73
|
-
Response containing joint targets.
|
|
74
|
-
"""
|
|
75
|
-
|
|
76
|
-
joint_targets: list[JointTarget]
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
class GetArticulationJointStates(Message):
|
|
80
|
-
"""
|
|
81
|
-
Get articulation joint states.
|
|
82
|
-
"""
|
|
83
|
-
|
|
84
|
-
path: str
|
|
85
|
-
joint_names: list[str] | None = None
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
class GetArticulationJointTargets(Message):
|
|
89
|
-
"""
|
|
90
|
-
Get articulation control targets.
|
|
91
|
-
"""
|
|
92
|
-
|
|
93
|
-
path: str
|
|
94
|
-
joint_names: list[str] | None = None
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
class SetArticulationJointStates(Message):
|
|
98
|
-
"""
|
|
99
|
-
Set articulation joint states (immediate teleport).
|
|
100
|
-
"""
|
|
101
|
-
|
|
102
|
-
path: str
|
|
103
|
-
joint_names: list[str] | None = None
|
|
104
|
-
joint_states: list[JointState] | None = None
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
class SetArticulationJointTargets(Message):
|
|
108
|
-
"""
|
|
109
|
-
Set articulation control targets using PD controller.
|
|
110
|
-
"""
|
|
111
|
-
|
|
112
|
-
path: str
|
|
113
|
-
joint_names: list[str] | None = None
|
|
114
|
-
joint_targets: list[JointTarget] | None = None
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
class GetArticulationJointConfigs(Message):
|
|
118
|
-
"""
|
|
119
|
-
Get joint configurations for all joints.
|
|
120
|
-
"""
|
|
121
|
-
|
|
122
|
-
path: str
|
|
123
|
-
joint_names: list[str] | None = None
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
class ArticulationJointConfigs(Message):
|
|
127
|
-
"""
|
|
128
|
-
Joint configurations response.
|
|
129
|
-
"""
|
|
130
|
-
|
|
131
|
-
joint_configs: list[ArticulationJointConfig]
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
class SetArticulationJointConfigs(Message):
|
|
135
|
-
"""
|
|
136
|
-
Set joint configurations.
|
|
137
|
-
"""
|
|
138
|
-
|
|
139
|
-
path: str
|
|
140
|
-
joint_configs: list[ArticulationJointConfig]
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
class BufferArticulationRead(Message):
|
|
144
|
-
"""
|
|
145
|
-
Request to buffer current articulation state at simulation time.
|
|
146
|
-
"""
|
|
147
|
-
|
|
148
|
-
path: str
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
class GetBufferedArticulationRead(Message):
|
|
152
|
-
"""
|
|
153
|
-
Request to get buffered articulation state at or before simulation time.
|
|
154
|
-
"""
|
|
155
|
-
|
|
156
|
-
path: str
|
|
157
|
-
read_sim_time: float
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
class BufferedArticulationState(Message):
|
|
161
|
-
"""
|
|
162
|
-
Buffered articulation state with joint names for filtering.
|
|
163
|
-
"""
|
|
164
|
-
|
|
165
|
-
pose: Pose
|
|
166
|
-
joint_states: list[JointState]
|
|
167
|
-
joint_names: list[str]
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
class BufferArticulationWrite(Message):
|
|
171
|
-
"""
|
|
172
|
-
Request to buffer articulation write at target simulation time.
|
|
173
|
-
"""
|
|
174
|
-
|
|
175
|
-
path: str
|
|
176
|
-
write_sim_time: float
|
|
177
|
-
joint_names: list[str] | None = None
|
|
178
|
-
joint_targets: list[JointTarget] | None = None
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
class BufferArticulationWriteResponse(Message):
|
|
182
|
-
"""
|
|
183
|
-
Acknowledgment for buffered articulation write.
|
|
184
|
-
"""
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
from typing import Literal
|
|
2
|
-
|
|
3
|
-
from pydantic import Field
|
|
4
|
-
|
|
5
|
-
from common.message import Message, Vector3
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class AddBasisCurveSemiCircle(Message):
|
|
9
|
-
"""
|
|
10
|
-
Add a basis curve semi-circle to the scene.
|
|
11
|
-
"""
|
|
12
|
-
|
|
13
|
-
path: str = Field(description="USD path for the basis curve")
|
|
14
|
-
center: Vector3 = Field(default_factory=Vector3.zeros, description="Center of the basis curve")
|
|
15
|
-
radius: float = Field(default=1.0, description="Radius of the basis curve")
|
|
16
|
-
min_angle_deg: float = Field(default=0.0, description="Minimum angle of the basis curve in degrees")
|
|
17
|
-
max_angle_deg: float = Field(default=180.0, description="Maximum angle of the basis curve in degrees")
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
class AddBasisCurveLine(Message):
|
|
21
|
-
"""
|
|
22
|
-
Add a basis curve line to the scene.
|
|
23
|
-
|
|
24
|
-
Supports two modes:
|
|
25
|
-
- Cartesian: Specify start and end points directly
|
|
26
|
-
- Polar: Specify start point, angle (degrees), and length
|
|
27
|
-
"""
|
|
28
|
-
|
|
29
|
-
path: str = Field(description="USD path for the basis curve")
|
|
30
|
-
start: Vector3 = Field(description="Start point of the line")
|
|
31
|
-
end: Vector3 | None = Field(default=None, description="End point of the line (Cartesian mode)")
|
|
32
|
-
angle_deg: float | None = Field(default=None, description="Angle in degrees from +X axis in XY plane (polar mode)")
|
|
33
|
-
length: float | None = Field(default=None, description="Length of the line (polar mode)")
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
class GetBasisCurve(Message):
|
|
37
|
-
"""
|
|
38
|
-
Get an existing basis curve view from a prim.
|
|
39
|
-
"""
|
|
40
|
-
|
|
41
|
-
path: str = Field(description="USD path for the basis curve")
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
class GetBasisCurveResponse(Message):
|
|
45
|
-
"""
|
|
46
|
-
Response from getting a basis curve.
|
|
47
|
-
"""
|
|
48
|
-
|
|
49
|
-
path: str
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
class GetBasisCurveExtents(Message):
|
|
53
|
-
"""
|
|
54
|
-
Get the extents of a basis curve.
|
|
55
|
-
"""
|
|
56
|
-
|
|
57
|
-
path: str = Field(description="USD path for the basis curve")
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
class GetBasisCurveExtentsResponse(Message):
|
|
61
|
-
"""
|
|
62
|
-
Response from getting the extents of a basis curve.
|
|
63
|
-
"""
|
|
64
|
-
|
|
65
|
-
start: Vector3 = Field(description="Start point of the basis curve")
|
|
66
|
-
end: Vector3 = Field(description="End point of the basis curve")
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
class GetBasisCurvePoints(Message):
|
|
70
|
-
"""
|
|
71
|
-
Get the points of a basis curve.
|
|
72
|
-
"""
|
|
73
|
-
|
|
74
|
-
path: str = Field(description="USD path for the basis curve")
|
|
75
|
-
samples_per_segment: int = Field(default=10, description="The number of samples per segment")
|
|
76
|
-
sort_by: Literal["X", "Y", "Z"] | None = Field(default=None, description="The axis to sort the points by")
|
|
77
|
-
ascending: bool = Field(default=True, description="Whether to sort the points in ascending order")
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
class GetBasisCurvePointsResponse(Message):
|
|
81
|
-
"""
|
|
82
|
-
Response from getting the points of a basis curve.
|
|
83
|
-
"""
|
|
84
|
-
|
|
85
|
-
points: list[Vector3] = Field(description="The points of the basis curve")
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
class SetBasisCurveVisibility(Message):
|
|
89
|
-
"""
|
|
90
|
-
Set the visibility of a basis curve.
|
|
91
|
-
"""
|
|
92
|
-
|
|
93
|
-
path: str = Field(description="USD path for the basis curve")
|
|
94
|
-
visible: bool = Field(description="True to make visible, False to hide")
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
class RemoveBasisCurve(Message):
|
|
98
|
-
"""
|
|
99
|
-
Remove a basis curve from the scene.
|
|
100
|
-
"""
|
|
101
|
-
|
|
102
|
-
path: str = Field(description="USD path for the basis curve")
|
common/session/views/camera.py
DELETED
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
from enum import Enum
|
|
2
|
-
|
|
3
|
-
from pydantic import Field
|
|
4
|
-
|
|
5
|
-
from common.message import CameraInfo, Message, Pose
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class CameraMode(str, Enum):
|
|
9
|
-
"""
|
|
10
|
-
Camera capture modes.
|
|
11
|
-
"""
|
|
12
|
-
|
|
13
|
-
RGB = "rgb"
|
|
14
|
-
DEPTH = "depth"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
class DistortionModel(str, Enum):
|
|
18
|
-
"""
|
|
19
|
-
Camera lens distortion model types.
|
|
20
|
-
"""
|
|
21
|
-
|
|
22
|
-
PINHOLE = "pinhole"
|
|
23
|
-
OPENCV_PINHOLE = "opencv_pinhole"
|
|
24
|
-
OPENCV_FISHEYE = "opencv_fisheye"
|
|
25
|
-
FTHETA = "ftheta"
|
|
26
|
-
KANNALA_BRANDT_K3 = "kannala_brandt_k3"
|
|
27
|
-
RAD_TAN_THIN_PRISM = "rad_tan_thin_prism"
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
class CameraConfig(Message):
|
|
31
|
-
"""
|
|
32
|
-
Configuration for camera sensor.
|
|
33
|
-
"""
|
|
34
|
-
|
|
35
|
-
mode: CameraMode = Field(default=CameraMode.RGB, description="Camera capture mode (RGB or depth)")
|
|
36
|
-
frequency: int = Field(default=30, description="Camera update frequency in Hz")
|
|
37
|
-
width: int = Field(default=640, description="Image width in pixels")
|
|
38
|
-
height: int = Field(default=480, description="Image height in pixels")
|
|
39
|
-
focal_length: float = Field(default=50.0, description="Focal length in mm")
|
|
40
|
-
sensor_width: float = Field(default=20.4, description="Physical sensor width in mm")
|
|
41
|
-
sensor_height: float = Field(default=15.3, description="Physical sensor height in mm")
|
|
42
|
-
near_clip: float = Field(default=0.1, description="Near clipping plane in meters")
|
|
43
|
-
far_clip: float = Field(default=1000.0, description="Far clipping plane in meters")
|
|
44
|
-
f_stop: float = Field(default=0.0, description="F-stop for depth of field")
|
|
45
|
-
focus_distance: float = Field(default=10.0, description="Focus distance in meters")
|
|
46
|
-
principal_point_x: float = Field(default=0.0, description="Principal point X offset in pixels")
|
|
47
|
-
principal_point_y: float = Field(default=0.0, description="Principal point Y offset in pixels")
|
|
48
|
-
distortion_model: DistortionModel = Field(default=DistortionModel.PINHOLE, description="Lens distortion model")
|
|
49
|
-
distortion_coefficients: list[float] | None = Field(default=None, description="Distortion coefficients")
|
|
50
|
-
|
|
51
|
-
def to_camera_info(self, frame_id: str = "camera_optical_frame") -> CameraInfo:
|
|
52
|
-
"""
|
|
53
|
-
Convert camera configuration to CameraInfo with calculated intrinsics.
|
|
54
|
-
|
|
55
|
-
:param frame_id: The coordinate frame ID for the camera.
|
|
56
|
-
:return: CameraInfo with full intrinsics and distortion parameters.
|
|
57
|
-
"""
|
|
58
|
-
|
|
59
|
-
# Convert mm to pixels for focal length
|
|
60
|
-
fx = self.width * self.focal_length / self.sensor_width
|
|
61
|
-
fy = self.height * self.focal_length / self.sensor_height
|
|
62
|
-
|
|
63
|
-
# Principal point (image center + offset)
|
|
64
|
-
cx = self.width / 2.0 + self.principal_point_x
|
|
65
|
-
cy = self.height / 2.0 + self.principal_point_y
|
|
66
|
-
|
|
67
|
-
return CameraInfo(
|
|
68
|
-
width=self.width,
|
|
69
|
-
height=self.height,
|
|
70
|
-
fx=fx,
|
|
71
|
-
fy=fy,
|
|
72
|
-
cx=cx,
|
|
73
|
-
cy=cy,
|
|
74
|
-
distortion_model=self.distortion_model.value,
|
|
75
|
-
distortion_coefficients=self.distortion_coefficients or [],
|
|
76
|
-
frame_id=frame_id,
|
|
77
|
-
)
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
class GetCamera(Message):
|
|
81
|
-
"""
|
|
82
|
-
Get an existing camera sensor.
|
|
83
|
-
"""
|
|
84
|
-
|
|
85
|
-
path: str | None = Field(default=None, description="USD path of the camera prim")
|
|
86
|
-
resolution: tuple[int, int] | None = Field(default=None, description="Image resolution in pixels (width, height)")
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
class GetCameraResponse(Message):
|
|
90
|
-
"""
|
|
91
|
-
Response from getting a camera.
|
|
92
|
-
"""
|
|
93
|
-
|
|
94
|
-
path: str
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
class AddCamera(Message):
|
|
98
|
-
"""
|
|
99
|
-
Add a camera sensor.
|
|
100
|
-
"""
|
|
101
|
-
|
|
102
|
-
path: str = Field(description="USD path for the camera")
|
|
103
|
-
config: CameraConfig
|
|
104
|
-
world_pose: Pose | None = Field(default=None, description="World pose (position and orientation)")
|
|
105
|
-
local_pose: Pose | None = Field(default=None, description="Local pose (translation and orientation)")
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
class GetCameraFrame(Message):
|
|
109
|
-
"""
|
|
110
|
-
Get camera frame with image data.
|
|
111
|
-
"""
|
|
112
|
-
|
|
113
|
-
path: str
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
class BufferCameraRgbRead(Message):
|
|
117
|
-
"""
|
|
118
|
-
Request to buffer current camera RGB frame at simulation time.
|
|
119
|
-
"""
|
|
120
|
-
|
|
121
|
-
path: str
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
class GetBufferedCameraRgbRead(Message):
|
|
125
|
-
"""
|
|
126
|
-
Request to get buffered camera RGB frame at or before simulation time.
|
|
127
|
-
"""
|
|
128
|
-
|
|
129
|
-
path: str
|
|
130
|
-
read_sim_time: float
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
class BufferCameraDepthRead(Message):
|
|
134
|
-
"""
|
|
135
|
-
Request to buffer current camera depth frame at simulation time.
|
|
136
|
-
"""
|
|
137
|
-
|
|
138
|
-
path: str
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
class GetBufferedCameraDepthRead(Message):
|
|
142
|
-
"""
|
|
143
|
-
Request to get buffered camera depth frame at or before simulation time.
|
|
144
|
-
"""
|
|
145
|
-
|
|
146
|
-
path: str
|
|
147
|
-
read_sim_time: float
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
from pydantic import Field
|
|
2
|
-
|
|
3
|
-
from common.message import Message
|
|
4
|
-
from common.session.views.geometry import MeshApproximation
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
class SetCollision(Message):
|
|
8
|
-
"""
|
|
9
|
-
Apply collision API to a prim, optionally with mesh approximation.
|
|
10
|
-
"""
|
|
11
|
-
|
|
12
|
-
path: str = Field(description="USD path to the prim")
|
|
13
|
-
mesh_approximation: MeshApproximation | None = Field(
|
|
14
|
-
default=None,
|
|
15
|
-
description="Optional mesh approximation method for collision geometry",
|
|
16
|
-
)
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
class RemoveCollision(Message):
|
|
20
|
-
"""
|
|
21
|
-
Remove collision API from a prim.
|
|
22
|
-
"""
|
|
23
|
-
|
|
24
|
-
path: str = Field(description="USD path to the prim")
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
class HasCollision(Message):
|
|
28
|
-
"""
|
|
29
|
-
Check if a prim has collision API applied.
|
|
30
|
-
"""
|
|
31
|
-
|
|
32
|
-
path: str = Field(description="USD path to the prim")
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
class HasCollisionResponse(Message):
|
|
36
|
-
"""
|
|
37
|
-
Response for collision check.
|
|
38
|
-
"""
|
|
39
|
-
|
|
40
|
-
has_collision: bool = Field(description="Whether the prim has collision API")
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
class GetMeshApproximation(Message):
|
|
44
|
-
"""
|
|
45
|
-
Get mesh collision approximation from a prim.
|
|
46
|
-
"""
|
|
47
|
-
|
|
48
|
-
path: str = Field(description="USD path to the prim")
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
class GetMeshApproximationResponse(Message):
|
|
52
|
-
"""
|
|
53
|
-
Response for mesh approximation query.
|
|
54
|
-
"""
|
|
55
|
-
|
|
56
|
-
approximation: MeshApproximation | None = Field(
|
|
57
|
-
default=None,
|
|
58
|
-
description="Mesh approximation method, or None if not set",
|
|
59
|
-
)
|
common/session/views/geometry.py
DELETED
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
from enum import Enum
|
|
2
|
-
|
|
3
|
-
from pydantic import Field
|
|
4
|
-
from pydantic.alias_generators import to_camel
|
|
5
|
-
|
|
6
|
-
from common.message import Message, Pose, Vector3
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class GeometryType(str, Enum):
|
|
10
|
-
"""
|
|
11
|
-
Supported geometry types.
|
|
12
|
-
"""
|
|
13
|
-
|
|
14
|
-
SPHERE = "sphere"
|
|
15
|
-
CUBE = "cube"
|
|
16
|
-
CYLINDER = "cylinder"
|
|
17
|
-
CONE = "cone"
|
|
18
|
-
CAPSULE = "capsule"
|
|
19
|
-
MESH = "mesh"
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
class MeshApproximation(str, Enum):
|
|
23
|
-
"""
|
|
24
|
-
Collision mesh approximation type.
|
|
25
|
-
|
|
26
|
-
Values are stored in snake_case for consistency with Rust. Use to_usd()
|
|
27
|
-
to get the camelCase format required by USD/Isaac Sim.
|
|
28
|
-
"""
|
|
29
|
-
|
|
30
|
-
NONE = "none"
|
|
31
|
-
CONVEX_HULL = "convex_hull"
|
|
32
|
-
CONVEX_DECOMPOSITION = "convex_decomposition"
|
|
33
|
-
BOUNDING_SPHERE = "bounding_sphere"
|
|
34
|
-
BOUNDING_CUBE = "bounding_cube"
|
|
35
|
-
MESH_SIMPLIFICATION = "mesh_simplification"
|
|
36
|
-
SDF = "sdf"
|
|
37
|
-
SPHERE_FILL = "sphere_fill"
|
|
38
|
-
|
|
39
|
-
def to_usd(self) -> str:
|
|
40
|
-
"""
|
|
41
|
-
Convert to USD camelCase format.
|
|
42
|
-
|
|
43
|
-
:return: The USD camelCase format.
|
|
44
|
-
"""
|
|
45
|
-
|
|
46
|
-
return to_camel(self.value)
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
class GeometryConfig(Message):
|
|
50
|
-
"""
|
|
51
|
-
Configuration for creating geometry.
|
|
52
|
-
"""
|
|
53
|
-
|
|
54
|
-
geometry_type: GeometryType = Field(description="Geometry type")
|
|
55
|
-
radius: float | None = Field(default=None, description="Radius for sphere/cylinder/cone/capsule")
|
|
56
|
-
height: float | None = Field(default=None, description="Height for cylinder/cone/capsule")
|
|
57
|
-
size: float | None = Field(default=None, description="Size for cube (uniform)")
|
|
58
|
-
color: Vector3 | None = Field(default=None, description="RGB color (0-1)")
|
|
59
|
-
opacity: float = Field(default=1.0, description="Opacity (0=transparent, 1=opaque)")
|
|
60
|
-
enable_collision: bool = Field(default=True, description="Whether to enable collision on this geometry")
|
|
61
|
-
static_friction: float = Field(default=0.5, description="Static friction coefficient")
|
|
62
|
-
dynamic_friction: float = Field(default=0.5, description="Dynamic friction coefficient")
|
|
63
|
-
restitution: float = Field(default=0.2, description="Restitution (bounciness)")
|
|
64
|
-
mesh_file_path: str | None = Field(
|
|
65
|
-
default=None,
|
|
66
|
-
description="Path to mesh file (FBX, OBJ, glTF, STL, etc.) - required for MESH type",
|
|
67
|
-
)
|
|
68
|
-
mesh_approximation: MeshApproximation = Field(
|
|
69
|
-
default=MeshApproximation.CONVEX_DECOMPOSITION,
|
|
70
|
-
description="Mesh approximation method",
|
|
71
|
-
)
|
|
72
|
-
contact_offset: float | None = Field(default=None, description="Distance at which collision detection begins")
|
|
73
|
-
rest_offset: float | None = Field(default=None, description="Minimum separation distance between objects")
|
|
74
|
-
torsional_patch_radius: float | None = Field(default=None, description="Radius for torsional friction calculations")
|
|
75
|
-
min_torsional_patch_radius: float | None = Field(default=None, description="Minimum radius for torsional friction")
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
class GetGeometry(Message):
|
|
79
|
-
"""
|
|
80
|
-
Get an existing geometry view from a prim.
|
|
81
|
-
"""
|
|
82
|
-
|
|
83
|
-
path: str | None = Field(default=None, description="USD path of the geometry prim")
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
class GetGeometryResponse(Message):
|
|
87
|
-
"""
|
|
88
|
-
Response from getting a geometry.
|
|
89
|
-
"""
|
|
90
|
-
|
|
91
|
-
path: str
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
class AddGeometry(Message):
|
|
95
|
-
"""
|
|
96
|
-
Add a geometry prim with optional pose.
|
|
97
|
-
"""
|
|
98
|
-
|
|
99
|
-
path: str = Field(description="USD path for the geometry")
|
|
100
|
-
config: GeometryConfig
|
|
101
|
-
world_pose: "Pose | None" = Field(default=None, description="Optional world pose")
|
|
102
|
-
local_pose: "Pose | None" = Field(default=None, description="Optional local pose")
|