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
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)