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.

Files changed (52) hide show
  1. antioch/session/__init__.py +15 -13
  2. antioch/session/ark.py +22 -26
  3. antioch/session/objects/__init__.py +40 -0
  4. antioch/session/{views → objects}/animation.py +25 -52
  5. antioch/session/{views → objects}/articulation.py +30 -95
  6. antioch/session/{views → objects}/basis_curve.py +18 -54
  7. antioch/session/{views → objects}/camera.py +12 -39
  8. antioch/session/objects/collision.py +46 -0
  9. antioch/session/{views → objects}/geometry.py +6 -22
  10. antioch/session/{views → objects}/ground_plane.py +5 -20
  11. antioch/session/{views → objects}/imu.py +10 -30
  12. antioch/session/{views → objects}/joint.py +5 -20
  13. antioch/session/{views → objects}/light.py +14 -66
  14. antioch/session/{views → objects}/pir_sensor.py +20 -62
  15. antioch/session/{views → objects}/radar.py +18 -29
  16. antioch/session/{views → objects}/rigid_body.py +25 -110
  17. antioch/session/{views → objects}/xform.py +24 -24
  18. antioch/session/scene.py +152 -162
  19. antioch/session/session.py +34 -43
  20. antioch/session/task.py +2 -16
  21. {antioch_py-2.0.6.dist-info → antioch_py-2.1.0.dist-info}/METADATA +1 -1
  22. {antioch_py-2.0.6.dist-info → antioch_py-2.1.0.dist-info}/RECORD +34 -48
  23. common/ark/hardware.py +13 -37
  24. common/ark/kinematics.py +1 -1
  25. common/core/agent.py +28 -0
  26. common/message/__init__.py +2 -0
  27. common/message/pir.py +7 -5
  28. common/message/velocity.py +11 -0
  29. common/session/__init__.py +1 -24
  30. common/session/config.py +390 -0
  31. common/session/sim.py +36 -147
  32. antioch/session/views/__init__.py +0 -40
  33. antioch/session/views/collision.py +0 -75
  34. common/session/views/__init__.py +0 -263
  35. common/session/views/animation.py +0 -73
  36. common/session/views/articulation.py +0 -184
  37. common/session/views/basis_curve.py +0 -102
  38. common/session/views/camera.py +0 -147
  39. common/session/views/collision.py +0 -59
  40. common/session/views/geometry.py +0 -102
  41. common/session/views/ground_plane.py +0 -41
  42. common/session/views/imu.py +0 -66
  43. common/session/views/joint.py +0 -81
  44. common/session/views/light.py +0 -96
  45. common/session/views/pir_sensor.py +0 -115
  46. common/session/views/radar.py +0 -82
  47. common/session/views/rigid_body.py +0 -236
  48. common/session/views/viewport.py +0 -21
  49. common/session/views/xform.py +0 -39
  50. {antioch_py-2.0.6.dist-info → antioch_py-2.1.0.dist-info}/WHEEL +0 -0
  51. {antioch_py-2.0.6.dist-info → antioch_py-2.1.0.dist-info}/entry_points.txt +0 -0
  52. {antioch_py-2.0.6.dist-info → antioch_py-2.1.0.dist-info}/top_level.txt +0 -0
@@ -1,147 +0,0 @@
1
- from enum import Enum
2
-
3
- from pydantic import Field
4
-
5
- from common.message import CameraInfo, Message, Pose
6
-
7
-
8
- class CameraMode(str, Enum):
9
- """
10
- Camera capture modes.
11
- """
12
-
13
- RGB = "rgb"
14
- DEPTH = "depth"
15
-
16
-
17
- class DistortionModel(str, Enum):
18
- """
19
- Camera lens distortion model types.
20
- """
21
-
22
- PINHOLE = "pinhole"
23
- OPENCV_PINHOLE = "opencv_pinhole"
24
- OPENCV_FISHEYE = "opencv_fisheye"
25
- FTHETA = "ftheta"
26
- KANNALA_BRANDT_K3 = "kannala_brandt_k3"
27
- RAD_TAN_THIN_PRISM = "rad_tan_thin_prism"
28
-
29
-
30
- class CameraConfig(Message):
31
- """
32
- Configuration for camera sensor.
33
- """
34
-
35
- mode: CameraMode = Field(default=CameraMode.RGB, description="Camera capture mode (RGB or depth)")
36
- frequency: int = Field(default=30, description="Camera update frequency in Hz")
37
- width: int = Field(default=640, description="Image width in pixels")
38
- height: int = Field(default=480, description="Image height in pixels")
39
- focal_length: float = Field(default=50.0, description="Focal length in mm")
40
- sensor_width: float = Field(default=20.4, description="Physical sensor width in mm")
41
- sensor_height: float = Field(default=15.3, description="Physical sensor height in mm")
42
- near_clip: float = Field(default=0.1, description="Near clipping plane in meters")
43
- far_clip: float = Field(default=1000.0, description="Far clipping plane in meters")
44
- f_stop: float = Field(default=0.0, description="F-stop for depth of field")
45
- focus_distance: float = Field(default=10.0, description="Focus distance in meters")
46
- principal_point_x: float = Field(default=0.0, description="Principal point X offset in pixels")
47
- principal_point_y: float = Field(default=0.0, description="Principal point Y offset in pixels")
48
- distortion_model: DistortionModel = Field(default=DistortionModel.PINHOLE, description="Lens distortion model")
49
- distortion_coefficients: list[float] | None = Field(default=None, description="Distortion coefficients")
50
-
51
- def to_camera_info(self, frame_id: str = "camera_optical_frame") -> CameraInfo:
52
- """
53
- Convert camera configuration to CameraInfo with calculated intrinsics.
54
-
55
- :param frame_id: The coordinate frame ID for the camera.
56
- :return: CameraInfo with full intrinsics and distortion parameters.
57
- """
58
-
59
- # Convert mm to pixels for focal length
60
- fx = self.width * self.focal_length / self.sensor_width
61
- fy = self.height * self.focal_length / self.sensor_height
62
-
63
- # Principal point (image center + offset)
64
- cx = self.width / 2.0 + self.principal_point_x
65
- cy = self.height / 2.0 + self.principal_point_y
66
-
67
- return CameraInfo(
68
- width=self.width,
69
- height=self.height,
70
- fx=fx,
71
- fy=fy,
72
- cx=cx,
73
- cy=cy,
74
- distortion_model=self.distortion_model.value,
75
- distortion_coefficients=self.distortion_coefficients or [],
76
- frame_id=frame_id,
77
- )
78
-
79
-
80
- class GetCamera(Message):
81
- """
82
- Get an existing camera sensor.
83
- """
84
-
85
- path: str | None = Field(default=None, description="USD path of the camera prim")
86
- resolution: tuple[int, int] | None = Field(default=None, description="Image resolution in pixels (width, height)")
87
-
88
-
89
- class GetCameraResponse(Message):
90
- """
91
- Response from getting a camera.
92
- """
93
-
94
- path: str
95
-
96
-
97
- class AddCamera(Message):
98
- """
99
- Add a camera sensor.
100
- """
101
-
102
- path: str = Field(description="USD path for the camera")
103
- config: CameraConfig
104
- world_pose: Pose | None = Field(default=None, description="World pose (position and orientation)")
105
- local_pose: Pose | None = Field(default=None, description="Local pose (translation and orientation)")
106
-
107
-
108
- class GetCameraFrame(Message):
109
- """
110
- Get camera frame with image data.
111
- """
112
-
113
- path: str
114
-
115
-
116
- class BufferCameraRgbRead(Message):
117
- """
118
- Request to buffer current camera RGB frame at simulation time.
119
- """
120
-
121
- path: str
122
-
123
-
124
- class GetBufferedCameraRgbRead(Message):
125
- """
126
- Request to get buffered camera RGB frame at or before simulation time.
127
- """
128
-
129
- path: str
130
- read_sim_time: float
131
-
132
-
133
- class BufferCameraDepthRead(Message):
134
- """
135
- Request to buffer current camera depth frame at simulation time.
136
- """
137
-
138
- path: str
139
-
140
-
141
- class GetBufferedCameraDepthRead(Message):
142
- """
143
- Request to get buffered camera depth frame at or before simulation time.
144
- """
145
-
146
- path: str
147
- read_sim_time: float
@@ -1,59 +0,0 @@
1
- from pydantic import Field
2
-
3
- from common.message import Message
4
- from common.session.views.geometry import MeshApproximation
5
-
6
-
7
- class SetCollision(Message):
8
- """
9
- Apply collision API to a prim, optionally with mesh approximation.
10
- """
11
-
12
- path: str = Field(description="USD path to the prim")
13
- mesh_approximation: MeshApproximation | None = Field(
14
- default=None,
15
- description="Optional mesh approximation method for collision geometry",
16
- )
17
-
18
-
19
- class RemoveCollision(Message):
20
- """
21
- Remove collision API from a prim.
22
- """
23
-
24
- path: str = Field(description="USD path to the prim")
25
-
26
-
27
- class HasCollision(Message):
28
- """
29
- Check if a prim has collision API applied.
30
- """
31
-
32
- path: str = Field(description="USD path to the prim")
33
-
34
-
35
- class HasCollisionResponse(Message):
36
- """
37
- Response for collision check.
38
- """
39
-
40
- has_collision: bool = Field(description="Whether the prim has collision API")
41
-
42
-
43
- class GetMeshApproximation(Message):
44
- """
45
- Get mesh collision approximation from a prim.
46
- """
47
-
48
- path: str = Field(description="USD path to the prim")
49
-
50
-
51
- class GetMeshApproximationResponse(Message):
52
- """
53
- Response for mesh approximation query.
54
- """
55
-
56
- approximation: MeshApproximation | None = Field(
57
- default=None,
58
- description="Mesh approximation method, or None if not set",
59
- )
@@ -1,102 +0,0 @@
1
- from enum import Enum
2
-
3
- from pydantic import Field
4
- from pydantic.alias_generators import to_camel
5
-
6
- from common.message import Message, Pose, Vector3
7
-
8
-
9
- class GeometryType(str, Enum):
10
- """
11
- Supported geometry types.
12
- """
13
-
14
- SPHERE = "sphere"
15
- CUBE = "cube"
16
- CYLINDER = "cylinder"
17
- CONE = "cone"
18
- CAPSULE = "capsule"
19
- MESH = "mesh"
20
-
21
-
22
- class MeshApproximation(str, Enum):
23
- """
24
- Collision mesh approximation type.
25
-
26
- Values are stored in snake_case for consistency with Rust. Use to_usd()
27
- to get the camelCase format required by USD/Isaac Sim.
28
- """
29
-
30
- NONE = "none"
31
- CONVEX_HULL = "convex_hull"
32
- CONVEX_DECOMPOSITION = "convex_decomposition"
33
- BOUNDING_SPHERE = "bounding_sphere"
34
- BOUNDING_CUBE = "bounding_cube"
35
- MESH_SIMPLIFICATION = "mesh_simplification"
36
- SDF = "sdf"
37
- SPHERE_FILL = "sphere_fill"
38
-
39
- def to_usd(self) -> str:
40
- """
41
- Convert to USD camelCase format.
42
-
43
- :return: The USD camelCase format.
44
- """
45
-
46
- return to_camel(self.value)
47
-
48
-
49
- class GeometryConfig(Message):
50
- """
51
- Configuration for creating geometry.
52
- """
53
-
54
- geometry_type: GeometryType = Field(description="Geometry type")
55
- radius: float | None = Field(default=None, description="Radius for sphere/cylinder/cone/capsule")
56
- height: float | None = Field(default=None, description="Height for cylinder/cone/capsule")
57
- size: float | None = Field(default=None, description="Size for cube (uniform)")
58
- color: Vector3 | None = Field(default=None, description="RGB color (0-1)")
59
- opacity: float = Field(default=1.0, description="Opacity (0=transparent, 1=opaque)")
60
- enable_collision: bool = Field(default=True, description="Whether to enable collision on this geometry")
61
- static_friction: float = Field(default=0.5, description="Static friction coefficient")
62
- dynamic_friction: float = Field(default=0.5, description="Dynamic friction coefficient")
63
- restitution: float = Field(default=0.2, description="Restitution (bounciness)")
64
- mesh_file_path: str | None = Field(
65
- default=None,
66
- description="Path to mesh file (FBX, OBJ, glTF, STL, etc.) - required for MESH type",
67
- )
68
- mesh_approximation: MeshApproximation = Field(
69
- default=MeshApproximation.CONVEX_DECOMPOSITION,
70
- description="Mesh approximation method",
71
- )
72
- contact_offset: float | None = Field(default=None, description="Distance at which collision detection begins")
73
- rest_offset: float | None = Field(default=None, description="Minimum separation distance between objects")
74
- torsional_patch_radius: float | None = Field(default=None, description="Radius for torsional friction calculations")
75
- min_torsional_patch_radius: float | None = Field(default=None, description="Minimum radius for torsional friction")
76
-
77
-
78
- class GetGeometry(Message):
79
- """
80
- Get an existing geometry view from a prim.
81
- """
82
-
83
- path: str | None = Field(default=None, description="USD path of the geometry prim")
84
-
85
-
86
- class GetGeometryResponse(Message):
87
- """
88
- Response from getting a geometry.
89
- """
90
-
91
- path: str
92
-
93
-
94
- class AddGeometry(Message):
95
- """
96
- Add a geometry prim with optional pose.
97
- """
98
-
99
- path: str = Field(description="USD path for the geometry")
100
- config: GeometryConfig
101
- world_pose: "Pose | None" = Field(default=None, description="Optional world pose")
102
- local_pose: "Pose | None" = Field(default=None, description="Optional local pose")
@@ -1,41 +0,0 @@
1
- from pydantic import Field
2
-
3
- from common.message import Message, Vector3
4
-
5
-
6
- class GroundPlaneConfig(Message):
7
- """
8
- Configuration for creating a ground plane.
9
- """
10
-
11
- size: float = Field(default=5000.0, description="Size of the ground plane in meters")
12
- z_position: float = Field(default=0.0, description="Z position of the ground plane")
13
- color: Vector3 = Field(default=Vector3.new(0.5, 0.5, 0.5), description="RGB color (0-1)")
14
- static_friction: float = Field(default=0.5, description="Static friction coefficient")
15
- dynamic_friction: float = Field(default=0.5, description="Dynamic friction coefficient")
16
- restitution: float = Field(default=0.0, description="Restitution (bounciness)")
17
-
18
-
19
- class GetGroundPlane(Message):
20
- """
21
- Get an existing ground plane.
22
- """
23
-
24
- path: str | None = Field(default=None, description="USD path of the ground plane prim")
25
-
26
-
27
- class GetGroundPlaneResponse(Message):
28
- """
29
- Response from getting a ground plane.
30
- """
31
-
32
- path: str
33
-
34
-
35
- class AddGroundPlane(Message):
36
- """
37
- Add a ground plane.
38
- """
39
-
40
- path: str = Field(description="USD path for the ground plane")
41
- config: GroundPlaneConfig
@@ -1,66 +0,0 @@
1
- from pydantic import Field
2
-
3
- from common.message import Message, Pose
4
-
5
-
6
- class ImuConfig(Message):
7
- """
8
- Configuration for IMU sensor.
9
- """
10
-
11
- frequency: int | None = Field(default=None, description="Sensor update frequency in Hz (optional, defaults to physics rate)")
12
- linear_acceleration_filter_size: int = Field(default=10, description="Filter window size for linear acceleration")
13
- angular_velocity_filter_size: int = Field(default=10, description="Filter window size for angular velocity")
14
- orientation_filter_size: int = Field(default=10, description="Filter window size for orientation")
15
-
16
-
17
- class GetImu(Message):
18
- """
19
- Get an existing IMU sensor.
20
- """
21
-
22
- path: str | None = Field(default=None, description="USD path of the IMU prim")
23
-
24
-
25
- class GetImuResponse(Message):
26
- """
27
- Response from getting an IMU.
28
- """
29
-
30
- path: str
31
-
32
-
33
- class AddImu(Message):
34
- """
35
- Add an IMU sensor.
36
- """
37
-
38
- path: str = Field(description="USD path for the IMU")
39
- config: ImuConfig
40
- world_pose: Pose | None = Field(default=None, description="World pose (position and orientation)")
41
- local_pose: Pose | None = Field(default=None, description="Local pose (translation and orientation)")
42
-
43
-
44
- class GetImuSample(Message):
45
- """
46
- Get IMU sensor sample.
47
- """
48
-
49
- path: str
50
-
51
-
52
- class BufferImuRead(Message):
53
- """
54
- Request to buffer current IMU data at simulation time.
55
- """
56
-
57
- path: str
58
-
59
-
60
- class GetBufferedImuRead(Message):
61
- """
62
- Request to get buffered IMU data at or before simulation time.
63
- """
64
-
65
- path: str
66
- read_sim_time: float
@@ -1,81 +0,0 @@
1
- from enum import Enum
2
-
3
- from pydantic import Field
4
-
5
- from common.message import Message, Pose
6
-
7
-
8
- class JointType(str, Enum):
9
- """
10
- Types of joints supported by the simulator.
11
- """
12
-
13
- REVOLUTE = "revolute"
14
- PRISMATIC = "prismatic"
15
- FIXED = "fixed"
16
- SPHERICAL = "spherical"
17
- DISTANCE = "distance"
18
- GENERIC = "generic"
19
-
20
-
21
- class JointAxis(str, Enum):
22
- """
23
- Axis of motion for joints.
24
- """
25
-
26
- X = "x"
27
- Y = "y"
28
- Z = "z"
29
-
30
-
31
- class JointConfig(Message):
32
- """
33
- Configuration for a joint object that connects two bodies.
34
- """
35
-
36
- # Joint relationships
37
- parent_path: str = Field(description="USD path to parent body")
38
- child_path: str = Field(description="USD path to child body")
39
-
40
- # Transform
41
- pose: Pose = Field(default_factory=Pose.identity, description="Joint pose relative to parent")
42
-
43
- # Joint properties
44
- joint_type: JointType = Field(default=JointType.FIXED, description="Type of joint motion allowed")
45
- axis: JointAxis = Field(default=JointAxis.X, description="Axis of motion for non-fixed joints")
46
-
47
- # Motion limits (for revolute: degrees, for prismatic: meters)
48
- lower_limit: float | None = Field(default=None, description="Lower motion limit")
49
- upper_limit: float | None = Field(default=None, description="Upper motion limit")
50
-
51
- # Physics properties
52
- friction: float = Field(default=0.01, description="Joint friction (unitless)")
53
- armature: float = Field(default=0.1, description="Joint armature (kg for prismatic, kg-m^2 for revolute)")
54
-
55
- # Special properties
56
- exclude_from_articulation: bool = Field(default=False, description="Whether to exclude this joint from articulation")
57
-
58
-
59
- class GetJoint(Message):
60
- """
61
- Get an existing joint.
62
- """
63
-
64
- path: str | None = Field(default=None, description="USD path of the joint prim")
65
-
66
-
67
- class GetJointResponse(Message):
68
- """
69
- Response from getting a joint.
70
- """
71
-
72
- path: str
73
-
74
-
75
- class AddJoint(Message):
76
- """
77
- Add a joint connecting two bodies.
78
- """
79
-
80
- path: str = Field(description="USD path for the joint")
81
- config: JointConfig
@@ -1,96 +0,0 @@
1
- from enum import Enum
2
-
3
- from pydantic import Field
4
-
5
- from common.message import Message, Pose, Vector3
6
-
7
-
8
- class LightType(str, Enum):
9
- """
10
- Supported light types.
11
- """
12
-
13
- SPHERE = "sphere"
14
- RECT = "rect"
15
- DISK = "disk"
16
- CYLINDER = "cylinder"
17
- DISTANT = "distant"
18
- DOME = "dome"
19
-
20
-
21
- class LightConfig(Message):
22
- """
23
- Configuration for creating a light.
24
- """
25
-
26
- light_type: LightType = Field(default=LightType.SPHERE, description="Light type")
27
- intensity: float = Field(default=30000.0, description="Light intensity")
28
- exposure: float = Field(default=10.0, description="Light exposure")
29
- color: Vector3 = Field(default_factory=Vector3.ones, description="RGB color (0-1)")
30
- radius: float = Field(default=0.1, description="Radius for sphere lights (meters)")
31
- width: float | None = Field(default=None, description="Width for rect lights (meters)")
32
- height: float | None = Field(default=None, description="Height for rect/cylinder lights (meters)")
33
- length: float | None = Field(default=None, description="Length for cylinder lights (meters)")
34
- angle: float | None = Field(default=None, description="Angle for distant lights (degrees)")
35
- texture_file: str | None = Field(default=None, description="Texture file for dome lights")
36
-
37
-
38
- class GetLight(Message):
39
- """
40
- Get an existing light source.
41
- """
42
-
43
- path: str | None = Field(default=None, description="USD path of the light prim")
44
-
45
-
46
- class GetLightResponse(Message):
47
- """
48
- Response from getting a light.
49
- """
50
-
51
- path: str
52
-
53
-
54
- class AddLight(Message):
55
- """
56
- Add a light source.
57
- """
58
-
59
- path: str = Field(description="USD path for the light")
60
- config: LightConfig
61
- world_pose: Pose | None = Field(default=None, description="World pose (position and orientation)")
62
- local_pose: Pose | None = Field(default=None, description="Local pose (translation and orientation)")
63
-
64
-
65
- class SetLightIntensity(Message):
66
- """
67
- Set light intensity.
68
- """
69
-
70
- path: str
71
- intensity: float
72
-
73
-
74
- class SetLightColor(Message):
75
- """
76
- Set light color.
77
- """
78
-
79
- path: str
80
- color: Vector3
81
-
82
-
83
- class EnableLight(Message):
84
- """
85
- Enable light.
86
- """
87
-
88
- path: str
89
-
90
-
91
- class DisableLight(Message):
92
- """
93
- Disable light.
94
- """
95
-
96
- path: str