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.
- antioch/__init__.py +101 -0
- antioch/{module/execution.py → execution.py} +1 -1
- antioch/{module/input.py → input.py} +2 -4
- antioch/{module/module.py → module.py} +17 -34
- antioch/{module/node.py → node.py} +17 -16
- {antioch_py-2.0.6.dist-info → antioch_py-3.0.12.dist-info}/METADATA +8 -11
- antioch_py-3.0.12.dist-info/RECORD +61 -0
- {antioch_py-2.0.6.dist-info → antioch_py-3.0.12.dist-info}/WHEEL +1 -1
- antioch_py-3.0.12.dist-info/licenses/LICENSE +21 -0
- common/ark/__init__.py +6 -16
- common/ark/ark.py +23 -60
- common/ark/hardware.py +13 -37
- common/ark/kinematics.py +1 -1
- common/ark/module.py +22 -0
- common/ark/node.py +46 -3
- common/ark/scheduler.py +2 -29
- common/ark/sim.py +1 -1
- {antioch/module → common/ark}/token.py +17 -0
- common/assets/rigging.usd +0 -0
- common/constants.py +83 -4
- common/core/__init__.py +37 -24
- common/core/auth.py +87 -114
- common/core/container.py +261 -0
- common/core/registry.py +131 -152
- common/core/rome.py +251 -0
- common/core/telemetry.py +176 -0
- common/core/types.py +219 -0
- common/message/__init__.py +19 -3
- common/message/annotation.py +174 -23
- common/message/array.py +25 -1
- common/message/camera.py +23 -1
- common/message/color.py +32 -6
- common/message/detection.py +40 -0
- common/message/foxglove.py +20 -0
- common/message/frame.py +71 -7
- common/message/image.py +58 -9
- common/message/imu.py +24 -4
- common/message/joint.py +69 -10
- common/message/log.py +52 -7
- common/message/pir.py +22 -5
- common/message/plot.py +57 -0
- common/message/point.py +55 -6
- common/message/point_cloud.py +55 -19
- common/message/pose.py +59 -19
- common/message/quaternion.py +105 -92
- common/message/radar.py +195 -29
- common/message/twist.py +34 -0
- common/message/types.py +40 -5
- common/message/vector.py +180 -245
- common/sim/__init__.py +49 -0
- common/sim/objects.py +460 -0
- common/sim/state.py +11 -0
- common/utils/comms.py +30 -12
- common/utils/logger.py +26 -7
- antioch/message.py +0 -87
- antioch/module/__init__.py +0 -53
- antioch/session/__init__.py +0 -150
- antioch/session/ark.py +0 -504
- antioch/session/asset.py +0 -65
- antioch/session/error.py +0 -80
- antioch/session/record.py +0 -158
- antioch/session/scene.py +0 -1521
- antioch/session/session.py +0 -220
- antioch/session/task.py +0 -323
- antioch/session/views/__init__.py +0 -40
- antioch/session/views/animation.py +0 -189
- antioch/session/views/articulation.py +0 -245
- antioch/session/views/basis_curve.py +0 -186
- antioch/session/views/camera.py +0 -92
- antioch/session/views/collision.py +0 -75
- antioch/session/views/geometry.py +0 -74
- antioch/session/views/ground_plane.py +0 -63
- antioch/session/views/imu.py +0 -73
- antioch/session/views/joint.py +0 -64
- antioch/session/views/light.py +0 -175
- antioch/session/views/pir_sensor.py +0 -140
- antioch/session/views/radar.py +0 -73
- antioch/session/views/rigid_body.py +0 -282
- antioch/session/views/xform.py +0 -119
- antioch_py-2.0.6.dist-info/RECORD +0 -99
- antioch_py-2.0.6.dist-info/entry_points.txt +0 -2
- common/core/agent.py +0 -296
- common/core/task.py +0 -36
- common/rome/__init__.py +0 -9
- common/rome/client.py +0 -430
- common/rome/error.py +0 -16
- common/session/__init__.py +0 -54
- common/session/environment.py +0 -31
- common/session/sim.py +0 -240
- 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
- common/utils/usd.py +0 -12
- /antioch/{module/clock.py → clock.py} +0 -0
- {antioch_py-2.0.6.dist-info → antioch_py-3.0.12.dist-info}/top_level.txt +0 -0
- /common/message/{base.py → message.py} +0 -0
antioch/session/record.py
DELETED
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
from collections import deque
|
|
2
|
-
from threading import Lock
|
|
3
|
-
from typing import TypeVar, overload
|
|
4
|
-
|
|
5
|
-
from antioch.module.node import TOKEN_OUTPUT_PATH
|
|
6
|
-
from antioch.module.token import Token, TokenType
|
|
7
|
-
from antioch.session.error import SessionRecordError
|
|
8
|
-
from common.ark.ark import Ark as ArkDefinition
|
|
9
|
-
from common.message import Message
|
|
10
|
-
from common.utils.comms import CommsSession
|
|
11
|
-
|
|
12
|
-
T = TypeVar("T", bound=Message)
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
class NodeOutputRecorder:
|
|
16
|
-
"""
|
|
17
|
-
Records node outputs by subscribing to token stream with filtering and buffering.
|
|
18
|
-
|
|
19
|
-
Maintains a circular buffer of recent tokens using async callback for efficient updates.
|
|
20
|
-
Validates that module/node/output exists in the Ark definition.
|
|
21
|
-
"""
|
|
22
|
-
|
|
23
|
-
def __init__(
|
|
24
|
-
self,
|
|
25
|
-
comms: CommsSession,
|
|
26
|
-
ark_def: ArkDefinition,
|
|
27
|
-
module_name: str,
|
|
28
|
-
node_name: str,
|
|
29
|
-
output_name: str,
|
|
30
|
-
token_type: TokenType | None = TokenType.DATA,
|
|
31
|
-
last_n: int = 10,
|
|
32
|
-
):
|
|
33
|
-
"""
|
|
34
|
-
Initialize node output recorder with validation and subscription.
|
|
35
|
-
|
|
36
|
-
:param comms: Communication session for subscribing to token stream.
|
|
37
|
-
:param ark_def: Ark definition used to validate module/node/output exists.
|
|
38
|
-
:param module_name: Name of module containing the node.
|
|
39
|
-
:param node_name: Name of node containing the output.
|
|
40
|
-
:param output_name: Name of output to record tokens from.
|
|
41
|
-
:param token_type: Token type to filter (None records all types).
|
|
42
|
-
:param last_n: Maximum number of recent tokens to buffer.
|
|
43
|
-
:raises SessionRecordError: If module, node, or output doesn't exist in Ark.
|
|
44
|
-
"""
|
|
45
|
-
|
|
46
|
-
# Validate module exists
|
|
47
|
-
module = next((m for m in ark_def.modules if m.name == module_name), None)
|
|
48
|
-
if module is None:
|
|
49
|
-
raise SessionRecordError(f"Module '{module_name}' not found in Ark")
|
|
50
|
-
|
|
51
|
-
# Validate node exists
|
|
52
|
-
node = module.nodes.get(node_name)
|
|
53
|
-
if node is None:
|
|
54
|
-
raise SessionRecordError(f"Node '{node_name}' not found in module '{module_name}'")
|
|
55
|
-
|
|
56
|
-
# Validate output exists
|
|
57
|
-
output = node.outputs.get(output_name)
|
|
58
|
-
if output is None:
|
|
59
|
-
raise SessionRecordError(f"Output '{output_name}' not found in node '{module_name}/{node_name}'")
|
|
60
|
-
|
|
61
|
-
self._token_type = token_type
|
|
62
|
-
self._buffer: deque[Token] = deque(maxlen=last_n)
|
|
63
|
-
self._buffer_lock = Lock()
|
|
64
|
-
self._subscriber = comms.declare_callback_subscriber(TOKEN_OUTPUT_PATH.format(path=output.path), self._on_token)
|
|
65
|
-
|
|
66
|
-
@overload
|
|
67
|
-
def next(self, message_cls: type[T]) -> T | None: ...
|
|
68
|
-
|
|
69
|
-
@overload
|
|
70
|
-
def next(self, message_cls: None = None) -> dict | None: ...
|
|
71
|
-
|
|
72
|
-
def next(self, message_cls: type[T] | None = None) -> T | dict | None:
|
|
73
|
-
"""
|
|
74
|
-
Return next deserialized payload in order and remove from buffer.
|
|
75
|
-
|
|
76
|
-
:param message_cls: Message class to deserialize payload (None for generic JSON dict).
|
|
77
|
-
:return: Deserialized payload, or None if buffer empty.
|
|
78
|
-
"""
|
|
79
|
-
|
|
80
|
-
token = self.next_token()
|
|
81
|
-
if token is None:
|
|
82
|
-
return None
|
|
83
|
-
return self._deserialize_payload(token, message_cls)
|
|
84
|
-
|
|
85
|
-
@overload
|
|
86
|
-
def latest(self, message_cls: type[T]) -> T | None: ...
|
|
87
|
-
|
|
88
|
-
@overload
|
|
89
|
-
def latest(self, message_cls: None = None) -> dict | None: ...
|
|
90
|
-
|
|
91
|
-
def latest(self, message_cls: type[T] | None = None) -> T | dict | None:
|
|
92
|
-
"""
|
|
93
|
-
Return latest deserialized payload and clear entire buffer.
|
|
94
|
-
|
|
95
|
-
:param message_cls: Message class to deserialize payload (None for generic JSON dict).
|
|
96
|
-
:return: Deserialized payload, or None if buffer empty.
|
|
97
|
-
"""
|
|
98
|
-
|
|
99
|
-
token = self.latest_token()
|
|
100
|
-
if token is None:
|
|
101
|
-
return None
|
|
102
|
-
return self._deserialize_payload(token, message_cls)
|
|
103
|
-
|
|
104
|
-
def next_token(self) -> Token | None:
|
|
105
|
-
"""
|
|
106
|
-
Return next token in order and remove from buffer.
|
|
107
|
-
|
|
108
|
-
:return: Token, or None if buffer empty.
|
|
109
|
-
"""
|
|
110
|
-
|
|
111
|
-
with self._buffer_lock:
|
|
112
|
-
if not self._buffer:
|
|
113
|
-
return None
|
|
114
|
-
return self._buffer.popleft()
|
|
115
|
-
|
|
116
|
-
def latest_token(self) -> Token | None:
|
|
117
|
-
"""
|
|
118
|
-
Return latest buffered token and clear entire buffer.
|
|
119
|
-
|
|
120
|
-
:return: Token, or None if buffer empty.
|
|
121
|
-
"""
|
|
122
|
-
|
|
123
|
-
with self._buffer_lock:
|
|
124
|
-
if not self._buffer:
|
|
125
|
-
return None
|
|
126
|
-
token = self._buffer[-1]
|
|
127
|
-
self._buffer.clear()
|
|
128
|
-
return token
|
|
129
|
-
|
|
130
|
-
def _on_token(self, sample) -> None:
|
|
131
|
-
"""
|
|
132
|
-
Callback invoked when token arrives, filters by type and adds to buffer.
|
|
133
|
-
|
|
134
|
-
:param sample: Zenoh sample containing token payload.
|
|
135
|
-
"""
|
|
136
|
-
|
|
137
|
-
token = Token.unpack(sample.payload.to_bytes())
|
|
138
|
-
if self._token_type is not None and token.status != self._token_type:
|
|
139
|
-
return
|
|
140
|
-
|
|
141
|
-
with self._buffer_lock:
|
|
142
|
-
self._buffer.append(token)
|
|
143
|
-
|
|
144
|
-
def _deserialize_payload(self, token: Token, message_cls: type[T] | None) -> T | dict | None:
|
|
145
|
-
"""
|
|
146
|
-
Deserialize token payload as specific message type or generic JSON dict.
|
|
147
|
-
|
|
148
|
-
:param token: Token containing payload to deserialize.
|
|
149
|
-
:param message_cls: Message class to deserialize as (None for generic JSON).
|
|
150
|
-
:return: Deserialized payload.
|
|
151
|
-
"""
|
|
152
|
-
|
|
153
|
-
if token.payload is None:
|
|
154
|
-
return None
|
|
155
|
-
elif message_cls is None:
|
|
156
|
-
return Message.extract_data_as_json(token.payload)
|
|
157
|
-
else:
|
|
158
|
-
return message_cls.unpack(token.payload)
|