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/core/agent.py DELETED
@@ -1,324 +0,0 @@
1
- from enum import Enum
2
- from typing import Literal, TypeVar
3
-
4
- from common.ark import Ark as ArkDefinition, Environment
5
- from common.message import Message
6
- from common.utils.comms import CommsSession
7
-
8
- T = TypeVar("T", bound=Message)
9
-
10
-
11
- class ContainerSource(str, Enum):
12
- """
13
- Source for container images.
14
- """
15
-
16
- LOCAL = "Local"
17
- REMOTE = "Remote"
18
-
19
-
20
- class ContainerState(Message):
21
- """
22
- State of a container with metadata.
23
- """
24
-
25
- _type = "antioch/agent/container_state"
26
-
27
- module_name: str
28
- running: bool
29
-
30
-
31
- class StartArkRequest(Message):
32
- """
33
- Request to start an Ark.
34
- """
35
-
36
- _type = "antioch/agent/start_ark_request"
37
-
38
- ark: ArkDefinition
39
- source: ContainerSource
40
- environment: Environment
41
- debug: bool
42
- timeout: float
43
-
44
-
45
- class StopArkRequest(Message):
46
- """
47
- Request to stop an Ark.
48
- """
49
-
50
- _type = "antioch/agent/stop_ark_request"
51
-
52
- timeout: float
53
-
54
-
55
- class RecordTelemetryRequest(Message):
56
- """
57
- Request to start recording telemetry.
58
- """
59
-
60
- _type = "antioch/agent/record_telemetry_request"
61
-
62
- mcap_path: str | None = None
63
- websocket_port: int | None = None
64
-
65
-
66
- class SaveTelemetryRequest(Message):
67
- """
68
- Request to save telemetry (finalize MCAP without resetting session).
69
- """
70
-
71
- _type = "antioch/agent/save_telemetry_request"
72
-
73
-
74
- class AgentResponse(Message):
75
- """
76
- Generic response for agent operations.
77
- """
78
-
79
- _type = "antioch/agent/response"
80
-
81
- success: bool
82
- error: str | None = None
83
-
84
-
85
- class AgentStateResponse(Message):
86
- """
87
- Agent state response.
88
- """
89
-
90
- _type = "antioch/agent/state_response"
91
-
92
- running: bool
93
- ark_active: bool
94
-
95
-
96
- class ArkStateResponse(Message):
97
- """
98
- Ark state response.
99
- """
100
-
101
- _type = "antioch/agent/ark_state_response"
102
-
103
- state: Literal["started", "stopped"]
104
- ark_name: str | None = None
105
- environment: Literal["sim", "real"] | None = None
106
- debug: bool | None = None
107
- global_start_time_us: int | None = None
108
- containers: list[ContainerState] | None = None
109
-
110
-
111
- class AgentError(Exception):
112
- """
113
- Agent operation error.
114
- """
115
-
116
-
117
- class AgentValidationError(Exception):
118
- """
119
- Agent validation error.
120
- """
121
-
122
-
123
- class Agent:
124
- """
125
- Client for interacting with the agent that manages Ark containers.
126
-
127
- The agent is a long-lived container that can start, stop, and manage Arks.
128
- This class provides a simple interface for all agent operations and works
129
- across all environments (sim/real, local/remote).
130
-
131
- Example:
132
- agent = Agent()
133
- agent.start_ark(ark_def, source=ContainerSource.LOCAL)
134
- state = agent.get_ark_state()
135
- agent.stop_ark()
136
- """
137
-
138
- def __init__(self):
139
- """
140
- Initialize the agent client.
141
- """
142
-
143
- self.comms = CommsSession()
144
-
145
- @property
146
- def connected(self) -> bool:
147
- """
148
- Check if the agent is reachable.
149
-
150
- :return: True if connected, False otherwise.
151
- """
152
-
153
- try:
154
- self._query_agent(
155
- path="_agent/get_state",
156
- response_type=AgentStateResponse,
157
- timeout=1.0,
158
- )
159
- return True
160
- except Exception:
161
- return False
162
-
163
- def start_ark(
164
- self,
165
- ark: ArkDefinition,
166
- source: ContainerSource = ContainerSource.LOCAL,
167
- environment: Environment = Environment.SIM,
168
- debug: bool = False,
169
- timeout: float = 30.0,
170
- ) -> None:
171
- """
172
- Start an Ark on the agent by launching all module containers.
173
-
174
- This operation is idempotent. If an Ark is already running, it will be
175
- gracefully stopped before starting the new one.
176
-
177
- :param ark: Ark definition to start.
178
- :param source: Container image source (local or remote).
179
- :param environment: Environment to run in (sim or real).
180
- :param debug: Enable debug mode.
181
- :param timeout: Timeout in seconds for modules to become ready (default: 30.0).
182
- :raises AgentError: If the agent fails to start the Ark.
183
- """
184
-
185
- response = self._query_agent(
186
- path="_agent/start_ark",
187
- response_type=AgentResponse,
188
- request=StartArkRequest(
189
- ark=ark,
190
- source=source,
191
- environment=environment,
192
- debug=debug,
193
- timeout=timeout,
194
- ),
195
- timeout=timeout + 10.0,
196
- )
197
-
198
- if not response.success:
199
- raise AgentError(f"Failed to start Ark: {response.error}")
200
-
201
- def stop_ark(
202
- self,
203
- timeout: float = 30.0,
204
- ) -> None:
205
- """
206
- Stop the currently running Ark on the agent.
207
-
208
- Removes all module containers. The agent continues running and can
209
- accept requests to start a new Ark.
210
-
211
- :param timeout: Timeout in seconds for stopping containers (default: 30.0).
212
- :raises AgentError: If the agent fails to stop the Ark.
213
- """
214
-
215
- response = self._query_agent(
216
- path="_agent/stop_ark",
217
- response_type=AgentResponse,
218
- request=StopArkRequest(timeout=timeout),
219
- timeout=timeout + 10.0,
220
- )
221
-
222
- if not response.success:
223
- raise AgentError(f"Failed to stop Ark: {response.error}")
224
-
225
- def get_ark_state(self) -> ArkStateResponse:
226
- """
227
- Get the current state of the Ark running on the agent.
228
-
229
- Returns the current state including all container statuses.
230
-
231
- :return: Current Ark state with container information.
232
- """
233
-
234
- return self._query_agent(
235
- path="_agent/ark_state",
236
- response_type=ArkStateResponse,
237
- timeout=10.0,
238
- )
239
-
240
- def record_telemetry(self, mcap_path: str | None = None) -> None:
241
- """
242
- Start recording telemetry to an MCAP file.
243
-
244
- Creates an MCAP writer at the specified path. The WebSocket server (port 8765)
245
- and subscriber task are always active, streaming telemetry continuously.
246
- If already recording, finalizes the current recording before starting a new one.
247
-
248
- :param mcap_path: Optional path where the MCAP file will be saved.
249
- :raises AgentError: If the agent fails to start recording telemetry.
250
- """
251
-
252
- response = self.comms.query(
253
- path="_agent/record_telemetry",
254
- response_type=AgentResponse,
255
- request=RecordTelemetryRequest(mcap_path=mcap_path),
256
- timeout=5.0,
257
- )
258
-
259
- if not response.success:
260
- raise AgentError(f"Failed to start recording telemetry: {response.error}")
261
-
262
- def save_telemetry(self) -> None:
263
- """
264
- Save telemetry by finalizing the MCAP file.
265
-
266
- Closes the current MCAP recording if one is active. Does NOT reset the websocket
267
- session or time tracking - telemetry continues streaming to connected clients.
268
-
269
- :raises AgentError: If the agent fails to save telemetry.
270
- """
271
-
272
- response = self.comms.query(
273
- path="_agent/save_telemetry",
274
- response_type=AgentResponse,
275
- request=SaveTelemetryRequest(),
276
- timeout=5.0,
277
- )
278
-
279
- if not response.success:
280
- raise AgentError(f"Failed to save telemetry: {response.error}")
281
-
282
- def reset_telemetry(self) -> None:
283
- """
284
- Reset telemetry session completely.
285
-
286
- Finalizes any active MCAP recording, resets time tracking, and clears the websocket
287
- session causing all clients to reset their state. This is useful when clearing the
288
- scene and starting a new Ark to ensure LET times start from 0 again.
289
-
290
- :raises AgentError: If the agent fails to reset telemetry.
291
- """
292
-
293
- response = self.comms.query(
294
- path="_agent/reset_telemetry",
295
- response_type=AgentResponse,
296
- timeout=5.0,
297
- )
298
-
299
- if not response.success:
300
- raise AgentError(f"Failed to reset telemetry: {response.error}")
301
-
302
- def _query_agent(
303
- self,
304
- path: str,
305
- response_type: type[T],
306
- request: Message | None = None,
307
- timeout: float = 10.0,
308
- ) -> T:
309
- """
310
- Execute an agent query.
311
-
312
- :param path: The agent query path.
313
- :param response_type: Expected response type.
314
- :param request: Optional request message.
315
- :param timeout: Query timeout in seconds.
316
- :return: The response message.
317
- """
318
-
319
- return self.comms.query(
320
- path=path,
321
- response_type=response_type,
322
- request=request,
323
- timeout=timeout,
324
- )
common/core/task.py DELETED
@@ -1,36 +0,0 @@
1
- from datetime import datetime
2
- from enum import Enum
3
-
4
- from common.message import Message
5
-
6
-
7
- class TaskOutcome(str, Enum):
8
- """
9
- Task outcome status.
10
- """
11
-
12
- SUCCESS = "success"
13
- FAILURE = "failure"
14
-
15
-
16
- class TaskCompletion(Message):
17
- """
18
- Task completion message (does not include task ID, as that is the lookup key).
19
- """
20
-
21
- ark_name: str
22
- ark_version: str
23
- ark_hash: str
24
- task_start_time: datetime
25
- task_complete_time: datetime
26
- outcome: TaskOutcome
27
- result: dict | None = None
28
-
29
-
30
- class TaskFileType(str, Enum):
31
- """
32
- Task file type.
33
- """
34
-
35
- MCAP = "mcap"
36
- BUNDLE = "bundle"
@@ -1,11 +0,0 @@
1
- from common.message.base import Message
2
- from common.message.vector import Vector3
3
-
4
-
5
- class Twist(Message):
6
- """
7
- Linear and angular velocity (twist).
8
- """
9
-
10
- linear: Vector3
11
- angular: Vector3
common/rome/__init__.py DELETED
@@ -1,9 +0,0 @@
1
- from common.rome.client import RomeClient
2
- from common.rome.error import RomeAuthError, RomeError, RomeNetworkError
3
-
4
- __all__ = [
5
- "RomeClient",
6
- "RomeError",
7
- "RomeAuthError",
8
- "RomeNetworkError",
9
- ]