antioch-py 2.0.6__py3-none-any.whl → 2.1.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.
- 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 +18 -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/{views → objects}/radar.py +18 -29
- antioch/session/{views → objects}/rigid_body.py +25 -110
- antioch/session/{views → objects}/xform.py +24 -24
- antioch/session/scene.py +152 -162
- antioch/session/session.py +34 -43
- antioch/session/task.py +2 -16
- {antioch_py-2.0.6.dist-info → antioch_py-2.1.0.dist-info}/METADATA +1 -1
- {antioch_py-2.0.6.dist-info → antioch_py-2.1.0.dist-info}/RECORD +34 -48
- common/ark/hardware.py +13 -37
- common/ark/kinematics.py +1 -1
- common/core/agent.py +28 -0
- common/message/__init__.py +2 -0
- common/message/pir.py +7 -5
- 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 -40
- antioch/session/views/collision.py +0 -75
- 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/pir_sensor.py +0 -115
- common/session/views/radar.py +0 -82
- 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.6.dist-info → antioch_py-2.1.0.dist-info}/WHEEL +0 -0
- {antioch_py-2.0.6.dist-info → antioch_py-2.1.0.dist-info}/entry_points.txt +0 -0
- {antioch_py-2.0.6.dist-info → antioch_py-2.1.0.dist-info}/top_level.txt +0 -0
antioch/session/session.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import os
|
|
2
2
|
import time
|
|
3
|
-
from typing import overload
|
|
3
|
+
from typing import Any, overload
|
|
4
4
|
|
|
5
5
|
from antioch.session.error import (
|
|
6
6
|
SessionSimRpcClientError,
|
|
@@ -50,7 +50,7 @@ class Session:
|
|
|
50
50
|
|
|
51
51
|
Example:
|
|
52
52
|
session = Session.get_current()
|
|
53
|
-
|
|
53
|
+
result = session.query_sim_rpc("get_state")
|
|
54
54
|
"""
|
|
55
55
|
|
|
56
56
|
_current: "Session | None" = None
|
|
@@ -96,11 +96,7 @@ class Session:
|
|
|
96
96
|
"""
|
|
97
97
|
|
|
98
98
|
try:
|
|
99
|
-
self.query_sim_rpc(
|
|
100
|
-
endpoint="get_info",
|
|
101
|
-
response_type=SimulationInfo,
|
|
102
|
-
timeout=1.0,
|
|
103
|
-
)
|
|
99
|
+
self.query_sim_rpc("get_info", response_type=SimulationInfo, timeout=1.0)
|
|
104
100
|
return True
|
|
105
101
|
except Exception:
|
|
106
102
|
return False
|
|
@@ -141,35 +137,37 @@ class Session:
|
|
|
141
137
|
def query_sim_rpc(
|
|
142
138
|
self,
|
|
143
139
|
endpoint: str,
|
|
144
|
-
|
|
145
|
-
|
|
140
|
+
payload: dict[str, Any] | None = None,
|
|
141
|
+
*,
|
|
146
142
|
timeout: float = 60.0,
|
|
147
|
-
) -> None: ...
|
|
143
|
+
) -> Any | None: ...
|
|
148
144
|
|
|
149
145
|
@overload
|
|
150
|
-
def query_sim_rpc[T
|
|
146
|
+
def query_sim_rpc[T](
|
|
151
147
|
self,
|
|
152
148
|
endpoint: str,
|
|
149
|
+
payload: dict[str, Any] | None = None,
|
|
150
|
+
*,
|
|
153
151
|
response_type: type[T],
|
|
154
|
-
payload: Message | None = None,
|
|
155
152
|
timeout: float = 60.0,
|
|
156
153
|
) -> T: ...
|
|
157
154
|
|
|
158
|
-
def query_sim_rpc[T
|
|
155
|
+
def query_sim_rpc[T](
|
|
159
156
|
self,
|
|
160
157
|
endpoint: str,
|
|
158
|
+
payload: dict[str, Any] | None = None,
|
|
159
|
+
*,
|
|
161
160
|
response_type: type[T] | None = None,
|
|
162
|
-
payload: Message | None = None,
|
|
163
161
|
timeout: float = 60.0,
|
|
164
|
-
) -> T | None:
|
|
162
|
+
) -> T | Any | None:
|
|
165
163
|
"""
|
|
166
164
|
Execute a sim RPC query.
|
|
167
165
|
|
|
168
166
|
:param endpoint: The sim RPC endpoint.
|
|
169
|
-
:param
|
|
170
|
-
:param
|
|
167
|
+
:param payload: Optional request payload dict.
|
|
168
|
+
:param response_type: Expected response type (Message subclass or primitive like int, str, bool).
|
|
171
169
|
:param timeout: Query timeout in seconds.
|
|
172
|
-
:return:
|
|
170
|
+
:return: Response as typed object, arbitrary data, or None.
|
|
173
171
|
:raises SessionSimRpcNotConnectedError: If the Sim RPC server is not reachable.
|
|
174
172
|
:raises SessionSimRpcClientError: If the Sim RPC server returns a client error.
|
|
175
173
|
:raises SessionSimRpcInternalError: If the Sim RPC server returns an internal error.
|
|
@@ -177,24 +175,33 @@ class Session:
|
|
|
177
175
|
|
|
178
176
|
try:
|
|
179
177
|
start_time = time.perf_counter() if self._debug else 0
|
|
180
|
-
|
|
181
|
-
# Normal RPC call
|
|
182
|
-
rpc_response = self._comms.query(
|
|
178
|
+
response = self._comms.query(
|
|
183
179
|
path=f"_sim/rpc/{endpoint}",
|
|
184
180
|
response_type=RpcResponse,
|
|
185
|
-
request=RpcCall(
|
|
181
|
+
request=RpcCall(data=payload),
|
|
186
182
|
timeout=timeout or self._timeout,
|
|
187
183
|
)
|
|
188
184
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
185
|
+
# Check for errors in RPC response
|
|
186
|
+
if response.error is not None:
|
|
187
|
+
if response.error.internal:
|
|
188
|
+
raise SessionSimRpcInternalError(message=response.error.message, traceback=response.error.traceback)
|
|
189
|
+
else:
|
|
190
|
+
raise SessionSimRpcClientError(response.error.message)
|
|
191
|
+
|
|
192
|
+
# Print elapsed time in debug mode
|
|
193
193
|
if self._debug:
|
|
194
194
|
elapsed_ms = (time.perf_counter() - start_time) * 1000
|
|
195
195
|
print(f"[SIM-RPC] {endpoint}: {elapsed_ms:.1f}ms", flush=True)
|
|
196
196
|
|
|
197
|
-
|
|
197
|
+
# Return response data or None if no data
|
|
198
|
+
if response.data is None:
|
|
199
|
+
return None
|
|
200
|
+
if response_type is not None:
|
|
201
|
+
if issubclass(response_type, Message):
|
|
202
|
+
return response_type.model_validate(response.data)
|
|
203
|
+
return response.data
|
|
204
|
+
return response.data
|
|
198
205
|
|
|
199
206
|
except TimeoutError as e:
|
|
200
207
|
if not self.connected:
|
|
@@ -202,19 +209,3 @@ class Session:
|
|
|
202
209
|
raise
|
|
203
210
|
except KeyboardInterrupt as e:
|
|
204
211
|
raise SessionSimRpcInterruptedError("Sim RPC interrupted") from e
|
|
205
|
-
|
|
206
|
-
@staticmethod
|
|
207
|
-
def _check_rpc_error(response: RpcResponse) -> None:
|
|
208
|
-
"""
|
|
209
|
-
Check for errors in Sim RPC response and raise appropriate exceptions.
|
|
210
|
-
|
|
211
|
-
:param response: The Sim RPC response to check.
|
|
212
|
-
:raises SessionSimRpcInternalError: If response contains an internal error.
|
|
213
|
-
:raises SessionSimRpcClientError: If response contains a client error.
|
|
214
|
-
"""
|
|
215
|
-
|
|
216
|
-
if response.error is not None:
|
|
217
|
-
if response.error.internal:
|
|
218
|
-
raise SessionSimRpcInternalError(message=response.error.message, traceback=response.error.traceback)
|
|
219
|
-
else:
|
|
220
|
-
raise SessionSimRpcClientError(response.error.message)
|
antioch/session/task.py
CHANGED
|
@@ -201,8 +201,8 @@ class Task(SessionContainer):
|
|
|
201
201
|
except Exception as e:
|
|
202
202
|
raise SessionTaskError(f"Failed to create bundle: {e}") from e
|
|
203
203
|
|
|
204
|
-
#
|
|
205
|
-
self._agent.
|
|
204
|
+
# Save the MCAP file to disk (does not reset websocket session)
|
|
205
|
+
self._agent.save_telemetry()
|
|
206
206
|
|
|
207
207
|
# Upload task to Antioch Cloud
|
|
208
208
|
try:
|
|
@@ -224,20 +224,6 @@ class Task(SessionContainer):
|
|
|
224
224
|
self._ark_hash = None
|
|
225
225
|
self._task_start_time = None
|
|
226
226
|
|
|
227
|
-
def clear(self) -> None:
|
|
228
|
-
"""
|
|
229
|
-
Clear the task and reset the task state.
|
|
230
|
-
"""
|
|
231
|
-
|
|
232
|
-
self._agent.reset_telemetry()
|
|
233
|
-
self._logger = None
|
|
234
|
-
self._started = False
|
|
235
|
-
self._mcap_path = None
|
|
236
|
-
self._ark_name = None
|
|
237
|
-
self._ark_version = None
|
|
238
|
-
self._ark_hash = None
|
|
239
|
-
self._task_start_time = None
|
|
240
|
-
|
|
241
227
|
def _create_bundle(self, bundle_paths: list[Path]) -> str:
|
|
242
228
|
"""
|
|
243
229
|
Create a tar.gz archive from the provided file paths.
|
|
@@ -7,46 +7,46 @@ antioch/module/input.py,sha256=BGbJ6AOgm7gVTO6PBYs8B53q0v_YD3Jy2joM5M7kUlk,4317
|
|
|
7
7
|
antioch/module/module.py,sha256=6b9s_N1Tpr4Wtp8hXVxZHDzhfKgG2IHeOd8KE65TfMk,7581
|
|
8
8
|
antioch/module/node.py,sha256=1EDNzKbQINs4nKZiSdn_FEPg-3MyCKdC0b7pfucmLgk,14542
|
|
9
9
|
antioch/module/token.py,sha256=6KJbPMoaMqUrx8nfYzAgVTf8EaazT46g6KMC1zO97Pk,830
|
|
10
|
-
antioch/session/__init__.py,sha256
|
|
11
|
-
antioch/session/ark.py,sha256=
|
|
10
|
+
antioch/session/__init__.py,sha256=-TtFaO3SCjIjBvh29Dso54qlfqnfdUbUN_p8tW5i220,3526
|
|
11
|
+
antioch/session/ark.py,sha256=r8hpCM8wymtgIX1mcvGofQR6mZOdn9UCsnFAtnnpvto,18814
|
|
12
12
|
antioch/session/asset.py,sha256=G4wKHVxDkzLEtUap7b7jDF6Y_I4gdHiJ-b756QFBx54,2222
|
|
13
13
|
antioch/session/error.py,sha256=hEByLcsS8PPpK46prnz1GSWBx0ErGTnSkwBd29FUmWg,1685
|
|
14
14
|
antioch/session/record.py,sha256=acNeikDeWJFZLovgwbXGHTriqi5-szYjjrnt9s_cdUY,5527
|
|
15
|
-
antioch/session/scene.py,sha256=
|
|
16
|
-
antioch/session/session.py,sha256=
|
|
17
|
-
antioch/session/task.py,sha256=
|
|
18
|
-
antioch/session/
|
|
19
|
-
antioch/session/
|
|
20
|
-
antioch/session/
|
|
21
|
-
antioch/session/
|
|
22
|
-
antioch/session/
|
|
23
|
-
antioch/session/
|
|
24
|
-
antioch/session/
|
|
25
|
-
antioch/session/
|
|
26
|
-
antioch/session/
|
|
27
|
-
antioch/session/
|
|
28
|
-
antioch/session/
|
|
29
|
-
antioch/session/
|
|
30
|
-
antioch/session/
|
|
31
|
-
antioch/session/
|
|
32
|
-
antioch/session/
|
|
15
|
+
antioch/session/scene.py,sha256=LVUqNZc_PonI8X6tg5rrKSTv3zqdAQERt-QOk-g4MhA,58585
|
|
16
|
+
antioch/session/session.py,sha256=K25RZZ8HYMUpyeDoCzzWh-YLs1DcjBlrzxN2SvbtZ4E,6348
|
|
17
|
+
antioch/session/task.py,sha256=OBGFAD-oWRjkQUAElO9bXhJ_SI-j7S6TxKpUmCgN1-M,11484
|
|
18
|
+
antioch/session/objects/__init__.py,sha256=n7EYDfneWwro1OaXphbWGyasZ0tvAAAGe72PcUmTF_Y,1184
|
|
19
|
+
antioch/session/objects/animation.py,sha256=FIgYsHG9TWcdi5aG3ycGorJv-nJBFkiHArDWXLEx8bY,5427
|
|
20
|
+
antioch/session/objects/articulation.py,sha256=bSAvi6ZOAGOPTsXEtt8fGAG3VF8UR8TxSL0L1izGtbQ,6644
|
|
21
|
+
antioch/session/objects/basis_curve.py,sha256=7LD7B92Ohr2bPm5Lh76NaMbFRiHFcUIxaKjWcMYtykc,4954
|
|
22
|
+
antioch/session/objects/camera.py,sha256=clFfSKKlvMlh8x_OZb7AmHrqmWxO9sI760_LGvIBwBM,2252
|
|
23
|
+
antioch/session/objects/collision.py,sha256=ZGAINF7p3MbCoTwvx4Pzicc8dIfbJgjBgUn_TC_hrT0,1479
|
|
24
|
+
antioch/session/objects/geometry.py,sha256=MuC6qnHCVGnxYGovHU8U2G-tRGbINoL273t3yYQAPCE,1954
|
|
25
|
+
antioch/session/objects/ground_plane.py,sha256=o82nW9Ndhw-AiwiSKUrr1IhspFmdah7BYOTc1EUVEeg,1460
|
|
26
|
+
antioch/session/objects/imu.py,sha256=vx59MutAg1HOEvZESqOmxlQocrnXEW1B5rqD7LBzLwM,1602
|
|
27
|
+
antioch/session/objects/joint.py,sha256=_mqXq1IDvzQ9FnvCpKXGa0YNh8f9zCtmskC8UP4QgNI,1476
|
|
28
|
+
antioch/session/objects/light.py,sha256=Sl0zPIiCnocCCLUaaJaiDLbHVhAJ-ZnIr9IOueIrc_g,3831
|
|
29
|
+
antioch/session/objects/pir_sensor.py,sha256=M7-xs4h0-Mq3_Qea0K4ZrezDTOnqL4nXVjLZIIKHdwU,3455
|
|
30
|
+
antioch/session/objects/radar.py,sha256=BXl8OzngiY_urBRBB7kAlBHvtpR9aosWv7nuYcKSeWo,1930
|
|
31
|
+
antioch/session/objects/rigid_body.py,sha256=TuJ04vG0eyzg4lFAVp7ZE0YTzOjhlcqLoNaeW2sZM0E,6294
|
|
32
|
+
antioch/session/objects/xform.py,sha256=VkSDIfFEuutrDVuKO2F5sI4zKsGa0xZzxFeH-tRMjp0,3237
|
|
33
33
|
common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
34
34
|
common/constants.py,sha256=xlgBKdPoiDzAnWkeEsnktMJfXjBP5FTJkM3MGClTnuY,1085
|
|
35
35
|
common/ark/__init__.py,sha256=Lu2lJ5k7-vN6ZGeX2sYhRwzXEyt9kCyXtgsyvdIaCiU,1472
|
|
36
36
|
common/ark/ark.py,sha256=rToMvtpu634ylJbEfYlTD13Cb3udF_S4SfI8xQsL1P4,2376
|
|
37
|
-
common/ark/hardware.py,sha256=
|
|
38
|
-
common/ark/kinematics.py,sha256=
|
|
37
|
+
common/ark/hardware.py,sha256=5AH9jkrjIvVK6JBfWM7Okpqm9Iqbs7gtyxktlzBS4oI,2252
|
|
38
|
+
common/ark/kinematics.py,sha256=BCPQKmQ5vWlZBCie861TIImmR3X5BniiuGRPoIvByDM,748
|
|
39
39
|
common/ark/module.py,sha256=IwkoirFb4dZkfVpn3tjgChRy5S6hVPbrtR9XgJ5UIBI,1922
|
|
40
40
|
common/ark/node.py,sha256=PWESl7sDdY_Q6aA3CZMRTQ0SONlO9LkUmXhRbUhT8_g,2303
|
|
41
41
|
common/ark/scheduler.py,sha256=QGO_-ZewCvOHJ-w9BAJJQdco0-b-mbbzufpSX9b-mNo,15703
|
|
42
42
|
common/ark/sim.py,sha256=SQtZkf97QF91oLWkTUEhq62GYL3yk7-LLDDR-lXVKcA,900
|
|
43
43
|
common/assets/__init__.py,sha256=We71LsStYI5-hknGd2XHrvHg8G4k1dity887BnI5oPI,102
|
|
44
44
|
common/core/__init__.py,sha256=L8rvLHQd-mOCfDQ2WN9BZiMqU0skeTTkeQvpJ59ouqI,1110
|
|
45
|
-
common/core/agent.py,sha256=
|
|
45
|
+
common/core/agent.py,sha256=EBNSTuxCOUM66UV7e1LA1aQLyYgIsRjFZXWqbbp-lR0,8613
|
|
46
46
|
common/core/auth.py,sha256=TeJIhYm8buQLAkl3jORuGV03pP1MNOhetHunE9z2nsM,9347
|
|
47
47
|
common/core/registry.py,sha256=J2Ihhgr6aTfovm-zSiGEcyHB8iBcpFcZVw6vVYKFjNg,11399
|
|
48
48
|
common/core/task.py,sha256=eybV7yQ8nPYgQtYuse-QvoMJ87Msh6rAN_LUOTGmN94,629
|
|
49
|
-
common/message/__init__.py,sha256=
|
|
49
|
+
common/message/__init__.py,sha256=JHTTMFuMYUF9jspydMihfz2dK9-Mp37zWOTMZBUwK5g,1802
|
|
50
50
|
common/message/annotation.py,sha256=BlzDYhioAK1ATFfgZozmaF7uOqFdSr7KBhe2m03Z2q4,1911
|
|
51
51
|
common/message/array.py,sha256=Fly7u8BE-_QRwnkmv3k6P2EI0FguEUIzF_tE-mFGT1Q,13971
|
|
52
52
|
common/message/base.py,sha256=kdBEmcHy6R9EV_QbarSwPWZE0n_Sar-gXK8g5ceT2-U,18080
|
|
@@ -57,7 +57,7 @@ common/message/image.py,sha256=aF_rU_sOSJQci6g_Wr5Sd16FUFnHm2kgurqWcPPKbaA,5296
|
|
|
57
57
|
common/message/imu.py,sha256=mwIu_dK64aixrnz6Hsg8v-vXVKUabLBNbfHe2KqbVPo,328
|
|
58
58
|
common/message/joint.py,sha256=V9qEILZVaWoAbKGT_V3wvSAvZzoJ7YmrcROkIdzmg5o,1051
|
|
59
59
|
common/message/log.py,sha256=VN1zCwrUtTPNiyakNjYPZuz3UDMtW19fhD1F1M8MTf8,552
|
|
60
|
-
common/message/pir.py,sha256=
|
|
60
|
+
common/message/pir.py,sha256=nSm5dymphomoOZqZAtQeUCowrIginEjVvLwW9NdGNAU,797
|
|
61
61
|
common/message/point.py,sha256=oryHZEltba1z3GFRyb099oDddmiLE5SM4TKexgtBYaE,2229
|
|
62
62
|
common/message/point_cloud.py,sha256=e06e6-bGaN8VzwkCy4MltDZocnKP7Bbr14gBlUhXu-A,2035
|
|
63
63
|
common/message/pose.py,sha256=fcb0-xuIYWaaHHGC_iET9yma1fuicFvXJsaJaLO5XVI,4703
|
|
@@ -65,35 +65,21 @@ common/message/quaternion.py,sha256=Y6-XR3g7VaWVOkLoK6hE26wTYjnJFjrHIv9y17GM1EY,
|
|
|
65
65
|
common/message/radar.py,sha256=18w89hpq5tahh9V_49CWKXkU78b21xrTj_bH35u1UFE,2014
|
|
66
66
|
common/message/types.py,sha256=k2wtbozsyd4HhMBoDfPFMLyCAGmTxaOvVhzIr-wx3N0,480
|
|
67
67
|
common/message/vector.py,sha256=IrREGUi2zKTUmp5PG4YNiJKEM1zRXLl0fK9QuF7I06o,20302
|
|
68
|
+
common/message/velocity.py,sha256=vHcFH_nMNBgobwY7dLeBaHJNvNiJxsQaPxImUh3GjHY,205
|
|
68
69
|
common/rome/__init__.py,sha256=hfwUw5wbT-Ph-OFwGhiqw3XEeWaZwmLAs66LOYKqfzU,210
|
|
69
70
|
common/rome/client.py,sha256=6cFzqXilZWNndRAhJctqdPjQQbJM4a0BzoyGYZapIh0,15462
|
|
70
71
|
common/rome/error.py,sha256=oW8yI81o3hQghop4omFcMkXx4IbacGye38Iyw2VKihQ,294
|
|
71
|
-
common/session/__init__.py,sha256=
|
|
72
|
+
common/session/__init__.py,sha256=S6DsgJbRwFHaEcqe2CNrR_KI2811B1auLv-VX4g5JVU,643
|
|
73
|
+
common/session/config.py,sha256=IxNK4uGRVmruLq9eFktBu8opyc_ACg1kysgkvCb5lho,17874
|
|
72
74
|
common/session/environment.py,sha256=CVW00KXWF8L0L6ocUsZ2UWt-iqAiP0usFdhZsK43fak,714
|
|
73
|
-
common/session/sim.py,sha256=
|
|
74
|
-
common/session/views/__init__.py,sha256=AVqMcuR_rA2mO7JmttYcACnHXsNyIf4xvqmDBCXft30,6525
|
|
75
|
-
common/session/views/animation.py,sha256=Dz9bFMQeLGWaOgQ9GPOMjBBZ7uB2Nynk0ovQl9EDBfA,2407
|
|
76
|
-
common/session/views/articulation.py,sha256=DwJTQk8iU3vII9aEc9_CBtUEszD1uhfCAr2NNJP9SBA,5044
|
|
77
|
-
common/session/views/basis_curve.py,sha256=56ylRppXA6_pUWJvSS_XjgI5rxBtJ0v16zU7vM8RcnQ,3115
|
|
78
|
-
common/session/views/camera.py,sha256=H9Gt0K9DhoiBKxeSyljezj6Mn1-Rp4-vkf_4our3IPE,4458
|
|
79
|
-
common/session/views/collision.py,sha256=brMzJRsYXW9MAqmPMzovSBx73MM870V3hzfkL5yroFY,1360
|
|
80
|
-
common/session/views/geometry.py,sha256=7CBTugs8Onr7tddyzz5g5f3HY7rz_9tuIxYbRWbnFmM,3453
|
|
81
|
-
common/session/views/ground_plane.py,sha256=iHi7bx3qHveh94b88oPz7Yy9cjznc194T6Bx9I6SK1Q,1174
|
|
82
|
-
common/session/views/imu.py,sha256=usMm4yeqY_emcTQGjs2hC3Rk-tfen2dp0fIWTDADpxc,1593
|
|
83
|
-
common/session/views/joint.py,sha256=eP5fLAWqvaQ13xZrNkn79DdRERZMvVrP9emJYZ_J_KA,2098
|
|
84
|
-
common/session/views/light.py,sha256=IpqkSB6qZCfbe63GAJaPHdy4rJDNki8h-Hm-1kwDwHc,2284
|
|
85
|
-
common/session/views/pir_sensor.py,sha256=ykAylA5MK97u_8uyfOYDhoJxdhV023gxn-9EggS3_B8,4936
|
|
86
|
-
common/session/views/radar.py,sha256=kM3HcBriE1bQDwgafsRjInQOkEH05IUynJqutSZyT24,2426
|
|
87
|
-
common/session/views/rigid_body.py,sha256=19cjU2bZvaFzs8OoNsu4gzZHu97nJMUueBc6Wt0NUWk,4523
|
|
88
|
-
common/session/views/viewport.py,sha256=tPb1yCFd5nqCapkqSyWCEJ8joEk3fIIfZNr1uAbNAfM,682
|
|
89
|
-
common/session/views/xform.py,sha256=uxcmtFFGKLF-Jkln1r08CZuyLr7EI8DvdKYuyUFdieM,863
|
|
75
|
+
common/session/sim.py,sha256=CrwVPbu0m8UAFUSsTsU_TMgD1Ik9FKxs9FsaepIuZzg,2859
|
|
90
76
|
common/utils/__init__.py,sha256=9zRb7XayzCGRs4I94hWKJHyQ1MevlUiTzXsPNBLBX7Y,113
|
|
91
77
|
common/utils/comms.py,sha256=1lpnb9ra5I3xv-Eo0GFZ7nR4TjKseOeDNf9QMWQZbds,17283
|
|
92
78
|
common/utils/logger.py,sha256=VcZ4dduWut8xWPs-F5ye8RRrNdBehSSG3r1LAWc-IBY,3389
|
|
93
79
|
common/utils/time.py,sha256=kGDzObbaqWOep4vT1Y2W-BheunxdjYBI4V3Nfp4Ck3Q,790
|
|
94
80
|
common/utils/usd.py,sha256=to4VPtnamMDIQK-pwDIVfiuzUnNzEImj5szOar1NHiE,253
|
|
95
|
-
antioch_py-2.0.
|
|
96
|
-
antioch_py-2.0.
|
|
97
|
-
antioch_py-2.0.
|
|
98
|
-
antioch_py-2.0.
|
|
99
|
-
antioch_py-2.0.
|
|
81
|
+
antioch_py-2.1.0.dist-info/METADATA,sha256=3OC3a-QVismTnO4q-fDOvSjPScvGZqPKSMEeCcrJ-ro,3485
|
|
82
|
+
antioch_py-2.1.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
83
|
+
antioch_py-2.1.0.dist-info/entry_points.txt,sha256=1bLTH5BXCOsQkS8k6L_wJ6Nj62j4aoU9Ey_PhWzsRRM,59
|
|
84
|
+
antioch_py-2.1.0.dist-info/top_level.txt,sha256=GtzNccsep3YdBt9VXQ7-ZFsFJFffr4hyZvqg0YqRqtw,15
|
|
85
|
+
antioch_py-2.1.0.dist-info/RECORD,,
|
common/ark/hardware.py
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
from enum import Enum
|
|
4
|
+
from typing import Annotated, Literal, Union
|
|
4
5
|
|
|
5
|
-
from pydantic import Field
|
|
6
|
+
from pydantic import Field
|
|
6
7
|
|
|
7
8
|
from common.message import Message, Pose
|
|
8
|
-
from common.session.
|
|
9
|
-
from common.session.views.camera import CameraConfig
|
|
10
|
-
from common.session.views.imu import ImuConfig
|
|
11
|
-
from common.session.views.pir_sensor import PirSensorConfig
|
|
12
|
-
from common.session.views.radar import RadarConfig
|
|
9
|
+
from common.session.config import ArticulationConfig, CameraConfig, ImuConfig, PirSensorConfig, RadarConfig
|
|
13
10
|
|
|
14
11
|
|
|
15
12
|
class HardwareType(str, Enum):
|
|
@@ -29,6 +26,7 @@ class ActuatorGroupHardware(Message):
|
|
|
29
26
|
Actuator group hardware that controls multiple joints.
|
|
30
27
|
"""
|
|
31
28
|
|
|
29
|
+
type: Literal[HardwareType.ACTUATOR_GROUP] = HardwareType.ACTUATOR_GROUP
|
|
32
30
|
module: str
|
|
33
31
|
name: str
|
|
34
32
|
config: ArticulationConfig
|
|
@@ -39,6 +37,7 @@ class ImuHardware(Message):
|
|
|
39
37
|
IMU sensor hardware attached to a link.
|
|
40
38
|
"""
|
|
41
39
|
|
|
40
|
+
type: Literal[HardwareType.IMU] = HardwareType.IMU
|
|
42
41
|
module: str
|
|
43
42
|
name: str
|
|
44
43
|
path: str
|
|
@@ -52,6 +51,7 @@ class PirHardware(Message):
|
|
|
52
51
|
PIR (Passive Infrared) sensor hardware attached to a link.
|
|
53
52
|
"""
|
|
54
53
|
|
|
54
|
+
type: Literal[HardwareType.PIR] = HardwareType.PIR
|
|
55
55
|
module: str
|
|
56
56
|
name: str
|
|
57
57
|
path: str
|
|
@@ -65,6 +65,7 @@ class RadarHardware(Message):
|
|
|
65
65
|
Radar sensor hardware attached to a link.
|
|
66
66
|
"""
|
|
67
67
|
|
|
68
|
+
type: Literal[HardwareType.RADAR] = HardwareType.RADAR
|
|
68
69
|
module: str
|
|
69
70
|
name: str
|
|
70
71
|
path: str
|
|
@@ -80,6 +81,7 @@ class CameraHardware(Message):
|
|
|
80
81
|
Used for both RGB and depth cameras - the mode is specified in the config.
|
|
81
82
|
"""
|
|
82
83
|
|
|
84
|
+
type: Literal[HardwareType.CAMERA] = HardwareType.CAMERA
|
|
83
85
|
module: str
|
|
84
86
|
name: str
|
|
85
87
|
path: str
|
|
@@ -88,34 +90,8 @@ class CameraHardware(Message):
|
|
|
88
90
|
config: CameraConfig
|
|
89
91
|
|
|
90
92
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
Union
|
|
94
|
-
""
|
|
95
|
-
|
|
96
|
-
type: HardwareType
|
|
97
|
-
config: ActuatorGroupHardware | ImuHardware | PirHardware | RadarHardware | CameraHardware
|
|
98
|
-
|
|
99
|
-
@field_validator("config", mode="before")
|
|
100
|
-
@classmethod
|
|
101
|
-
def validate_config(cls, config: dict, info: ValidationInfo):
|
|
102
|
-
"""
|
|
103
|
-
Validate the hardware config based on the type field.
|
|
104
|
-
"""
|
|
105
|
-
|
|
106
|
-
hw_type = info.data.get("type")
|
|
107
|
-
if hw_type is None:
|
|
108
|
-
raise ValueError("Hardware type is required")
|
|
109
|
-
match hw_type:
|
|
110
|
-
case HardwareType.ACTUATOR_GROUP:
|
|
111
|
-
return ActuatorGroupHardware.model_validate(config)
|
|
112
|
-
case HardwareType.IMU:
|
|
113
|
-
return ImuHardware.model_validate(config)
|
|
114
|
-
case HardwareType.PIR:
|
|
115
|
-
return PirHardware.model_validate(config)
|
|
116
|
-
case HardwareType.RADAR:
|
|
117
|
-
return RadarHardware.model_validate(config)
|
|
118
|
-
case HardwareType.CAMERA:
|
|
119
|
-
return CameraHardware.model_validate(config)
|
|
120
|
-
case _:
|
|
121
|
-
raise ValueError(f"Unknown hardware type: {hw_type}")
|
|
93
|
+
# Discriminated union based on the 'type' field
|
|
94
|
+
Hardware = Annotated[
|
|
95
|
+
Union[ActuatorGroupHardware, ImuHardware, PirHardware, RadarHardware, CameraHardware],
|
|
96
|
+
Field(discriminator="type"),
|
|
97
|
+
]
|
common/ark/kinematics.py
CHANGED
common/core/agent.py
CHANGED
|
@@ -63,6 +63,14 @@ class RecordTelemetryRequest(Message):
|
|
|
63
63
|
websocket_port: int | None = None
|
|
64
64
|
|
|
65
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
|
+
|
|
66
74
|
class AgentResponse(Message):
|
|
67
75
|
"""
|
|
68
76
|
Generic response for agent operations.
|
|
@@ -251,6 +259,26 @@ class Agent:
|
|
|
251
259
|
if not response.success:
|
|
252
260
|
raise AgentError(f"Failed to start recording telemetry: {response.error}")
|
|
253
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
|
+
|
|
254
282
|
def reset_telemetry(self) -> None:
|
|
255
283
|
"""
|
|
256
284
|
Reset telemetry session completely.
|
common/message/__init__.py
CHANGED
|
@@ -16,6 +16,7 @@ from common.message.quaternion import Quaternion
|
|
|
16
16
|
from common.message.radar import RadarDetection, RadarScan
|
|
17
17
|
from common.message.types import Bool, Float, Int, String
|
|
18
18
|
from common.message.vector import Vector2, Vector3
|
|
19
|
+
from common.message.velocity import Twist
|
|
19
20
|
|
|
20
21
|
__all__ = [
|
|
21
22
|
"Array",
|
|
@@ -56,4 +57,5 @@ __all__ = [
|
|
|
56
57
|
"TextAnnotation",
|
|
57
58
|
"Vector2",
|
|
58
59
|
"Vector3",
|
|
60
|
+
"Twist",
|
|
59
61
|
]
|
common/message/pir.py
CHANGED
|
@@ -9,8 +9,10 @@ class PirStatus(Message):
|
|
|
9
9
|
"""
|
|
10
10
|
|
|
11
11
|
_type = "antioch/pir_status"
|
|
12
|
-
is_detected: bool = Field(description="Whether motion is currently detected")
|
|
13
|
-
signal_strength: float = Field(description="
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
is_detected: bool = Field(description="Whether motion is currently detected (aggregated across all sensors)")
|
|
13
|
+
signal_strength: float = Field(description="Max absolute signal strength across all sensors")
|
|
14
|
+
|
|
15
|
+
# Multi-sensor status
|
|
16
|
+
sensor_states: list[bool] = Field(default_factory=list, description="Detection state per sensor (Center, Left, Right)")
|
|
17
|
+
sensor_signals: list[float] = Field(default_factory=list, description="Signal strength per sensor")
|
|
18
|
+
sensor_thresholds: list[float] = Field(default_factory=list, description="Detection threshold per sensor")
|
common/session/__init__.py
CHANGED
|
@@ -1,54 +1,31 @@
|
|
|
1
|
+
from common.session.config import BodyType, DistortionModel, GeometryType, LightType, MeshApproximation
|
|
1
2
|
from common.session.sim import (
|
|
2
|
-
AddAsset,
|
|
3
|
-
GetLocalPose,
|
|
4
|
-
GetPrimAttribute,
|
|
5
|
-
GetWorldPose,
|
|
6
3
|
PrimAttributeValue,
|
|
7
4
|
PrimInfo,
|
|
8
|
-
QueryScene,
|
|
9
5
|
RpcCall,
|
|
10
6
|
RpcError,
|
|
11
7
|
RpcResponse,
|
|
12
8
|
SceneQueryResponse,
|
|
13
9
|
SceneTarget,
|
|
14
|
-
SetLocalPose,
|
|
15
|
-
SetPrimAttribute,
|
|
16
|
-
SetWorldPose,
|
|
17
10
|
SimulationInfo,
|
|
18
11
|
SimulationState,
|
|
19
12
|
SimulationTime,
|
|
20
|
-
Step,
|
|
21
|
-
ToggleUi,
|
|
22
13
|
)
|
|
23
|
-
from common.session.views.camera import DistortionModel
|
|
24
|
-
from common.session.views.geometry import GeometryType, MeshApproximation
|
|
25
|
-
from common.session.views.light import LightType
|
|
26
|
-
from common.session.views.rigid_body import BodyType
|
|
27
14
|
|
|
28
15
|
__all__ = [
|
|
29
|
-
"AddAsset",
|
|
30
16
|
"BodyType",
|
|
31
17
|
"DistortionModel",
|
|
32
18
|
"GeometryType",
|
|
33
|
-
"GetLocalPose",
|
|
34
|
-
"GetPrimAttribute",
|
|
35
|
-
"GetWorldPose",
|
|
36
19
|
"LightType",
|
|
37
20
|
"MeshApproximation",
|
|
38
21
|
"PrimAttributeValue",
|
|
39
22
|
"PrimInfo",
|
|
40
|
-
"QueryScene",
|
|
41
23
|
"RpcCall",
|
|
42
24
|
"RpcError",
|
|
43
25
|
"RpcResponse",
|
|
44
26
|
"SceneQueryResponse",
|
|
45
27
|
"SceneTarget",
|
|
46
|
-
"SetLocalPose",
|
|
47
|
-
"SetPrimAttribute",
|
|
48
|
-
"SetWorldPose",
|
|
49
28
|
"SimulationInfo",
|
|
50
29
|
"SimulationState",
|
|
51
30
|
"SimulationTime",
|
|
52
|
-
"Step",
|
|
53
|
-
"ToggleUi",
|
|
54
31
|
]
|