antioch-py 2.0.6__py3-none-any.whl → 3.0.12__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 (109) 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.0.6.dist-info → antioch_py-3.0.12.dist-info}/METADATA +8 -11
  7. antioch_py-3.0.12.dist-info/RECORD +61 -0
  8. {antioch_py-2.0.6.dist-info → antioch_py-3.0.12.dist-info}/WHEEL +1 -1
  9. antioch_py-3.0.12.dist-info/licenses/LICENSE +21 -0
  10. common/ark/__init__.py +6 -16
  11. common/ark/ark.py +23 -60
  12. common/ark/hardware.py +13 -37
  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 +83 -4
  21. common/core/__init__.py +37 -24
  22. common/core/auth.py +87 -114
  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 -3
  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 +22 -5
  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/sim/objects.py +460 -0
  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 -150
  58. antioch/session/ark.py +0 -504
  59. antioch/session/asset.py +0 -65
  60. antioch/session/error.py +0 -80
  61. antioch/session/record.py +0 -158
  62. antioch/session/scene.py +0 -1521
  63. antioch/session/session.py +0 -220
  64. antioch/session/task.py +0 -323
  65. antioch/session/views/__init__.py +0 -40
  66. antioch/session/views/animation.py +0 -189
  67. antioch/session/views/articulation.py +0 -245
  68. antioch/session/views/basis_curve.py +0 -186
  69. antioch/session/views/camera.py +0 -92
  70. antioch/session/views/collision.py +0 -75
  71. antioch/session/views/geometry.py +0 -74
  72. antioch/session/views/ground_plane.py +0 -63
  73. antioch/session/views/imu.py +0 -73
  74. antioch/session/views/joint.py +0 -64
  75. antioch/session/views/light.py +0 -175
  76. antioch/session/views/pir_sensor.py +0 -140
  77. antioch/session/views/radar.py +0 -73
  78. antioch/session/views/rigid_body.py +0 -282
  79. antioch/session/views/xform.py +0 -119
  80. antioch_py-2.0.6.dist-info/RECORD +0 -99
  81. antioch_py-2.0.6.dist-info/entry_points.txt +0 -2
  82. common/core/agent.py +0 -296
  83. common/core/task.py +0 -36
  84. common/rome/__init__.py +0 -9
  85. common/rome/client.py +0 -430
  86. common/rome/error.py +0 -16
  87. common/session/__init__.py +0 -54
  88. common/session/environment.py +0 -31
  89. common/session/sim.py +0 -240
  90. common/session/views/__init__.py +0 -263
  91. common/session/views/animation.py +0 -73
  92. common/session/views/articulation.py +0 -184
  93. common/session/views/basis_curve.py +0 -102
  94. common/session/views/camera.py +0 -147
  95. common/session/views/collision.py +0 -59
  96. common/session/views/geometry.py +0 -102
  97. common/session/views/ground_plane.py +0 -41
  98. common/session/views/imu.py +0 -66
  99. common/session/views/joint.py +0 -81
  100. common/session/views/light.py +0 -96
  101. common/session/views/pir_sensor.py +0 -115
  102. common/session/views/radar.py +0 -82
  103. common/session/views/rigid_body.py +0 -236
  104. common/session/views/viewport.py +0 -21
  105. common/session/views/xform.py +0 -39
  106. common/utils/usd.py +0 -12
  107. /antioch/{module/clock.py → clock.py} +0 -0
  108. {antioch_py-2.0.6.dist-info → antioch_py-3.0.12.dist-info}/top_level.txt +0 -0
  109. /common/message/{base.py → message.py} +0 -0
common/core/agent.py DELETED
@@ -1,296 +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 AgentResponse(Message):
67
- """
68
- Generic response for agent operations.
69
- """
70
-
71
- _type = "antioch/agent/response"
72
-
73
- success: bool
74
- error: str | None = None
75
-
76
-
77
- class AgentStateResponse(Message):
78
- """
79
- Agent state response.
80
- """
81
-
82
- _type = "antioch/agent/state_response"
83
-
84
- running: bool
85
- ark_active: bool
86
-
87
-
88
- class ArkStateResponse(Message):
89
- """
90
- Ark state response.
91
- """
92
-
93
- _type = "antioch/agent/ark_state_response"
94
-
95
- state: Literal["started", "stopped"]
96
- ark_name: str | None = None
97
- environment: Literal["sim", "real"] | None = None
98
- debug: bool | None = None
99
- global_start_time_us: int | None = None
100
- containers: list[ContainerState] | None = None
101
-
102
-
103
- class AgentError(Exception):
104
- """
105
- Agent operation error.
106
- """
107
-
108
-
109
- class AgentValidationError(Exception):
110
- """
111
- Agent validation error.
112
- """
113
-
114
-
115
- class Agent:
116
- """
117
- Client for interacting with the agent that manages Ark containers.
118
-
119
- The agent is a long-lived container that can start, stop, and manage Arks.
120
- This class provides a simple interface for all agent operations and works
121
- across all environments (sim/real, local/remote).
122
-
123
- Example:
124
- agent = Agent()
125
- agent.start_ark(ark_def, source=ContainerSource.LOCAL)
126
- state = agent.get_ark_state()
127
- agent.stop_ark()
128
- """
129
-
130
- def __init__(self):
131
- """
132
- Initialize the agent client.
133
- """
134
-
135
- self.comms = CommsSession()
136
-
137
- @property
138
- def connected(self) -> bool:
139
- """
140
- Check if the agent is reachable.
141
-
142
- :return: True if connected, False otherwise.
143
- """
144
-
145
- try:
146
- self._query_agent(
147
- path="_agent/get_state",
148
- response_type=AgentStateResponse,
149
- timeout=1.0,
150
- )
151
- return True
152
- except Exception:
153
- return False
154
-
155
- def start_ark(
156
- self,
157
- ark: ArkDefinition,
158
- source: ContainerSource = ContainerSource.LOCAL,
159
- environment: Environment = Environment.SIM,
160
- debug: bool = False,
161
- timeout: float = 30.0,
162
- ) -> None:
163
- """
164
- Start an Ark on the agent by launching all module containers.
165
-
166
- This operation is idempotent. If an Ark is already running, it will be
167
- gracefully stopped before starting the new one.
168
-
169
- :param ark: Ark definition to start.
170
- :param source: Container image source (local or remote).
171
- :param environment: Environment to run in (sim or real).
172
- :param debug: Enable debug mode.
173
- :param timeout: Timeout in seconds for modules to become ready (default: 30.0).
174
- :raises AgentError: If the agent fails to start the Ark.
175
- """
176
-
177
- response = self._query_agent(
178
- path="_agent/start_ark",
179
- response_type=AgentResponse,
180
- request=StartArkRequest(
181
- ark=ark,
182
- source=source,
183
- environment=environment,
184
- debug=debug,
185
- timeout=timeout,
186
- ),
187
- timeout=timeout + 10.0,
188
- )
189
-
190
- if not response.success:
191
- raise AgentError(f"Failed to start Ark: {response.error}")
192
-
193
- def stop_ark(
194
- self,
195
- timeout: float = 30.0,
196
- ) -> None:
197
- """
198
- Stop the currently running Ark on the agent.
199
-
200
- Removes all module containers. The agent continues running and can
201
- accept requests to start a new Ark.
202
-
203
- :param timeout: Timeout in seconds for stopping containers (default: 30.0).
204
- :raises AgentError: If the agent fails to stop the Ark.
205
- """
206
-
207
- response = self._query_agent(
208
- path="_agent/stop_ark",
209
- response_type=AgentResponse,
210
- request=StopArkRequest(timeout=timeout),
211
- timeout=timeout + 10.0,
212
- )
213
-
214
- if not response.success:
215
- raise AgentError(f"Failed to stop Ark: {response.error}")
216
-
217
- def get_ark_state(self) -> ArkStateResponse:
218
- """
219
- Get the current state of the Ark running on the agent.
220
-
221
- Returns the current state including all container statuses.
222
-
223
- :return: Current Ark state with container information.
224
- """
225
-
226
- return self._query_agent(
227
- path="_agent/ark_state",
228
- response_type=ArkStateResponse,
229
- timeout=10.0,
230
- )
231
-
232
- def record_telemetry(self, mcap_path: str | None = None) -> None:
233
- """
234
- Start recording telemetry to an MCAP file.
235
-
236
- Creates an MCAP writer at the specified path. The WebSocket server (port 8765)
237
- and subscriber task are always active, streaming telemetry continuously.
238
- If already recording, finalizes the current recording before starting a new one.
239
-
240
- :param mcap_path: Optional path where the MCAP file will be saved.
241
- :raises AgentError: If the agent fails to start recording telemetry.
242
- """
243
-
244
- response = self.comms.query(
245
- path="_agent/record_telemetry",
246
- response_type=AgentResponse,
247
- request=RecordTelemetryRequest(mcap_path=mcap_path),
248
- timeout=5.0,
249
- )
250
-
251
- if not response.success:
252
- raise AgentError(f"Failed to start recording telemetry: {response.error}")
253
-
254
- def reset_telemetry(self) -> None:
255
- """
256
- Reset telemetry session completely.
257
-
258
- Finalizes any active MCAP recording, resets time tracking, and clears the websocket
259
- session causing all clients to reset their state. This is useful when clearing the
260
- scene and starting a new Ark to ensure LET times start from 0 again.
261
-
262
- :raises AgentError: If the agent fails to reset telemetry.
263
- """
264
-
265
- response = self.comms.query(
266
- path="_agent/reset_telemetry",
267
- response_type=AgentResponse,
268
- timeout=5.0,
269
- )
270
-
271
- if not response.success:
272
- raise AgentError(f"Failed to reset telemetry: {response.error}")
273
-
274
- def _query_agent(
275
- self,
276
- path: str,
277
- response_type: type[T],
278
- request: Message | None = None,
279
- timeout: float = 10.0,
280
- ) -> T:
281
- """
282
- Execute an agent query.
283
-
284
- :param path: The agent query path.
285
- :param response_type: Expected response type.
286
- :param request: Optional request message.
287
- :param timeout: Query timeout in seconds.
288
- :return: The response message.
289
- """
290
-
291
- return self.comms.query(
292
- path=path,
293
- response_type=response_type,
294
- request=request,
295
- timeout=timeout,
296
- )
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"
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
- ]