antioch-py 2.2.4__py3-none-any.whl → 3.0.1__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.4.dist-info → antioch_py-3.0.1.dist-info}/METADATA +8 -11
  7. antioch_py-3.0.1.dist-info/RECORD +61 -0
  8. {antioch_py-2.2.4.dist-info → antioch_py-3.0.1.dist-info}/WHEEL +1 -1
  9. antioch_py-3.0.1.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 -102
  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.4.dist-info/RECORD +0 -85
  81. antioch_py-2.2.4.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 -435
  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.4.dist-info → antioch_py-3.0.1.dist-info}/top_level.txt +0 -0
  94. /common/message/{base.py → message.py} +0 -0
antioch/session/asset.py DELETED
@@ -1,65 +0,0 @@
1
- from pathlib import Path
2
-
3
- from antioch.session.session import SessionContainer
4
- from common.ark import AssetReference
5
- from common.core import list_local_assets, list_remote_assets, pull_remote_asset
6
-
7
-
8
- class Asset(SessionContainer):
9
- """
10
- Provides methods for interacting with the asset registry.
11
-
12
- All methods handle authentication automatically using the current session's auth context.
13
- This is a lightweight wrapper around registry functions that manages auth token complexity.
14
-
15
- Example:
16
- # List local assets
17
- local_assets = Asset.list_local()
18
-
19
- # List remote assets (requires auth)
20
- remote_assets = Asset.list_remote()
21
-
22
- # Pull an asset from remote registry
23
- asset_path = Asset.pull(name="my_asset", version="1.0.0")
24
- """
25
-
26
- @staticmethod
27
- def list_local() -> list[AssetReference]:
28
- """
29
- List all locally available assets.
30
-
31
- :return: List of AssetReference objects from local storage.
32
- """
33
-
34
- return list_local_assets()
35
-
36
- @staticmethod
37
- def list_remote() -> list[AssetReference]:
38
- """
39
- List all assets from remote registry.
40
-
41
- Requires authentication. Call session.login() first if not authenticated.
42
-
43
- :return: List of AssetReference objects from remote registry.
44
- :raises SessionAuthError: If not authenticated.
45
- """
46
-
47
- return list_remote_assets()
48
-
49
- @staticmethod
50
- def pull(name: str, version: str, overwrite: bool = False, show_progress: bool = True) -> Path:
51
- """
52
- Pull an asset from remote registry to local storage.
53
-
54
- Requires authentication. Call session.login() first if not authenticated.
55
- If the asset already exists locally, returns the existing path unless overwrite=True.
56
-
57
- :param name: Name of the asset.
58
- :param version: Version of the asset.
59
- :param overwrite: Overwrite local asset if it already exists.
60
- :param show_progress: Show download progress bar.
61
- :return: Path to the downloaded asset file.
62
- :raises SessionAuthError: If not authenticated.
63
- """
64
-
65
- return pull_remote_asset(name=name, version=version, overwrite=overwrite, show_progress=show_progress)
antioch/session/error.py DELETED
@@ -1,80 +0,0 @@
1
- class SessionError(Exception):
2
- """
3
- Base exception for all session-related errors.
4
- """
5
-
6
-
7
- class SessionSimRpcNotConnectedError(SessionError):
8
- """
9
- Raised when the Sim RPC server is not reachable.
10
- """
11
-
12
-
13
- class SessionSimRpcInterruptedError(SessionError):
14
- """
15
- Raised when the Sim RPC is interrupted.
16
- """
17
-
18
-
19
- class SessionSimRpcClientError(SessionError):
20
- """
21
- Raised when the Sim RPC server returns a client error (user error).
22
- """
23
-
24
-
25
- class SessionSimRpcInternalError(SessionError):
26
- """
27
- Raised when the Sim RPC server returns an internal error with traceback.
28
- """
29
-
30
- def __init__(self, message: str, traceback: str | None = None):
31
- super().__init__(message)
32
- self.traceback = traceback
33
-
34
-
35
- class SessionAuthError(SessionError):
36
- """
37
- Raised when authentication fails.
38
- """
39
-
40
-
41
- class SessionAgentError(SessionError):
42
- """
43
- Raised when an agent operation fails (start/stop ark, telemetry, etc).
44
- """
45
-
46
-
47
- class SessionTaskError(SessionError):
48
- """
49
- Raised when a task operation fails (invalid lifecycle, etc).
50
- """
51
-
52
-
53
- class SessionArkError(SessionError):
54
- """
55
- Raised when an Ark operation fails (loading, stepping, hardware access, etc).
56
- """
57
-
58
-
59
- class SessionHardwareError(SessionError):
60
- """
61
- Raised when a hardware operation fails.
62
- """
63
-
64
-
65
- class SessionAssetError(SessionError):
66
- """
67
- Raised when an asset operation fails.
68
- """
69
-
70
-
71
- class SessionRecordError(SessionError):
72
- """
73
- Raised when a recording operation fails (node output recording, etc).
74
- """
75
-
76
-
77
- class SessionValidationError(SessionError):
78
- """
79
- Raised when input validation fails (user error).
80
- """
@@ -1,40 +0,0 @@
1
- from antioch.session.objects.animation import Animation
2
- from antioch.session.objects.articulation import Articulation
3
- from antioch.session.objects.basis_curve import BasisCurve
4
- from antioch.session.objects.camera import Camera
5
- from antioch.session.objects.collision import (
6
- get_mesh_approximation,
7
- has_collision,
8
- remove_collision,
9
- set_collision,
10
- )
11
- from antioch.session.objects.geometry import Geometry
12
- from antioch.session.objects.ground_plane import GroundPlane
13
- from antioch.session.objects.imu import Imu
14
- from antioch.session.objects.joint import Joint
15
- from antioch.session.objects.light import Light
16
- from antioch.session.objects.pir_sensor import PirSensor, set_pir_material
17
- from antioch.session.objects.radar import Radar
18
- from antioch.session.objects.rigid_body import RigidBody
19
- from antioch.session.objects.xform import XForm
20
-
21
- __all__ = [
22
- "Animation",
23
- "Articulation",
24
- "BasisCurve",
25
- "Camera",
26
- "Geometry",
27
- "GroundPlane",
28
- "Imu",
29
- "Joint",
30
- "Light",
31
- "PirSensor",
32
- "Radar",
33
- "RigidBody",
34
- "XForm",
35
- "get_mesh_approximation",
36
- "has_collision",
37
- "remove_collision",
38
- "set_collision",
39
- "set_pir_material",
40
- ]
@@ -1,162 +0,0 @@
1
- from typing import Literal, overload
2
-
3
- from antioch.session.session import Session, SessionContainer
4
- from common.message import Vector3
5
-
6
-
7
- class Animation(SessionContainer):
8
- """
9
- Ergonomic wrapper for animation operations.
10
-
11
- Animations should be added using scene.add_animation() or retrieved using scene.get_animation().
12
- Animations wrap around an existing skeleton UsdSkel.Root and provide a way to play and control the animation.
13
-
14
- Example:
15
- scene = Scene()
16
-
17
- # Add xform
18
- animation = scene.add_animation(
19
- path="/World/skeleton",
20
- waypoints=[Vector3(1.0, 0.0, 0.0), Vector3(0.0, 1.0, 0.0), Vector3(0.0, 0.0, 1.0)],
21
- loop=True,
22
- )
23
- """
24
-
25
- def __init__(self, path: str):
26
- """
27
- Initialize animation by resolving path and validating existence.
28
-
29
- :param path: USD path for the animation.
30
- """
31
-
32
- super().__init__()
33
- self._path = path
34
-
35
- @overload
36
- @classmethod
37
- def add(cls, path: str, *, waypoints: list[Vector3], loop: bool = True) -> "Animation": ...
38
-
39
- @overload
40
- @classmethod
41
- def add(
42
- cls,
43
- path: str,
44
- *,
45
- basis_curve: str,
46
- samples_per_segment: int = 10,
47
- sort_by: Literal["X", "Y", "Z"] | None = None,
48
- ascending: bool = True,
49
- ) -> "Animation": ...
50
-
51
- @classmethod
52
- def add(
53
- cls,
54
- path: str,
55
- *,
56
- waypoints: list[Vector3] | None = None,
57
- basis_curve: str | None = None,
58
- samples_per_segment: int = 10,
59
- sort_by: Literal["X", "Y", "Z"] | None = None,
60
- ascending: bool = True,
61
- loop: bool = True,
62
- ) -> "Animation":
63
- """
64
- Add an animation to the scene.
65
-
66
- :param path: USD path for the animation.
67
- :param waypoints: List of waypoints.
68
- :param basis_curve: Path to the basis curve to use for the animation.
69
- :param samples_per_segment: The number of samples per segment to use from the basis curve.
70
- :param sort_by: The axis to sort the points by.
71
- :param ascending: Whether to sort the points in ascending order.
72
- :param loop: Whether to loop the animation (waypoints only).
73
- :return: The animation instance.
74
- """
75
-
76
- if waypoints is not None:
77
- Session.get_current().query_sim_rpc(
78
- endpoint="animation/add_from_waypoints",
79
- payload={"path": path, "waypoints": waypoints, "loop": loop},
80
- )
81
- elif basis_curve is not None:
82
- Session.get_current().query_sim_rpc(
83
- endpoint="animation/add_from_basis_curve",
84
- payload={
85
- "path": path,
86
- "basis_curve": basis_curve,
87
- "samples_per_segment": samples_per_segment,
88
- "sort_by": sort_by,
89
- "ascending": ascending,
90
- },
91
- )
92
- else:
93
- raise ValueError("Must provide either waypoints or basis_curve")
94
-
95
- return cls(path)
96
-
97
- @overload
98
- def update(self, *, waypoints: list[Vector3], loop: bool = True) -> "Animation": ...
99
-
100
- @overload
101
- def update(
102
- self,
103
- *,
104
- basis_curve: str,
105
- samples_per_segment: int = 10,
106
- sort_by: Literal["X", "Y", "Z"] | None = None,
107
- ascending: bool = True,
108
- ) -> "Animation": ...
109
-
110
- def update(
111
- self,
112
- *,
113
- waypoints: list[Vector3] | None = None,
114
- basis_curve: str | None = None,
115
- samples_per_segment: int = 10,
116
- sort_by: Literal["X", "Y", "Z"] | None = None,
117
- ascending: bool = True,
118
- loop: bool = True,
119
- ) -> "Animation":
120
- """
121
- Update the animation.
122
-
123
- :param waypoints: List of waypoints.
124
- :param basis_curve: Path to the basis curve to use for the animation.
125
- :param samples_per_segment: The number of samples per segment to use from the basis curve.
126
- :param sort_by: The axis to sort the points by.
127
- :param ascending: Whether to sort the points in ascending order.
128
- :param loop: Whether to loop the animation (waypoints only).
129
- :raises ValueError: If both waypoints and basis curve are provided.
130
- :return: The animation instance.
131
- """
132
-
133
- if waypoints is not None and basis_curve is not None:
134
- raise ValueError("Must provide either waypoints or basis_curve")
135
-
136
- if waypoints is not None:
137
- Session.get_current().query_sim_rpc(
138
- endpoint="animation/update_waypoints",
139
- payload={"path": self._path, "waypoints": waypoints, "loop": loop},
140
- )
141
- elif basis_curve is not None:
142
- Session.get_current().query_sim_rpc(
143
- endpoint="animation/update_basis_curve",
144
- payload={
145
- "path": self._path,
146
- "basis_curve": basis_curve,
147
- "samples_per_segment": samples_per_segment,
148
- "sort_by": sort_by,
149
- "ascending": ascending,
150
- },
151
- )
152
- else:
153
- raise ValueError("Must provide either waypoints or basis_curve")
154
-
155
- return self
156
-
157
- def remove(self) -> None:
158
- """
159
- Remove the animation from the scene (deletes the character).
160
- """
161
-
162
- self._session.query_sim_rpc(endpoint="animation/remove", payload={"path": self._path})
@@ -1,180 +0,0 @@
1
- from antioch.session.session import Session, SessionContainer
2
- from common.message import JointState, JointTarget, Pose, Vector3
3
- from common.session.config import ArticulationConfig, ArticulationJointConfig
4
-
5
-
6
- class Articulation(SessionContainer):
7
- """
8
- Ergonomic wrapper for articulation operations.
9
-
10
- Articulations should be added using scene.add_articulation() or retrieved using scene.get_articulation().
11
-
12
- Example:
13
- scene = Scene()
14
-
15
- # Get an existing articulation
16
- robot = scene.get_articulation(path="/World/robot")
17
-
18
- # Use articulation
19
- joint_states = robot.get_joint_states()
20
- robot.set_joint_targets(
21
- joint_targets=[
22
- JointTarget(position=0.1, velocity=0.0, effort=0.0),
23
- JointTarget(position=0.2, velocity=0.0, effort=0.0),
24
- ]
25
- )
26
- pose = robot.get_world_pose()
27
- """
28
-
29
- def __init__(self, path: str):
30
- """
31
- Initialize articulation by resolving path and validating existence.
32
-
33
- :param path: USD path for the articulation.
34
- """
35
-
36
- super().__init__()
37
- self._session.query_sim_rpc(endpoint="articulation/get", payload={"path": path})
38
- self._path = path
39
-
40
- @classmethod
41
- def add(
42
- cls,
43
- path: str,
44
- config: ArticulationConfig,
45
- world_pose: Pose | None,
46
- local_pose: Pose | None,
47
- scale: Vector3 | None,
48
- ) -> "Articulation":
49
- """
50
- Add an articulation to the scene.
51
-
52
- :param path: USD path for the articulation.
53
- :param config: Articulation configuration.
54
- :param world_pose: Optional world pose.
55
- :param local_pose: Optional local pose.
56
- :param scale: Optional scale.
57
- :return: The articulation instance.
58
- """
59
-
60
- Session.get_current().query_sim_rpc(
61
- endpoint="articulation/add",
62
- payload={"path": path, "config": config, "world_pose": world_pose, "local_pose": local_pose, "scale": scale},
63
- )
64
- return cls(path)
65
-
66
- def get_joint_states(self, joint_names: list[str] | None = None) -> list[JointState]:
67
- """
68
- Get current joint states.
69
-
70
- :param joint_names: Optional list of joint names. If None, returns all joints.
71
- :return: List of joint states.
72
- """
73
-
74
- response = self._session.query_sim_rpc(
75
- endpoint="articulation/get_joint_states",
76
- payload={"path": self._path, "joint_names": joint_names},
77
- )
78
- return [JointState.model_validate(js) for js in response] if response else []
79
-
80
- def get_joint_targets(self, joint_names: list[str] | None = None) -> list[JointTarget]:
81
- """
82
- Get current applied control targets.
83
-
84
- :param joint_names: Optional list of joint names. If None, returns all joints.
85
- :return: List of joint control targets.
86
- """
87
-
88
- response = self._session.query_sim_rpc(
89
- endpoint="articulation/get_joint_targets",
90
- payload={"path": self._path, "joint_names": joint_names},
91
- )
92
- return [JointTarget.model_validate(jt) for jt in response] if response else []
93
-
94
- def get_joint_configs(self, joint_names: list[str] | None = None) -> list[ArticulationJointConfig]:
95
- """
96
- Get complete joint configurations.
97
-
98
- Only returns DOF joints. Non-DOF joints are automatically filtered out.
99
- Use the joint_name field in each config to get joint names.
100
-
101
- :param joint_names: Optional list of joint names. If None, returns all DOF joints.
102
- :return: List of joint configurations (DOF joints only).
103
- """
104
-
105
- response = self._session.query_sim_rpc(
106
- endpoint="articulation/get_joint_configs",
107
- payload={"path": self._path, "joint_names": joint_names},
108
- )
109
- return [ArticulationJointConfig.model_validate(jc) for jc in response] if response else []
110
-
111
- def set_joint_configs(self, joint_configs: list[ArticulationJointConfig]) -> None:
112
- """
113
- Set complete joint configurations.
114
-
115
- :param joint_configs: List of joint configurations to apply.
116
- """
117
-
118
- self._session.query_sim_rpc(endpoint="articulation/set_joint_configs", payload={"path": self._path, "joint_configs": joint_configs})
119
-
120
- def set_joint_states(self, joint_names: list[str] | None = None, joint_states: list[JointState] | None = None) -> None:
121
- """
122
- Set the joint states of the articulation (immediate teleport).
123
-
124
- :param joint_names: Optional list of joint names. If None, sets all joints.
125
- :param joint_states: List of joint states to set.
126
- """
127
-
128
- self._session.query_sim_rpc(
129
- endpoint="articulation/set_joint_states",
130
- payload={"path": self._path, "joint_names": joint_names, "joint_states": joint_states},
131
- )
132
-
133
- def set_joint_targets(self, joint_names: list[str] | None = None, joint_targets: list[JointTarget] | None = None) -> None:
134
- """
135
- Set control targets for the articulation's PD controllers.
136
-
137
- :param joint_names: Optional list of joint names. If None, targets all joints.
138
- :param joint_targets: List of joint control targets.
139
- """
140
-
141
- self._session.query_sim_rpc(
142
- endpoint="articulation/set_joint_targets",
143
- payload={"path": self._path, "joint_names": joint_names, "joint_targets": joint_targets},
144
- )
145
-
146
- def get_world_pose(self) -> Pose:
147
- """
148
- Get the world pose of the articulation.
149
-
150
- :return: World pose.
151
- """
152
-
153
- return self._session.query_sim_rpc(endpoint="articulation/get_world_pose", payload={"path": self._path}, response_type=Pose)
154
-
155
- def get_local_pose(self) -> Pose:
156
- """
157
- Get the local pose of the articulation.
158
-
159
- :return: Local pose.
160
- """
161
-
162
- return self._session.query_sim_rpc(endpoint="articulation/get_local_pose", payload={"path": self._path}, response_type=Pose)
163
-
164
- def set_world_pose(self, pose: Pose | dict) -> None:
165
- """
166
- Set the world pose of the articulation.
167
-
168
- :param pose: World pose as Pose (or dict with position/orientation lists).
169
- """
170
-
171
- self._session.query_sim_rpc(endpoint="articulation/set_world_pose", payload={"path": self._path, "pose": pose})
172
-
173
- def set_local_pose(self, pose: Pose | dict) -> None:
174
- """
175
- Set the local pose of the articulation.
176
-
177
- :param pose: Local pose as Pose (or dict with position/orientation lists).
178
- """
179
-
180
- self._session.query_sim_rpc(endpoint="articulation/set_local_pose", payload={"path": self._path, "pose": pose})