antioch-py 2.0.6__tar.gz → 2.1.0__tar.gz
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_py-2.0.6/antioch_py.egg-info → antioch_py-2.1.0}/PKG-INFO +1 -1
- {antioch_py-2.0.6 → antioch_py-2.1.0}/antioch/session/__init__.py +15 -13
- {antioch_py-2.0.6 → antioch_py-2.1.0}/antioch/session/ark.py +22 -26
- antioch_py-2.1.0/antioch/session/objects/__init__.py +40 -0
- {antioch_py-2.0.6/antioch/session/views → antioch_py-2.1.0/antioch/session/objects}/animation.py +25 -52
- {antioch_py-2.0.6/antioch/session/views → antioch_py-2.1.0/antioch/session/objects}/articulation.py +30 -95
- {antioch_py-2.0.6/antioch/session/views → antioch_py-2.1.0/antioch/session/objects}/basis_curve.py +18 -54
- {antioch_py-2.0.6/antioch/session/views → antioch_py-2.1.0/antioch/session/objects}/camera.py +12 -39
- antioch_py-2.1.0/antioch/session/objects/collision.py +46 -0
- {antioch_py-2.0.6/antioch/session/views → antioch_py-2.1.0/antioch/session/objects}/geometry.py +6 -22
- {antioch_py-2.0.6/antioch/session/views → antioch_py-2.1.0/antioch/session/objects}/ground_plane.py +5 -20
- {antioch_py-2.0.6/antioch/session/views → antioch_py-2.1.0/antioch/session/objects}/imu.py +10 -30
- {antioch_py-2.0.6/antioch/session/views → antioch_py-2.1.0/antioch/session/objects}/joint.py +5 -20
- {antioch_py-2.0.6/antioch/session/views → antioch_py-2.1.0/antioch/session/objects}/light.py +14 -66
- {antioch_py-2.0.6/antioch/session/views → antioch_py-2.1.0/antioch/session/objects}/pir_sensor.py +20 -62
- {antioch_py-2.0.6/antioch/session/views → antioch_py-2.1.0/antioch/session/objects}/radar.py +18 -29
- {antioch_py-2.0.6/antioch/session/views → antioch_py-2.1.0/antioch/session/objects}/rigid_body.py +25 -110
- {antioch_py-2.0.6/antioch/session/views → antioch_py-2.1.0/antioch/session/objects}/xform.py +24 -24
- {antioch_py-2.0.6 → antioch_py-2.1.0}/antioch/session/scene.py +152 -162
- {antioch_py-2.0.6 → antioch_py-2.1.0}/antioch/session/session.py +34 -43
- {antioch_py-2.0.6 → antioch_py-2.1.0}/antioch/session/task.py +2 -16
- {antioch_py-2.0.6 → antioch_py-2.1.0/antioch_py.egg-info}/PKG-INFO +1 -1
- {antioch_py-2.0.6 → antioch_py-2.1.0}/antioch_py.egg-info/SOURCES.txt +17 -31
- {antioch_py-2.0.6 → antioch_py-2.1.0}/common/ark/hardware.py +13 -37
- {antioch_py-2.0.6 → antioch_py-2.1.0}/common/ark/kinematics.py +1 -1
- {antioch_py-2.0.6 → antioch_py-2.1.0}/common/core/agent.py +28 -0
- {antioch_py-2.0.6 → antioch_py-2.1.0}/common/message/__init__.py +2 -0
- antioch_py-2.1.0/common/message/pir.py +18 -0
- antioch_py-2.1.0/common/message/velocity.py +11 -0
- antioch_py-2.1.0/common/session/__init__.py +31 -0
- antioch_py-2.1.0/common/session/config.py +390 -0
- antioch_py-2.1.0/common/session/sim.py +129 -0
- {antioch_py-2.0.6 → antioch_py-2.1.0}/pyproject.toml +1 -1
- antioch_py-2.0.6/antioch/session/views/__init__.py +0 -40
- antioch_py-2.0.6/antioch/session/views/collision.py +0 -75
- antioch_py-2.0.6/common/message/pir.py +0 -16
- antioch_py-2.0.6/common/session/__init__.py +0 -54
- antioch_py-2.0.6/common/session/sim.py +0 -240
- antioch_py-2.0.6/common/session/views/__init__.py +0 -263
- antioch_py-2.0.6/common/session/views/animation.py +0 -73
- antioch_py-2.0.6/common/session/views/articulation.py +0 -184
- antioch_py-2.0.6/common/session/views/basis_curve.py +0 -102
- antioch_py-2.0.6/common/session/views/camera.py +0 -147
- antioch_py-2.0.6/common/session/views/collision.py +0 -59
- antioch_py-2.0.6/common/session/views/geometry.py +0 -102
- antioch_py-2.0.6/common/session/views/ground_plane.py +0 -41
- antioch_py-2.0.6/common/session/views/imu.py +0 -66
- antioch_py-2.0.6/common/session/views/joint.py +0 -81
- antioch_py-2.0.6/common/session/views/light.py +0 -96
- antioch_py-2.0.6/common/session/views/pir_sensor.py +0 -115
- antioch_py-2.0.6/common/session/views/radar.py +0 -82
- antioch_py-2.0.6/common/session/views/rigid_body.py +0 -236
- antioch_py-2.0.6/common/session/views/viewport.py +0 -21
- antioch_py-2.0.6/common/session/views/xform.py +0 -39
- {antioch_py-2.0.6 → antioch_py-2.1.0}/MANIFEST.in +0 -0
- {antioch_py-2.0.6 → antioch_py-2.1.0}/README.md +0 -0
- {antioch_py-2.0.6 → antioch_py-2.1.0}/README.pypi.md +0 -0
- {antioch_py-2.0.6 → antioch_py-2.1.0}/antioch/__init__.py +0 -0
- {antioch_py-2.0.6 → antioch_py-2.1.0}/antioch/message.py +0 -0
- {antioch_py-2.0.6 → antioch_py-2.1.0}/antioch/module/__init__.py +0 -0
- {antioch_py-2.0.6 → antioch_py-2.1.0}/antioch/module/clock.py +0 -0
- {antioch_py-2.0.6 → antioch_py-2.1.0}/antioch/module/execution.py +0 -0
- {antioch_py-2.0.6 → antioch_py-2.1.0}/antioch/module/input.py +0 -0
- {antioch_py-2.0.6 → antioch_py-2.1.0}/antioch/module/module.py +0 -0
- {antioch_py-2.0.6 → antioch_py-2.1.0}/antioch/module/node.py +0 -0
- {antioch_py-2.0.6 → antioch_py-2.1.0}/antioch/module/token.py +0 -0
- {antioch_py-2.0.6 → antioch_py-2.1.0}/antioch/session/asset.py +0 -0
- {antioch_py-2.0.6 → antioch_py-2.1.0}/antioch/session/error.py +0 -0
- {antioch_py-2.0.6 → antioch_py-2.1.0}/antioch/session/record.py +0 -0
- {antioch_py-2.0.6 → antioch_py-2.1.0}/antioch_py.egg-info/dependency_links.txt +0 -0
- {antioch_py-2.0.6 → antioch_py-2.1.0}/antioch_py.egg-info/entry_points.txt +0 -0
- {antioch_py-2.0.6 → antioch_py-2.1.0}/antioch_py.egg-info/requires.txt +0 -0
- {antioch_py-2.0.6 → antioch_py-2.1.0}/antioch_py.egg-info/top_level.txt +0 -0
- {antioch_py-2.0.6 → antioch_py-2.1.0}/common/__init__.py +0 -0
- {antioch_py-2.0.6 → antioch_py-2.1.0}/common/ark/__init__.py +0 -0
- {antioch_py-2.0.6 → antioch_py-2.1.0}/common/ark/ark.py +0 -0
- {antioch_py-2.0.6 → antioch_py-2.1.0}/common/ark/module.py +0 -0
- {antioch_py-2.0.6 → antioch_py-2.1.0}/common/ark/node.py +0 -0
- {antioch_py-2.0.6 → antioch_py-2.1.0}/common/ark/scheduler.py +0 -0
- {antioch_py-2.0.6 → antioch_py-2.1.0}/common/ark/sim.py +0 -0
- {antioch_py-2.0.6 → antioch_py-2.1.0}/common/assets/__init__.py +0 -0
- {antioch_py-2.0.6 → antioch_py-2.1.0}/common/constants.py +0 -0
- {antioch_py-2.0.6 → antioch_py-2.1.0}/common/core/__init__.py +0 -0
- {antioch_py-2.0.6 → antioch_py-2.1.0}/common/core/auth.py +0 -0
- {antioch_py-2.0.6 → antioch_py-2.1.0}/common/core/registry.py +0 -0
- {antioch_py-2.0.6 → antioch_py-2.1.0}/common/core/task.py +0 -0
- {antioch_py-2.0.6 → antioch_py-2.1.0}/common/message/annotation.py +0 -0
- {antioch_py-2.0.6 → antioch_py-2.1.0}/common/message/array.py +0 -0
- {antioch_py-2.0.6 → antioch_py-2.1.0}/common/message/base.py +0 -0
- {antioch_py-2.0.6 → antioch_py-2.1.0}/common/message/camera.py +0 -0
- {antioch_py-2.0.6 → antioch_py-2.1.0}/common/message/color.py +0 -0
- {antioch_py-2.0.6 → antioch_py-2.1.0}/common/message/frame.py +0 -0
- {antioch_py-2.0.6 → antioch_py-2.1.0}/common/message/image.py +0 -0
- {antioch_py-2.0.6 → antioch_py-2.1.0}/common/message/imu.py +0 -0
- {antioch_py-2.0.6 → antioch_py-2.1.0}/common/message/joint.py +0 -0
- {antioch_py-2.0.6 → antioch_py-2.1.0}/common/message/log.py +0 -0
- {antioch_py-2.0.6 → antioch_py-2.1.0}/common/message/point.py +0 -0
- {antioch_py-2.0.6 → antioch_py-2.1.0}/common/message/point_cloud.py +0 -0
- {antioch_py-2.0.6 → antioch_py-2.1.0}/common/message/pose.py +0 -0
- {antioch_py-2.0.6 → antioch_py-2.1.0}/common/message/quaternion.py +0 -0
- {antioch_py-2.0.6 → antioch_py-2.1.0}/common/message/radar.py +0 -0
- {antioch_py-2.0.6 → antioch_py-2.1.0}/common/message/types.py +0 -0
- {antioch_py-2.0.6 → antioch_py-2.1.0}/common/message/vector.py +0 -0
- {antioch_py-2.0.6 → antioch_py-2.1.0}/common/rome/__init__.py +0 -0
- {antioch_py-2.0.6 → antioch_py-2.1.0}/common/rome/client.py +0 -0
- {antioch_py-2.0.6 → antioch_py-2.1.0}/common/rome/error.py +0 -0
- {antioch_py-2.0.6 → antioch_py-2.1.0}/common/session/environment.py +0 -0
- {antioch_py-2.0.6 → antioch_py-2.1.0}/common/utils/__init__.py +0 -0
- {antioch_py-2.0.6 → antioch_py-2.1.0}/common/utils/comms.py +0 -0
- {antioch_py-2.0.6 → antioch_py-2.1.0}/common/utils/logger.py +0 -0
- {antioch_py-2.0.6 → antioch_py-2.1.0}/common/utils/time.py +0 -0
- {antioch_py-2.0.6 → antioch_py-2.1.0}/common/utils/usd.py +0 -0
- {antioch_py-2.0.6 → antioch_py-2.1.0}/setup.cfg +0 -0
|
@@ -13,10 +13,10 @@ from antioch.session.error import (
|
|
|
13
13
|
SessionTaskError,
|
|
14
14
|
SessionValidationError,
|
|
15
15
|
)
|
|
16
|
+
from antioch.session.objects import Articulation, BasisCurve, Camera, Geometry, GroundPlane, Imu, Joint, Light, Radar, RigidBody, XForm
|
|
16
17
|
from antioch.session.scene import Scene
|
|
17
18
|
from antioch.session.session import Session, SessionContainer
|
|
18
19
|
from antioch.session.task import Task, TaskOutcome
|
|
19
|
-
from antioch.session.views import Articulation, BasisCurve, Camera, Geometry, GroundPlane, Imu, Joint, Light, Radar, RigidBody, XForm
|
|
20
20
|
from common.ark import (
|
|
21
21
|
ArkInfo,
|
|
22
22
|
ArkMetadata,
|
|
@@ -43,16 +43,20 @@ from common.core import (
|
|
|
43
43
|
Organization,
|
|
44
44
|
)
|
|
45
45
|
from common.message import ImuSample, JointState, JointStates, JointTarget, JointTargets, Pose
|
|
46
|
+
from common.session.config import (
|
|
47
|
+
ArticulationJointConfig,
|
|
48
|
+
BodyType,
|
|
49
|
+
CameraConfig,
|
|
50
|
+
DistortionModel,
|
|
51
|
+
GeometryType,
|
|
52
|
+
ImuConfig,
|
|
53
|
+
JointAxis,
|
|
54
|
+
JointType,
|
|
55
|
+
LightType,
|
|
56
|
+
MeshApproximation,
|
|
57
|
+
RadarConfig,
|
|
58
|
+
)
|
|
46
59
|
from common.session.sim import SimulationInfo, SimulationState, SimulationTime
|
|
47
|
-
from common.session.views.articulation import ArticulationJointConfig
|
|
48
|
-
from common.session.views.camera import CameraConfig, DistortionModel
|
|
49
|
-
from common.session.views.geometry import GeometryType, MeshApproximation
|
|
50
|
-
from common.session.views.imu import ImuConfig
|
|
51
|
-
from common.session.views.joint import JointAxis, JointType
|
|
52
|
-
from common.session.views.light import LightType
|
|
53
|
-
from common.session.views.radar import RadarConfig
|
|
54
|
-
from common.session.views.rigid_body import BodyType
|
|
55
|
-
from common.session.views.viewport import SetActiveViewportCamera, SetCameraView
|
|
56
60
|
|
|
57
61
|
__all__ = [
|
|
58
62
|
# Core containers
|
|
@@ -69,7 +73,7 @@ __all__ = [
|
|
|
69
73
|
"SessionContainer",
|
|
70
74
|
"Task",
|
|
71
75
|
"TaskOutcome",
|
|
72
|
-
#
|
|
76
|
+
# Object containers
|
|
73
77
|
"Articulation",
|
|
74
78
|
"Camera",
|
|
75
79
|
"Geometry",
|
|
@@ -81,8 +85,6 @@ __all__ = [
|
|
|
81
85
|
"RigidBody",
|
|
82
86
|
"XForm",
|
|
83
87
|
"BasisCurve",
|
|
84
|
-
"SetActiveViewportCamera",
|
|
85
|
-
"SetCameraView",
|
|
86
88
|
# Session client and errors
|
|
87
89
|
"Session",
|
|
88
90
|
"SessionError",
|
|
@@ -3,15 +3,15 @@ from typing import TYPE_CHECKING, cast
|
|
|
3
3
|
|
|
4
4
|
from antioch.module.token import TokenType
|
|
5
5
|
from antioch.session.error import SessionArkError, SessionAssetError
|
|
6
|
+
from antioch.session.objects.articulation import Articulation
|
|
7
|
+
from antioch.session.objects.camera import Camera
|
|
8
|
+
from antioch.session.objects.imu import Imu
|
|
9
|
+
from antioch.session.objects.pir_sensor import PirSensor
|
|
10
|
+
from antioch.session.objects.radar import Radar
|
|
6
11
|
from antioch.session.record import NodeOutputRecorder
|
|
7
12
|
from antioch.session.session import SessionContainer
|
|
8
|
-
from antioch.session.views.articulation import Articulation
|
|
9
|
-
from antioch.session.views.camera import Camera
|
|
10
|
-
from antioch.session.views.imu import Imu
|
|
11
|
-
from antioch.session.views.pir_sensor import PirSensor
|
|
12
|
-
from antioch.session.views.radar import Radar
|
|
13
13
|
from common.ark import Ark as ArkDefinition, ArkReference, Environment, HardwareAccessMode
|
|
14
|
-
from common.ark.hardware import ActuatorGroupHardware,
|
|
14
|
+
from common.ark.hardware import ActuatorGroupHardware, HardwareType
|
|
15
15
|
from common.ark.scheduler import NodeCompleteEvent, NodeStartEvent, OnlineScheduler
|
|
16
16
|
from common.ark.sim import SimNodeComplete, SimNodeStart
|
|
17
17
|
from common.core import (
|
|
@@ -453,35 +453,31 @@ class Ark(SessionContainer):
|
|
|
453
453
|
self._radars: dict[tuple[str, str], Radar] = {}
|
|
454
454
|
for hardware in self._ark_def.hardware:
|
|
455
455
|
if hardware.type == HardwareType.CAMERA:
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
local_pose=camera_hw.pose,
|
|
456
|
+
self._cameras[(hardware.module, hardware.name)] = self._scene.add_camera(
|
|
457
|
+
path=f"{self._base_path}{hardware.path}",
|
|
458
|
+
config=hardware.config,
|
|
459
|
+
local_pose=hardware.pose,
|
|
461
460
|
)
|
|
462
461
|
|
|
463
462
|
elif hardware.type == HardwareType.IMU:
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
local_pose=imu_hw.pose,
|
|
463
|
+
self._imus[(hardware.module, hardware.name)] = self._scene.add_imu(
|
|
464
|
+
path=f"{self._base_path}{hardware.path}",
|
|
465
|
+
config=hardware.config,
|
|
466
|
+
local_pose=hardware.pose,
|
|
469
467
|
)
|
|
470
468
|
|
|
471
469
|
elif hardware.type == HardwareType.PIR:
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
local_pose=pir_hw.pose,
|
|
470
|
+
self._pirs[(hardware.module, hardware.name)] = self._scene.add_pir_sensor(
|
|
471
|
+
path=f"{self._base_path}{hardware.path}",
|
|
472
|
+
config=hardware.config,
|
|
473
|
+
local_pose=hardware.pose,
|
|
477
474
|
)
|
|
478
475
|
|
|
479
476
|
elif hardware.type == HardwareType.RADAR:
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
local_pose=radar_hw.pose,
|
|
477
|
+
self._radars[(hardware.module, hardware.name)] = self._scene.add_radar(
|
|
478
|
+
path=f"{self._base_path}{hardware.path}",
|
|
479
|
+
config=hardware.config,
|
|
480
|
+
local_pose=hardware.pose,
|
|
485
481
|
)
|
|
486
482
|
|
|
487
483
|
def _load_ark_asset(self, world_pose: Pose | None = None, local_pose: Pose | None = None) -> None:
|
|
@@ -0,0 +1,40 @@
|
|
|
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
|
+
]
|
{antioch_py-2.0.6/antioch/session/views → antioch_py-2.1.0/antioch/session/objects}/animation.py
RENAMED
|
@@ -2,13 +2,6 @@ from typing import Literal, overload
|
|
|
2
2
|
|
|
3
3
|
from antioch.session.session import Session, SessionContainer
|
|
4
4
|
from common.message import Vector3
|
|
5
|
-
from common.session.views.animation import (
|
|
6
|
-
AddAnimationFromBasisCurve,
|
|
7
|
-
AddAnimationFromWaypoints,
|
|
8
|
-
RemoveAnimation,
|
|
9
|
-
UpdateAnimationBasisCurve,
|
|
10
|
-
UpdateAnimationWaypoints,
|
|
11
|
-
)
|
|
12
5
|
|
|
13
6
|
|
|
14
7
|
class Animation(SessionContainer):
|
|
@@ -41,13 +34,7 @@ class Animation(SessionContainer):
|
|
|
41
34
|
|
|
42
35
|
@overload
|
|
43
36
|
@classmethod
|
|
44
|
-
def add(
|
|
45
|
-
cls,
|
|
46
|
-
path: str,
|
|
47
|
-
*,
|
|
48
|
-
waypoints: list[Vector3],
|
|
49
|
-
loop: bool = True,
|
|
50
|
-
) -> "Animation": ...
|
|
37
|
+
def add(cls, path: str, *, waypoints: list[Vector3], loop: bool = True) -> "Animation": ...
|
|
51
38
|
|
|
52
39
|
@overload
|
|
53
40
|
@classmethod
|
|
@@ -88,23 +75,19 @@ class Animation(SessionContainer):
|
|
|
88
75
|
|
|
89
76
|
if waypoints is not None:
|
|
90
77
|
Session.get_current().query_sim_rpc(
|
|
91
|
-
endpoint="
|
|
92
|
-
payload=
|
|
93
|
-
path=path,
|
|
94
|
-
waypoints=waypoints,
|
|
95
|
-
loop=loop,
|
|
96
|
-
),
|
|
78
|
+
endpoint="animation/add_from_waypoints",
|
|
79
|
+
payload={"path": path, "waypoints": waypoints, "loop": loop},
|
|
97
80
|
)
|
|
98
81
|
elif basis_curve is not None:
|
|
99
82
|
Session.get_current().query_sim_rpc(
|
|
100
|
-
endpoint="
|
|
101
|
-
payload=
|
|
102
|
-
path
|
|
103
|
-
basis_curve
|
|
104
|
-
samples_per_segment
|
|
105
|
-
sort_by
|
|
106
|
-
ascending
|
|
107
|
-
|
|
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
|
+
},
|
|
108
91
|
)
|
|
109
92
|
else:
|
|
110
93
|
raise ValueError("Must provide either waypoints or basis_curve")
|
|
@@ -112,12 +95,7 @@ class Animation(SessionContainer):
|
|
|
112
95
|
return cls(path)
|
|
113
96
|
|
|
114
97
|
@overload
|
|
115
|
-
def update(
|
|
116
|
-
self,
|
|
117
|
-
*,
|
|
118
|
-
waypoints: list[Vector3],
|
|
119
|
-
loop: bool = True,
|
|
120
|
-
) -> "Animation": ...
|
|
98
|
+
def update(self, *, waypoints: list[Vector3], loop: bool = True) -> "Animation": ...
|
|
121
99
|
|
|
122
100
|
@overload
|
|
123
101
|
def update(
|
|
@@ -151,31 +129,29 @@ class Animation(SessionContainer):
|
|
|
151
129
|
:raises ValueError: If both waypoints and basis curve are provided.
|
|
152
130
|
:return: The animation instance.
|
|
153
131
|
"""
|
|
132
|
+
|
|
154
133
|
if waypoints is not None and basis_curve is not None:
|
|
155
134
|
raise ValueError("Must provide either waypoints or basis_curve")
|
|
156
135
|
|
|
157
136
|
if waypoints is not None:
|
|
158
137
|
Session.get_current().query_sim_rpc(
|
|
159
|
-
endpoint="
|
|
160
|
-
payload=
|
|
161
|
-
path=self._path,
|
|
162
|
-
waypoints=waypoints,
|
|
163
|
-
loop=loop,
|
|
164
|
-
),
|
|
138
|
+
endpoint="animation/update_waypoints",
|
|
139
|
+
payload={"path": self._path, "waypoints": waypoints, "loop": loop},
|
|
165
140
|
)
|
|
166
141
|
elif basis_curve is not None:
|
|
167
142
|
Session.get_current().query_sim_rpc(
|
|
168
|
-
endpoint="
|
|
169
|
-
payload=
|
|
170
|
-
path
|
|
171
|
-
basis_curve
|
|
172
|
-
samples_per_segment
|
|
173
|
-
sort_by
|
|
174
|
-
ascending
|
|
175
|
-
|
|
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
|
+
},
|
|
176
151
|
)
|
|
177
152
|
else:
|
|
178
153
|
raise ValueError("Must provide either waypoints or basis_curve")
|
|
154
|
+
|
|
179
155
|
return self
|
|
180
156
|
|
|
181
157
|
def remove(self) -> None:
|
|
@@ -183,7 +159,4 @@ class Animation(SessionContainer):
|
|
|
183
159
|
Remove the animation from the scene (deletes the character).
|
|
184
160
|
"""
|
|
185
161
|
|
|
186
|
-
self._session.query_sim_rpc(
|
|
187
|
-
endpoint="remove_animation",
|
|
188
|
-
payload=RemoveAnimation(path=self._path),
|
|
189
|
-
)
|
|
162
|
+
self._session.query_sim_rpc(endpoint="animation/remove", payload={"path": self._path})
|
{antioch_py-2.0.6/antioch/session/views → antioch_py-2.1.0/antioch/session/objects}/articulation.py
RENAMED
|
@@ -1,22 +1,6 @@
|
|
|
1
1
|
from antioch.session.session import Session, SessionContainer
|
|
2
2
|
from common.message import JointState, JointTarget, Pose, Vector3
|
|
3
|
-
from common.session.
|
|
4
|
-
from common.session.views.articulation import (
|
|
5
|
-
AddArticulation,
|
|
6
|
-
ArticulationConfig,
|
|
7
|
-
ArticulationJointConfig,
|
|
8
|
-
ArticulationJointConfigs,
|
|
9
|
-
ArticulationJointStates,
|
|
10
|
-
ArticulationJointTargets,
|
|
11
|
-
GetArticulation,
|
|
12
|
-
GetArticulationJointConfigs,
|
|
13
|
-
GetArticulationJointStates,
|
|
14
|
-
GetArticulationJointTargets,
|
|
15
|
-
GetArticulationResponse,
|
|
16
|
-
SetArticulationJointConfigs,
|
|
17
|
-
SetArticulationJointStates,
|
|
18
|
-
SetArticulationJointTargets,
|
|
19
|
-
)
|
|
3
|
+
from common.session.config import ArticulationConfig, ArticulationJointConfig
|
|
20
4
|
|
|
21
5
|
|
|
22
6
|
class Articulation(SessionContainer):
|
|
@@ -50,13 +34,8 @@ class Articulation(SessionContainer):
|
|
|
50
34
|
"""
|
|
51
35
|
|
|
52
36
|
super().__init__()
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
self._path = self._session.query_sim_rpc(
|
|
56
|
-
endpoint="get_articulation",
|
|
57
|
-
payload=GetArticulation(path=path),
|
|
58
|
-
response_type=GetArticulationResponse,
|
|
59
|
-
).path
|
|
37
|
+
self._session.query_sim_rpc(endpoint="articulation/get", payload={"path": path})
|
|
38
|
+
self._path = path
|
|
60
39
|
|
|
61
40
|
@classmethod
|
|
62
41
|
def add(
|
|
@@ -79,21 +58,12 @@ class Articulation(SessionContainer):
|
|
|
79
58
|
"""
|
|
80
59
|
|
|
81
60
|
Session.get_current().query_sim_rpc(
|
|
82
|
-
endpoint="
|
|
83
|
-
payload=
|
|
84
|
-
path=path,
|
|
85
|
-
config=config,
|
|
86
|
-
world_pose=world_pose,
|
|
87
|
-
local_pose=local_pose,
|
|
88
|
-
scale=scale,
|
|
89
|
-
),
|
|
61
|
+
endpoint="articulation/add",
|
|
62
|
+
payload={"path": path, "config": config, "world_pose": world_pose, "local_pose": local_pose, "scale": scale},
|
|
90
63
|
)
|
|
91
64
|
return cls(path)
|
|
92
65
|
|
|
93
|
-
def get_joint_states(
|
|
94
|
-
self,
|
|
95
|
-
joint_names: list[str] | None = None,
|
|
96
|
-
) -> list[JointState]:
|
|
66
|
+
def get_joint_states(self, joint_names: list[str] | None = None) -> list[JointState]:
|
|
97
67
|
"""
|
|
98
68
|
Get current joint states.
|
|
99
69
|
|
|
@@ -102,12 +72,10 @@ class Articulation(SessionContainer):
|
|
|
102
72
|
"""
|
|
103
73
|
|
|
104
74
|
response = self._session.query_sim_rpc(
|
|
105
|
-
endpoint="
|
|
106
|
-
payload=
|
|
107
|
-
response_type=ArticulationJointStates,
|
|
75
|
+
endpoint="articulation/get_joint_states",
|
|
76
|
+
payload={"path": self._path, "joint_names": joint_names},
|
|
108
77
|
)
|
|
109
|
-
|
|
110
|
-
return response.joint_states if response else []
|
|
78
|
+
return [JointState.model_validate(js) for js in response] if response else []
|
|
111
79
|
|
|
112
80
|
def get_joint_targets(self, joint_names: list[str] | None = None) -> list[JointTarget]:
|
|
113
81
|
"""
|
|
@@ -117,11 +85,11 @@ class Articulation(SessionContainer):
|
|
|
117
85
|
:return: List of joint control targets.
|
|
118
86
|
"""
|
|
119
87
|
|
|
120
|
-
|
|
121
|
-
endpoint="
|
|
122
|
-
payload=
|
|
123
|
-
|
|
124
|
-
)
|
|
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 []
|
|
125
93
|
|
|
126
94
|
def get_joint_configs(self, joint_names: list[str] | None = None) -> list[ArticulationJointConfig]:
|
|
127
95
|
"""
|
|
@@ -134,11 +102,11 @@ class Articulation(SessionContainer):
|
|
|
134
102
|
:return: List of joint configurations (DOF joints only).
|
|
135
103
|
"""
|
|
136
104
|
|
|
137
|
-
|
|
138
|
-
endpoint="
|
|
139
|
-
payload=
|
|
140
|
-
|
|
141
|
-
)
|
|
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 []
|
|
142
110
|
|
|
143
111
|
def set_joint_configs(self, joint_configs: list[ArticulationJointConfig]) -> None:
|
|
144
112
|
"""
|
|
@@ -147,16 +115,9 @@ class Articulation(SessionContainer):
|
|
|
147
115
|
:param joint_configs: List of joint configurations to apply.
|
|
148
116
|
"""
|
|
149
117
|
|
|
150
|
-
self._session.query_sim_rpc(
|
|
151
|
-
endpoint="set_articulation_joint_configs",
|
|
152
|
-
payload=SetArticulationJointConfigs(path=self._path, joint_configs=joint_configs),
|
|
153
|
-
)
|
|
118
|
+
self._session.query_sim_rpc(endpoint="articulation/set_joint_configs", payload={"path": self._path, "joint_configs": joint_configs})
|
|
154
119
|
|
|
155
|
-
def set_joint_states(
|
|
156
|
-
self,
|
|
157
|
-
joint_names: list[str] | None = None,
|
|
158
|
-
joint_states: list[JointState] | None = None,
|
|
159
|
-
) -> None:
|
|
120
|
+
def set_joint_states(self, joint_names: list[str] | None = None, joint_states: list[JointState] | None = None) -> None:
|
|
160
121
|
"""
|
|
161
122
|
Set the joint states of the articulation (immediate teleport).
|
|
162
123
|
|
|
@@ -165,19 +126,11 @@ class Articulation(SessionContainer):
|
|
|
165
126
|
"""
|
|
166
127
|
|
|
167
128
|
self._session.query_sim_rpc(
|
|
168
|
-
endpoint="
|
|
169
|
-
payload=
|
|
170
|
-
path=self._path,
|
|
171
|
-
joint_names=joint_names,
|
|
172
|
-
joint_states=joint_states,
|
|
173
|
-
),
|
|
129
|
+
endpoint="articulation/set_joint_states",
|
|
130
|
+
payload={"path": self._path, "joint_names": joint_names, "joint_states": joint_states},
|
|
174
131
|
)
|
|
175
132
|
|
|
176
|
-
def set_joint_targets(
|
|
177
|
-
self,
|
|
178
|
-
joint_names: list[str] | None = None,
|
|
179
|
-
joint_targets: list[JointTarget] | None = None,
|
|
180
|
-
) -> None:
|
|
133
|
+
def set_joint_targets(self, joint_names: list[str] | None = None, joint_targets: list[JointTarget] | None = None) -> None:
|
|
181
134
|
"""
|
|
182
135
|
Set control targets for the articulation's PD controllers.
|
|
183
136
|
|
|
@@ -186,12 +139,8 @@ class Articulation(SessionContainer):
|
|
|
186
139
|
"""
|
|
187
140
|
|
|
188
141
|
self._session.query_sim_rpc(
|
|
189
|
-
endpoint="
|
|
190
|
-
payload=
|
|
191
|
-
path=self._path,
|
|
192
|
-
joint_names=joint_names,
|
|
193
|
-
joint_targets=joint_targets,
|
|
194
|
-
),
|
|
142
|
+
endpoint="articulation/set_joint_targets",
|
|
143
|
+
payload={"path": self._path, "joint_names": joint_names, "joint_targets": joint_targets},
|
|
195
144
|
)
|
|
196
145
|
|
|
197
146
|
def get_world_pose(self) -> Pose:
|
|
@@ -201,11 +150,7 @@ class Articulation(SessionContainer):
|
|
|
201
150
|
:return: World pose.
|
|
202
151
|
"""
|
|
203
152
|
|
|
204
|
-
return self._session.query_sim_rpc(
|
|
205
|
-
endpoint="get_articulation_world_pose",
|
|
206
|
-
payload=GetWorldPose(path=self._path),
|
|
207
|
-
response_type=Pose,
|
|
208
|
-
)
|
|
153
|
+
return self._session.query_sim_rpc(endpoint="articulation/get_world_pose", payload={"path": self._path}, response_type=Pose)
|
|
209
154
|
|
|
210
155
|
def get_local_pose(self) -> Pose:
|
|
211
156
|
"""
|
|
@@ -214,11 +159,7 @@ class Articulation(SessionContainer):
|
|
|
214
159
|
:return: Local pose.
|
|
215
160
|
"""
|
|
216
161
|
|
|
217
|
-
return self._session.query_sim_rpc(
|
|
218
|
-
endpoint="get_articulation_local_pose",
|
|
219
|
-
payload=GetLocalPose(path=self._path),
|
|
220
|
-
response_type=Pose,
|
|
221
|
-
)
|
|
162
|
+
return self._session.query_sim_rpc(endpoint="articulation/get_local_pose", payload={"path": self._path}, response_type=Pose)
|
|
222
163
|
|
|
223
164
|
def set_world_pose(self, pose: Pose | dict) -> None:
|
|
224
165
|
"""
|
|
@@ -227,10 +168,7 @@ class Articulation(SessionContainer):
|
|
|
227
168
|
:param pose: World pose as Pose (or dict with position/orientation lists).
|
|
228
169
|
"""
|
|
229
170
|
|
|
230
|
-
self._session.query_sim_rpc(
|
|
231
|
-
endpoint="set_articulation_world_pose",
|
|
232
|
-
payload=SetWorldPose(path=self._path, pose=Pose.from_any(pose)),
|
|
233
|
-
)
|
|
171
|
+
self._session.query_sim_rpc(endpoint="articulation/set_world_pose", payload={"path": self._path, "pose": pose})
|
|
234
172
|
|
|
235
173
|
def set_local_pose(self, pose: Pose | dict) -> None:
|
|
236
174
|
"""
|
|
@@ -239,7 +177,4 @@ class Articulation(SessionContainer):
|
|
|
239
177
|
:param pose: Local pose as Pose (or dict with position/orientation lists).
|
|
240
178
|
"""
|
|
241
179
|
|
|
242
|
-
self._session.query_sim_rpc(
|
|
243
|
-
endpoint="set_articulation_local_pose",
|
|
244
|
-
payload=SetLocalPose(path=self._path, pose=Pose.from_any(pose)),
|
|
245
|
-
)
|
|
180
|
+
self._session.query_sim_rpc(endpoint="articulation/set_local_pose", payload={"path": self._path, "pose": pose})
|
{antioch_py-2.0.6/antioch/session/views → antioch_py-2.1.0/antioch/session/objects}/basis_curve.py
RENAMED
|
@@ -2,18 +2,6 @@ from typing import Literal
|
|
|
2
2
|
|
|
3
3
|
from antioch.session.session import Session, SessionContainer
|
|
4
4
|
from common.message import Vector3
|
|
5
|
-
from common.session.views.basis_curve import (
|
|
6
|
-
AddBasisCurveLine,
|
|
7
|
-
AddBasisCurveSemiCircle,
|
|
8
|
-
GetBasisCurve,
|
|
9
|
-
GetBasisCurveExtents,
|
|
10
|
-
GetBasisCurveExtentsResponse,
|
|
11
|
-
GetBasisCurvePoints,
|
|
12
|
-
GetBasisCurvePointsResponse,
|
|
13
|
-
GetBasisCurveResponse,
|
|
14
|
-
RemoveBasisCurve,
|
|
15
|
-
SetBasisCurveVisibility,
|
|
16
|
-
)
|
|
17
5
|
|
|
18
6
|
|
|
19
7
|
class BasisCurve(SessionContainer):
|
|
@@ -45,13 +33,8 @@ class BasisCurve(SessionContainer):
|
|
|
45
33
|
"""
|
|
46
34
|
|
|
47
35
|
super().__init__()
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
self._path = self._session.query_sim_rpc(
|
|
51
|
-
endpoint="get_basis_curve",
|
|
52
|
-
payload=GetBasisCurve(path=path),
|
|
53
|
-
response_type=GetBasisCurveResponse,
|
|
54
|
-
).path
|
|
36
|
+
self._session.query_sim_rpc(endpoint="basis_curve/get", payload={"path": path})
|
|
37
|
+
self._path = path
|
|
55
38
|
|
|
56
39
|
@property
|
|
57
40
|
def path(self) -> str:
|
|
@@ -84,14 +67,8 @@ class BasisCurve(SessionContainer):
|
|
|
84
67
|
"""
|
|
85
68
|
|
|
86
69
|
Session.get_current().query_sim_rpc(
|
|
87
|
-
endpoint="
|
|
88
|
-
payload=
|
|
89
|
-
path=path,
|
|
90
|
-
center=center,
|
|
91
|
-
radius=radius,
|
|
92
|
-
min_angle_deg=min_angle_deg,
|
|
93
|
-
max_angle_deg=max_angle_deg,
|
|
94
|
-
),
|
|
70
|
+
endpoint="basis_curve/add_semi_circle",
|
|
71
|
+
payload={"path": path, "center": center, "radius": radius, "min_angle_deg": min_angle_deg, "max_angle_deg": max_angle_deg},
|
|
95
72
|
)
|
|
96
73
|
return cls(path)
|
|
97
74
|
|
|
@@ -121,14 +98,8 @@ class BasisCurve(SessionContainer):
|
|
|
121
98
|
"""
|
|
122
99
|
|
|
123
100
|
Session.get_current().query_sim_rpc(
|
|
124
|
-
endpoint="
|
|
125
|
-
payload=
|
|
126
|
-
path=path,
|
|
127
|
-
start=start,
|
|
128
|
-
end=end,
|
|
129
|
-
angle_deg=angle_deg,
|
|
130
|
-
length=length,
|
|
131
|
-
),
|
|
101
|
+
endpoint="basis_curve/add_line",
|
|
102
|
+
payload={"path": path, "start": start, "end": end, "angle_deg": angle_deg, "length": length},
|
|
132
103
|
)
|
|
133
104
|
return cls(path)
|
|
134
105
|
|
|
@@ -139,12 +110,10 @@ class BasisCurve(SessionContainer):
|
|
|
139
110
|
:return: Extents as tuple of start and end points.
|
|
140
111
|
"""
|
|
141
112
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
)
|
|
147
|
-
return extents.start, extents.end
|
|
113
|
+
result = self._session.query_sim_rpc(endpoint="basis_curve/get_extents", payload={"path": self._path})
|
|
114
|
+
if result is None:
|
|
115
|
+
raise RuntimeError("Failed to get extents")
|
|
116
|
+
return Vector3(**result[0]), Vector3(**result[1])
|
|
148
117
|
|
|
149
118
|
def get_points(
|
|
150
119
|
self, samples_per_segment: int = 10, sort_by: Literal["X", "Y", "Z"] | None = None, ascending: bool = True
|
|
@@ -157,11 +126,12 @@ class BasisCurve(SessionContainer):
|
|
|
157
126
|
:param ascending: Whether to sort the points in ascending order.
|
|
158
127
|
:return: The points of the basis curve.
|
|
159
128
|
"""
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
)
|
|
129
|
+
|
|
130
|
+
response = self._session.query_sim_rpc(
|
|
131
|
+
endpoint="basis_curve/get_points",
|
|
132
|
+
payload={"path": self._path, "samples_per_segment": samples_per_segment, "sort_by": sort_by, "ascending": ascending},
|
|
133
|
+
)
|
|
134
|
+
return [Vector3(**pt) for pt in response] if response else []
|
|
165
135
|
|
|
166
136
|
def set_visibility(self, visible: bool) -> None:
|
|
167
137
|
"""
|
|
@@ -170,17 +140,11 @@ class BasisCurve(SessionContainer):
|
|
|
170
140
|
:param visible: True to make visible, False to hide.
|
|
171
141
|
"""
|
|
172
142
|
|
|
173
|
-
self._session.query_sim_rpc(
|
|
174
|
-
endpoint="set_basis_curve_visibility",
|
|
175
|
-
payload=SetBasisCurveVisibility(path=self._path, visible=visible),
|
|
176
|
-
)
|
|
143
|
+
self._session.query_sim_rpc(endpoint="basis_curve/set_visibility", payload={"path": self._path, "visible": visible})
|
|
177
144
|
|
|
178
145
|
def remove(self) -> None:
|
|
179
146
|
"""
|
|
180
147
|
Remove the basis curve from the scene.
|
|
181
148
|
"""
|
|
182
149
|
|
|
183
|
-
self._session.query_sim_rpc(
|
|
184
|
-
endpoint="remove_basis_curve",
|
|
185
|
-
payload=RemoveBasisCurve(path=self._path),
|
|
186
|
-
)
|
|
150
|
+
self._session.query_sim_rpc(endpoint="basis_curve/remove", payload={"path": self._path})
|