antioch-py 2.0.7__py3-none-any.whl → 2.2.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.
- antioch/session/__init__.py +15 -13
- antioch/session/ark.py +22 -26
- antioch/session/objects/__init__.py +40 -0
- antioch/session/{views → objects}/animation.py +25 -52
- antioch/session/{views → objects}/articulation.py +30 -95
- antioch/session/{views → objects}/basis_curve.py +48 -54
- antioch/session/{views → objects}/camera.py +12 -39
- antioch/session/objects/collision.py +46 -0
- antioch/session/{views → objects}/geometry.py +6 -22
- antioch/session/{views → objects}/ground_plane.py +5 -20
- antioch/session/{views → objects}/imu.py +10 -30
- antioch/session/{views → objects}/joint.py +5 -20
- antioch/session/{views → objects}/light.py +14 -66
- antioch/session/{views → objects}/pir_sensor.py +20 -62
- antioch/session/objects/radar.py +62 -0
- antioch/session/{views → objects}/rigid_body.py +25 -110
- antioch/session/{views → objects}/xform.py +24 -24
- antioch/session/scene.py +116 -134
- antioch/session/session.py +34 -43
- antioch/session/task.py +2 -16
- {antioch_py-2.0.7.dist-info → antioch_py-2.2.1.dist-info}/METADATA +1 -1
- antioch_py-2.2.1.dist-info/RECORD +85 -0
- common/ark/ark.py +2 -0
- common/ark/hardware.py +1 -5
- common/ark/kinematics.py +1 -1
- common/constants.py +16 -2
- common/core/agent.py +28 -0
- common/core/auth.py +1 -3
- common/message/__init__.py +2 -0
- common/message/velocity.py +11 -0
- common/session/__init__.py +1 -24
- common/session/config.py +390 -0
- common/session/sim.py +36 -147
- antioch/session/views/__init__.py +0 -42
- antioch/session/views/collision.py +0 -75
- antioch/session/views/material.py +0 -54
- antioch/session/views/radar.py +0 -131
- antioch_py-2.0.7.dist-info/RECORD +0 -101
- 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/material.py +0 -25
- common/session/views/pir_sensor.py +0 -119
- common/session/views/radar.py +0 -107
- common/session/views/rigid_body.py +0 -236
- common/session/views/viewport.py +0 -21
- common/session/views/xform.py +0 -39
- {antioch_py-2.0.7.dist-info → antioch_py-2.2.1.dist-info}/WHEEL +0 -0
- {antioch_py-2.0.7.dist-info → antioch_py-2.2.1.dist-info}/entry_points.txt +0 -0
- {antioch_py-2.0.7.dist-info → antioch_py-2.2.1.dist-info}/top_level.txt +0 -0
|
@@ -1,22 +1,14 @@
|
|
|
1
1
|
from antioch.session.session import Session, SessionContainer
|
|
2
2
|
from common.message import PirStatus, Pose
|
|
3
|
-
from common.session.
|
|
4
|
-
AddPirSensor,
|
|
5
|
-
GetPirDetectionStatus,
|
|
6
|
-
GetPirSensor,
|
|
7
|
-
GetPirSensorResponse,
|
|
8
|
-
PirSensorConfig,
|
|
9
|
-
SetPirDebugMode,
|
|
10
|
-
SetPirMaterial,
|
|
11
|
-
)
|
|
3
|
+
from common.session.config import PirSensorConfig
|
|
12
4
|
|
|
13
5
|
|
|
14
6
|
class PirSensor(SessionContainer):
|
|
15
7
|
"""
|
|
16
|
-
PIR (Passive Infrared) sensor
|
|
8
|
+
PIR (Passive Infrared) sensor object for motion detection.
|
|
17
9
|
|
|
18
10
|
PIR sensors detect infrared radiation changes caused by moving warm objects.
|
|
19
|
-
The sensor uses a
|
|
11
|
+
The sensor uses a 3-sensor design (center, left, right) with dual elements per sensor.
|
|
20
12
|
|
|
21
13
|
Example:
|
|
22
14
|
scene = Scene()
|
|
@@ -27,35 +19,21 @@ class PirSensor(SessionContainer):
|
|
|
27
19
|
print(f"Detected: {status.is_detected}")
|
|
28
20
|
"""
|
|
29
21
|
|
|
30
|
-
def __init__(
|
|
31
|
-
self,
|
|
32
|
-
path: str,
|
|
33
|
-
config: PirSensorConfig | None = None,
|
|
34
|
-
):
|
|
22
|
+
def __init__(self, path: str, config: PirSensorConfig | None = None):
|
|
35
23
|
"""
|
|
36
|
-
Initialize PIR sensor
|
|
24
|
+
Initialize PIR sensor object.
|
|
37
25
|
|
|
38
26
|
:param path: USD path for the PIR sensor.
|
|
39
27
|
:param config: Optional PIR sensor config.
|
|
40
28
|
"""
|
|
41
29
|
|
|
42
30
|
super().__init__()
|
|
43
|
-
|
|
44
31
|
self._config = config
|
|
45
|
-
self.
|
|
46
|
-
|
|
47
|
-
payload=GetPirSensor(path=path),
|
|
48
|
-
response_type=GetPirSensorResponse,
|
|
49
|
-
).path
|
|
32
|
+
self._session.query_sim_rpc(endpoint="pir_sensor/get", payload={"path": path})
|
|
33
|
+
self._path = path
|
|
50
34
|
|
|
51
35
|
@classmethod
|
|
52
|
-
def add(
|
|
53
|
-
cls,
|
|
54
|
-
path: str,
|
|
55
|
-
config: PirSensorConfig,
|
|
56
|
-
world_pose: Pose | None,
|
|
57
|
-
local_pose: Pose | None,
|
|
58
|
-
) -> "PirSensor":
|
|
36
|
+
def add(cls, path: str, config: PirSensorConfig, world_pose: Pose | None, local_pose: Pose | None) -> "PirSensor":
|
|
59
37
|
"""
|
|
60
38
|
Add PIR sensor to the scene.
|
|
61
39
|
|
|
@@ -67,13 +45,8 @@ class PirSensor(SessionContainer):
|
|
|
67
45
|
"""
|
|
68
46
|
|
|
69
47
|
Session.get_current().query_sim_rpc(
|
|
70
|
-
endpoint="
|
|
71
|
-
payload=
|
|
72
|
-
path=path,
|
|
73
|
-
config=config,
|
|
74
|
-
world_pose=world_pose,
|
|
75
|
-
local_pose=local_pose,
|
|
76
|
-
),
|
|
48
|
+
endpoint="pir_sensor/add",
|
|
49
|
+
payload={"path": path, "config": config, "world_pose": world_pose, "local_pose": local_pose},
|
|
77
50
|
)
|
|
78
51
|
return cls(path, config)
|
|
79
52
|
|
|
@@ -81,39 +54,28 @@ class PirSensor(SessionContainer):
|
|
|
81
54
|
"""
|
|
82
55
|
Get current detection status.
|
|
83
56
|
|
|
84
|
-
:return: Detection status with is_detected, signal_strength,
|
|
57
|
+
:return: Detection status with is_detected, signal_strength, and per-sensor details.
|
|
85
58
|
"""
|
|
86
59
|
|
|
87
|
-
|
|
88
|
-
endpoint="get_pir_detection_status",
|
|
89
|
-
payload=GetPirDetectionStatus(path=self._path),
|
|
90
|
-
response_type=PirStatus,
|
|
91
|
-
)
|
|
92
|
-
return status
|
|
60
|
+
return PirStatus(**self._session.query_sim_rpc(endpoint="pir_sensor/get_status", payload={"path": self._path}))
|
|
93
61
|
|
|
94
62
|
def set_debug_mode(self, enabled: bool) -> None:
|
|
95
63
|
"""
|
|
96
64
|
Enable or disable debug ray visualization.
|
|
97
65
|
|
|
98
66
|
When enabled, rays are drawn each update:
|
|
99
|
-
-
|
|
100
|
-
- Blue
|
|
101
|
-
-
|
|
67
|
+
- Green: Center sensor
|
|
68
|
+
- Blue: Left sensor
|
|
69
|
+
- Red: Right sensor
|
|
70
|
+
- Cyan points at hit locations
|
|
102
71
|
|
|
103
72
|
:param enabled: Whether to enable debug visualization.
|
|
104
73
|
"""
|
|
105
74
|
|
|
106
|
-
self._session.query_sim_rpc(
|
|
107
|
-
endpoint="set_pir_debug_mode",
|
|
108
|
-
payload=SetPirDebugMode(path=self._path, enabled=enabled),
|
|
109
|
-
)
|
|
75
|
+
self._session.query_sim_rpc(endpoint="pir_sensor/set_debug_mode", payload={"path": self._path, "enabled": enabled})
|
|
110
76
|
|
|
111
77
|
|
|
112
|
-
def set_pir_material(
|
|
113
|
-
path: str,
|
|
114
|
-
emissivity: float = 0.9,
|
|
115
|
-
temperature_c: float | None = None,
|
|
116
|
-
) -> None:
|
|
78
|
+
def set_pir_material(path: str, emissivity: float = 0.9, temperature_c: float | None = None) -> None:
|
|
117
79
|
"""
|
|
118
80
|
Set PIR-specific thermal properties on a prim.
|
|
119
81
|
|
|
@@ -131,10 +93,6 @@ def set_pir_material(
|
|
|
131
93
|
"""
|
|
132
94
|
|
|
133
95
|
Session.get_current().query_sim_rpc(
|
|
134
|
-
endpoint="
|
|
135
|
-
payload=
|
|
136
|
-
path=path,
|
|
137
|
-
emissivity=emissivity,
|
|
138
|
-
temperature_c=temperature_c,
|
|
139
|
-
),
|
|
96
|
+
endpoint="pir_material/set",
|
|
97
|
+
payload={"path": path, "emissivity": emissivity, "temperature_c": temperature_c},
|
|
140
98
|
)
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
from antioch.session.session import Session, SessionContainer
|
|
2
|
+
from common.message import Pose, RadarScan
|
|
3
|
+
from common.session.config import RadarConfig
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class Radar(SessionContainer):
|
|
7
|
+
"""
|
|
8
|
+
Radar object for time-synchronized scan data.
|
|
9
|
+
|
|
10
|
+
Example:
|
|
11
|
+
scene = Scene()
|
|
12
|
+
radar = scene.get_radar(name="my_ark/my_module/my_radar")
|
|
13
|
+
scan = radar.get_scan()
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
def __init__(self, path: str):
|
|
17
|
+
"""
|
|
18
|
+
Initialize Radar object.
|
|
19
|
+
|
|
20
|
+
:param path: USD path for the radar.
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
super().__init__()
|
|
24
|
+
self._session.query_sim_rpc(endpoint="radar/get", payload={"path": path})
|
|
25
|
+
self._path = path
|
|
26
|
+
|
|
27
|
+
@classmethod
|
|
28
|
+
def add(cls, path: str, config: RadarConfig, world_pose: Pose | None, local_pose: Pose | None) -> "Radar":
|
|
29
|
+
"""
|
|
30
|
+
Add radar to the scene.
|
|
31
|
+
|
|
32
|
+
:param path: USD path for the radar.
|
|
33
|
+
:param config: Radar configuration.
|
|
34
|
+
:param world_pose: Optional world pose.
|
|
35
|
+
:param local_pose: Optional local pose.
|
|
36
|
+
:return: The radar instance.
|
|
37
|
+
"""
|
|
38
|
+
|
|
39
|
+
Session.get_current().query_sim_rpc(
|
|
40
|
+
endpoint="radar/add",
|
|
41
|
+
payload={"path": path, "config": config, "world_pose": world_pose, "local_pose": local_pose},
|
|
42
|
+
)
|
|
43
|
+
return cls(path)
|
|
44
|
+
|
|
45
|
+
def get_scan(self) -> RadarScan | None:
|
|
46
|
+
"""
|
|
47
|
+
Get radar scan data.
|
|
48
|
+
|
|
49
|
+
:return: Radar scan with detections, or None if scan data is not ready.
|
|
50
|
+
"""
|
|
51
|
+
|
|
52
|
+
scan = self._session.query_sim_rpc(endpoint="radar/get_scan", payload={"path": self._path})
|
|
53
|
+
return RadarScan(**scan) if scan else None
|
|
54
|
+
|
|
55
|
+
def set_debug_mode(self, enabled: bool) -> None:
|
|
56
|
+
"""
|
|
57
|
+
Enable or disable debug visualization.
|
|
58
|
+
|
|
59
|
+
:param enabled: Whether to enable debug visualization.
|
|
60
|
+
"""
|
|
61
|
+
|
|
62
|
+
self._session.query_sim_rpc(endpoint="radar/set_debug_mode", payload={"path": self._path, "enabled": enabled})
|
|
@@ -1,26 +1,6 @@
|
|
|
1
1
|
from antioch.session.session import Session, SessionContainer
|
|
2
|
-
from common.message import Pose, Vector3
|
|
3
|
-
from common.session.
|
|
4
|
-
from common.session.views.rigid_body import (
|
|
5
|
-
AddRigidBody,
|
|
6
|
-
ApplyForce,
|
|
7
|
-
BodyCenterOfMass,
|
|
8
|
-
BodyInertia,
|
|
9
|
-
BodyMass,
|
|
10
|
-
BodyVelocity,
|
|
11
|
-
DisableGravity,
|
|
12
|
-
DisablePhysics,
|
|
13
|
-
EnableGravity,
|
|
14
|
-
EnablePhysics,
|
|
15
|
-
GetBodyCenterOfMass,
|
|
16
|
-
GetBodyInertia,
|
|
17
|
-
GetBodyMass,
|
|
18
|
-
GetBodyVelocity,
|
|
19
|
-
GetRigidBody,
|
|
20
|
-
GetRigidBodyResponse,
|
|
21
|
-
RigidBodyConfig,
|
|
22
|
-
SetBodyVelocity,
|
|
23
|
-
)
|
|
2
|
+
from common.message import Pose, Twist, Vector3
|
|
3
|
+
from common.session.config import RigidBodyConfig
|
|
24
4
|
|
|
25
5
|
|
|
26
6
|
class RigidBody(SessionContainer):
|
|
@@ -55,13 +35,8 @@ class RigidBody(SessionContainer):
|
|
|
55
35
|
"""
|
|
56
36
|
|
|
57
37
|
super().__init__()
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
self._path = self._session.query_sim_rpc(
|
|
61
|
-
endpoint="get_rigid_body",
|
|
62
|
-
payload=GetRigidBody(path=path),
|
|
63
|
-
response_type=GetRigidBodyResponse,
|
|
64
|
-
).path
|
|
38
|
+
self._session.query_sim_rpc(endpoint="rigid_body/get", payload={"path": path})
|
|
39
|
+
self._path = path
|
|
65
40
|
|
|
66
41
|
@classmethod
|
|
67
42
|
def add(
|
|
@@ -84,29 +59,19 @@ class RigidBody(SessionContainer):
|
|
|
84
59
|
"""
|
|
85
60
|
|
|
86
61
|
Session.get_current().query_sim_rpc(
|
|
87
|
-
endpoint="
|
|
88
|
-
payload=
|
|
89
|
-
path=path,
|
|
90
|
-
config=config,
|
|
91
|
-
world_pose=world_pose,
|
|
92
|
-
local_pose=local_pose,
|
|
93
|
-
scale=scale,
|
|
94
|
-
),
|
|
62
|
+
endpoint="rigid_body/add",
|
|
63
|
+
payload={"path": path, "config": config, "world_pose": world_pose, "local_pose": local_pose, "scale": scale},
|
|
95
64
|
)
|
|
96
65
|
return cls(path)
|
|
97
66
|
|
|
98
|
-
def get_velocity(self) ->
|
|
67
|
+
def get_velocity(self) -> Twist:
|
|
99
68
|
"""
|
|
100
69
|
Get the velocity of the rigid body.
|
|
101
70
|
|
|
102
71
|
:return: Linear and angular velocities.
|
|
103
72
|
"""
|
|
104
73
|
|
|
105
|
-
return self._session.query_sim_rpc(
|
|
106
|
-
endpoint="get_body_velocity",
|
|
107
|
-
payload=GetBodyVelocity(path=self._path),
|
|
108
|
-
response_type=BodyVelocity,
|
|
109
|
-
)
|
|
74
|
+
return self._session.query_sim_rpc(endpoint="rigid_body/get_velocity", payload={"path": self._path}, response_type=Twist)
|
|
110
75
|
|
|
111
76
|
def set_velocity(
|
|
112
77
|
self,
|
|
@@ -120,16 +85,8 @@ class RigidBody(SessionContainer):
|
|
|
120
85
|
:param angular: Angular velocity as Vector3 (or list/tuple of 3 floats).
|
|
121
86
|
"""
|
|
122
87
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
payload=SetBodyVelocity(
|
|
126
|
-
path=self._path,
|
|
127
|
-
velocity=BodyVelocity(
|
|
128
|
-
linear=Vector3.from_any(linear),
|
|
129
|
-
angular=Vector3.from_any(angular),
|
|
130
|
-
),
|
|
131
|
-
),
|
|
132
|
-
)
|
|
88
|
+
twist = Twist(linear=Vector3.from_any(linear), angular=Vector3.from_any(angular))
|
|
89
|
+
self._session.query_sim_rpc(endpoint="rigid_body/set_velocity", payload={"path": self._path, "twist": twist})
|
|
133
90
|
|
|
134
91
|
def apply_force(
|
|
135
92
|
self,
|
|
@@ -144,12 +101,8 @@ class RigidBody(SessionContainer):
|
|
|
144
101
|
"""
|
|
145
102
|
|
|
146
103
|
self._session.query_sim_rpc(
|
|
147
|
-
endpoint="apply_force",
|
|
148
|
-
payload=
|
|
149
|
-
path=self._path,
|
|
150
|
-
force=Vector3.from_any(force),
|
|
151
|
-
is_global=is_global,
|
|
152
|
-
),
|
|
104
|
+
endpoint="rigid_body/apply_force",
|
|
105
|
+
payload={"path": self._path, "force": Vector3.from_any(force), "is_global": is_global},
|
|
153
106
|
)
|
|
154
107
|
|
|
155
108
|
def get_mass(self) -> float:
|
|
@@ -159,11 +112,7 @@ class RigidBody(SessionContainer):
|
|
|
159
112
|
:return: Mass in kg.
|
|
160
113
|
"""
|
|
161
114
|
|
|
162
|
-
return self._session.query_sim_rpc(
|
|
163
|
-
endpoint="get_body_mass",
|
|
164
|
-
payload=GetBodyMass(path=self._path),
|
|
165
|
-
response_type=BodyMass,
|
|
166
|
-
).mass
|
|
115
|
+
return self._session.query_sim_rpc(endpoint="rigid_body/get_mass", payload={"path": self._path}, response_type=float)
|
|
167
116
|
|
|
168
117
|
def get_inertia(self) -> list[float]:
|
|
169
118
|
"""
|
|
@@ -172,64 +121,44 @@ class RigidBody(SessionContainer):
|
|
|
172
121
|
:return: Inertia tensor as 9 values (3x3 matrix flattened).
|
|
173
122
|
"""
|
|
174
123
|
|
|
175
|
-
return self._session.query_sim_rpc(
|
|
176
|
-
endpoint="get_body_inertia",
|
|
177
|
-
payload=GetBodyInertia(path=self._path),
|
|
178
|
-
response_type=BodyInertia,
|
|
179
|
-
).inertia
|
|
124
|
+
return self._session.query_sim_rpc(endpoint="rigid_body/get_inertia", payload={"path": self._path}, response_type=list)
|
|
180
125
|
|
|
181
|
-
def get_center_of_mass(self) ->
|
|
126
|
+
def get_center_of_mass(self) -> Pose:
|
|
182
127
|
"""
|
|
183
128
|
Get the center of mass position and orientation.
|
|
184
129
|
|
|
185
|
-
:return: Center of mass
|
|
130
|
+
:return: Center of mass as Pose.
|
|
186
131
|
"""
|
|
187
132
|
|
|
188
|
-
return self._session.query_sim_rpc(
|
|
189
|
-
endpoint="get_body_center_of_mass",
|
|
190
|
-
payload=GetBodyCenterOfMass(path=self._path),
|
|
191
|
-
response_type=BodyCenterOfMass,
|
|
192
|
-
)
|
|
133
|
+
return self._session.query_sim_rpc(endpoint="rigid_body/get_center_of_mass", payload={"path": self._path}, response_type=Pose)
|
|
193
134
|
|
|
194
135
|
def enable_gravity(self) -> None:
|
|
195
136
|
"""
|
|
196
137
|
Enable gravity on the rigid body.
|
|
197
138
|
"""
|
|
198
139
|
|
|
199
|
-
self._session.query_sim_rpc(
|
|
200
|
-
endpoint="enable_gravity",
|
|
201
|
-
payload=EnableGravity(path=self._path),
|
|
202
|
-
)
|
|
140
|
+
self._session.query_sim_rpc(endpoint="rigid_body/enable_gravity", payload={"path": self._path})
|
|
203
141
|
|
|
204
142
|
def disable_gravity(self) -> None:
|
|
205
143
|
"""
|
|
206
144
|
Disable gravity on the rigid body.
|
|
207
145
|
"""
|
|
208
146
|
|
|
209
|
-
self._session.query_sim_rpc(
|
|
210
|
-
endpoint="disable_gravity",
|
|
211
|
-
payload=DisableGravity(path=self._path),
|
|
212
|
-
)
|
|
147
|
+
self._session.query_sim_rpc(endpoint="rigid_body/disable_gravity", payload={"path": self._path})
|
|
213
148
|
|
|
214
149
|
def enable_physics(self) -> None:
|
|
215
150
|
"""
|
|
216
151
|
Enable rigid body physics (make body dynamic).
|
|
217
152
|
"""
|
|
218
153
|
|
|
219
|
-
self._session.query_sim_rpc(
|
|
220
|
-
endpoint="enable_physics",
|
|
221
|
-
payload=EnablePhysics(path=self._path),
|
|
222
|
-
)
|
|
154
|
+
self._session.query_sim_rpc(endpoint="rigid_body/enable_physics", payload={"path": self._path})
|
|
223
155
|
|
|
224
156
|
def disable_physics(self) -> None:
|
|
225
157
|
"""
|
|
226
158
|
Disable rigid body physics (make body kinematic).
|
|
227
159
|
"""
|
|
228
160
|
|
|
229
|
-
self._session.query_sim_rpc(
|
|
230
|
-
endpoint="disable_physics",
|
|
231
|
-
payload=DisablePhysics(path=self._path),
|
|
232
|
-
)
|
|
161
|
+
self._session.query_sim_rpc(endpoint="rigid_body/disable_physics", payload={"path": self._path})
|
|
233
162
|
|
|
234
163
|
def get_world_pose(self) -> Pose:
|
|
235
164
|
"""
|
|
@@ -238,11 +167,7 @@ class RigidBody(SessionContainer):
|
|
|
238
167
|
:return: World pose.
|
|
239
168
|
"""
|
|
240
169
|
|
|
241
|
-
return self._session.query_sim_rpc(
|
|
242
|
-
endpoint="get_rigid_body_world_pose",
|
|
243
|
-
payload=GetWorldPose(path=self._path),
|
|
244
|
-
response_type=Pose,
|
|
245
|
-
)
|
|
170
|
+
return self._session.query_sim_rpc(endpoint="rigid_body/get_world_pose", payload={"path": self._path}, response_type=Pose)
|
|
246
171
|
|
|
247
172
|
def get_local_pose(self) -> Pose:
|
|
248
173
|
"""
|
|
@@ -251,11 +176,7 @@ class RigidBody(SessionContainer):
|
|
|
251
176
|
:return: Local pose.
|
|
252
177
|
"""
|
|
253
178
|
|
|
254
|
-
return self._session.query_sim_rpc(
|
|
255
|
-
endpoint="get_rigid_body_local_pose",
|
|
256
|
-
payload=GetLocalPose(path=self._path),
|
|
257
|
-
response_type=Pose,
|
|
258
|
-
)
|
|
179
|
+
return self._session.query_sim_rpc(endpoint="rigid_body/get_local_pose", payload={"path": self._path}, response_type=Pose)
|
|
259
180
|
|
|
260
181
|
def set_world_pose(self, pose: Pose | dict) -> None:
|
|
261
182
|
"""
|
|
@@ -264,10 +185,7 @@ class RigidBody(SessionContainer):
|
|
|
264
185
|
:param pose: World pose as Pose (or dict with position/orientation lists).
|
|
265
186
|
"""
|
|
266
187
|
|
|
267
|
-
self._session.query_sim_rpc(
|
|
268
|
-
endpoint="set_rigid_body_world_pose",
|
|
269
|
-
payload=SetWorldPose(path=self._path, pose=Pose.from_any(pose)),
|
|
270
|
-
)
|
|
188
|
+
self._session.query_sim_rpc(endpoint="rigid_body/set_world_pose", payload={"path": self._path, "pose": pose})
|
|
271
189
|
|
|
272
190
|
def set_local_pose(self, pose: Pose | dict) -> None:
|
|
273
191
|
"""
|
|
@@ -276,7 +194,4 @@ class RigidBody(SessionContainer):
|
|
|
276
194
|
:param pose: Local pose as Pose (or dict with position/orientation lists).
|
|
277
195
|
"""
|
|
278
196
|
|
|
279
|
-
self._session.query_sim_rpc(
|
|
280
|
-
endpoint="set_rigid_body_local_pose",
|
|
281
|
-
payload=SetLocalPose(path=self._path, pose=Pose.from_any(pose)),
|
|
282
|
-
)
|
|
197
|
+
self._session.query_sim_rpc(endpoint="rigid_body/set_local_pose", payload={"path": self._path, "pose": pose})
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
from antioch.session.session import Session, SessionContainer
|
|
2
2
|
from common.message import Pose, Vector3
|
|
3
|
-
from common.session.sim import GetLocalPose, GetWorldPose, SetLocalPose, SetWorldPose
|
|
4
|
-
from common.session.views.xform import AddXForm, GetXForm, GetXFormResponse
|
|
5
3
|
|
|
6
4
|
|
|
7
5
|
class XForm(SessionContainer):
|
|
@@ -31,13 +29,8 @@ class XForm(SessionContainer):
|
|
|
31
29
|
"""
|
|
32
30
|
|
|
33
31
|
super().__init__()
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
self._path = self._session.query_sim_rpc(
|
|
37
|
-
endpoint="get_xform",
|
|
38
|
-
payload=GetXForm(path=path),
|
|
39
|
-
response_type=GetXFormResponse,
|
|
40
|
-
).path
|
|
32
|
+
self._session.query_sim_rpc(endpoint="xform/get", payload={"path": path})
|
|
33
|
+
self._path = path
|
|
41
34
|
|
|
42
35
|
@classmethod
|
|
43
36
|
def add(
|
|
@@ -58,13 +51,8 @@ class XForm(SessionContainer):
|
|
|
58
51
|
"""
|
|
59
52
|
|
|
60
53
|
Session.get_current().query_sim_rpc(
|
|
61
|
-
endpoint="
|
|
62
|
-
payload=
|
|
63
|
-
path=path,
|
|
64
|
-
world_pose=world_pose,
|
|
65
|
-
local_pose=local_pose,
|
|
66
|
-
scale=scale,
|
|
67
|
-
),
|
|
54
|
+
endpoint="xform/add",
|
|
55
|
+
payload={"path": path, "world_pose": world_pose, "local_pose": local_pose, "scale": scale},
|
|
68
56
|
)
|
|
69
57
|
return cls(path)
|
|
70
58
|
|
|
@@ -76,8 +64,8 @@ class XForm(SessionContainer):
|
|
|
76
64
|
"""
|
|
77
65
|
|
|
78
66
|
return self._session.query_sim_rpc(
|
|
79
|
-
endpoint="
|
|
80
|
-
payload=
|
|
67
|
+
endpoint="xform/get_world_pose",
|
|
68
|
+
payload={"path": self._path},
|
|
81
69
|
response_type=Pose,
|
|
82
70
|
)
|
|
83
71
|
|
|
@@ -89,8 +77,8 @@ class XForm(SessionContainer):
|
|
|
89
77
|
"""
|
|
90
78
|
|
|
91
79
|
return self._session.query_sim_rpc(
|
|
92
|
-
endpoint="
|
|
93
|
-
payload=
|
|
80
|
+
endpoint="xform/get_local_pose",
|
|
81
|
+
payload={"path": self._path},
|
|
94
82
|
response_type=Pose,
|
|
95
83
|
)
|
|
96
84
|
|
|
@@ -102,8 +90,8 @@ class XForm(SessionContainer):
|
|
|
102
90
|
"""
|
|
103
91
|
|
|
104
92
|
self._session.query_sim_rpc(
|
|
105
|
-
endpoint="
|
|
106
|
-
payload=
|
|
93
|
+
endpoint="xform/set_world_pose",
|
|
94
|
+
payload={"path": self._path, "pose": pose},
|
|
107
95
|
)
|
|
108
96
|
|
|
109
97
|
def set_local_pose(self, pose: Pose | dict) -> None:
|
|
@@ -114,6 +102,18 @@ class XForm(SessionContainer):
|
|
|
114
102
|
"""
|
|
115
103
|
|
|
116
104
|
self._session.query_sim_rpc(
|
|
117
|
-
endpoint="
|
|
118
|
-
payload=
|
|
105
|
+
endpoint="xform/set_local_pose",
|
|
106
|
+
payload={"path": self._path, "pose": pose},
|
|
107
|
+
)
|
|
108
|
+
|
|
109
|
+
def set_visibility(self, visible: bool) -> None:
|
|
110
|
+
"""
|
|
111
|
+
Set the visibility of the xform.
|
|
112
|
+
|
|
113
|
+
:param visible: True to make visible, False to hide.
|
|
114
|
+
"""
|
|
115
|
+
|
|
116
|
+
self._session.query_sim_rpc(
|
|
117
|
+
endpoint="xform/set_visibility",
|
|
118
|
+
payload={"path": self._path, "visible": visible},
|
|
119
119
|
)
|