antioch-py 2.2.3__py3-none-any.whl → 3.0.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.

Files changed (94) hide show
  1. antioch/__init__.py +101 -0
  2. antioch/{module/execution.py → execution.py} +1 -1
  3. antioch/{module/input.py → input.py} +2 -4
  4. antioch/{module/module.py → module.py} +17 -34
  5. antioch/{module/node.py → node.py} +17 -16
  6. {antioch_py-2.2.3.dist-info → antioch_py-3.0.0.dist-info}/METADATA +8 -11
  7. antioch_py-3.0.0.dist-info/RECORD +61 -0
  8. {antioch_py-2.2.3.dist-info → antioch_py-3.0.0.dist-info}/WHEEL +1 -1
  9. antioch_py-3.0.0.dist-info/licenses/LICENSE +21 -0
  10. common/ark/__init__.py +6 -16
  11. common/ark/ark.py +23 -62
  12. common/ark/hardware.py +1 -1
  13. common/ark/kinematics.py +1 -1
  14. common/ark/module.py +22 -0
  15. common/ark/node.py +46 -3
  16. common/ark/scheduler.py +2 -29
  17. common/ark/sim.py +1 -1
  18. {antioch/module → common/ark}/token.py +17 -0
  19. common/assets/rigging.usd +0 -0
  20. common/constants.py +63 -5
  21. common/core/__init__.py +37 -24
  22. common/core/auth.py +87 -112
  23. common/core/container.py +261 -0
  24. common/core/registry.py +131 -152
  25. common/core/rome.py +251 -0
  26. common/core/telemetry.py +176 -0
  27. common/core/types.py +219 -0
  28. common/message/__init__.py +19 -5
  29. common/message/annotation.py +174 -23
  30. common/message/array.py +25 -1
  31. common/message/camera.py +23 -1
  32. common/message/color.py +32 -6
  33. common/message/detection.py +40 -0
  34. common/message/foxglove.py +20 -0
  35. common/message/frame.py +71 -7
  36. common/message/image.py +58 -9
  37. common/message/imu.py +24 -4
  38. common/message/joint.py +69 -10
  39. common/message/log.py +52 -7
  40. common/message/pir.py +23 -8
  41. common/message/plot.py +57 -0
  42. common/message/point.py +55 -6
  43. common/message/point_cloud.py +55 -19
  44. common/message/pose.py +59 -19
  45. common/message/quaternion.py +105 -92
  46. common/message/radar.py +195 -29
  47. common/message/twist.py +34 -0
  48. common/message/types.py +40 -5
  49. common/message/vector.py +180 -245
  50. common/sim/__init__.py +49 -0
  51. common/{session/config.py → sim/objects.py} +97 -27
  52. common/sim/state.py +11 -0
  53. common/utils/comms.py +30 -12
  54. common/utils/logger.py +26 -7
  55. antioch/message.py +0 -87
  56. antioch/module/__init__.py +0 -53
  57. antioch/session/__init__.py +0 -152
  58. antioch/session/ark.py +0 -500
  59. antioch/session/asset.py +0 -65
  60. antioch/session/error.py +0 -80
  61. antioch/session/objects/__init__.py +0 -40
  62. antioch/session/objects/animation.py +0 -162
  63. antioch/session/objects/articulation.py +0 -180
  64. antioch/session/objects/basis_curve.py +0 -180
  65. antioch/session/objects/camera.py +0 -65
  66. antioch/session/objects/collision.py +0 -46
  67. antioch/session/objects/geometry.py +0 -58
  68. antioch/session/objects/ground_plane.py +0 -48
  69. antioch/session/objects/imu.py +0 -53
  70. antioch/session/objects/joint.py +0 -49
  71. antioch/session/objects/light.py +0 -123
  72. antioch/session/objects/pir_sensor.py +0 -98
  73. antioch/session/objects/radar.py +0 -62
  74. antioch/session/objects/rigid_body.py +0 -197
  75. antioch/session/objects/xform.py +0 -119
  76. antioch/session/record.py +0 -158
  77. antioch/session/scene.py +0 -1544
  78. antioch/session/session.py +0 -211
  79. antioch/session/task.py +0 -309
  80. antioch_py-2.2.3.dist-info/RECORD +0 -85
  81. antioch_py-2.2.3.dist-info/entry_points.txt +0 -2
  82. common/core/agent.py +0 -324
  83. common/core/task.py +0 -36
  84. common/message/velocity.py +0 -11
  85. common/rome/__init__.py +0 -9
  86. common/rome/client.py +0 -430
  87. common/rome/error.py +0 -16
  88. common/session/__init__.py +0 -31
  89. common/session/environment.py +0 -31
  90. common/session/sim.py +0 -129
  91. common/utils/usd.py +0 -12
  92. /antioch/{module/clock.py → clock.py} +0 -0
  93. {antioch_py-2.2.3.dist-info → antioch_py-3.0.0.dist-info}/top_level.txt +0 -0
  94. /common/message/{base.py → message.py} +0 -0
common/rome/client.py DELETED
@@ -1,430 +0,0 @@
1
- from datetime import datetime
2
- from pathlib import Path
3
- from typing import Generator, overload
4
-
5
- import httpx
6
- import requests
7
- from requests import Response
8
- from tqdm.auto import tqdm
9
-
10
- from common.ark import ArkReference, AssetReference
11
- from common.core.task import TaskCompletion, TaskOutcome
12
- from common.rome.error import RomeAuthError, RomeError, RomeNetworkError
13
-
14
- DOWNLOAD_CHUNK_SIZE = 8 * 1024 * 1024 # 8MB
15
- UPLOAD_CHUNK_SIZE = 1024 # 1KB
16
- FILE_TRANSFER_UNIT_DIVISOR = 1024
17
-
18
-
19
- class RomeClient:
20
- """
21
- Client for interacting with Rome (Antioch's cloud API).
22
-
23
- Handles task completion, artifact uploads/downloads, and registry operations for Arks and Assets.
24
- """
25
-
26
- def __init__(self, api_url: str, token: str):
27
- """
28
- Initialize the Rome client.
29
-
30
- :param api_url: Base URL for Rome API.
31
- :param token: Authentication token.
32
- """
33
-
34
- self._api_url = api_url
35
- self._token = token
36
-
37
- def complete_task(
38
- self,
39
- ark_name: str,
40
- ark_version: str,
41
- ark_hash: str,
42
- task_start_time: datetime,
43
- task_complete_time: datetime,
44
- outcome: TaskOutcome,
45
- result: dict | None = None,
46
- ) -> str:
47
- """
48
- Complete a task by creating an entry in Antioch's database.
49
-
50
- :param ark_name: Name of the Ark.
51
- :param ark_version: Version of the Ark.
52
- :param ark_hash: Hash of the Ark.
53
- :param task_start_time: Task start time.
54
- :param task_complete_time: Task completion time.
55
- :param outcome: Task outcome (success or failure).
56
- :param result: Optional task result dictionary.
57
- :return: The task ID.
58
- """
59
-
60
- payload = TaskCompletion(
61
- ark_name=ark_name,
62
- ark_version=ark_version,
63
- ark_hash=ark_hash,
64
- task_start_time=task_start_time,
65
- task_complete_time=task_complete_time,
66
- outcome=outcome,
67
- result=result,
68
- )
69
-
70
- response = self._send_request("POST", "/tasks/complete", json=payload.model_dump(mode="json"))
71
- return response["task_id"]
72
-
73
- def upload_mcap(self, task_id: str, mcap_path: str, show_progress: bool = True) -> None:
74
- """
75
- Upload MCAP file to Rome's cloud storage using streaming.
76
-
77
- :param task_id: Unique task identifier.
78
- :param mcap_path: Path to the MCAP file.
79
- :param show_progress: Show upload progress bar.
80
- """
81
-
82
- self._upload_file(
83
- endpoint="/tasks/upload_mcap",
84
- task_id=task_id,
85
- file_path=mcap_path,
86
- content_type="application/octet-stream",
87
- show_progress=show_progress,
88
- )
89
-
90
- def upload_bundle(self, task_id: str, bundle_path: str, show_progress: bool = True) -> None:
91
- """
92
- Upload bundle tar.gz file to Rome's cloud storage using streaming.
93
-
94
- :param task_id: Unique task identifier.
95
- :param bundle_path: Path to the bundle tar.gz file.
96
- :param show_progress: Show upload progress bar.
97
- """
98
-
99
- self._upload_file(
100
- endpoint="/tasks/upload_bundle",
101
- task_id=task_id,
102
- file_path=bundle_path,
103
- content_type="application/gzip",
104
- show_progress=show_progress,
105
- )
106
-
107
- def download_mcap(self, task_id: str, output_path: str, show_progress: bool = True, overwrite: bool = False) -> str:
108
- """
109
- Download MCAP file from Rome's cloud storage.
110
-
111
- :param task_id: Unique task identifier.
112
- :param output_path: Path where the file should be saved.
113
- :param show_progress: Show download progress bar.
114
- :param overwrite: Overwrite existing file.
115
- :return: Path to the downloaded MCAP file.
116
- """
117
-
118
- if not output_path.endswith(".mcap"):
119
- raise ValueError("Output path must end with .mcap")
120
-
121
- return self._download_file(
122
- endpoint="/tasks/download-mcap",
123
- output_path=output_path,
124
- params={"task_id": task_id},
125
- show_progress=show_progress,
126
- overwrite=overwrite,
127
- )
128
-
129
- def download_bundle(self, task_id: str, output_path: str, show_progress: bool = True, overwrite: bool = False) -> str:
130
- """
131
- Download bundle tar.gz file from Rome's cloud storage.
132
-
133
- :param task_id: Unique task identifier.
134
- :param output_path: Path where the file should be saved.
135
- :param show_progress: Show download progress bar.
136
- :param overwrite: Overwrite existing file.
137
- :return: Path to the downloaded bundle file.
138
- """
139
-
140
- if not output_path.endswith(".tar.gz"):
141
- raise ValueError("Output path must end with .tar.gz")
142
-
143
- return self._download_file(
144
- endpoint="/tasks/download-bundle",
145
- output_path=output_path,
146
- params={"task_id": task_id},
147
- show_progress=show_progress,
148
- overwrite=overwrite,
149
- )
150
-
151
- def list_arks(self) -> list[ArkReference]:
152
- """
153
- List all Arks from Rome registry.
154
-
155
- :return: List of ArkReference objects from remote registry.
156
- """
157
-
158
- response = self._send_request("GET", "/ark/list")
159
- return [ArkReference(**ark) for ark in response.get("data", [])]
160
-
161
- def get_ark(self, name: str, version: str) -> dict:
162
- """
163
- Get Ark definition from Rome registry.
164
-
165
- :param name: Name of the Ark.
166
- :param version: Version of the Ark.
167
- :return: Ark definition as dictionary.
168
- """
169
-
170
- response = self._send_request("GET", "/ark/get", json={"name": name, "version": version})
171
- return response["ark"]
172
-
173
- def download_ark_assets(self, name: str, version: str) -> bytes:
174
- """
175
- Download Ark asset file from Rome registry.
176
-
177
- :param name: Name of the Ark.
178
- :param version: Version of the Ark.
179
- :return: Asset file content as bytes.
180
- """
181
-
182
- response = self._send_request("GET", "/ark/download-assets", params={"name": name, "version": version}, return_content=True)
183
- assert isinstance(response, bytes)
184
- return response
185
-
186
- def list_assets(self) -> list[AssetReference]:
187
- """
188
- List all assets from Rome registry.
189
-
190
- :return: List of AssetReference objects from remote registry.
191
- """
192
-
193
- response = self._send_request("GET", "/asset/list")
194
- return [AssetReference(**asset) for asset in response.get("data", [])]
195
-
196
- def get_asset_metadata(self, name: str, version: str) -> dict:
197
- """
198
- Get metadata for a specific asset version.
199
-
200
- :param name: Name of the asset.
201
- :param version: Version of the asset.
202
- :return: Asset metadata dictionary containing extension, file_size, and modified_time.
203
- """
204
-
205
- response = self._send_request("GET", "/asset/metadata", params={"name": name, "version": version})
206
- return response["data"]
207
-
208
- def download_asset(self, name: str, version: str, output_path: str, show_progress: bool = True) -> None:
209
- """
210
- Download asset from Rome registry to local storage.
211
-
212
- :param name: Name of the asset.
213
- :param version: Version of the asset.
214
- :param output_path: Path where the file should be saved.
215
- :param show_progress: Show download progress bar.
216
- """
217
-
218
- self._download_file(
219
- endpoint="/asset/download",
220
- output_path=output_path,
221
- params={"name": name, "version": version},
222
- show_progress=show_progress,
223
- description=f"Downloading {name}:{version}",
224
- )
225
-
226
- @overload
227
- def _send_request(
228
- self,
229
- method: str,
230
- endpoint: str,
231
- json: dict | None = None,
232
- params: dict | None = None,
233
- return_content: bool = False,
234
- ) -> dict: ...
235
-
236
- @overload
237
- def _send_request(
238
- self,
239
- method: str,
240
- endpoint: str,
241
- json: dict | None = None,
242
- params: dict | None = None,
243
- return_content: bool = True,
244
- ) -> bytes: ...
245
-
246
- def _send_request(
247
- self,
248
- method: str,
249
- endpoint: str,
250
- json: dict | None = None,
251
- params: dict | None = None,
252
- return_content: bool = False,
253
- ) -> dict | bytes:
254
- """
255
- Send a request to Rome API with standardized error handling.
256
-
257
- :param method: HTTP method (GET, POST, etc.).
258
- :param endpoint: API endpoint path.
259
- :param json: Optional JSON payload.
260
- :param params: Optional query parameters.
261
- :param return_content: If True, return raw bytes content instead of JSON.
262
- :return: Response JSON data or raw content bytes.
263
- :raises RomeAuthError: If user is not authenticated.
264
- :raises RomeError: If client error (4xx) occurs or JSON decode fails.
265
- :raises RomeNetworkError: If network error or server error (5xx) occurs.
266
- """
267
-
268
- if not self._token:
269
- raise RomeAuthError("User not authenticated")
270
-
271
- try:
272
- url = f"{self._api_url}{endpoint}"
273
- headers = {"Authorization": f"Bearer {self._token}", "Content-Type": "application/json"}
274
- response = requests.request(method, url, json=json, params=params, headers=headers, timeout=30)
275
- self._check_response_errors(response)
276
-
277
- if return_content:
278
- return response.content
279
-
280
- try:
281
- return response.json()
282
- except requests.exceptions.JSONDecodeError as e:
283
- raise RomeError(f"Invalid JSON response: {e}") from e
284
- except requests.exceptions.RequestException as e:
285
- raise RomeNetworkError(f"Network error: {e}") from e
286
-
287
- def _download_file(
288
- self,
289
- endpoint: str,
290
- output_path: str,
291
- params: dict | None = None,
292
- show_progress: bool = True,
293
- overwrite: bool = True,
294
- description: str | None = None,
295
- ) -> str:
296
- """
297
- Download a file from Rome's cloud storage with streaming.
298
-
299
- :param endpoint: API endpoint path.
300
- :param output_path: Path where the file should be saved.
301
- :param params: Optional query parameters.
302
- :param show_progress: Show download progress bar.
303
- :param overwrite: Overwrite existing file.
304
- :param description: Optional description for progress bar.
305
- :return: Path to the downloaded file.
306
- :raises RuntimeError: If file exists and overwrite is False.
307
- :raises RomeAuthError: If user is not authenticated.
308
- :raises RomeError: If client error (4xx) occurs.
309
- :raises RomeNetworkError: If network error or server error (5xx) occurs.
310
- """
311
-
312
- if not overwrite and Path(output_path).exists():
313
- raise RuntimeError(f"{output_path} already exists (pass overwrite=True to overwrite)")
314
- if not self._token:
315
- raise RomeAuthError("User not authenticated")
316
-
317
- try:
318
- url = f"{self._api_url}{endpoint}"
319
- headers = {"Authorization": f"Bearer {self._token}"}
320
- response = requests.get(url, params=params, headers=headers, stream=True, timeout=None)
321
- self._check_response_errors(response)
322
-
323
- with (
324
- open(output_path, "wb") as f,
325
- tqdm(
326
- total=int(response.headers.get("content-length", 0)),
327
- unit="B",
328
- unit_scale=True,
329
- unit_divisor=FILE_TRANSFER_UNIT_DIVISOR,
330
- desc=description or f"Downloading {Path(output_path).name}",
331
- disable=not show_progress,
332
- ) as pbar,
333
- ):
334
- for chunk in response.iter_content(chunk_size=DOWNLOAD_CHUNK_SIZE):
335
- if chunk:
336
- f.write(chunk)
337
- pbar.update(len(chunk))
338
-
339
- return output_path
340
- except requests.exceptions.RequestException as e:
341
- raise RomeNetworkError(f"Network error: {e}") from e
342
-
343
- def _upload_file_stream(self, file_path: Path, show_progress: bool = True) -> Generator[bytes, None, None]:
344
- """
345
- Generator for streaming file upload with progress tracking.
346
-
347
- :param file_path: Path to the file to upload.
348
- :param show_progress: Show upload progress bar.
349
- :return: Generator yielding file chunks as bytes.
350
- """
351
-
352
- with (
353
- tqdm(
354
- total=file_path.stat().st_size,
355
- unit="B",
356
- unit_scale=True,
357
- unit_divisor=FILE_TRANSFER_UNIT_DIVISOR,
358
- desc=f"Uploading {file_path.name}",
359
- disable=not show_progress,
360
- ) as pbar,
361
- open(file_path, "rb") as f,
362
- ):
363
- while data := f.read(UPLOAD_CHUNK_SIZE):
364
- pbar.update(len(data))
365
- yield data
366
-
367
- def _upload_file(
368
- self,
369
- endpoint: str,
370
- task_id: str,
371
- file_path: str,
372
- content_type: str,
373
- show_progress: bool,
374
- ) -> None:
375
- """
376
- Upload a file to Rome's cloud storage using streaming.
377
-
378
- :param endpoint: API endpoint path.
379
- :param task_id: Unique task identifier.
380
- :param file_path: Path to the file to upload.
381
- :param content_type: MIME type of the file.
382
- :param show_progress: Show upload progress bar.
383
- :raises RomeAuthError: If user is not authenticated.
384
- :raises RomeError: If client error (4xx) occurs.
385
- :raises RomeNetworkError: If network error or server error (5xx) occurs.
386
- """
387
-
388
- if not self._token:
389
- raise RomeAuthError("User not authenticated")
390
-
391
- try:
392
- url = f"{self._api_url}{endpoint}"
393
- headers = {"Authorization": f"Bearer {self._token}", "Content-Type": content_type}
394
- stream_data = self._upload_file_stream(Path(file_path), show_progress)
395
- with httpx.Client(timeout=None) as client:
396
- response = client.post(url, params={"task_id": task_id}, content=stream_data, headers=headers)
397
- self._check_response_errors(response)
398
- except httpx.HTTPError as e:
399
- raise RomeNetworkError(f"Network error: {e}") from e
400
-
401
- def _check_response_errors(self, response: Response | httpx.Response) -> None:
402
- """
403
- Check response for HTTP errors and raise appropriate exceptions.
404
-
405
- :param response: HTTP response object from requests or httpx.
406
- :raises RomeError: If client error (4xx) occurs.
407
- :raises RomeNetworkError: If server error (5xx) occurs.
408
- """
409
-
410
- if response.status_code >= 400:
411
- error_message = self._extract_error_message(response)
412
- if response.status_code < 500:
413
- raise RomeError(error_message)
414
- raise RomeNetworkError(f"Server error: {error_message}")
415
-
416
- def _extract_error_message(self, response: Response | httpx.Response) -> str:
417
- """
418
- Extract error message from response JSON or return generic message.
419
-
420
- :param response: HTTP response object from requests or httpx.
421
- :return: Error message string from response or generic HTTP status message.
422
- """
423
-
424
- try:
425
- data = response.json()
426
- if isinstance(data, dict) and "message" in data:
427
- return data["message"]
428
- except Exception:
429
- pass
430
- return f"HTTP {response.status_code}"
common/rome/error.py DELETED
@@ -1,16 +0,0 @@
1
- class RomeError(Exception):
2
- """
3
- Base error for Rome API operations.
4
- """
5
-
6
-
7
- class RomeAuthError(RomeError):
8
- """
9
- Authentication error when interacting with Rome API.
10
- """
11
-
12
-
13
- class RomeNetworkError(RomeError):
14
- """
15
- Network error when interacting with Rome API.
16
- """
@@ -1,31 +0,0 @@
1
- from common.session.config import BodyType, DistortionModel, GeometryType, LightType, MeshApproximation
2
- from common.session.sim import (
3
- PrimAttributeValue,
4
- PrimInfo,
5
- RpcCall,
6
- RpcError,
7
- RpcResponse,
8
- SceneQueryResponse,
9
- SceneTarget,
10
- SimulationInfo,
11
- SimulationState,
12
- SimulationTime,
13
- )
14
-
15
- __all__ = [
16
- "BodyType",
17
- "DistortionModel",
18
- "GeometryType",
19
- "LightType",
20
- "MeshApproximation",
21
- "PrimAttributeValue",
22
- "PrimInfo",
23
- "RpcCall",
24
- "RpcError",
25
- "RpcResponse",
26
- "SceneQueryResponse",
27
- "SceneTarget",
28
- "SimulationInfo",
29
- "SimulationState",
30
- "SimulationTime",
31
- ]
@@ -1,31 +0,0 @@
1
- import os
2
- from enum import Enum
3
-
4
-
5
- class SessionEnvironment(str, Enum):
6
- """
7
- The environment of Session.
8
-
9
- :cvar ANTIOCH_CLOUD: The Antioch Cloud environment.
10
- :cvar LOCAL: The local environment.
11
- """
12
-
13
- ANTIOCH_CLOUD = "antioch_cloud"
14
- LOCAL = "local"
15
-
16
- def __str__(self) -> str:
17
- return self.value
18
-
19
- @classmethod
20
- def check(cls) -> "SessionEnvironment":
21
- """
22
- Check the session environment by checking the KUBERNETES_SERVICE_HOST
23
- environment variable.
24
-
25
- :return: The session environment.
26
- """
27
-
28
- if os.environ.get("KUBERNETES_SERVICE_HOST") is not None:
29
- return cls.ANTIOCH_CLOUD
30
- else:
31
- return cls.LOCAL
common/session/sim.py DELETED
@@ -1,129 +0,0 @@
1
- from enum import Enum
2
- from typing import Any, TypeVar, cast
3
-
4
- from common.message import Message
5
-
6
- T = TypeVar("T")
7
- _MISSING = object()
8
-
9
-
10
- class SimulationState(str, Enum):
11
- """
12
- Represents the current state of the simulation.
13
- """
14
-
15
- PLAYING = "playing"
16
- PAUSED = "paused"
17
- STOPPED = "stopped"
18
-
19
-
20
- class SimulationInfo(Message):
21
- """
22
- Full simulation info.
23
- """
24
-
25
- state: SimulationState
26
- sim_time_us: int | None
27
-
28
-
29
- class SimulationTime(Message):
30
- """
31
- Current simulation time in microseconds.
32
- """
33
-
34
- time_us: int
35
-
36
-
37
- class RpcError(Message):
38
- """
39
- RPC error details.
40
- """
41
-
42
- message: str
43
- internal: bool = False
44
- traceback: str | None = None
45
-
46
-
47
- class RpcCall(Message):
48
- """
49
- RPC request with dict payload.
50
- """
51
-
52
- data: dict[str, Any] | None = None
53
-
54
- def get(self, key: str, *, type: type[T] | None = None, default: T | object = _MISSING) -> T:
55
- """
56
- Get a value from the call data with optional type conversion.
57
-
58
- If type is a Message subclass, auto-converts via model_validate.
59
- Raises KeyError if key missing and no default provided.
60
-
61
- :param key: The key to lookup in data.
62
- :param type: The expected type class (optional).
63
- :param default: Default value to return if key is missing (can be None).
64
- :return: The value (converted if type provided).
65
- :raises KeyError: If key is missing and no default provided.
66
- """
67
-
68
- if self.data is None or key not in self.data:
69
- if default is not _MISSING:
70
- return cast(T, default)
71
- raise KeyError(f"Missing required field '{key}'")
72
-
73
- value = self.data[key]
74
- if type is not None and isinstance(value, dict) and issubclass(type, Message):
75
- return cast(T, type.model_validate(value))
76
-
77
- return cast(T, value)
78
-
79
-
80
- class RpcResponse(Message):
81
- """
82
- RPC response with arbitrary payload or error.
83
- """
84
-
85
- data: Any = None
86
- error: RpcError | None = None
87
-
88
-
89
- class SceneTarget(str, Enum):
90
- """
91
- Enum representing the different types of prims that can be queried in the scene.
92
- """
93
-
94
- XFORM = "xform"
95
- ARTICULATION = "articulation"
96
- RIGID_BODY = "rigid_body"
97
- JOINT = "joint"
98
- LIGHT = "light"
99
- GROUND_PLANE = "ground_plane"
100
- GEOMETRY = "geometry"
101
- CAMERA = "camera"
102
- RADAR = "radar"
103
- IMU = "imu"
104
- ANIMATION = "animation"
105
-
106
-
107
- class PrimInfo(Message):
108
- """
109
- Information about a prim in the scene with its applicable view types.
110
- """
111
-
112
- path: str
113
- targets: list[SceneTarget]
114
-
115
-
116
- class SceneQueryResponse(Message):
117
- """
118
- Response containing the results of a scene query.
119
- """
120
-
121
- prims: list[PrimInfo]
122
-
123
-
124
- class PrimAttributeValue(Message):
125
- """
126
- Response containing an attribute value.
127
- """
128
-
129
- value: float | int | str | bool | list[float]
common/utils/usd.py DELETED
@@ -1,12 +0,0 @@
1
- import re
2
-
3
-
4
- def sanitize_usd_path(path: str) -> str:
5
- """
6
- Sanitize a path string to be a valid USD path.
7
-
8
- :param path: The path string to sanitize.
9
- :return: The sanitized USD path.
10
- """
11
-
12
- return re.sub(r"[^a-zA-Z0-9_/]", "_", path)
File without changes
File without changes